diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-05-20 10:10:27 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-05-20 10:10:27 +0400 |
commit | 307ec31f2cfebd9c8bf9caba575e2864d42c8597 (patch) | |
tree | 2d6120c412b272344d204e9947fb3859bb7b3aa7 /plugins/ExampleUI | |
parent | 45ae10e999baf0dfa066e5daae00bca824a68191 (diff) |
refs #5192 added generator for menus, updated more plugins to use menu class, fixed some bugs, improved design, fixed tests, ...
Diffstat (limited to 'plugins/ExampleUI')
-rw-r--r-- | plugins/ExampleUI/Menu.php (renamed from plugins/ExampleUI/ExampleUI.php) | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/plugins/ExampleUI/ExampleUI.php b/plugins/ExampleUI/Menu.php index d9204abca8..c2b61f6e2d 100644 --- a/plugins/ExampleUI/ExampleUI.php +++ b/plugins/ExampleUI/Menu.php @@ -6,28 +6,17 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later * */ - namespace Piwik\Plugins\ExampleUI; -use Piwik\Menu\MenuAbstract; -use Piwik\Menu\MenuMain; + +use Piwik\Menu\MenuReporting; use Piwik\Menu\MenuTop; +use Piwik\Plugin\Manager as PluginManager; /** */ -class ExampleUI extends \Piwik\Plugin +class Menu extends \Piwik\Plugin\Menu { - /** - * @see Piwik\Plugin::getListHooksRegistered - */ - public function getListHooksRegistered() - { - return array( - 'Menu.Reporting.addItems' => 'addReportingMenuItems', - 'Menu.Top.addItems' => 'addTopMenuItems', - ); - } - - function addReportingMenuItems(MenuAbstract $menu) + public function configureReportingMenu(MenuReporting $menu) { $menu->add('UI Framework', '', array('module' => 'ExampleUI', 'action' => 'dataTables'), true, 30); @@ -38,18 +27,18 @@ class ExampleUI extends \Piwik\Plugin $this->addSubMenu($menu, 'Sparklines', 'sparklines', 5); $this->addSubMenu($menu, 'Evolution Graph', 'evolutionGraph', 6); - if (\Piwik\Plugin\Manager::getInstance()->isPluginActivated('TreemapVisualization')) { + if (PluginManager::getInstance()->isPluginActivated('TreemapVisualization')) { $this->addSubMenu($menu, 'Treemap', 'treemap', 7); } } - function addTopMenuItems(MenuTop $menu) + public function configureTopMenu(MenuTop $menu) { $urlParams = array('module' => 'ExampleUI', 'action' => 'notifications'); - $menu->addEntry('UI Notifications', null, $urlParams, $displayedForCurrentUser = true, $order = 3); + $menu->add('UI Notifications', null, $urlParams, $displayedForCurrentUser = true, $order = 3); } - private function addSubMenu(MenuAbstract $menu, $subMenu, $action, $order) + private function addSubMenu(MenuReporting $menu, $subMenu, $action, $order) { $menu->add('UI Framework', $subMenu, array('module' => 'ExampleUI', 'action' => $action), true, $order); } |