Apply PSR-12 code style (#3886)
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / acp / page / SitemapListPage.class.php
CommitLineData
d43dd49d 1<?php
a9229942 2
d43dd49d 3namespace wcf\acp\page;
a9229942 4
7e569e89 5use wcf\data\object\type\ObjectType;
d43dd49d
JR
6use wcf\data\object\type\ObjectTypeCache;
7use wcf\page\AbstractPage;
8use wcf\system\WCF;
1207c990 9use wcf\system\worker\SitemapRebuildWorker;
d43dd49d
JR
10
11/**
a9229942
TD
12 * Shows a list of sitemap object types.
13 *
14 * @author Joshua Ruesweg
15 * @copyright 2001-2019 WoltLab GmbH
16 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
17 * @package WoltLabSuite\Core\Acp\page
18 * @since 3.1
d43dd49d 19 */
a9229942
TD
20class SitemapListPage extends AbstractPage
21{
22 /**
23 * @inheritDoc
24 */
25 public $activeMenuItem = 'wcf.acp.menu.link.maintenance.sitemap';
26
27 /**
28 * @inheritDoc
29 */
30 public $neededPermissions = ['admin.management.canRebuildData'];
31
32 /**
33 * @var array<ObjectType>
34 */
35 public $sitemapObjectTypes = [];
36
37 /**
38 * @inheritDoc
39 */
40 public function readData()
41 {
42 parent::readData();
43
44 $this->sitemapObjectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.sitemap.object');
45
46 foreach ($this->sitemapObjectTypes as $sitemapObjectType) {
47 SitemapRebuildWorker::prepareSitemapObject($sitemapObjectType);
48 }
49 }
50
51 /**
52 * @inheritDoc
53 */
54 public function assignVariables()
55 {
56 parent::assignVariables();
57
58 WCF::getTPL()->assign([
59 'sitemapObjectTypes' => $this->sitemapObjectTypes,
60 ]);
61 }
d43dd49d 62}