<acpmenuitem name="wcf.acp.menu.link.option.importAndExport">
<parent>wcf.acp.menu.link.option.management</parent>
<showorder>1</showorder>
- <link>index.php/OptionImport/</link>
+ <controller><![CDATA[OptionImport]]></controller>
</acpmenuitem>
<!-- /options -->
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.package.list">
- <link>index.php/PackageList/</link>
+ <controller><![CDATA[wcf\acp\page\PackageListPage]]></controller>
<parent>wcf.acp.menu.link.package.management</parent>
<permissions>admin.system.package.canUpdatePackage,admin.system.package.canUninstallPackage</permissions>
<showorder>1</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.package.install">
- <link>index.php/PackageStartInstall/?action=install</link>
+ <controller><![CDATA[wcf\acp\form\PackageStartInstallForm]]></controller>
+ <link><![CDATA[action=install]]></link>
<parent>wcf.acp.menu.link.package.management</parent>
<permissions>admin.system.package.canInstallPackage</permissions>
<showorder>2</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.package.autoupdate">
- <link>index.php/PackageAutoUpdateList/</link>
+ <controller><![CDATA[wcf\acp\page\PackageAutoUpdateListPage]]></controller>
<parent>wcf.acp.menu.link.package.update</parent>
<permissions>admin.system.package.canUpdatePackage</permissions>
<showorder>1</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.package.database">
- <link>index.php/PackageUpdateSearch/</link>
+ <controller><![CDATA[wcf\acp\form\PackageUpdateSearchForm]]></controller>
<parent>wcf.acp.menu.link.package.update</parent>
<permissions>admin.system.package.canInstallPackage,admin.system.package.canUpdatePackage</permissions>
<showorder>2</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.package.server.list">
- <link>index.php/UpdateServerList/</link>
+ <controller><![CDATA[wcf\acp\page\UpdateServerListPage]]></controller>
<parent>wcf.acp.menu.link.package.server</parent>
<permissions>admin.system.package.canEditServer</permissions>
<showorder>1</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.package.server.add">
- <link>index.php/UpdateServerAdd/</link>
+ <controller><![CDATA[wcf\acp\form\UpdateServerAddForm]]></controller>
<parent>wcf.acp.menu.link.package.server</parent>
<permissions>admin.system.package.canEditServer</permissions>
<showorder>2</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.application.management">
- <link>index.php/ApplicationManagement/</link>
+ <controller><![CDATA[wcf\acp\page\ApplicationManagementPage]]></controller>
<parent>wcf.acp.menu.link.application</parent>
<permissions>admin.system.canManageApplication</permissions>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.application.cache">
- <link>index.php/CacheList/</link>
+ <controller><![CDATA[wcf\acp\page\CacheListPage]]></controller>
<parent>wcf.acp.menu.link.application</parent>
<permissions>admin.system.canManageApplication</permissions>
</acpmenuitem>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.cronjob.list">
- <link>index.php/CronjobList/</link>
+ <controller><![CDATA[wcf\acp\page\CronjobListPage]]></controller>
<parent>wcf.acp.menu.link.cronjob</parent>
<permissions>admin.system.canManageCronjob</permissions>
<showorder>1</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.cronjob.add">
- <link>index.php/CronjobAdd/</link>
+ <controller><![CDATA[wcf\acp\form\CronjobAddForm]]></controller>
<parent>wcf.acp.menu.link.cronjob</parent>
<permissions>admin.system.canManageCronjob</permissions>
<showorder>2</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.log.session">
- <link>index.php/ACPSessionLogList/</link>
+ <controller><![CDATA[wcf\acp\page\ACPSessionLogListPage]]></controller>
<parent>wcf.acp.menu.link.log</parent>
<permissions>admin.system.canViewLog</permissions>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.log.cronjob">
- <link>index.php/CronjobLogList/</link>
+ <controller><![CDATA[wcf\acp\page\CronjobLogListPage]]></controller>
<parent>wcf.acp.menu.link.log</parent>
<permissions>admin.system.canManageCronjob</permissions>
</acpmenuitem>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.user.list">
- <link>index.php/UserList/</link>
+ <controller><![CDATA[wcf\acp\page\UserListPage]]></controller>
<parent>wcf.acp.menu.link.user.management.general</parent>
<permissions>admin.user.canSearchUser</permissions>
<showorder>1</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.user.add">
- <link>index.php/UserAdd/</link>
+ <controller><![CDATA[wcf\acp\form\UserAddForm]]></controller>
<parent>wcf.acp.menu.link.user.management.general</parent>
<permissions>admin.user.canAddUser</permissions>
<showorder>2</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.user.search">
- <link>index.php/UserSearch/</link>
+ <controller><![CDATA[wcf\acp\form\UserSearchForm]]></controller>
<parent>wcf.acp.menu.link.user.management.general</parent>
<permissions>admin.user.canSearchUser</permissions>
<showorder>3</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.user.massProcessing">
- <link>index.php/UsersMassProcessing/</link>
+ <controller><![CDATA[wcf\acp\form\UsersMassProcessingForm]]></controller>
<parent>wcf.acp.menu.link.user.management.additional</parent>
<permissions>admin.user.canEditUser,admin.user.canDeleteUser,admin.user.canMailUser</permissions>
<showorder>1</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.user.mail">
- <link>index.php/UserMail/?action=all</link>
+ <controller><![CDATA[wcf\acp\form\UserMailForm]]></controller>
+ <link><![CDATA[action=all]]></link>
<parent>wcf.acp.menu.link.user.management.additional</parent>
<permissions>admin.user.canMailUser</permissions>
<showorder>2</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.group.list">
- <link>index.php/UserGroupList/</link>
+ <controller><![CDATA[wcf\acp\page\UserGroupListPage]]></controller>
<parent>wcf.acp.menu.link.group.general</parent>
<permissions>admin.user.canEditGroup,admin.user.canDeleteGroup</permissions>
<showorder>1</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.group.add">
- <link>index.php/UserGroupAdd/</link>
+ <controller><![CDATA[wcf\acp\form\UserGroupAddForm]]></controller>
<parent>wcf.acp.menu.link.group.general</parent>
<permissions>admin.user.canAddGroup</permissions>
<showorder>2</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.group.mail">
- <link>index.php/UserMail/?action=group</link>
+ <controller><![CDATA[wcf\acp\form\UserMailForm]]></controller>
+ <link><![CDATA[action=group]]></link>
<parent>wcf.acp.menu.link.group.additional</parent>
<permissions>admin.user.canMailUser</permissions>
<showorder>1</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.pageMenu.list">
- <link>index.php/PageMenuItemList/</link>
+ <controller><![CDATA[wcf\acp\page\PageMenuItemListPage]]></controller>
<parent>wcf.acp.menu.link.pageMenu</parent>
<permissions>admin.display.canManagePageMenu</permissions>
<showorder>1</showorder>
</acpmenuitem>
<acpmenuitem name="wcf.acp.menu.link.pageMenu.add">
- <link>index.php/PageMenuItemAdd/</link>
+ <controller><![CDATA[wcf\acp\form\PageMenuItemAddForm]]></controller>
<parent>wcf.acp.menu.link.pageMenu</parent>
<permissions>admin.display.canManagePageMenu</permissions>
<showorder>2</showorder>
use wcf\data\DatabaseObject;
use wcf\system\menu\ITreeMenuItem;
use wcf\system\request\LinkHandler;
+use wcf\system\Regex;
+use wcf\system\WCF;
/**
* Represents an ACP menu item.
*/
protected static $databaseTableIndexName = 'menuItemID';
+ /**
+ * application abbreviation
+ * @var string
+ */
+ protected $application = '';
+
+ /**
+ * menu item controller
+ * @var string
+ */
+ protected $controller = null;
+
/**
* @see wcf\system\menu\ITreeMenuItem::getLink()
*/
public function getLink() {
- return LinkHandler::getInstance()->getLink(null, array(), $this->menuItemLink);
+ // external link
+ if (!$this->menuItemController) {
+ return WCF::getLanguage()->get($this->menuItemLink);
+ }
+
+ $this->parseController();
+ return LinkHandler::getInstance()->getLink($this->controller, array('application' => $this->application), WCF::getLanguage()->get($this->menuItemLink));
+ }
+
+ /**
+ * Returns controller name.
+ *
+ * @return string
+ */
+ public function getController() {
+ $this->parseController();
+
+ return $this->controller;
+ }
+
+ /**
+ * Parses controller name.
+ */
+ protected function parseController() {
+ if ($this->controller === null) {
+ $this->controller = '';
+
+ // resolve application and controller
+ if ($this->menuItemController) {
+ $parts = explode('\\', $this->menuItemController);
+ $this->application = array_shift($parts);
+ $menuItemController = array_pop($parts);
+
+ // drop controller suffix
+ $this->controller = Regex::compile('(Action|Form|Page)$')->replace($menuItemController, '');
+ }
+ }
+ }
+
+ /**
+ * Returns the menu item name.
+ *
+ * @return string
+ */
+ public function __toString() {
+ return WCF::getLanguage()->get($this->menuItem);
}
}