Enable the view module in maintenance mode
- This allows to load the default theme CSS - Theme scripts have been updated to reflect the possibility they will be included in maintenance mode
This commit is contained in:
parent
ac56dcd50f
commit
1d94e2866a
10 changed files with 177 additions and 141 deletions
|
@ -25,13 +25,12 @@ if (file_exists("$THEMEPATH/style.css")) {
|
|||
echo file_get_contents("$THEMEPATH/style.css");
|
||||
}
|
||||
|
||||
$uid = $_REQUEST['puid'] ?? 0;
|
||||
|
||||
$s_colorset = DI::config()->get('duepuntozero', 'colorset');
|
||||
$colorset = DI::pConfig()->get($uid, 'duepuntozero', 'colorset');
|
||||
|
||||
if (empty($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 = '';
|
||||
|
|
|
@ -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');
|
||||
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'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />'."\n";
|
||||
if ($colorset == 'purplezero')
|
||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/purplezero.css" type="text/css" media="screen" />'."\n";
|
||||
if ($colorset == 'easterbunny')
|
||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/easterbunny.css" type="text/css" media="screen" />'."\n";
|
||||
if ($colorset == 'darkzero')
|
||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/darkzero.css" type="text/css" media="screen" />'."\n";
|
||||
if ($colorset == 'comix')
|
||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/comix.css" type="text/css" media="screen" />'."\n";
|
||||
if ($colorset == 'slackr')
|
||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/slackr.css" type="text/css" media="screen" />'."\n";
|
||||
}
|
||||
$colorset = null;
|
||||
|
||||
if (DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) {
|
||||
$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'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />' . "\n";
|
||||
if ($colorset == 'purplezero')
|
||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/purplezero.css" type="text/css" media="screen" />' . "\n";
|
||||
if ($colorset == 'easterbunny')
|
||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/easterbunny.css" type="text/css" media="screen" />' . "\n";
|
||||
if ($colorset == 'darkzero')
|
||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/darkzero.css" type="text/css" media="screen" />' . "\n";
|
||||
if ($colorset == 'comix')
|
||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/comix.css" type="text/css" media="screen" />' . "\n";
|
||||
if ($colorset == 'slackr')
|
||||
DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/slackr.css" type="text/css" media="screen" />' . "\n";
|
||||
}
|
||||
DI::page()['htmlhead'] .= <<< EOT
|
||||
<script>
|
||||
function cmtBbOpen(comment, id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue