From f6d87baf3833a00c3747cd590d83d0e499d7c94e Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Tue, 22 Jul 2014 08:49:54 +0200 Subject: refs #5192 simplified admin menu since it is very confusing for developers to find the correct translation key to use for menuName. Results in lots of dulicated code as well (same translation keys are mentioned everywhere). Also removed the $displayedForCurrentUsers in those methods since boolean parameters are bad practice and it did result in duplicated code as well as you had to call the same function or pass the same variable in each add() call. Moved the VisitorGenerator in a development section since it is not really diagnostic. There will be another development menu item with the next commit. Need to update ui tests --- core/Menu/MenuAdmin.php | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'core/Menu') diff --git a/core/Menu/MenuAdmin.php b/core/Menu/MenuAdmin.php index 106420b712..ad4c6c4108 100644 --- a/core/Menu/MenuAdmin.php +++ b/core/Menu/MenuAdmin.php @@ -48,6 +48,71 @@ class MenuAdmin extends MenuAbstract self::getInstance()->add('General_Settings', $adminMenuName, $url, $displayedForCurrentUser, $order); } + /** + * See {@link add()}. Adds a new menu item to the development section. + * @param string $menuName + * @param array $url + * @param int $order + * @param bool $tooltip + * @api + */ + public function addDevelopmentItem($menuName, $url, $order = 50, $tooltip = false) + { + $this->add('CoreAdminHome_MenuDevelopment', $menuName, $url, true, $order, $tooltip); + } + + /** + * See {@link add()}. Adds a new menu item to the development section. + * @param string $menuName + * @param array $url + * @param int $order + * @param bool $tooltip + * @api + */ + public function addDiagnosticItem($menuName, $url, $order = 50, $tooltip = false) + { + $this->add('CoreAdminHome_MenuDiagnostic', $menuName, $url, true, $order, $tooltip); + } + + /** + * See {@link add()}. Adds a new menu item to the development section. + * @param string $menuName + * @param array $url + * @param int $order + * @param bool $tooltip + * @api + */ + public function addPlatformItem($menuName, $url, $order = 50, $tooltip = false) + { + $this->add('CorePluginsAdmin_MenuPlatform', $menuName, $url, true, $order, $tooltip); + } + + /** + * See {@link add()}. Adds a new menu item to the development section. + * @param string $menuName + * @param array $url + * @param int $order + * @param bool $tooltip + * @api + */ + public function addSettingsItem($menuName, $url, $order = 50, $tooltip = false) + { + $this->add('General_Settings', $menuName, $url, true, $order, $tooltip); + } + + /** + * See {@link add()}. Adds a new menu item to the development section. + * @param string $menuName + * @param array $url + * @param int $order + * @param bool $tooltip + * @api + */ + public function addManageItem($menuName, $url, $order = 50, $tooltip = false) + { + $this->add('CoreAdminHome_MenuManage', $menuName, $url, true, $order, $tooltip); + } + /** * Triggers the Menu.MenuAdmin.addItems hook and returns the admin menu. * -- cgit v1.2.3