Merge pull request #11729 from MrPetovan/bug/11723-maintenance-mode-view-module

Enable the view module in maintenance mode
This commit is contained in:
Tobias Diekershoff 2022-07-13 06:32:28 +02:00 committed by GitHub
commit 1ca929ca36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 177 additions and 141 deletions

View File

@ -705,7 +705,8 @@ class App
// Initialize module that can set the current theme in the init() method, either directly or via App->setProfileOwner // Initialize module that can set the current theme in the init() method, either directly or via App->setProfileOwner
$page['page_title'] = $moduleName; $page['page_title'] = $moduleName;
if (!$this->mode->isInstall() && !$this->mode->has(App\Mode::MAINTENANCEDISABLED)) { // The "view" module is required to show the theme CSS
if (!$this->mode->isInstall() && !$this->mode->has(App\Mode::MAINTENANCEDISABLED) && $moduleName !== 'view') {
$module = $router->getModule(Maintenance::class); $module = $router->getModule(Maintenance::class);
} else { } else {
// determine the module class and save it to the module instance // determine the module class and save it to the module instance

View File

@ -25,13 +25,12 @@ if (file_exists("$THEMEPATH/style.css")) {
echo file_get_contents("$THEMEPATH/style.css"); echo file_get_contents("$THEMEPATH/style.css");
} }
$uid = $_REQUEST['puid'] ?? 0; /*
* This script can be included when the maintenance mode is on, which requires us to avoid any config call
$s_colorset = DI::config()->get('duepuntozero', 'colorset'); */
$colorset = DI::pConfig()->get($uid, 'duepuntozero', 'colorset'); if (DI::mode()->has(\Friendica\App\Mode::MAINTENANCEDISABLED)) {
$s_colorset = DI::config()->get('duepuntozero', 'colorset');
if (empty($colorset)) { $colorset = DI::pConfig()->get($_REQUEST['puid'] ?? 0, 'duepuntozero', 'colorset', $s_colorset);
$colorset = $s_colorset;
} }
$setcss = ''; $setcss = '';

View File

@ -23,27 +23,36 @@ use Friendica\App;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\DI; 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) { function duepuntozero_init(App $a) {
Renderer::setActiveTemplateEngine('smarty3'); Renderer::setActiveTemplateEngine('smarty3');
$colorset = DI::pConfig()->get( local_user(), 'duepuntozero','colorset'); $colorset = null;
if (!$colorset)
$colorset = DI::config()->get('duepuntozero', 'colorset'); // user setting have priority, then node settings if (DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) {
if ($colorset) { $colorset = DI::pConfig()->get(local_user(), 'duepuntozero', 'colorset');
if ($colorset == 'greenzero') if (!$colorset)
DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />'."\n"; $colorset = DI::config()->get('duepuntozero', 'colorset'); // user setting have priority, then node settings
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') if ($colorset) {
DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/easterbunny.css" type="text/css" media="screen" />'."\n"; if ($colorset == 'greenzero')
if ($colorset == 'darkzero') DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />' . "\n";
DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/darkzero.css" type="text/css" media="screen" />'."\n"; if ($colorset == 'purplezero')
if ($colorset == 'comix') DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/purplezero.css" type="text/css" media="screen" />' . "\n";
DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/comix.css" type="text/css" media="screen" />'."\n"; if ($colorset == 'easterbunny')
if ($colorset == 'slackr') DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/easterbunny.css" type="text/css" media="screen" />' . "\n";
DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/slackr.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 DI::page()['htmlhead'] .= <<< EOT
<script> <script>
function cmtBbOpen(comment, id) { function cmtBbOpen(comment, id) {

View File

@ -31,45 +31,64 @@ $schemecss = '';
$schemecssfile = false; $schemecssfile = false;
$scheme_modified = 0; $scheme_modified = 0;
DI::config()->load('frio'); /*
* This script can be included when the maintenance mode is on, which requires us to avoid any config call and
* use the following hardcoded defaults
*/
$scheme = null;
$scheme_accent = FRIO_SCHEME_ACCENT_BLUE;
$nav_bg = '#708fa0';
$nav_icon_color = '#ffffff';
$link_color = '#6fdbe8';
$background_color = '#ededed';
$contentbg_transp = 100;
$background_image = 'img/none.png';
$bg_image_option = '';
$login_bg_image = '';
$login_bg_color = '';
$modified = time();
// Default to hard-coded values for empty settings if (DI::mode()->has(\Friendica\App\Mode::MAINTENANCEDISABLED)) {
$scheme = DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'schema')); DI::config()->load('frio');
$scheme_accent = DI::config()->get('frio', 'scheme_accent') ?: FRIO_SCHEME_ACCENT_BLUE;
$nav_bg = DI::config()->get('frio', 'nav_bg') ?: '#708fa0'; // Default to hard-coded values for empty settings
$nav_icon_color = DI::config()->get('frio', 'nav_icon_color') ?: '#ffffff'; $scheme = DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'schema'));
$link_color = DI::config()->get('frio', 'link_color') ?: '#6fdbe8'; $scheme_accent = DI::config()->get('frio', 'scheme_accent') ?: $scheme_accent;
$background_color = DI::config()->get('frio', 'background_color') ?: '#ededed'; $nav_bg = DI::config()->get('frio', 'nav_bg') ?: $nav_bg;
$contentbg_transp = DI::config()->get('frio', 'contentbg_transp') ?? 100; $nav_icon_color = DI::config()->get('frio', 'nav_icon_color') ?: $nav_icon_color;
$background_image = DI::config()->get('frio', 'background_image') ?: 'img/none.png'; $link_color = DI::config()->get('frio', 'link_color') ?: $link_color;
$bg_image_option = DI::config()->get('frio', 'bg_image_option') ?: ''; $background_color = DI::config()->get('frio', 'background_color') ?: $background_color;
$login_bg_image = DI::config()->get('frio', 'login_bg_image') ?: ''; $contentbg_transp = DI::config()->get('frio', 'contentbg_transp') ?? $contentbg_transp;
$login_bg_color = DI::config()->get('frio', 'login_bg_color') ?: ''; $background_image = DI::config()->get('frio', 'background_image') ?: $background_image;
$modified = DI::config()->get('frio', 'css_modified') ?: time(); $bg_image_option = DI::config()->get('frio', 'bg_image_option') ?: $bg_image_option;
$login_bg_image = DI::config()->get('frio', 'login_bg_image') ?: $login_bg_image;
$login_bg_color = DI::config()->get('frio', 'login_bg_color') ?: $login_bg_color;
$modified = DI::config()->get('frio', 'css_modified') ?: $modified;
// Get the UID of the profile owner.
$uid = $_REQUEST['puid'] ?? 0;
if ($uid) {
DI::pConfig()->load($uid, 'frio');
// Only override display settings that have actually been set
$scheme = DI::pConfig()->get($uid, 'frio', 'scheme', DI::pConfig()->get($uid, 'frio', 'schema')) ?: $scheme;
$scheme_accent = DI::pConfig()->get($uid, 'frio', 'scheme_accent') ?: $scheme_accent;
$nav_bg = DI::pConfig()->get($uid, 'frio', 'nav_bg') ?: $nav_bg;
$nav_icon_color = DI::pConfig()->get($uid, 'frio', 'nav_icon_color') ?: $nav_icon_color;
$link_color = DI::pConfig()->get($uid, 'frio', 'link_color') ?: $link_color;
$background_color = DI::pConfig()->get($uid, 'frio', 'background_color') ?: $background_color;
$contentbg_transp = DI::pConfig()->get($uid, 'frio', 'contentbg_transp') ?? $contentbg_transp;
$background_image = DI::pConfig()->get($uid, 'frio', 'background_image') ?: $background_image;
$bg_image_option = DI::pConfig()->get($uid, 'frio', 'bg_image_option') ?: $bg_image_option;
$modified = DI::pConfig()->get($uid, 'frio', 'css_modified') ?: $modified;
}
}
if (!$login_bg_image && !$login_bg_color) { if (!$login_bg_image && !$login_bg_color) {
$login_bg_image = 'img/login_bg.jpg'; $login_bg_image = 'img/login_bg.jpg';
} }
$login_bg_color = $login_bg_color ?: '#ededed'; $login_bg_color = $login_bg_color ?: '#ededed';
// Get the UID of the profile owner.
$uid = $_REQUEST['puid'] ?? 0;
if ($uid) {
DI::pConfig()->load($uid, 'frio');
// Only override display settings that have actually been set
$scheme = DI::pConfig()->get($uid, 'frio', 'scheme', DI::pConfig()->get($uid, 'frio', 'schema')) ?: $scheme;
$scheme_accent = DI::pConfig()->get($uid, 'frio', 'scheme_accent') ?: $scheme_accent;
$nav_bg = DI::pConfig()->get($uid, 'frio', 'nav_bg') ?: $nav_bg;
$nav_icon_color = DI::pConfig()->get($uid, 'frio', 'nav_icon_color') ?: $nav_icon_color;
$link_color = DI::pConfig()->get($uid, 'frio', 'link_color') ?: $link_color;
$background_color = DI::pConfig()->get($uid, 'frio', 'background_color') ?: $background_color;
$contentbg_transp = DI::pConfig()->get($uid, 'frio', 'contentbg_transp') ?? $contentbg_transp;
$background_image = DI::pConfig()->get($uid, 'frio', 'background_image') ?: $background_image;
$bg_image_option = DI::pConfig()->get($uid, 'frio', 'bg_image_option') ?: $bg_image_option;
$modified = DI::pConfig()->get($uid, 'frio', 'css_modified') ?: $modified;
}
// Now load the scheme. If a value is changed above, we'll keep the settings // Now load the scheme. If a value is changed above, we'll keep the settings
// If not, we'll keep those defined by the scheme // If not, we'll keep those defined by the scheme
// Setting $scheme to '' wasn't working for some reason, so we'll check it's // Setting $scheme to '' wasn't working for some reason, so we'll check it's
@ -81,7 +100,7 @@ if (!empty($_REQUEST['scheme'])) {
$scheme = Strings::sanitizeFilePathItem($scheme ?? ''); $scheme = Strings::sanitizeFilePathItem($scheme ?? '');
if (($scheme) && ($scheme != '---')) { if ($scheme && ($scheme != '---')) {
if (file_exists('view/theme/frio/scheme/' . $scheme . '.php')) { if (file_exists('view/theme/frio/scheme/' . $scheme . '.php')) {
$schemefile = 'view/theme/frio/scheme/' . $scheme . '.php'; $schemefile = 'view/theme/frio/scheme/' . $scheme . '.php';
require_once $schemefile; require_once $schemefile;
@ -104,7 +123,7 @@ if (!$scheme) {
} }
} }
$contentbg_transp = ((isset($contentbg_transp) && $contentbg_transp != '') ? $contentbg_transp : 100); $contentbg_transp = $contentbg_transp ?? 0 ?: 100;
// Calculate some colors in dependance of existing colors. // Calculate some colors in dependance of existing colors.
// Some colors are calculated to don't have too many selection // Some colors are calculated to don't have too many selection

View File

@ -27,6 +27,10 @@ const FRIO_SCHEME_ACCENT_PURPLE = '#a54bad';
const FRIO_SCHEME_ACCENT_GREEN = '#218f39'; const FRIO_SCHEME_ACCENT_GREEN = '#218f39';
const FRIO_SCHEME_ACCENT_PINK = '#d900a9'; const FRIO_SCHEME_ACCENT_PINK = '#d900a9';
/*
* This script can be included even when the app is in maintenance mode which requires us to avoid any config call
*/
function frio_init(App $a) function frio_init(App $a)
{ {
global $frio; global $frio;
@ -191,50 +195,52 @@ function frio_contact_photo_menu(App $a, &$args)
*/ */
function frio_remote_nav(App $a, array &$nav_info) function frio_remote_nav(App $a, array &$nav_info)
{ {
// get the homelink from $_XSESSION if (DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) {
$homelink = Model\Profile::getMyURL(); // get the homelink from $_SESSION
if (!$homelink) { $homelink = Model\Profile::getMyURL();
$homelink = Session::get('visitor_home', ''); if (!$homelink) {
} $homelink = Session::get('visitor_home', '');
}
// since $userinfo isn't available for the hook we write it to the nav array // since $userinfo isn't available for the hook we write it to the nav array
// this isn't optimal because the contact query will be done now twice // this isn't optimal because the contact query will be done now twice
$fields = ['id', 'url', 'avatar', 'micro', 'name', 'nick', 'baseurl', 'updated']; $fields = ['id', 'url', 'avatar', 'micro', 'name', 'nick', 'baseurl', 'updated'];
if ($a->isLoggedIn()) { if ($a->isLoggedIn()) {
$remoteUser = Contact::selectFirst($fields, ['uid' => $a->getLoggedInUserId(), 'self' => true]); $remoteUser = Contact::selectFirst($fields, ['uid' => $a->getLoggedInUserId(), 'self' => true]);
} elseif (!local_user() && remote_user()) { } elseif (!local_user() && remote_user()) {
$remoteUser = Contact::getById(remote_user(), $fields); $remoteUser = Contact::getById(remote_user(), $fields);
$nav_info['nav']['remote'] = DI::l10n()->t('Guest'); $nav_info['nav']['remote'] = DI::l10n()->t('Guest');
} elseif (Model\Profile::getMyURL()) { } elseif (Model\Profile::getMyURL()) {
$remoteUser = Contact::getByURL($homelink, null, $fields); $remoteUser = Contact::getByURL($homelink, null, $fields);
$nav_info['nav']['remote'] = DI::l10n()->t('Visitor'); $nav_info['nav']['remote'] = DI::l10n()->t('Visitor');
} else { } else {
$remoteUser = null; $remoteUser = null;
} }
if (DBA::isResult($remoteUser)) { if (DBA::isResult($remoteUser)) {
$nav_info['userinfo'] = [ $nav_info['userinfo'] = [
'icon' => Contact::getMicro($remoteUser), 'icon' => Contact::getMicro($remoteUser),
'name' => $remoteUser['name'], 'name' => $remoteUser['name'],
]; ];
$server_url = $remoteUser['baseurl']; $server_url = $remoteUser['baseurl'];
} }
if (!local_user() && !empty($server_url) && !is_null($remoteUser)) { if (!local_user() && !empty($server_url) && !is_null($remoteUser)) {
// user menu // user menu
$nav_info['nav']['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'], DI::l10n()->t('Status'), '', DI::l10n()->t('Your posts and conversations')]; $nav_info['nav']['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'], DI::l10n()->t('Status'), '', DI::l10n()->t('Your posts and conversations')];
$nav_info['nav']['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'] . '/profile', DI::l10n()->t('Profile'), '', DI::l10n()->t('Your profile page')]; $nav_info['nav']['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'] . '/profile', DI::l10n()->t('Profile'), '', DI::l10n()->t('Your profile page')];
$nav_info['nav']['usermenu'][] = [$server_url . '/photos/' . $remoteUser['nick'], DI::l10n()->t('Photos'), '', DI::l10n()->t('Your photos')]; $nav_info['nav']['usermenu'][] = [$server_url . '/photos/' . $remoteUser['nick'], DI::l10n()->t('Photos'), '', DI::l10n()->t('Your photos')];
$nav_info['nav']['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'] . '/media', DI::l10n()->t('Media'), '', DI::l10n()->t('Your postings with media')]; $nav_info['nav']['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'] . '/media', DI::l10n()->t('Media'), '', DI::l10n()->t('Your postings with media')];
$nav_info['nav']['usermenu'][] = [$server_url . '/events/', DI::l10n()->t('Events'), '', DI::l10n()->t('Your events')]; $nav_info['nav']['usermenu'][] = [$server_url . '/events/', DI::l10n()->t('Events'), '', DI::l10n()->t('Your events')];
// navbar links // navbar links
$nav_info['nav']['network'] = [$server_url . '/network', DI::l10n()->t('Network'), '', DI::l10n()->t('Conversations from your friends')]; $nav_info['nav']['network'] = [$server_url . '/network', DI::l10n()->t('Network'), '', DI::l10n()->t('Conversations from your friends')];
$nav_info['nav']['events'] = [$server_url . '/events', DI::l10n()->t('Events'), '', DI::l10n()->t('Events and Calendar')]; $nav_info['nav']['events'] = [$server_url . '/events', DI::l10n()->t('Events'), '', DI::l10n()->t('Events and Calendar')];
$nav_info['nav']['messages'] = [$server_url . '/message', DI::l10n()->t('Messages'), '', DI::l10n()->t('Private mail')]; $nav_info['nav']['messages'] = [$server_url . '/message', DI::l10n()->t('Messages'), '', DI::l10n()->t('Private mail')];
$nav_info['nav']['settings'] = [$server_url . '/settings', DI::l10n()->t('Settings'), '', DI::l10n()->t('Account settings')]; $nav_info['nav']['settings'] = [$server_url . '/settings', DI::l10n()->t('Settings'), '', DI::l10n()->t('Account settings')];
$nav_info['nav']['contacts'] = [$server_url . '/contact', DI::l10n()->t('Contacts'), '', DI::l10n()->t('Manage/edit friends and contacts')]; $nav_info['nav']['contacts'] = [$server_url . '/contact', DI::l10n()->t('Contacts'), '', DI::l10n()->t('Manage/edit friends and contacts')];
$nav_info['nav']['sitename'] = DI::config()->get('config', 'sitename'); $nav_info['nav']['sitename'] = DI::config()->get('config', 'sitename');
}
} }
} }

