/** * Triggers the Menu.MenuAdmin.addItems hook and returns the admin menu. * * @return Array */ public function getMenu() { if (!$this->menu) { /** * Triggered when collecting all available admin menu items. Subscribe to this event if you want * to add one or more items to the Piwik admin menu. * * Menu items should be added via the {@link add()} method. * * **Example** * * use Piwik\Menu\MenuAdmin; * * public function addMenuItems() * { * MenuAdmin::getInstance()->add( * 'MenuName', * 'SubmenuName', * array('module' => 'MyPlugin', 'action' => 'index'), * $showOnlyIf = Piwik::isUserIsSuperUser(), * $order = 6 * ); * } */ Piwik::postEvent('Menu.Admin.addItems'); } return parent::getMenu(); }
/** * Triggers the Menu.Top.addItems hook and returns the menu. * * @return Array */ public function getMenu() { if (!$this->menu) { foreach ($this->getAllMenus() as $menu) { $menu->configureTopMenu($this); } } return parent::getMenu(); }
/** * Triggers the Menu.MenuAdmin.addItems hook and returns the admin menu. * * @return Array */ public function getMenu() { if (!$this->menu) { /** * @ignore */ Piwik::postEvent('Menu.Admin.addItems', array()); foreach ($this->getAvailableMenus() as $menu) { $menu->configureAdminMenu($this); } } return parent::getMenu(); }
/** * Triggers the Menu.Reporting.addItems hook and returns the menu. * * @return Array */ public function getMenu() { if (!$this->menu) { /** * @ignore * @deprecated */ Piwik::postEvent('Menu.Reporting.addItems', array()); foreach ($this->getAvailableMenus() as $menu) { $menu->configureReportingMenu($this); } } return parent::getMenu(); }
/** * Triggers the Menu.Top.addItems hook and returns the menu. * * @return Array */ public function getMenu() { if (!$this->menu) { /** * Triggered when collecting all available menu items that are be displayed on the very top of every * page, next to the login/logout links. * * Subscribe to this event if you want to add one or more items to the top menu. * * Menu items should be added via the {@link addEntry()} method. * * **Example** * * use Piwik\Menu\MenuTop; * * public function addMenuItems() * { * MenuTop::addEntry( * 'TopMenuName', * array('module' => 'MyPlugin', 'action' => 'index'), * $showOnlyIf = Piwik::isUserIsSuperUser(), * $order = 6 * ); * } */ Piwik::postEvent('Menu.Top.addItems'); } return parent::getMenu(); }