X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Ftheme%2Fduepuntozero%2Ftheme.php;h=729c5bb0852a2314c0e77157daa16404c5686a28;hb=35ca4961d21c807b85af97295961c5d513f5be50;hp=cc77e781bf0c225e6f5632c6c75880be2886c1cc;hpb=322b7c856ca9ba53bd9c7da50dd5c1e3c9197d56;p=friendica.git diff --git a/view/theme/duepuntozero/theme.php b/view/theme/duepuntozero/theme.php index cc77e781bf..729c5bb085 100644 --- a/view/theme/duepuntozero/theme.php +++ b/view/theme/duepuntozero/theme.php @@ -23,27 +23,36 @@ use Friendica\App; use Friendica\Core\Renderer; use Friendica\DI; +/* + * This script can be included even when the app is in maintenance mode which requires us to avoid any config call + */ + function duepuntozero_init(App $a) { -Renderer::setActiveTemplateEngine('smarty3'); - - $colorset = DI::pConfig()->get( local_user(), 'duepuntozero','colorset'); - if (!$colorset) - $colorset = DI::config()->get('duepuntozero', 'colorset'); // user setting have priority, then node settings - if ($colorset) { - if ($colorset == 'greenzero') - DI::page()['htmlhead'] .= ''."\n"; - if ($colorset == 'purplezero') - DI::page()['htmlhead'] .= ''."\n"; - if ($colorset == 'easterbunny') - DI::page()['htmlhead'] .= ''."\n"; - if ($colorset == 'darkzero') - DI::page()['htmlhead'] .= ''."\n"; - if ($colorset == 'comix') - DI::page()['htmlhead'] .= ''."\n"; - if ($colorset == 'slackr') - DI::page()['htmlhead'] .= ''."\n"; - } + Renderer::setActiveTemplateEngine('smarty3'); + + $colorset = null; + + if (DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) { + $colorset = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'duepuntozero', 'colorset'); + if (!$colorset) + $colorset = DI::config()->get('duepuntozero', 'colorset'); // user setting have priority, then node settings + } + + if ($colorset) { + if ($colorset == 'greenzero') + DI::page()['htmlhead'] .= '' . "\n"; + if ($colorset == 'purplezero') + DI::page()['htmlhead'] .= '' . "\n"; + if ($colorset == 'easterbunny') + DI::page()['htmlhead'] .= '' . "\n"; + if ($colorset == 'darkzero') + DI::page()['htmlhead'] .= '' . "\n"; + if ($colorset == 'comix') + DI::page()['htmlhead'] .= '' . "\n"; + if ($colorset == 'slackr') + DI::page()['htmlhead'] .= '' . "\n"; + } DI::page()['htmlhead'] .= <<< EOT