Adds active menu item handling to AbstractPage and removes ACPForm
authorMatthias Schmidt <gravatronics@live.com>
Sun, 30 Dec 2012 18:10:59 +0000 (19:10 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 30 Dec 2012 18:10:59 +0000 (19:10 +0100)
37 files changed:
wcfsetup/install/files/lib/acp/form/ACPForm.class.php [deleted file]
wcfsetup/install/files/lib/acp/form/ApplicationEditForm.class.php
wcfsetup/install/files/lib/acp/form/CronjobAddForm.class.php
wcfsetup/install/files/lib/acp/form/CronjobEditForm.class.php
wcfsetup/install/files/lib/acp/form/MasterPasswordForm.class.php
wcfsetup/install/files/lib/acp/form/MasterPasswordInitForm.class.php
wcfsetup/install/files/lib/acp/form/OptionImportForm.class.php
wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php
wcfsetup/install/files/lib/acp/form/PackageUpdateAuthForm.class.php
wcfsetup/install/files/lib/acp/form/PackageUpdateForm.class.php
wcfsetup/install/files/lib/acp/form/PackageUpdateSearchForm.class.php
wcfsetup/install/files/lib/acp/form/PageMenuItemAddForm.class.php
wcfsetup/install/files/lib/acp/form/PageMenuItemEditForm.class.php
wcfsetup/install/files/lib/acp/form/UpdateServerAddForm.class.php
wcfsetup/install/files/lib/acp/form/UpdateServerEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserAssignToGroupForm.class.php
wcfsetup/install/files/lib/acp/form/UserEmailAddressExportForm.class.php
wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php
wcfsetup/install/files/lib/acp/form/UserMailForm.class.php
wcfsetup/install/files/lib/acp/page/ACPSessionLogListPage.class.php
wcfsetup/install/files/lib/acp/page/ACPSessionLogPage.class.php
wcfsetup/install/files/lib/acp/page/ApplicationManagementPage.class.php
wcfsetup/install/files/lib/acp/page/CacheListPage.class.php
wcfsetup/install/files/lib/acp/page/CronjobListPage.class.php
wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php
wcfsetup/install/files/lib/acp/page/IndexPage.class.php
wcfsetup/install/files/lib/acp/page/PackageAutoUpdateListPage.class.php
wcfsetup/install/files/lib/acp/page/PackageInstallationConfirmPage.class.php
wcfsetup/install/files/lib/acp/page/PackageListDetailedPage.class.php
wcfsetup/install/files/lib/acp/page/PackageListPage.class.php
wcfsetup/install/files/lib/acp/page/PackagePage.class.php
wcfsetup/install/files/lib/acp/page/PackageUpdateSearchResultPage.class.php
wcfsetup/install/files/lib/acp/page/PageMenuItemListPage.class.php
wcfsetup/install/files/lib/acp/page/UpdateServerListPage.class.php
wcfsetup/install/files/lib/acp/page/UserGroupListPage.class.php
wcfsetup/install/files/lib/acp/page/UserListPage.class.php
wcfsetup/install/files/lib/page/AbstractPage.class.php

diff --git a/wcfsetup/install/files/lib/acp/form/ACPForm.class.php b/wcfsetup/install/files/lib/acp/form/ACPForm.class.php
deleted file mode 100755 (executable)
index 1bda404..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-namespace wcf\acp\form;
-use wcf\form\AbstractForm;
-use wcf\system\menu\acp\ACPMenu;
-
-/**
- * Provides a default implementation for the show method in acp forms.
- * 
- * @author     Marcel Werk
- * @copyright  2001-2012 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage acp.form
- * @category   Community Framework
- */
-class ACPForm extends AbstractForm {
-       /**
-        * active acp menu item
-        * @var string
-        */
-       public $activeMenuItem = '';
-       
-       /**
-        * @see wcf\page\IPage::show()
-        */
-       public function show() {
-               // set active acp menu item
-               if (!empty($this->activeMenuItem)) {
-                       ACPMenu::getInstance()->setActiveMenuItem($this->activeMenuItem);
-               }
-               
-               parent::show();
-       }
-}
index 6a492ea0fd2c9552309ce5067dea9baef2a306b3..035cafc346088b84b8744086f7b1cb1f9cc04e24 100644 (file)
@@ -4,6 +4,7 @@ use wcf\data\application\Application;
 use wcf\data\application\ApplicationAction;
 use wcf\data\application\ViewableApplication;
 use wcf\system\application\ApplicationHandler;
+use wcf\form\AbstractForm;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\UserInputException;
 use wcf\system\Regex;
@@ -21,9 +22,9 @@ use wcf\util\StringUtil;
  * @subpackage acp.form
  * @category   Community Framework
  */
-class ApplicationEditForm extends ACPForm {
+class ApplicationEditForm extends AbstractForm {
        /**
-        * @see wcf\acp\form\ACPForm::$activeMenuItem
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
        public $activeMenuItem = 'wcf.acp.menu.link.application';
        
index 32f68f34e4c31ff1b9bf9a4f96d81b08b07a15e9..758a6d8081ac0ba59cedace3d5323c9b0e6f80d9 100755 (executable)
@@ -2,6 +2,7 @@
 namespace wcf\acp\form;
 use wcf\data\cronjob\CronjobAction;
 use wcf\data\cronjob\CronjobEditor;
+use wcf\form\AbstractForm;
 use wcf\system\exception\SystemException;
 use wcf\system\exception\UserInputException;
 use wcf\system\language\I18nHandler;
@@ -19,9 +20,9 @@ use wcf\util\StringUtil;
  * @subpackage acp.form
  * @category   Community Framework
  */
-class CronjobAddForm extends ACPForm {
+class CronjobAddForm extends AbstractForm {
        /**
-        * @see wcf\acp\form\ACPForm::$activeMenuItem
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
        public $activeMenuItem = 'wcf.acp.menu.link.cronjob.add';
        
index e47d60747576e260cbd59d7b1bd944eaa9ea0617..3259b720a6ad02739430fb71bdd9bab86d4001ca 100755 (executable)
@@ -2,6 +2,7 @@
 namespace wcf\acp\form;
 use wcf\data\cronjob\Cronjob;
 use wcf\data\cronjob\CronjobAction;
+use wcf\form\AbstractForm;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\language\I18nHandler;
 use wcf\system\WCF;
@@ -18,7 +19,7 @@ use wcf\system\WCF;
  */
 class CronjobEditForm extends CronjobAddForm {
        /**
-        * @see wcf\acp\form\ACPForm::$activeMenuItem
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
        public $activeMenuItem = 'wcf.acp.menu.link.cronjob';
        
@@ -58,7 +59,7 @@ class CronjobEditForm extends CronjobAddForm {
         * @see wcf\form\IForm::save()
         */
        public function save() {
-               ACPForm::save();
+               AbstractForm::save();
                
                $this->description = 'wcf.acp.cronjob.description.cronjob'.$this->cronjob->cronjobID;
                if (I18nHandler::getInstance()->isPlainValue('description')) {
index 246c988dd70b047bfb9aea36800d5c8f3b5eb8d0..46059b02e0985c9485e91a4fa0f8271d139d3edb 100755 (executable)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\acp\form;
+use wcf\form\AbstractForm;
 use wcf\system\exception\UserInputException;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
@@ -16,7 +17,7 @@ use wcf\util\StringUtil;
  * @subpackage acp.form
  * @category   Community Framework
  */
-class MasterPasswordForm extends ACPForm {
+class MasterPasswordForm extends AbstractForm {
        /**
         * master password
         * @var string
index 833ec1b896e15ac58a45d5bd028105e4a6f5be4c..be25e9e169e43b2d237b3d810758bf38133bbeed 100755 (executable)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\acp\form;
+use wcf\form\AbstractForm;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\UserInputException;
 use wcf\system\io\File;
@@ -48,7 +49,7 @@ class MasterPasswordInitForm extends MasterPasswordForm {
         * @see wcf\form\IForm::validate()
         */
        public function validate() {
-               ACPForm::validate();
+               AbstractForm::validate();
                
                if (empty($this->masterPassword)) {
                        throw new UserInputException('masterPassword');
index 2cb4593e5a7e706ea5712ea7cc1cf730f7457e03..000075f88f7fb244178a085c67e46c0091516924 100755 (executable)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\acp\form;
 use wcf\data\option\OptionAction;
+use wcf\form\AbstractForm;
 use wcf\system\exception\SystemException;
 use wcf\system\exception\UserInputException;
 use wcf\system\WCF;
@@ -17,16 +18,16 @@ use wcf\util\XML;
  * @subpackage acp.form
  * @category   Community Framework
  */
-class OptionImportForm extends ACPForm {
+class OptionImportForm extends AbstractForm {
        /**
-        * @see wcf\page\AbstractPage::$neededPermissions
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
-       public $neededPermissions = array('admin.system.canEditOption');
+       public $activeMenuItem = 'wcf.acp.menu.link.option.importAndExport';
        
        /**
-        * @see wcf\acp\form\ACPForm::$activeMenuItem
+        * @see wcf\page\AbstractPage::$neededPermissions
         */
-       public $activeMenuItem = 'wcf.acp.menu.link.option.importAndExport';
+       public $neededPermissions = array('admin.system.canEditOption');
        
        /**
         * upload file data
index 055b8508e7ceffb5261c084cd6ffe5c4eeee204f..d1f5aa6f85616095f76353fd06abd25d6d90a228 100755 (executable)
@@ -3,16 +3,15 @@ namespace wcf\acp\form;
 use wcf\data\package\installation\queue\PackageInstallationQueue;
 use wcf\data\package\installation\queue\PackageInstallationQueueEditor;
 use wcf\data\package\Package;
+use wcf\form\AbstractForm;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\SystemException;
 use wcf\system\exception\UserInputException;
 use wcf\system\package\PackageArchive;
 use wcf\system\package\PackageInstallationDispatcher;
-use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
 use wcf\system\WCFACP;
 use wcf\util\FileUtil;
-use wcf\util\HeaderUtil;
 use wcf\util\StringUtil;
 
 /**
@@ -25,9 +24,9 @@ use wcf\util\StringUtil;
  * @subpackage acp.form
  * @category   Community Framework
  */
-class PackageStartInstallForm extends ACPForm {
+class PackageStartInstallForm extends AbstractForm {
        /**
-        * @see wcf\acp\form\ACPForm::$activeMenuItem
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
        public $activeMenuItem = 'wcf.acp.menu.link.package.install';
        
index bce8b97c062768f30bb1b1ad2c3109b8f560e930..49e53212f19d6ce1264fb473138644f05d5265b9 100755 (executable)
@@ -2,6 +2,7 @@
 namespace wcf\acp\form;
 use wcf\data\package\update\server\PackageUpdateServer;
 use wcf\data\package\update\server\PackageUpdateServerEditor;
+use wcf\form\AbstractForm;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\package\PackageUpdateAuthorizationRequiredException;
 use wcf\system\request\RequestHandler;
@@ -19,16 +20,16 @@ use wcf\util\StringUtil;
  * @subpackage acp.form
  * @category   Community Framework
  */
-class PackageUpdateAuthForm extends ACPForm {
+class PackageUpdateAuthForm extends AbstractForm {
        /**
-        * @see wcf\page\AbstractPage::$neededPermissions
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
-       public $neededPermissions = array('admin.system.package.canUpdatePackage', 'admin.system.package.canInstallPackage');
+       public $activeMenuItem = 'wcf.acp.menu.link.package';
        
        /**
-        * @see wcf\acp\form\ACPForm::$activeMenuItem
+        * @see wcf\page\AbstractPage::$neededPermissions
         */
-       public $activeMenuItem = 'wcf.acp.menu.link.package';
+       public $neededPermissions = array('admin.system.package.canUpdatePackage', 'admin.system.package.canInstallPackage');
        
        /**
         * exception that has been thrown if an authorization for the package update
index 0e5e2774042f8e44c094c16edba226bb937a9904..5dabb65533d4fc56b45a509905924b4eac7a90d6 100755 (executable)
@@ -1,14 +1,12 @@
 <?php
 namespace wcf\acp\form;
+use wcf\form\AbstractForm;
 use wcf\system\package\PackageInstallationDispatcher;
-
 use wcf\system\exception\SystemException;
 use wcf\system\exception\UserInputException;
 use wcf\system\package\PackageUpdateDispatcher;
-use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
 use wcf\system\WCFACP;
-use wcf\util\HeaderUtil;
 
 /**
  * Shows the package update confirmation form.
@@ -20,16 +18,16 @@ use wcf\util\HeaderUtil;
  * @subpackage acp.form
  * @category   Community Framework
  */
-class PackageUpdateForm extends ACPForm {
+class PackageUpdateForm extends AbstractForm {
        /**
-        * @see wcf\page\AbstractPage::$neededPermissions
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
-       public $neededPermissions = array('admin.system.package.canUpdatePackage', 'admin.system.package.canInstallPackage');
+       public $activeMenuItem = 'wcf.acp.menu.link.package';
        
        /**
-        * @see wcf\acp\form\ACPForm::$activeMenuItem
+        * @see wcf\page\AbstractPage::$neededPermissions
         */
-       public $activeMenuItem = 'wcf.acp.menu.link.package';
+       public $neededPermissions = array('admin.system.package.canUpdatePackage', 'admin.system.package.canInstallPackage');
        
        /**
         * list of packages to update
index faab837aa7540aa7fba1e0b79e81318759a9f193..5a1bd266c21f18d6ab439218bdad2c11bb849df3 100644 (file)
@@ -2,6 +2,7 @@
 namespace wcf\acp\form;
 use wcf\data\package\update\server\PackageUpdateServer;
 use wcf\data\search\SearchEditor;
+use wcf\form\AbstractForm;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\exception\UserInputException;
 use wcf\system\package\PackageUpdateDispatcher;
@@ -22,16 +23,16 @@ use wcf\util\StringUtil;
  * @subpackage acp.form
  * @category   Community Framework
  */
-class PackageUpdateSearchForm extends ACPForm {
+class PackageUpdateSearchForm extends AbstractForm {
        /**
-        * @see wcf\page\AbstractPage::$neededPermissions
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
-       public $neededPermissions = array('admin.system.package.canUpdatePackage', 'admin.system.package.canInstallPackage');
+       public $activeMenuItem = 'wcf.acp.menu.link.package.database';
        
        /**
-        * @see wcf\acp\form\ACPForm::$activeMenuItem
+        * @see wcf\page\AbstractPage::$neededPermissions
         */
-       public $activeMenuItem = 'wcf.acp.menu.link.package.database';
+       public $neededPermissions = array('admin.system.package.canUpdatePackage', 'admin.system.package.canInstallPackage');
        
        /**
         * list of package update server ids which are searched
index f007468d03c330335d7c2e1d35dcfed14dc6dad2..02fec357f6976a751a73567a3f583f34c22f237e 100644 (file)
@@ -3,6 +3,7 @@ namespace wcf\acp\form;
 use wcf\data\page\menu\item\PageMenuItemAction;
 use wcf\data\page\menu\item\PageMenuItemEditor;
 use wcf\data\page\menu\item\PageMenuItemList;
+use wcf\form\AbstractForm;
 use wcf\system\exception\UserInputException;
 use wcf\system\language\I18nHandler;
 use wcf\system\WCF;
@@ -18,9 +19,9 @@ use wcf\util\StringUtil;
  * @subpackage acp.form
  * @category   Community Framework
  */
-class PageMenuItemAddForm extends ACPForm {
+class PageMenuItemAddForm extends AbstractForm {
        /**
-        * @see wcf\acp\form\ACPForm::$activeMenuItem
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
        public $activeMenuItem = 'wcf.acp.menu.link.pageMenu.add';
        
index 7833d8c704ca76cf5948092fba5f9c10d0921a3b..cb3382a739599efe1ccc805c01776ffa65c61fca 100644 (file)
@@ -2,6 +2,7 @@
 namespace wcf\acp\form;
 use wcf\data\page\menu\item\PageMenuItem;
 use wcf\data\page\menu\item\PageMenuItemAction;
+use wcf\form\AbstractForm;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\language\I18nHandler;
 use wcf\system\WCF;
@@ -18,7 +19,7 @@ use wcf\system\WCF;
  */
 class PageMenuItemEditForm extends PageMenuItemAddForm {
        /**
-        * @see wcf\acp\form\ACPForm::$activeMenuItem
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
        public $activeMenuItem = 'wcf.acp.menu.link.pageMenu';
        
@@ -82,7 +83,7 @@ class PageMenuItemEditForm extends PageMenuItemAddForm {
         * @see wcf\form\IForm::save()
         */
        public function save() {
-               ACPForm::save();
+               AbstractForm::save();
                
                // save menu item
                I18nHandler::getInstance()->save('pageMenuItem', $this->menuItem->menuItem, 'wcf.page');
index f5ecc85f41bef018f7d069c45f896c78dcdbdcd5..5fc82c528b13771dd0688963128d663a4b1df99e 100755 (executable)
@@ -2,6 +2,7 @@
 namespace wcf\acp\form;
 use wcf\data\package\update\server\PackageUpdateServer;
 use wcf\data\package\update\server\PackageUpdateServerAction;
+use wcf\form\AbstractForm;
 use wcf\system\exception\UserInputException;
 use wcf\system\WCF;
 use wcf\system\WCFACP;
@@ -17,9 +18,9 @@ use wcf\util\StringUtil;
  * @subpackage acp.form
  * @category   Community Framework
  */
-class UpdateServerAddForm extends ACPForm {
+class UpdateServerAddForm extends AbstractForm {
        /**
-        * @see wcf\acp\form\ACPForm::$activeMenuItem
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
        public $activeMenuItem = 'wcf.acp.menu.link.package.server.add';
        
index 8f901df853b8996817d9c61a614a4c12103b162b..c506b7c059a304f362eec6ae837ec1757d5eb20b 100755 (executable)
@@ -18,7 +18,7 @@ use wcf\system\WCF;
  */
 class UpdateServerEditForm extends UpdateServerAddForm {
        /**
-        * @see wcf\acp\form\ACPForm::$activeMenuItem
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
        public $activeMenuItem = 'wcf.acp.menu.link.package.server';
        
index 9f344b435e55547168bd8fc13cfeb6fb7f673551..30385223867b61ef227ad1c38feb764b77cc47ee 100755 (executable)
@@ -2,6 +2,7 @@
 namespace wcf\acp\form;
 use wcf\data\user\group\UserGroup;
 use wcf\data\user\UserEditor;
+use wcf\form\AbstractForm;
 use wcf\system\clipboard\ClipboardHandler;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\exception\IllegalLinkException;
@@ -22,14 +23,14 @@ use wcf\util\ArrayUtil;
  * @subpackage acp.form
  * @category   Community Framework
  */
-class UserAssignToGroupForm extends ACPForm {
+class UserAssignToGroupForm extends AbstractForm {
        /**
         * @see wcf\page\AbstractPage::$neededPermissions
         */
        public $neededPermissions = array('admin.user.canEditUser');
        
        /**
-        * @see wcf\acp\form\ACPForm::$activeMenuItem
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
        public $activeMenuItem = 'wcf.acp.menu.link.user.management';
        
index 5cdcf590fc642903dc09e150643a4957d53592c9..e43e9c66674c9dc78e4d6a0bab4ae1bdfdba3e30 100755 (executable)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\acp\form;
+use wcf\form\AbstractForm;
 use wcf\system\clipboard\ClipboardHandler;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\exception\IllegalLinkException;
@@ -17,7 +18,7 @@ use wcf\util\StringUtil;
  * @subpackage acp.form
  * @category   Community Framework
  */
-class UserEmailAddressExportForm extends ACPForm {
+class UserEmailAddressExportForm extends AbstractForm {
        /**
         * @see wcf\page\AbstractPage::$activeMenuItem
         */
index 616351173564c1fdae5ac7a667c00b21d02f4156..c246c94a20f8267541a38fd403d34124b8c022c7 100644 (file)
@@ -5,6 +5,7 @@ use wcf\data\user\group\option\UserGroupOption;
 use wcf\data\user\group\option\UserGroupOptionAction;
 use wcf\data\user\group\UserGroup;
 use wcf\data\DatabaseObject;
+use wcf\form\AbstractForm;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\PermissionDeniedException;
@@ -22,9 +23,9 @@ use wcf\system\WCF;
  * @subpackage acp.form
  * @category   Community Framework
  */
-class UserGroupOptionForm extends ACPForm {
+class UserGroupOptionForm extends AbstractForm {
        /**
-        * @see wcf\acp\form\ACPForm::$activeMenuItem
+        * @see wcf\page\AbstractPage::$activeMenuItem
         */
        public $activeMenuItem = 'wcf.acp.menu.link.group';
        
index 4bfc13c4ca0737440ebd94ee516fa58ff8751850..cfe5c8658a231c803c0574f94004e69a091814dd 100755 (executable)
@@ -2,6 +2,7 @@
 namespace wcf\acp\form;
 use wcf\data\user\group\UserGroup;
 use wcf\data\user\UserList;
+use wcf\form\AbstractForm;
 use wcf\system\clipboard\ClipboardHandler;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\SystemException;
@@ -20,7 +21,7 @@ use wcf\util\StringUtil;
  * @subpackage acp.form
  * @category   Community Framework
  */
-class UserMailForm extends ACPForm {
+class UserMailForm extends AbstractForm {
        /**
         * enable html for message body
         * @var boolean
index 883a5bf1fb9a7608cd0f5938c236ef8fdbb277bd..07422e1e19146cbe9e4d400e9edc94ad9bd7a34e 100755 (executable)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\acp\page;
 use wcf\page\SortablePage;
-use wcf\system\menu\acp\ACPMenu;
 
 /**
  * Shows a list of log sessions.
@@ -14,6 +13,11 @@ use wcf\system\menu\acp\ACPMenu;
  * @category   Community Framework
  */
 class ACPSessionLogListPage extends SortablePage {
+       /**
+        * @see wcf\page\AbstractPage::$activeMenuItem
+        */
+       public $activeMenuItem = 'wcf.acp.menu.link.log.session';
+       
        /**
         * @see wcf\page\AbstractPage::$templateName
         */
@@ -52,14 +56,4 @@ class ACPSessionLogListPage extends SortablePage {
                
                parent::readObjects();
        }
-       
-       /**
-        * @see wcf\page\IPage::show()
-        */
-       public function show() {
-               // enable menu item
-               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.log.session');
-               
-               parent::show();
-       }
 }
index 84657047f2bcd91312d0c4e8a1d4e3e51a54ce3a..41167a406ca4e208b64a11e05615c0bfb00290a0 100755 (executable)
@@ -3,7 +3,6 @@ namespace wcf\acp\page;
 use wcf\data\acp\session\log\ACPSessionLog;
 use wcf\page\SortablePage;
 use wcf\system\exception\IllegalLinkException;
-use wcf\system\menu\acp\ACPMenu;
 use wcf\system\WCF;
 
 /**
@@ -17,6 +16,11 @@ use wcf\system\WCF;
  * @category   Community Framework
  */
 class ACPSessionLogPage extends SortablePage {
+       /**
+        * @see wcf\page\AbstractPage::$activeMenuItem
+        */
+       public $activeMenuItem = 'wcf.acp.menu.link.log.session';
+       
        /**
         * @see wcf\page\AbstractPage::$templateName
         */
@@ -97,14 +101,4 @@ class ACPSessionLogPage extends SortablePage {
                        'sessionLog' => $this->sessionLog
                ));
        }
-       
-       /**
-        * @see wcf\page\IPage::show()
-        */
-       public function show() {
-               // enable menu item
-               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.log.session');
-               
-               parent::show();
-       }
 }
index b3665bfbe0b570037a30889b375c45621e7fea54..ea70f6007b8d3e4225cc5ef3c0cd372b42edcebb 100644 (file)
@@ -2,7 +2,6 @@
 namespace wcf\acp\page;
 use wcf\data\application\ViewableApplicationList;
 use wcf\page\AbstractPage;
-use wcf\system\menu\acp\ACPMenu;
 use wcf\system\WCF;
 
 /**
@@ -16,6 +15,11 @@ use wcf\system\WCF;
  * @category   Community Framework
  */
 class ApplicationManagementPage extends AbstractPage {
+       /**
+        * @see wcf\page\AbstractPage::$activeMenuItem
+        */
+       public $activeMenuItem = 'wcf.acp.menu.link.application.management';
+       
        /**
         * list of applications
         * @var wcf\data\application\ViewableApplicationList
@@ -48,14 +52,4 @@ class ApplicationManagementPage extends AbstractPage {
                        'applicationList' => $this->applicationList
                ));
        }
-       
-       /**
-        * @see wcf\page\IPage::show()
-        */
-       public function show() {
-               // enable menu item
-               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.application.management');
-               
-               parent::show();
-       }
 }
index 22bdc6077a7fe0a9065e3f1f6de78c9a179acca1..155f111310019743d1143b2697f6dde7518c6e19 100755 (executable)
@@ -1,8 +1,6 @@
 <?php
 namespace wcf\acp\page;
-use wcf\system\menu\acp\ACPMenu;
 use wcf\page\AbstractPage;
-use wcf\system\cache\source\MemcacheAdapter;
 use wcf\system\cache\CacheHandler;
 use wcf\system\exception\SystemException;
 use wcf\system\Regex;
@@ -21,6 +19,11 @@ use wcf\util\DirectoryUtil;
  * @category   Community Framework
  */
 class CacheListPage extends AbstractPage {
+       /**
+        * @see wcf\page\AbstractPage::$activeMenuItem
+        */
+       public $activeMenuItem = 'wcf.acp.menu.link.application.cache';
+       
        /**
         * @see wcf\page\AbstractPage::$neededPermissions
         */
@@ -214,14 +217,4 @@ class CacheListPage extends AbstractPage {
                        'cleared' => $this->cleared
                ));
        }
-       
-       /**
-        * @see wcf\page\IPage::show()
-        */
-       public function show() {
-               // enable menu item
-               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.application.cache');
-               
-               parent::show();
-       }
 }
index 2174125007829969d321193ace432afed97a0177..47d5b8bb281ef8f3142197a4759b8295e5adf8e1 100755 (executable)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\acp\page;
 use wcf\page\SortablePage;
-use wcf\system\menu\acp\ACPMenu;
 
 /**
  * Shows information about configured cron jobs.
@@ -14,6 +13,11 @@ use wcf\system\menu\acp\ACPMenu;
  * @category   Community Framework
  */
 class CronjobListPage extends SortablePage {
+       /**
+        * @see wcf\page\AbstractPage::$activeMenuItem
+        */
+       public $activeMenuItem = 'wcf.acp.menu.link.cronjob.list';
+       
        /**
         * @see wcf\page\AbstractPage::$neededPermissions
         */
@@ -42,14 +46,4 @@ class CronjobListPage extends SortablePage {
                
                $this->sqlOrderBy = "cronjob.".$this->sortField." ".$this->sortOrder;
        }
-       
-       /**
-        * @see wcf\page\IPage::show()
-        */
-       public function show() {
-               // set active menu item.
-               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.cronjob.list');
-               
-               parent::show();
-       }
 }
index a62d96d420cc8e48b3af61fd620a61f0433711f8..9712f488c7f5a628e6765dbbdeb7267a76d43a34 100755 (executable)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\acp\page;
 use wcf\page\SortablePage;
-use wcf\system\menu\acp\ACPMenu;
 
 /**
  * Shows cronjob log information.
@@ -14,6 +13,11 @@ use wcf\system\menu\acp\ACPMenu;
  * @category   Community Framework
  */
 class CronjobLogListPage extends SortablePage {
+       /**
+        * @see wcf\page\AbstractPage::$activeMenuItem
+        */
+       public $activeMenuItem = 'wcf.acp.menu.link.log.cronjob';
+       
        /**
         * @see wcf\page\AbstractPage::$neededPermissions
         */
@@ -62,14 +66,4 @@ class CronjobLogListPage extends SortablePage {
                
                parent::readObjects();
        }
-       
-       /**
-        * @see wcf\page\IPage::show()
-        */
-       public function show() {
-               // set active menu item.
-               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.log.cronjob');
-               
-               parent::show();
-       }
 }
index 9e65fae0d163778b42d01fae4c9d326de0fffce6..b8e1752e5ef0a918d553119b39eecde41914e4e3 100755 (executable)
@@ -8,7 +8,6 @@ use wcf\system\image\adapter\ImagickImageAdapter;
 use wcf\system\language\LanguageFactory;
 use wcf\system\package\PackageInstallationDispatcher;
 use wcf\system\WCF;
-use wcf\system\WCFACP;
 
 /**
  * Shows the welcome page in admin control panel.
index d49bf0b5401b63caa9f522ad15372a6e58fefef0..a7ac55ba06627407568fe966eda51e5073a03039 100755 (executable)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\acp\page;
 use wcf\page\AbstractPage;
-use wcf\system\menu\acp\ACPMenu;
 use wcf\system\package\PackageUpdateDispatcher;
 use wcf\system\WCF;
 use wcf\system\WCFACP;
@@ -17,6 +16,11 @@ use wcf\system\WCFACP;
  * @category   Community Framework
  */
 class PackageAutoUpdateListPage extends AbstractPage {
+       /**
+        * @see wcf\page\AbstractPage::$activeMenuItem
+        */
+       public $activeMenuItem = 'wcf.acp.menu.link.package.autoupdate';
+       
        /**
         * @see wcf\page\AbstractPage::$neededPermissions
         */
@@ -58,9 +62,6 @@ class PackageAutoUpdateListPage extends AbstractPage {
         * @see wcf\page\IPage::show()
         */
        public function show() {
-               // set active menu item
-               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.package.autoupdate');
-               
                // check master password
                WCFACP::checkMasterPassword();
                
index 96c1a4a3050ce517919576b8cfc484898aeafdbf..fb3740cbf5f847ee3b14dce9210cbb9063008db1 100644 (file)
@@ -3,7 +3,6 @@ namespace wcf\acp\page;
 use wcf\data\package\installation\queue\PackageInstallationQueue;
 use wcf\page\AbstractPage;
 use wcf\system\exception\IllegalLinkException;
-use wcf\system\menu\acp\ACPMenu;
 use wcf\system\package\PackageInstallationDispatcher;
 use wcf\system\WCF;
 use wcf\system\WCFACP;
@@ -19,6 +18,11 @@ use wcf\system\WCFACP;
  * @category   Community Framework
  */
 class PackageInstallationConfirmPage extends AbstractPage {
+       /**
+        * @see wcf\page\AbstractPage::$activeMenuItem
+        */
+       public $activeMenuItem = 'wcf.acp.menu.link.package.install';
+       
        /**
         * number of missing packages
         * @var integer
@@ -123,8 +127,6 @@ class PackageInstallationConfirmPage extends AbstractPage {
         * @see wcf\page\IPage::show()
         */
        public function show() {
-               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.package.install');
-               
                // check master password
                WCFACP::checkMasterPassword();
                
index 619a8164e09b4ecbfbe1bfea72e94b2c0db152e0..8b27d61c66c6e0dbf96959b1af18d0ac23319815 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\acp\page;
 use wcf\page\SortablePage;
-use wcf\system\menu\acp\ACPMenu;
 
 /**
  * Shows a list of all installed packages.
@@ -14,6 +13,11 @@ use wcf\system\menu\acp\ACPMenu;
  * @category   Community Framework
  */
 class PackageListDetailedPage extends SortablePage {
+       /**
+        * @see wcf\page\AbstractPage::$activeMenuItem
+        */
+       public $activeMenuItem = 'wcf.acp.menu.link.package.list';
+       
        /**
         * @see wcf\page\AbstractPage::$neededPermissions
         */
@@ -52,14 +56,4 @@ class PackageListDetailedPage extends SortablePage {
                
                parent::readObjects();
        }
-       
-       /**
-        * @see wcf\page\IPage::show()
-        */
-       public function show() {
-               // enable menu item
-               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.package.list');
-               
-               parent::show();
-       }
 }
index 3c0ec75088cb5362aa4427520908d58ef6876413..65aedd9dfa17d4f45dae6dee51465b3927f2a325 100755 (executable)
@@ -3,7 +3,6 @@ namespace wcf\acp\page;
 use wcf\data\package\Package;
 use wcf\data\package\PackageList;
 use wcf\page\AbstractPage;
-use wcf\system\menu\acp\ACPMenu;
 use wcf\system\request\RouteHandler;
 use wcf\system\WCF;
 use wcf\util\HeaderUtil;
@@ -19,6 +18,11 @@ use wcf\util\HeaderUtil;
  * @category   Community Framework
  */
 class PackageListPage extends AbstractPage {
+       /**
+        * @see wcf\page\AbstractPage::$activeMenuItem
+        */
+       public $activeMenuItem = 'wcf.acp.menu.link.package.list';
+       
        /**
         * list of applications
         * @var wcf\data\package\PackageList
@@ -88,9 +92,6 @@ class PackageListPage extends AbstractPage {
                        exit;
                }
                
-               // enable menu item
-               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.package.list');
-               
                parent::show();
        }
 }
index 29d2b2131cf5ab7636602f3989d66df617cb7a01..8c8e42ce422b0fb16b28d6b0bcb33e2930062579 100755 (executable)
@@ -3,7 +3,6 @@ namespace wcf\acp\page;
 use wcf\data\package\Package;
 use wcf\page\AbstractPage;
 use wcf\system\exception\IllegalLinkException;
-use wcf\system\menu\acp\ACPMenu;
 use wcf\system\WCF;
 
 /**
@@ -17,6 +16,11 @@ use wcf\system\WCF;
  * @category   Community Framework
  */
 class PackagePage extends AbstractPage {
+       /**
+        * @see wcf\page\AbstractPage::$activeMenuItem
+        */
+       public $activeMenuItem = 'wcf.acp.menu.link.package';
+       
        /**
         * @see wcf\page\AbstractPage::$neededPermissions
         */
@@ -55,14 +59,4 @@ class PackagePage extends AbstractPage {
                
                WCF::getTPL()->assign('package', $this->package);
        }
-       
-       /**
-        * @see wcf\page\IPage::show()
-        */
-       public function show() {
-               // enable menu item
-               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.package');
-               
-               parent::show();
-       }
 }
index 421196db964b51fab886a22e7121d12c739e1c65..a028d41c8da7cdc79327775778f414c54e78d84d 100755 (executable)
@@ -5,7 +5,6 @@ use wcf\data\search\Search;
 use wcf\page\SortablePage;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\exception\IllegalLinkException;
-use wcf\system\menu\acp\ACPMenu;
 use wcf\system\WCF;
 
 /**
@@ -19,6 +18,11 @@ use wcf\system\WCF;
  * @category   Community Framework
  */
 class PackageUpdateSearchResultPage extends SortablePage {
+       /**
+        * @see wcf\page\AbstractPage::$activeMenuItem
+        */
+       public $activeMenuItem = 'wcf.acp.menu.link.package.database';
+       
        /**
         * @see wcf\page\AbstractPage::$neededPermissions
         */
@@ -166,14 +170,4 @@ class PackageUpdateSearchResultPage extends SortablePage {
                        'selectedPackages' => array()
                ));
        }
-       
-       /**
-        * @see wcf\page\IPage::show()
-        */
-       public function show() {
-               // set active menu item
-               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.package.database');
-               
-               parent::show();
-       }
 }
index 5e1c9dd1cf07ee833105b908408e70c28f832dbe..d92df71cb1b51ea6582fdf945991fbe57144902d 100644 (file)
@@ -3,7 +3,6 @@ namespace wcf\acp\page;
 use wcf\data\page\menu\item\PageMenuItemList;
 use wcf\data\page\menu\item\ViewablePageMenuItem;
 use wcf\page\AbstractPage;
-use wcf\system\menu\acp\ACPMenu;
 use wcf\system\WCF;
 
 /**
@@ -17,6 +16,11 @@ use wcf\system\WCF;
  * @category   Community Framework
  */
 class PageMenuItemListPage extends AbstractPage {
+       /**
+        * @see wcf\page\AbstractPage::$activeMenuItem
+        */
+       public $activeMenuItem = 'wcf.acp.menu.link.pageMenu.list';
+       
        /**
         * list of footer page menu items
         * @var array<wcf\data\page\menu\item\PageMenuItem>
@@ -75,14 +79,4 @@ class PageMenuItemListPage extends AbstractPage {
                        'headerItems' => $this->headerItems
                ));
        }
-       
-       /**
-        * @see wcf\page\IPage::show()
-        */
-       public function show() {
-               // set active menu item.
-               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.pageMenu.list');
-               
-               parent::show();
-       }
 }
index 94e439181707a3f732cc4dcf06c93783e55ed67e..b1dbf8eceb6f1a8880825d656785bd59bb26755d 100755 (executable)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\acp\page;
 use wcf\page\SortablePage;
-use wcf\system\menu\acp\ACPMenu;
 use wcf\system\WCF;
 
 /**
@@ -15,6 +14,11 @@ use wcf\system\WCF;
  * @category   Community Framework
  */
 class UpdateServerListPage extends SortablePage {
+       /**
+        * @see wcf\page\AbstractPage::$activeMenuItem
+        */
+       public $activeMenuItem = 'wcf.acp.menu.link.package.server.list';
+       
        /**
         * @see wcf\page\AbstractPage::$neededPermissions
         */
@@ -69,14 +73,4 @@ class UpdateServerListPage extends SortablePage {
                        'deletedPackageUpdateServerID' => $this->deletedPackageUpdateServerID
                ));
        }
-       
-       /**
-        * @see wcf\page\IPage::show()
-        */
-       public function show() {
-               // enable menu item
-               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.package.server.list');
-               
-               parent::show();
-       }
 }
index 5a7ae2223939a19e979eb9063191214176802bba..81b9f074be1309fbe6baf38b23eed976961bb813 100755 (executable)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\acp\page;
 use wcf\page\SortablePage;
-use wcf\system\menu\acp\ACPMenu;
 use wcf\system\WCF;
 
 /**
@@ -15,6 +14,11 @@ use wcf\system\WCF;
  * @category   Community Framework
  */
 class UserGroupListPage extends SortablePage {
+       /**
+        * @see wcf\page\AbstractPage::$activeMenuItem
+        */
+       public $activeMenuItem = 'wcf.acp.menu.link.group.list';
+       
        /**
         * @see wcf\page\AbstractPage::$neededPermissions
         */
@@ -81,14 +85,4 @@ class UserGroupListPage extends SortablePage {
                        'deletedGroups' => $this->deletedGroups
                ));
        }
-       
-       /**
-        * @see wcf\page\IPage::show()
-        */
-       public function show() {
-               // enable menu item
-               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.group.list');
-               
-               parent::show();
-       }
 }
index a16d12bb7c7d37ad772143b6f2c41b5a2e4040e4..9fadcb72e1c3e4c084d77f59a9b4f0dd3f9c10dc 100755 (executable)
@@ -9,7 +9,6 @@ use wcf\system\clipboard\ClipboardHandler;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\event\EventHandler;
 use wcf\system\exception\IllegalLinkException;
-use wcf\system\menu\acp\ACPMenu;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
 use wcf\util\DateUtil;
@@ -177,8 +176,7 @@ class UserListPage extends SortablePage {
         * @see wcf\page\IPage::show()
         */
        public function show() {
-               // set active menu item
-               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.user.'.($this->searchID ? 'search' : 'list'));
+               $this->activeMenuItem = 'wcf.acp.menu.link.user.'.($this->searchID ? 'search' : 'list');
                
                parent::show();
        }
index 7d5cd2c88628011a46f81f71140d18b154d0617a..16a3cf02521afe6e5adfc155a30d0c84149e2478 100644 (file)
@@ -3,11 +3,18 @@ namespace wcf\page;
 use wcf\system\event\EventHandler;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\PermissionDeniedException;
+use wcf\system\menu\acp\ACPMenu;
+use wcf\system\menu\page\PageMenu;
+use wcf\system\request\RequestHandler;
 use wcf\system\WCF;
 
 /**
- * This class provides default implementations for the Page interface.
- * This includes the call of the default event listeners for a page: readParameters, readData, assignVariables and show.
+ * Abstract implementation of a page which fires the default event actions of a
+ * page:
+ *     - readParameters
+ *     - readData
+ *     - assignVariables
+ *     - show
  * 
  * @author     Marcel Werk
  * @copyright  2001-2012 WoltLab GmbH
@@ -29,6 +36,12 @@ abstract class AbstractPage implements IPage, ITrackablePage {
         */
        public $useTemplate = true;
        
+       /**
+        * name of the active menu item
+        * @var string
+        */
+       public $activeMenuItem = '';
+       
        /**
         * value of the given action parameter
         * @var string
@@ -153,6 +166,9 @@ abstract class AbstractPage implements IPage, ITrackablePage {
                        throw new PermissionDeniedException();
                }
                
+               // sets the active menu item
+               $this->setActiveMenuItem();
+               
                // check modules
                $this->checkModules();
                
@@ -190,6 +206,20 @@ abstract class AbstractPage implements IPage, ITrackablePage {
                }
        }
        
+       /**
+        * Sets the active menu item of the page.
+        */
+       protected function setActiveMenuItem() {
+               if (!empty($this->activeMenuItem)) {
+                       if (RequestHandler::getInstance()->isACPRequest()) {
+                               ACPMenu::getInstance()->setActiveMenuItem($this->activeMenuItem);
+                       }
+                       else {
+                               PageMenu::getInstance()->setActiveMenuItem($this->activeMenuItem);
+                       }
+               }
+       }
+       
        /**
         * @see wcf\page\ITrackablePage::isTracked()
         */