View File

@ -21,24 +21,27 @@
use Friendica\DI; use Friendica\DI;
$uid = $_REQUEST['puid'] ?? 0; /*
* This script can be included when the maintenance mode is on, which requires us to avoid any config call and
$color = false; * use the following hardcoded defaults
*/
$color = 'dark';
$quattro_align = false; $quattro_align = false;
$site_color = DI::config()->get("quattro", "color", "dark"); $textarea_font_size = '20';
$site_quattro_align = DI::config()->get("quattro", "align", false); $post_font_size = '12';
if ($uid) { if (DI::mode()->has(\Friendica\App\Mode::MAINTENANCEDISABLED)) {
$color = DI::pConfig()->get($uid, "quattro", "color", false); $site_color = DI::config()->get("quattro", "color", $color);
$quattro_align = DI::pConfig()->get($uid, 'quattro', 'align', false); $site_quattro_align = DI::config()->get("quattro", "align", $quattro_align);
} $site_textarea_font_size = DI::config()->get("quattro", "tfs", $textarea_font_size);
$site_post_font_size = DI::config()->get("quattro", "pfs", $post_font_size);
if ($color === false) { $uid = $_REQUEST['puid'] ?? 0;
$color = $site_color;
}
if ($quattro_align === false) { $color = DI::pConfig()->get($uid, "quattro", "color", $site_color);
$quattro_align = $site_quattro_align; $quattro_align = DI::pConfig()->get($uid, 'quattro', 'align', $site_quattro_align);
$textarea_font_size = DI::pConfig()->get($uid, "quattro", "tfs", $site_textarea_font_size);
$post_font_size = DI::pConfig()->get($uid, "quattro", "pfs", $site_post_font_size);
} }
$color = \Friendica\Util\Strings::sanitizeFilePathItem($color); $color = \Friendica\Util\Strings::sanitizeFilePathItem($color);
@ -59,24 +62,6 @@ if ($quattro_align == "center") {
} }
$textarea_font_size = false;
$post_font_size = false;
$site_textarea_font_size = DI::config()->get("quattro", "tfs", "20");
$site_post_font_size = DI::config()->get("quattro", "pfs", "12");
if ($uid) {
$textarea_font_size = DI::pConfig()->get($uid, "quattro", "tfs", false);
$post_font_size = DI::pConfig()->get($uid, "quattro", "pfs", false);
}
if ($textarea_font_size === false) {
$textarea_font_size = $site_textarea_font_size;
}
if ($post_font_size === false) {
$post_font_size = $site_post_font_size;
}
echo " echo "
textarea { font-size: ${textarea_font_size}px; } textarea { font-size: ${textarea_font_size}px; }
.wall-item-comment-wrapper .comment-edit-text-full { font-size: ${textarea_font_size}px; } .wall-item-comment-wrapper .comment-edit-text-full { font-size: ${textarea_font_size}px; }

