Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core/Menu
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-06-19 05:37:17 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-06-19 05:37:17 +0400
commit253b165e621953efcb692f985036e217920ba696 (patch)
treede76a07700ed5b41f3f6a2cc4a880351e1b8b20b /core/Menu
parent95aed5eba938839e2ffe74beca4fbf3399c77a54 (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')
-rw-r--r--core/Menu/MenuAbstract.php23
-rw-r--r--core/Menu/MenuReporting.php7
2 files changed, 19 insertions, 11 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;
+ }
}
}
diff --git a/core/Menu/MenuReporting.php b/core/Menu/MenuReporting.php
index 67f95bb8a6..d704134510 100644
--- a/core/Menu/MenuReporting.php
+++ b/core/Menu/MenuReporting.php
@@ -68,13 +68,14 @@ class MenuReporting extends MenuAbstract
*/
Piwik::postEvent('Menu.Reporting.addItems', array());
+ foreach (Report::getAllReports() as $report) {
+ $report->configureReportingMenu($this);
+ }
+
foreach ($this->getAvailableMenus() as $menu) {
$menu->configureReportingMenu($this);
}
- foreach (Report::getAllReports() as $report) {
- $report->configureReportingMenu($this);
- }
}
return parent::getMenu();