From f0049a83d46965f23532b02fb51e22904a2ea9c3 Mon Sep 17 00:00:00 2001 From: Satoshi Sahara Date: Wed, 15 Jul 2020 20:59:02 +0900 Subject: [PATCH] Remove Ui\{Denide, Locked} class They are not UI components. We should show error message in Action\{Denide, Locked}::tplContent() methods. --- inc/Action/Denied.php | 19 ++++++++++++++++++- inc/{Ui => Action}/Locked.php | 28 +++++++++++++++++++++------- inc/Ui/Denied.php | 32 -------------------------------- 3 files changed, 39 insertions(+), 40 deletions(-) rename inc/{Ui => Action}/Locked.php (64%) delete mode 100644 inc/Ui/Denied.php diff --git a/inc/Action/Denied.php b/inc/Action/Denied.php index f5fce71e0..1daac22b3 100644 --- a/inc/Action/Denied.php +++ b/inc/Action/Denied.php @@ -19,9 +19,26 @@ class Denied extends AbstractAclAction return AUTH_NONE; } + /** @inheritdoc */ public function tplContent() { - (new Ui\Denied)->show(); + $this->showBanner(); + if (empty($_SERVER['REMOTE_USER']) && actionOK('login')) { + (new Ui\Login)->show(); + } + } + + /** + * Display error on denied pages + * + * @author Andreas Gohr + * + * @return void + */ + protected function showBanner() + { + // print intro + print p_locale_xhtml('denied'); } } diff --git a/inc/Ui/Locked.php b/inc/Action/Locked.php similarity index 64% rename from inc/Ui/Locked.php rename to inc/Action/Locked.php index 63a3defec..dca61831b 100644 --- a/inc/Ui/Locked.php +++ b/inc/Action/Locked.php @@ -1,17 +1,31 @@ showBanner(); + (new Ui\Editor)->show(); + } + /** * Display error on locked pages * @@ -19,7 +33,7 @@ class Locked extends Ui * * @return void */ - public function show() + protected function showBanner() { global $ID; global $conf; diff --git a/inc/Ui/Denied.php b/inc/Ui/Denied.php deleted file mode 100644 index 210050387..000000000 --- a/inc/Ui/Denied.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * @return void - */ - public function show() - { - // print intro - print p_locale_xhtml('denied'); - - if (empty($_SERVER['REMOTE_USER']) && actionOK('login')) { - (new Login)->show(); - } - } - -} -- 2.11.4.GIT