Merge branch '3.0'
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / acp / page / MenuListPage.class.php
CommitLineData
e7fb3339
MW
1<?php
2namespace wcf\acp\page;
157054c9 3use wcf\data\menu\MenuList;
e7fb3339
MW
4use wcf\page\SortablePage;
5
6/**
7 * Shows a list of menus.
8 *
9 * @author Marcel Werk
c839bd49 10 * @copyright 2001-2018 WoltLab GmbH
e7fb3339 11 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
e71525e4
MW
12 * @package WoltLabSuite\Core\Acp\Page
13 * @since 3.0
fe4f149a
MS
14 *
15 * @property MenuList $objectList
e7fb3339
MW
16 */
17class MenuListPage extends SortablePage {
18 /**
28012eaf 19 * @inheritDoc
e7fb3339
MW
20 */
21 public $activeMenuItem = 'wcf.acp.menu.link.cms.menu.list';
22
23 /**
28012eaf 24 * @inheritDoc
e7fb3339 25 */
157054c9 26 public $objectListClassName = MenuList::class;
e7fb3339
MW
27
28 /**
28012eaf 29 * @inheritDoc
e7fb3339 30 */
28012eaf 31 public $neededPermissions = ['admin.content.cms.canManageMenu'];
e7fb3339
MW
32
33 /**
28012eaf 34 * @inheritDoc
e7fb3339
MW
35 */
36 public $defaultSortField = 'title';
37
38 /**
28012eaf 39 * @inheritDoc
e7fb3339 40 */
59237c52 41 public $validSortFields = ['menuID', 'title', 'position', 'items', 'showOrder'];
28012eaf 42
6776809e
MW
43 /**
44 * @inheritDoc
45 */
46 public $itemsPerPage = 50;
47
28012eaf
MW
48 /**
49 * @inheritDoc
50 */
51 protected function initObjectList() {
52 parent::initObjectList();
53
59237c52 54 $this->objectList->sqlSelects .= '(SELECT COUNT(*) FROM wcf'.WCF_N.'_menu_item WHERE menuID = menu.menuID) AS items, (SELECT position FROM wcf'.WCF_N.'_box WHERE menuID = menu.menuID) AS position, (SELECT showOrder FROM wcf'.WCF_N.'_box WHERE menuID = menu.menuID) AS showOrder';
28012eaf 55 }
e7fb3339 56}