New Admin Area Documentation

Common template parts

Navigation

  • Go back link
  • Contextual menus

Messages

  • Success
  • Error

Confirmation

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.

confirmation.tpl.php template variables
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');
newadmin/documentation.txt · Last modified: 2006/07/05 13:03 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki