mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Introducing variable pageTitles (admin dispatcher) - optional, control
over admin page titles for pages not in adminMenu. Contains default title for Admin UI edit view.
This commit is contained in:
@@ -996,6 +996,17 @@ class e_admin_dispatcher
|
||||
* @var array
|
||||
*/
|
||||
protected $adminMenu = array();
|
||||
|
||||
|
||||
/**
|
||||
* Optional (set by child class).
|
||||
* Page titles for pages not in adminMenu (e.g. main/edit)
|
||||
* Format array(mod/action => Page Title)
|
||||
* @var string
|
||||
*/
|
||||
protected $pageTitles = array(
|
||||
'main/edit' => LAN_MANAGE,
|
||||
);
|
||||
|
||||
/**
|
||||
* Optional (set by child class).
|
||||
@@ -1152,6 +1163,15 @@ class e_admin_dispatcher
|
||||
{
|
||||
return $this->adminMenu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get admin menu array
|
||||
* @return array
|
||||
*/
|
||||
public function getPageTitles()
|
||||
{
|
||||
return $this->pageTitles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get admin menu array
|
||||
@@ -1796,11 +1816,15 @@ class e_admin_controller
|
||||
if(true === $title)
|
||||
{
|
||||
$_dispatcher = $this->getDispatcher();
|
||||
$data = $_dispatcher->getMenuData();
|
||||
$data = $_dispatcher->getPageTitles();
|
||||
$search = $this->getMode().'/'.$this->getAction();
|
||||
if(isset($data[$search])) $res = $data[$search];
|
||||
else return $this;
|
||||
|
||||
if(isset($data[$search])) $res['caption'] = $data[$search];
|
||||
else
|
||||
{
|
||||
$data = $_dispatcher->getMenuData();
|
||||
if(isset($data[$search])) $res = $data[$search];
|
||||
else return $this;
|
||||
}
|
||||
$title = $res['caption'];
|
||||
}
|
||||
$this->getResponse()->appendTitle($title);
|
||||
@@ -5582,4 +5606,4 @@ include_once(e107::coreTemplatePath('admin_icons'));
|
||||
* 17. tree list view (should handle cases like Site Links admin page)
|
||||
*/
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Reference in New Issue
Block a user