View File

@ -10,6 +10,10 @@
use Friendica\App; use Friendica\App;
use Friendica\DI; 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 quattro_init(App $a) { function quattro_init(App $a) {
DI::page()['htmlhead'] .= '<script src="'.DI::baseUrl().'/view/theme/quattro/tinycon.min.js"></script>'; DI::page()['htmlhead'] .= '<script src="'.DI::baseUrl().'/view/theme/quattro/tinycon.min.js"></script>';
DI::page()['htmlhead'] .= '<script src="'.DI::baseUrl().'/view/theme/quattro/js/quattro.js"></script>';; DI::page()['htmlhead'] .= '<script src="'.DI::baseUrl().'/view/theme/quattro/js/quattro.js"></script>';;

View File

@ -14,6 +14,10 @@ use Friendica\App;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\DI; 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 smoothly_init(App $a) { function smoothly_init(App $a) {
Renderer::setActiveTemplateEngine('smarty3'); Renderer::setActiveTemplateEngine('smarty3');

View File

@ -23,16 +23,16 @@ use Friendica\Core\Logger;
use Friendica\DI; use Friendica\DI;
use Friendica\Network\HTTPException\NotModifiedException; use Friendica\Network\HTTPException\NotModifiedException;
$uid = $_REQUEST['puid'] ?? 0; /*
* This script can be included when the maintenance mode is on, which requires us to avoid any config call and
* use the following hardcoded default
*/
$style = 'plus';
$style = DI::pConfig()->get($uid, 'vier', 'style'); if (DI::mode()->has(\Friendica\App\Mode::MAINTENANCEDISABLED)) {
$uid = $_REQUEST['puid'] ?? 0;
if (empty($style)) { $style = DI::pConfig()->get($uid, 'vier', 'style', DI::config()->get('vier', 'style', $style));
$style = DI::config()->get('vier', 'style');
}
if (empty($style)) {
$style = "plus";
} }
$stylecss = ''; $stylecss = '';

View File

@ -19,6 +19,10 @@ use Friendica\DI;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Util\Strings; use Friendica\Util\Strings;
/*
* This script can be included even when the app is in maintenance mode which requires us to avoid any config call
*/
function vier_init(App $a) function vier_init(App $a)
{ {
$a->setThemeInfoValue('events_in_profile', false); $a->setThemeInfoValue('events_in_profile', false);
@ -27,7 +31,12 @@ function vier_init(App $a)
$args = DI::args(); $args = DI::args();
if ($args->get(0) === 'profile' && $args->get(1) === ($a->getLoggedInUserNickname() ?? '') || $args->get(0) === 'network' && local_user() if (
DI::mode()->has(App\Mode::MAINTENANCEDISABLED)
&& (
$args->get(0) === 'profile' && $args->get(1) === ($a->getLoggedInUserNickname() ?? '')
|| $args->get(0) === 'network' && local_user()
)
) { ) {
vier_community_info(); vier_community_info();