diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-06-19 05:37:17 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-06-19 05:37:17 +0400 |
commit | 253b165e621953efcb692f985036e217920ba696 (patch) | |
tree | de76a07700ed5b41f3f6a2cc4a880351e1b8b20b /core/Menu/MenuAbstract.php | |
parent | 95aed5eba938839e2ffe74beca4fbf3399c77a54 (diff) |
added possibility to pass a report instance to renderReport() in controller, fixed a bug in menu where the sorting was wrong in case the first added menu item of a category was a submenu entry, made sure it is possible for plugin Menu classes to rename/modify report menu entries, created some reports for live plugin, centralized no permission to view report check and made it possible to overwrite this message for each report
Diffstat (limited to 'core/Menu/MenuAbstract.php')
-rw-r--r-- | core/Menu/MenuAbstract.php | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/core/Menu/MenuAbstract.php b/core/Menu/MenuAbstract.php index 3f624b117f..cbd5c5a798 100644 --- a/core/Menu/MenuAbstract.php +++ b/core/Menu/MenuAbstract.php @@ -126,13 +126,17 @@ abstract class MenuAbstract extends Singleton */ private function buildMenuItem($menuName, $subMenuName, $url, $order = 50, $tooltip = false) { - if (!isset($this->menu[$menuName]) || empty($subMenuName)) { - $this->menu[$menuName]['_url'] = $url; - if (empty($subMenuName)) { - $this->menu[$menuName]['_order'] = $order; - } - $this->menu[$menuName]['_name'] = $menuName; - $this->menu[$menuName]['_hasSubmenu'] = false; + if (!isset($this->menu[$menuName])) { + $this->menu[$menuName] = array( + '_hasSubmenu' => false, + '_order' => $order + ); + } + + if (empty($subMenuName)) { + $this->menu[$menuName]['_url'] = $url; + $this->menu[$menuName]['_order'] = $order; + $this->menu[$menuName]['_name'] = $menuName; $this->menu[$menuName]['_tooltip'] = $tooltip; } if (!empty($subMenuName)) { @@ -141,7 +145,10 @@ abstract class MenuAbstract extends Singleton $this->menu[$menuName][$subMenuName]['_name'] = $subMenuName; $this->menu[$menuName][$subMenuName]['_tooltip'] = $tooltip; $this->menu[$menuName]['_hasSubmenu'] = true; - $this->menu[$menuName]['_tooltip'] = $tooltip; + + if (!array_key_exists('_tooltip', $this->menu[$menuName])) { + $this->menu[$menuName]['_tooltip'] = $tooltip; + } } } |