Made BoxHandler::disablePageLayout static
authorMarcel Werk <burntime@woltlab.com>
Thu, 22 Dec 2016 18:51:43 +0000 (19:51 +0100)
committerMarcel Werk <burntime@woltlab.com>
Thu, 22 Dec 2016 18:51:47 +0000 (19:51 +0100)
wcfsetup/install/files/lib/system/box/BoxHandler.class.php
wcfsetup/install/files/lib/system/exception/NamedUserException.class.php
wcfsetup/install/files/lib/system/exception/PermissionDeniedException.class.php
wcfsetup/install/files/lib/system/request/RequestHandler.class.php

index 09320cebed30c9532a2fb725c316d363e3586134..89d1a867166b56e21cbbb08a757eece9a974bde5 100644 (file)
@@ -37,9 +37,9 @@ class BoxHandler extends SingletonFactory {
        protected $boxesByPosition = [];
        
        /**
-        * @var bool
+        * @var boolean
         */
-       protected $disablePageLayout = false;
+       protected static $disablePageLayout = false;
        
        /**
         * @inheritDoc
@@ -47,7 +47,7 @@ class BoxHandler extends SingletonFactory {
        protected function init() {
                // get active page id
                $pageID = 0;
-               if (!$this->disablePageLayout) {
+               if (!self::$disablePageLayout) {
                        if (($request = RequestHandler::getInstance()->getActiveRequest()) !== null) {
                                $pageID = $request->getPageID();
                        }
@@ -203,7 +203,7 @@ class BoxHandler extends SingletonFactory {
        /**
         * Disables the loading of the box layout for the active page.
         */
-       public function disablePageLayout() {
-               $this->disablePageLayout = true;
+       public static function disablePageLayout() {
+               self::$disablePageLayout = true;
        }
 }
index 18efbe6f16ecb82e7ca392c01bfdc9864085ebbd..893a9e41b5d3263765d51c7e975b6a728d0c7324 100644 (file)
@@ -19,7 +19,7 @@ class NamedUserException extends UserException {
         */
        public function show() {
                if (!class_exists(WCFACP::class, false)) {
-                       BoxHandler::getInstance()->disablePageLayout();
+                       BoxHandler::disablePageLayout();
                }
                SessionHandler::getInstance()->disableTracking();
                
index b8632c008c9cdd8ae19a469f348b0635360b3642..bdb9988504acba2a9d66b10f2ee794d4a928d961 100644 (file)
@@ -27,7 +27,7 @@ class PermissionDeniedException extends UserException {
         */
        public function show() {
                if (!class_exists(WCFACP::class, false)) {
-                       BoxHandler::getInstance()->disablePageLayout();
+                       BoxHandler::disablePageLayout();
                }
                SessionHandler::getInstance()->disableTracking();
                
index e1d49e3e0aa1556ed19d1f37d1913b0a6b494ab4..fb99967da0fc8c0090fe1d7d187e628efff43144 100644 (file)
@@ -78,7 +78,7 @@ class RequestHandler extends SingletonFactory {
                                        }
                                        else {
                                                @header('HTTP/1.1 503 Service Unavailable');
-                                               BoxHandler::getInstance()->disablePageLayout();
+                                               BoxHandler::disablePageLayout();
                                                WCF::getTPL()->assign([
                                                        'templateName' => 'offline',
                                                        'templateNameApplication' => 'wcf'