X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Ftheme%2Fduepuntozero%2Ftheme.php;h=729c5bb0852a2314c0e77157daa16404c5686a28;hb=22c1cd3cd12d8a565c83249ccf691723a76a47bd;hp=363f6dc487d7fc883776f5e37b967cb31f6a2a72;hpb=36ba7fa79c7c2d4304f3423d84215771e3bb6a9f;p=friendica.git diff --git a/view/theme/duepuntozero/theme.php b/view/theme/duepuntozero/theme.php index 363f6dc487..729c5bb085 100644 --- a/view/theme/duepuntozero/theme.php +++ b/view/theme/duepuntozero/theme.php @@ -1,32 +1,59 @@ . + * + */ use Friendica\App; -use Friendica\Core\Config; -use Friendica\Core\PConfig; 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 = PConfig::get( local_user(), 'duepuntozero','colorset'); - if (!$colorset) - $colorset = Config::get('duepuntozero', 'colorset'); // user setting have priority, then node settings - if ($colorset) { - if ($colorset == 'greenzero') - $a->page['htmlhead'] .= ''."\n"; - if ($colorset == 'purplezero') - $a->page['htmlhead'] .= ''."\n"; - if ($colorset == 'easterbunny') - $a->page['htmlhead'] .= ''."\n"; - if ($colorset == 'darkzero') - $a->page['htmlhead'] .= ''."\n"; - if ($colorset == 'comix') - $a->page['htmlhead'] .= ''."\n"; - if ($colorset == 'slackr') - $a->page['htmlhead'] .= ''."\n"; - } -$a->page['htmlhead'] .= <<< EOT + 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 EOT; } + +/** + * @param int|null $uid + * @return null + * @see \Friendica\Core\Theme::getBackgroundColor() + * @TODO Implement this function + */ +function duepuntozero_get_background_color(int $uid = null) +{ + return null; +} + +/** + * @param int|null $uid + * @return null + * @see \Friendica\Core\Theme::getThemeColor() + * @TODO Implement this function + */ +function duepuntozero_get_theme_color(int $uid = null) +{ + return null; +}