X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=view%2Ftheme%2Ffrio%2Ftheme.php;h=22afbc9a7cf63394680a9d2f4baaf53ae52e113c;hb=d6ed0068e6c8bf513e40a5d29b73d100f664261b;hp=f256bec6957f8527e49fc2f9ab53a7c3c3cd7deb;hpb=0b8fd92e1eeb8229afb2aaf31b072c2a1fa51af7;p=friendica.git diff --git a/view/theme/frio/theme.php b/view/theme/frio/theme.php index f256bec695..22afbc9a7c 100644 --- a/view/theme/frio/theme.php +++ b/view/theme/frio/theme.php @@ -40,14 +40,6 @@ function frio_init(App $a) EOT; } - - $enable_compose = DI::pConfig()->get(local_user(), 'frio', 'enable_compose'); - $compose = $enable_compose === '1' || $enable_compose === null && DI::config()->get('frio', 'enable_compose') ? 1 : 0; - DI::page()['htmlhead'] .= <<< HTML - -HTML; } function frio_install() @@ -360,9 +352,57 @@ function frio_display_item(App $a, &$arr) $subthread = [ 'menu' => 'follow_thread', 'title' => DI::l10n()->t('Follow Thread'), - 'action' => 'dosubthread(' . $arr['item']['id'] . '); return false;', + 'action' => 'dosubthread(' . $arr['item']['id'] . ');', 'href' => '#' ]; } $arr['output']['subthread'] = $subthread; } + +/** + * @param int|null $uid + * @return string + * @see \Friendica\Core\Theme::getBackgroundColor() + */ +function frio_get_background_color(int $uid = null) +{ + $background_color = DI::config()->get('frio', 'background_color') ?: '#ededed'; + + if ($uid) { + $background_color = DI::pConfig()->get($uid, 'frio', 'background_color') ?: $background_color; + } + + $scheme = DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'schema')); + $scheme = Strings::sanitizeFilePathItem($scheme); + + if ($scheme && ($scheme != '---') && file_exists('view/theme/frio/scheme/' . $scheme . '.php')) { + $schemefile = 'view/theme/frio/scheme/' . $scheme . '.php'; + require_once $schemefile; + } + + return $background_color; +} + +/** + * @param int|null $uid + * @return string + * @see \Friendica\Core\Theme::getThemeColor() + */ +function frio_get_theme_color(int $uid = null) +{ + $nav_bg = DI::config()->get('frio', 'nav_bg') ?: '#708fa0'; + + if ($uid) { + $nav_bg = DI::pConfig()->get($uid, 'frio', 'background_color') ?: $nav_bg; + } + + $scheme = DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'schema')); + $scheme = Strings::sanitizeFilePathItem($scheme); + + if ($scheme && ($scheme != '---') && file_exists('view/theme/frio/scheme/' . $scheme . '.php')) { + $schemefile = 'view/theme/frio/scheme/' . $scheme . '.php'; + require_once $schemefile; + } + + return $nav_bg; +}