diff options
Diffstat (limited to 'core/Menu')
-rw-r--r-- | core/Menu/Group.php | 31 | ||||
-rw-r--r-- | core/Menu/MenuReporting.php | 15 |
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 |