X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Ftheme%2Fduepuntozero%2Fstyle.php;h=575f0dff584f606c7f4894a4abf7483c33b622d2;hb=22c1cd3cd12d8a565c83249ccf691723a76a47bd;hp=48be1e02653ff5fc8763b6a243d959caaab99cfa;hpb=acb4630eed14175ef35f09e21609d6329f3f990c;p=friendica.git diff --git a/view/theme/duepuntozero/style.php b/view/theme/duepuntozero/style.php index 48be1e0265..575f0dff58 100644 --- a/view/theme/duepuntozero/style.php +++ b/view/theme/duepuntozero/style.php @@ -1,31 +1,64 @@ . + * + */ -use Friendica\Core\Config; -use Friendica\Core\PConfig; +use Friendica\DI; -if (file_exists("$THEMEPATH/style.css")){ - echo file_get_contents("$THEMEPATH/style.css"); +if (file_exists("$THEMEPATH/style.css")) { + echo file_get_contents("$THEMEPATH/style.css"); } -$uid = get_theme_uid(); -$s_colorset = Config::get('duepuntozero','colorset'); -$colorset = PConfig::get( $uid, 'duepuntozero', 'colorset'); -if (!x($colorset)) - $colorset = $s_colorset; +/* + * This script can be included when the maintenance mode is on, which requires us to avoid any config call + */ +if (DI::mode()->has(\Friendica\App\Mode::MAINTENANCEDISABLED)) { + $s_colorset = DI::config()->get('duepuntozero', 'colorset'); + $colorset = DI::pConfig()->get($_REQUEST['puid'] ?? 0, 'duepuntozero', 'colorset', $s_colorset); +} + +$setcss = ''; if ($colorset) { - if ($colorset == 'greenzero') - $setcss = file_get_contents('view/theme/duepuntozero/deriv/greenzero.css'); - if ($colorset == 'purplezero') - $setcss = file_get_contents('view/theme/duepuntozero/deriv/purplezero.css'); - if ($colorset == 'easterbunny') - $setcss = file_get_contents('view/theme/duepuntozero/deriv/easterbunny.css'); - if ($colorset == 'darkzero') - $setcss = file_get_contents('view/theme/duepuntozero/deriv/darkzero.css'); - if ($colorset == 'comix') - $setcss = file_get_contents('view/theme/duepuntozero/deriv/comix.css'); - if ($colorset == 'slackr') - $setcss = file_get_contents('view/theme/duepuntozero/deriv/slackr.css'); + if ($colorset == 'greenzero') { + $setcss = file_get_contents('view/theme/duepuntozero/deriv/greenzero.css'); + } + + if ($colorset == 'purplezero') { + $setcss = file_get_contents('view/theme/duepuntozero/deriv/purplezero.css'); + } + + if ($colorset == 'easterbunny') { + $setcss = file_get_contents('view/theme/duepuntozero/deriv/easterbunny.css'); + } + + if ($colorset == 'darkzero') { + $setcss = file_get_contents('view/theme/duepuntozero/deriv/darkzero.css'); + } + + if ($colorset == 'comix') { + $setcss = file_get_contents('view/theme/duepuntozero/deriv/comix.css'); + } + + if ($colorset == 'slackr') { + $setcss = file_get_contents('view/theme/duepuntozero/deriv/slackr.css'); + } } echo $setcss;