Uses AbstractPage::$activeMenuItem in user (group)-related forms
authorMatthias Schmidt <gravatronics@live.com>
Wed, 9 Oct 2013 15:42:49 +0000 (17:42 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 9 Oct 2013 15:42:49 +0000 (17:42 +0200)
wcfsetup/install/files/lib/acp/form/UserAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php

index 0856845895479e8bbd3399fd859ccc12295df813..66dd96ed1f68d189af69e2a1a17a2be8f8a56f8a 100644 (file)
@@ -8,7 +8,6 @@ use wcf\form\AbstractForm;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\exception\UserInputException;
 use wcf\system\language\LanguageFactory;
-use wcf\system\menu\acp\ACPMenu;
 use wcf\system\WCF;
 use wcf\util\ArrayUtil;
 use wcf\util\StringUtil;
@@ -26,15 +25,14 @@ use wcf\util\UserUtil;
  */
 class UserAddForm extends UserOptionListForm {
        /**
-        * @see wcf\page\AbstractPage::$neededPermissions
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
-       public $neededPermissions = array('admin.user.canAddUser');
+       public $activeMenuItem = 'wcf.acp.menu.link.user.add';
        
        /**
-        * name of the active menu item
-        * @var string
+        * @see wcf\page\AbstractPage::$neededPermissions
         */
-       public $menuItemName = 'wcf.acp.menu.link.user.add';
+       public $neededPermissions = array('admin.user.canAddUser');
        
        /**
         * username
@@ -407,9 +405,6 @@ class UserAddForm extends UserOptionListForm {
         * @see wcf\page\IPage::show()
         */
        public function show() {
-               // set active menu item
-               ACPMenu::getInstance()->setActiveMenuItem($this->menuItemName);
-               
                // get the default language id
                $this->languageID = $this->getDefaultFormLanguageID();
                
index 35c82333200057648a886e8c2514af97bfcbdac2..f1b4ce2834ab15edb23b567cef12f16f77d26158 100755 (executable)
@@ -28,9 +28,9 @@ use wcf\util\StringUtil;
  */
 class UserEditForm extends UserAddForm {
        /**
-        * @see wcf\acp\form\UserAddForm::$menuItemName
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
-       public $menuItemName = 'wcf.acp.menu.link.user.management';
+       public $activeMenuItem = 'wcf.acp.menu.link.user.management';
        
        /**
         * @see wcf\page\AbstractPage::$neededPermissions
index d3a0ba5aeab7ca77ff32e66cc92f1962fb9de27f..585f4cec760097272f410d8140d5c37f9b9b8c84 100755 (executable)
@@ -5,7 +5,6 @@ use wcf\data\user\group\UserGroupAction;
 use wcf\data\user\group\UserGroupEditor;
 use wcf\system\exception\UserInputException;
 use wcf\system\language\I18nHandler;
-use wcf\system\menu\acp\ACPMenu;
 use wcf\system\WCF;
 use wcf\system\WCFACP;
 use wcf\util\StringUtil;
@@ -22,15 +21,14 @@ use wcf\util\StringUtil;
  */
 class UserGroupAddForm extends AbstractOptionListForm {
        /**
-        * @see wcf\page\AbstractPage::$neededPermissions
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
-       public $neededPermissions = array('admin.user.canAddGroup');
+       public $activeMenuItem = 'wcf.acp.menu.link.group.add';
        
        /**
-        * name of the active acp menu item
-        * @var string
+        * @see wcf\page\AbstractPage::$neededPermissions
         */
-       public $menuItemName = 'wcf.acp.menu.link.group.add';
+       public $neededPermissions = array('admin.user.canAddGroup');
        
        /**
         * option tree
@@ -231,9 +229,6 @@ class UserGroupAddForm extends AbstractOptionListForm {
         * @see wcf\form\IForm::show()
         */
        public function show() {
-               // set active menu item
-               ACPMenu::getInstance()->setActiveMenuItem($this->menuItemName);
-               
                // check master password
                WCFACP::checkMasterPassword();
                
index b2b9cf8fbb92454cae0ecb3613e96765c2dbcd6e..4b484e7fdeeacf2dadb51fc2401f9292d01a8ed5 100755 (executable)
@@ -21,9 +21,9 @@ use wcf\system\WCF;
  */
 class UserGroupEditForm extends UserGroupAddForm {
        /**
-        * @see wcf\acp\form\UserGroupAddForm::$menuItemName
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
-       public $menuItemName = 'wcf.acp.menu.link.group';
+       public $activeMenuItem = 'wcf.acp.menu.link.group';
        
        /**
         * @see wcf\page\AbstractPage::$neededPermissions
index 41c4e5efa7a189d541aaae1b3c5d09ebb8a5d6a1..c1dbefb36db97b019b57952fdd4046df7c2f28a9 100755 (executable)
@@ -6,7 +6,6 @@ use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\event\EventHandler;
 use wcf\system\exception\UserInputException;
 use wcf\system\language\LanguageFactory;
-use wcf\system\menu\acp\ACPMenu;
 use wcf\system\request\LinkHandler;
 use wcf\system\wcf;
 use wcf\util\ArrayUtil;
@@ -25,10 +24,9 @@ use wcf\util\StringUtil;
  */
 class UserSearchForm extends UserOptionListForm {
        /**
-        * active menu item name
-        * @var string
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
-       public $menuItemName = 'wcf.acp.menu.link.user.search';
+       public $activeMenuItem = 'wcf.acp.menu.link.user.search';
        
        /**
         * @see wcf\page\AbstractPage::$neededPermissions
@@ -272,17 +270,6 @@ class UserSearchForm extends UserOptionListForm {
                ));
        }
        
-       /**
-        * @see wcf\form\IForm::show()
-        */
-       public function show() {
-               // set active menu item
-               ACPMenu::getInstance()->setActiveMenuItem($this->menuItemName);
-               
-               // show form
-               parent::show();
-       }
-       
        /**
         * @see wcf\form\IForm::save()
         */