From eee6ed99cf522e4e65df6618f5cd919a18da481b Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Sat, 6 Sep 2014 12:16:37 +0200 Subject: refs #6140 easier way to define URLs for menu items and introducing a method to addItem without boolean parameter --- plugins/ExampleUI/Menu.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'plugins/ExampleUI') diff --git a/plugins/ExampleUI/Menu.php b/plugins/ExampleUI/Menu.php index 8b5f1bcfea..d608968edf 100644 --- a/plugins/ExampleUI/Menu.php +++ b/plugins/ExampleUI/Menu.php @@ -18,7 +18,7 @@ class Menu extends \Piwik\Plugin\Menu { public function configureReportingMenu(MenuReporting $menu) { - $menu->add('UI Framework', '', array('module' => 'ExampleUI', 'action' => 'dataTables'), true, 30); + $menu->addItem('UI Framework', '', array('module' => 'ExampleUI', 'action' => 'dataTables'), 30); $this->addSubMenu($menu, 'Data tables', 'dataTables', 1); $this->addSubMenu($menu, 'Bar graph', 'barGraph', 2); @@ -34,12 +34,11 @@ class Menu extends \Piwik\Plugin\Menu public function configureUserMenu(MenuUser $menu) { - $urlParams = array('module' => 'ExampleUI', 'action' => 'notifications'); - $menu->addPlatformItem('UI Notifications', $urlParams, $order = 3); + $menu->addPlatformItem('UI Notifications', $this->urlForAction('notifications'), $order = 3); } private function addSubMenu(MenuReporting $menu, $subMenu, $action, $order) { - $menu->add('UI Framework', $subMenu, array('module' => 'ExampleUI', 'action' => $action), true, $order); + $menu->addItem('UI Framework', $subMenu, $this->urlForAction($action), $order); } } -- cgit v1.2.3