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-08-19 15:49:28 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-08-19 15:49:28 +0400
commit01db6297b942be7fbda669f00bc73881aa86b736 (patch)
tree7cb5735c9ec51c1923d3bdf3efd6ac4d5222b4ed /core/Menu
parent0f6424a0a1aff64cdbbda376d13c3ba3cc3b6803 (diff)
refs #5977 group goals in a menu if there are more than 3 goals. I reused an existing menuDropDown component that was already used for Language and Usermenu. I removed the round border there as all our other components to not have round corners. Also had to add some z-index because Segment and Date picker define a z-index. So to make sure the components are correct visible I had to add a z-index to the submenu and therefore to the top menu. I hope this does not introduce any side effects. Tested with leftMenu and with ZenMode...
Diffstat (limited to 'core/Menu')
-rw-r--r--core/Menu/Group.php31
-rw-r--r--core/Menu/MenuReporting.php15
2 files changed, 46 insertions, 0 deletions
diff --git a/core/Menu/Group.php b/core/Menu/Group.php
new file mode 100644
index 0000000000..17e7c9bc5c
--- /dev/null
+++ b/core/Menu/Group.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Menu;
+
+/**
+ * @ignore
+ */
+class Group
+{
+ private $items;
+
+ public function add($subTitleMenu, $url, $tooltip = false)
+ {
+ $this->items[] = array(
+ 'name' => $subTitleMenu,
+ 'url' => $url,
+ 'tooltip' => $tooltip
+ );;
+ }
+
+ public function getItems()
+ {
+ return $this->items;
+ }
+}
diff --git a/core/Menu/MenuReporting.php b/core/Menu/MenuReporting.php
index c2d1801a8f..28fddd8313 100644
--- a/core/Menu/MenuReporting.php
+++ b/core/Menu/MenuReporting.php
@@ -63,6 +63,21 @@ class MenuReporting extends MenuAbstract
}
/**
+ * Should not be a public API yet. We probably have to change the API once we have another use case.
+ * @ignore
+ */
+ public function addGroup($menuName, $defaultTitle, Group $group, $order = 50, $tooltip = false)
+ {
+ $this->menuEntries[] = array(
+ $menuName,
+ $defaultTitle,
+ $group,
+ $order,
+ $tooltip
+ );
+ }
+
+ /**
* See {@link add()}. Adds a new menu item to the referrers section of the reporting menu.
* @param string $menuName
* @param array $url