Apply PSR-12 code style (#3886)
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / acp / page / PackageUpdatePage.class.php
1 <?php
2
3 namespace wcf\acp\page;
4
5 use wcf\page\AbstractPage;
6 use wcf\system\package\PackageUpdateDispatcher;
7 use wcf\system\WCF;
8 use wcf\system\WCFACP;
9
10 /**
11 * Shows the package update confirmation form.
12 *
13 * @author Alexander Ebert
14 * @copyright 2001-2019 WoltLab GmbH
15 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
16 * @package WoltLabSuite\Core\Acp\Page
17 */
18 class PackageUpdatePage extends AbstractPage
19 {
20 /**
21 * @inheritDoc
22 */
23 public $activeMenuItem = 'wcf.acp.menu.link.package';
24
25 /**
26 * list of available updates
27 * @var array
28 */
29 public $availableUpdates = [];
30
31 /**
32 * @inheritDoc
33 */
34 public $neededPermissions = ['admin.configuration.package.canUpdatePackage'];
35
36 /**
37 * @inheritDoc
38 */
39 public function readData()
40 {
41 parent::readData();
42
43 $this->availableUpdates = PackageUpdateDispatcher::getInstance()->getAvailableUpdates(true, true);
44 }
45
46 /**
47 * @inheritDoc
48 */
49 public function assignVariables()
50 {
51 parent::assignVariables();
52
53 WCF::getTPL()->assign([
54 'availableUpdates' => $this->availableUpdates,
55 ]);
56 }
57
58 /**
59 * @inheritDoc
60 */
61 public function show()
62 {
63 // check master password
64 WCFACP::checkMasterPassword();
65
66 parent::show();
67 }
68 }