From: Marcel Werk Date: Fri, 15 Apr 2016 20:05:40 +0000 (+0200) Subject: Fixed column 'items' in menu list X-Git-Tag: 3.0.0_Beta_1~1893 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=28012eaf16ff9e46197f2302ec0e19e8eff51757;p=GitHub%2FWoltLab%2FWCF.git Fixed column 'items' in menu list --- diff --git a/wcfsetup/install/files/acp/templates/menuList.tpl b/wcfsetup/install/files/acp/templates/menuList.tpl index 38eb665d9f..7380782573 100644 --- a/wcfsetup/install/files/acp/templates/menuList.tpl +++ b/wcfsetup/install/files/acp/templates/menuList.tpl @@ -35,7 +35,7 @@ {lang}wcf.global.objectID{/lang} {lang}wcf.global.name{/lang} - {lang}wcf.acp.menu.items{/lang} + {lang}wcf.acp.menu.items{/lang} {event name='columnHeads'} diff --git a/wcfsetup/install/files/lib/acp/page/MenuListPage.class.php b/wcfsetup/install/files/lib/acp/page/MenuListPage.class.php index 11c7d9a79f..aebc64d68f 100644 --- a/wcfsetup/install/files/lib/acp/page/MenuListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/MenuListPage.class.php @@ -15,27 +15,36 @@ use wcf\page\SortablePage; */ class MenuListPage extends SortablePage { /** - * @see \wcf\page\AbstractPage::$activeMenuItem + * @inheritDoc */ public $activeMenuItem = 'wcf.acp.menu.link.cms.menu.list'; /** - * @see \wcf\page\MultipleLinkPage::$objectListClassName + * @inheritDoc */ public $objectListClassName = 'wcf\data\menu\MenuList'; /** - * @see \wcf\page\AbstractPage::$neededPermissions + * @inheritDoc */ - public $neededPermissions = array('admin.content.cms.canManageMenu'); + public $neededPermissions = ['admin.content.cms.canManageMenu']; /** - * @see \wcf\page\SortablePage::$defaultSortField + * @inheritDoc */ public $defaultSortField = 'title'; /** - * @see \wcf\page\SortablePage::$validSortFields + * @inheritDoc */ - public $validSortFields = array('menuID', 'title', 'items'); + public $validSortFields = ['menuID', 'title', 'items']; + + /** + * @inheritDoc + */ + protected function initObjectList() { + parent::initObjectList(); + + $this->objectList->sqlSelects .= '(SELECT COUNT(*) FROM wcf'.WCF_N.'_menu_item WHERE menuID = menu.menuID) AS items'; + } }