mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +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
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $adminMenu = 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).
|
* Optional (set by child class).
|
||||||
@@ -1152,6 +1163,15 @@ class e_admin_dispatcher
|
|||||||
{
|
{
|
||||||
return $this->adminMenu;
|
return $this->adminMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get admin menu array
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getPageTitles()
|
||||||
|
{
|
||||||
|
return $this->pageTitles;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get admin menu array
|
* Get admin menu array
|
||||||
@@ -1796,11 +1816,15 @@ class e_admin_controller
|
|||||||
if(true === $title)
|
if(true === $title)
|
||||||
{
|
{
|
||||||
$_dispatcher = $this->getDispatcher();
|
$_dispatcher = $this->getDispatcher();
|
||||||
$data = $_dispatcher->getMenuData();
|
$data = $_dispatcher->getPageTitles();
|
||||||
$search = $this->getMode().'/'.$this->getAction();
|
$search = $this->getMode().'/'.$this->getAction();
|
||||||
if(isset($data[$search])) $res = $data[$search];
|
if(isset($data[$search])) $res['caption'] = $data[$search];
|
||||||
else return $this;
|
else
|
||||||
|
{
|
||||||
|
$data = $_dispatcher->getMenuData();
|
||||||
|
if(isset($data[$search])) $res = $data[$search];
|
||||||
|
else return $this;
|
||||||
|
}
|
||||||
$title = $res['caption'];
|
$title = $res['caption'];
|
||||||
}
|
}
|
||||||
$this->getResponse()->appendTitle($title);
|
$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)
|
* 17. tree list view (should handle cases like Site Links admin page)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user