The template confirmation.tpl.php is used to display a confirmation form, which is assigned to the template variable $confirmation. Once $confirmation is defined, the form is displayed.
| Template variable | type | Description |
|---|---|---|
$confirm['title'] | string | Confirmation title |
$confirm['message'] | string | Confirmation message |
$confirm['items'] | array | Name of items which are subject of confirmation |
$confirm['hidden'] | array | Group of hidden fields: name ⇒ value |
$confirm['button'] | string | Text for submit button |
A confirmation message example:
// confirmation title $this->tpl->confirm['title'] = _DELETE_CONFIRM; // confirmation message $this->tpl->confirm['message'] = _CONFIRMTXT_CATEGORY; // list of item titles to perform the action $this->tpl->confirm['items'] = array($blog->getCategoryName($catid)); // three hidden fields are set here: name => value $this->tpl->confirm['hidden'] = array( 'action' => 'categorydeleteconfirm', 'blogid' => $blogid, 'catid' => $catid ); // submit button $this->tpl->confirm['button'] = _DELETE_CONFIRM_BTN; // fetch the template and assign it to $confirmation $this->tpl->confirmation = $this->tpl->fetch('confirmation.tpl.php');
A more compact version:
// confirmation form definitions $this->tpl->confirm = array( 'title' => _DELETE_CONFIRM, 'message' => _CONFIRMTXT_CATEGORY, 'items' => array( $blog->getCategoryName($catid) ), 'hidden' => array( 'action' => 'categorydeleteconfirm', 'blogid' => $blogid, 'catid' => $catid ), 'button' => _DELETE_CONFIRM_BTN ); // fetch the template and assign it to $confirmation $this->tpl->confirmation = $this->tpl->fetch('confirmation.tpl.php');