]> git.mxchange.org Git - friendica.git/commitdiff
Kept the hook, ditched the init
authorPhilipp Holzer <admin@philipp.info>
Sat, 4 May 2019 14:26:32 +0000 (16:26 +0200)
committerPhilipp Holzer <admin@philipp.info>
Sat, 4 May 2019 14:26:32 +0000 (16:26 +0200)
src/Module/Home.php

index f58664f9d70df297744ef2373677c4a5a4acc3ac..adcdb02a63202e1809e25bb8c4aad8024aeb878f 100644 (file)
@@ -12,16 +12,24 @@ use Friendica\Core\Renderer;
  */
 class Home extends BaseModule
 {
-       public static function init()
+       public static function content()
        {
-               // currently no returned data is used
-               $ret = [];
+               if (!empty($_SESSION['theme'])) {
+                       unset($_SESSION['theme']);
+               }
 
-               Hook::callAll('home_init', $ret);
+               if (!empty($_SESSION['mobile-theme'])) {
+                       unset($_SESSION['mobile-theme']);
+               }
 
                $app = self::getApp();
                $config = $app->getConfig();
 
+               // currently no returned data is used
+               $ret = [];
+
+               Hook::callAll('home_init', $ret);
+
                if (local_user() && ($app->user['nickname'])) {
                        $app->internalRedirect('network');
                }
@@ -29,20 +37,6 @@ class Home extends BaseModule
                if (strlen($config->get('system', 'singleuser'))) {
                        $app->internalRedirect('/profile/' . $config->get('system', 'singleuser'));
                }
-       }
-
-       public static function content()
-       {
-               if (!empty($_SESSION['theme'])) {
-                       unset($_SESSION['theme']);
-               }
-
-               if (!empty($_SESSION['mobile-theme'])) {
-                       unset($_SESSION['mobile-theme']);
-               }
-
-               $app = self::getApp();
-               $config = $app->getConfig();
 
                $customHome = '';
                $defaultHeader = ($config->get('config', 'sitename') ? L10n::t('Welcome to %s', $config->get('config', 'sitename')) : '');