diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index aeaa39fc86..2857c9cd44 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2024.03-rc\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-24 15:29+0000\n" +"POT-Creation-Date: 2024-03-01 08:51-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -244,7 +244,7 @@ msgstr "" msgid "Discard" msgstr "" -#: mod/message.php:135 src/Content/Nav.php:318 view/theme/frio/theme.php:241 +#: mod/message.php:135 src/Content/Nav.php:318 view/theme/frio/theme.php:244 msgid "Messages" msgstr "" @@ -315,7 +315,7 @@ msgstr "" #: src/Module/Profile/Profile.php:274 src/Module/Settings/Profile/Index.php:257 #: src/Module/Settings/Server/Action.php:79 src/Module/User/Delegation.php:189 #: src/Object/Post.php:1154 view/theme/duepuntozero/config.php:85 -#: view/theme/frio/config.php:171 view/theme/quattro/config.php:87 +#: view/theme/frio/config.php:150 view/theme/quattro/config.php:87 #: view/theme/vier/config.php:135 msgid "Submit" msgstr "" @@ -1807,7 +1807,7 @@ msgstr "" msgid "%1$s tagged %2$s's %3$s with %4$s" msgstr "" -#: src/Content/Item.php:429 view/theme/frio/theme.php:262 +#: src/Content/Item.php:429 view/theme/frio/theme.php:265 msgid "Follow Thread" msgstr "" @@ -1925,42 +1925,42 @@ msgstr "" #: src/Content/Nav.php:230 src/Module/BaseProfile.php:49 #: src/Module/BaseSettings.php:98 src/Module/Contact.php:503 #: src/Module/Contact/Profile.php:419 src/Module/Profile/Profile.php:268 -#: src/Module/Welcome.php:57 view/theme/frio/theme.php:230 +#: src/Module/Welcome.php:57 view/theme/frio/theme.php:233 msgid "Profile" msgstr "" -#: src/Content/Nav.php:230 view/theme/frio/theme.php:230 +#: src/Content/Nav.php:230 view/theme/frio/theme.php:233 msgid "Your profile page" msgstr "" #: src/Content/Nav.php:231 src/Module/BaseProfile.php:65 -#: src/Module/Media/Photo/Browser.php:74 view/theme/frio/theme.php:234 +#: src/Module/Media/Photo/Browser.php:74 view/theme/frio/theme.php:237 msgid "Photos" msgstr "" -#: src/Content/Nav.php:231 view/theme/frio/theme.php:234 +#: src/Content/Nav.php:231 view/theme/frio/theme.php:237 msgid "Your photos" msgstr "" #: src/Content/Nav.php:232 src/Module/BaseProfile.php:73 #: src/Module/BaseProfile.php:76 src/Module/Contact.php:527 -#: view/theme/frio/theme.php:235 +#: view/theme/frio/theme.php:238 msgid "Media" msgstr "" -#: src/Content/Nav.php:232 view/theme/frio/theme.php:235 +#: src/Content/Nav.php:232 view/theme/frio/theme.php:238 msgid "Your postings with media" msgstr "" #: src/Content/Nav.php:233 src/Content/Nav.php:293 #: src/Module/BaseProfile.php:85 src/Module/BaseProfile.php:88 #: src/Module/BaseProfile.php:96 src/Module/BaseProfile.php:99 -#: src/Module/Settings/Display.php:319 view/theme/frio/theme.php:236 -#: view/theme/frio/theme.php:240 +#: src/Module/Settings/Display.php:319 view/theme/frio/theme.php:239 +#: view/theme/frio/theme.php:243 msgid "Calendar" msgstr "" -#: src/Content/Nav.php:233 view/theme/frio/theme.php:236 +#: src/Content/Nav.php:233 view/theme/frio/theme.php:239 msgid "Your calendar" msgstr "" @@ -2030,7 +2030,7 @@ msgstr "" #: src/Content/Nav.php:274 src/Content/Nav.php:329 #: src/Content/Text/HTML.php:877 src/Module/BaseProfile.php:127 #: src/Module/BaseProfile.php:130 src/Module/Contact.php:426 -#: src/Module/Contact.php:535 view/theme/frio/theme.php:243 +#: src/Module/Contact.php:535 view/theme/frio/theme.php:246 msgid "Contacts" msgstr "" @@ -2069,15 +2069,15 @@ msgstr "" msgid "Terms of Service of this Friendica instance" msgstr "" -#: src/Content/Nav.php:306 view/theme/frio/theme.php:239 +#: src/Content/Nav.php:306 view/theme/frio/theme.php:242 msgid "Network" msgstr "" -#: src/Content/Nav.php:306 view/theme/frio/theme.php:239 +#: src/Content/Nav.php:306 view/theme/frio/theme.php:242 msgid "Conversations from your friends" msgstr "" -#: src/Content/Nav.php:308 view/theme/frio/theme.php:229 +#: src/Content/Nav.php:308 view/theme/frio/theme.php:232 msgid "Your posts and conversations" msgstr "" @@ -2106,7 +2106,7 @@ msgstr "" msgid "Mark all system notifications as seen" msgstr "" -#: src/Content/Nav.php:318 view/theme/frio/theme.php:241 +#: src/Content/Nav.php:318 view/theme/frio/theme.php:244 msgid "Private mail" msgstr "" @@ -2128,15 +2128,15 @@ msgstr "" #: src/Content/Nav.php:327 src/Module/Admin/Addons/Details.php:114 #: src/Module/Admin/Themes/Details.php:93 src/Module/BaseSettings.php:182 -#: src/Module/Welcome.php:52 view/theme/frio/theme.php:242 +#: src/Module/Welcome.php:52 view/theme/frio/theme.php:245 msgid "Settings" msgstr "" -#: src/Content/Nav.php:327 view/theme/frio/theme.php:242 +#: src/Content/Nav.php:327 view/theme/frio/theme.php:245 msgid "Account settings" msgstr "" -#: src/Content/Nav.php:329 view/theme/frio/theme.php:243 +#: src/Content/Nav.php:329 view/theme/frio/theme.php:246 msgid "Manage/edit friends and contacts" msgstr "" @@ -6892,7 +6892,7 @@ msgid "Actions" msgstr "" #: src/Module/Contact/Profile.php:417 -#: src/Module/Settings/TwoFactor/Index.php:140 view/theme/frio/theme.php:229 +#: src/Module/Settings/TwoFactor/Index.php:140 view/theme/frio/theme.php:232 msgid "Status" msgstr "" @@ -8875,7 +8875,7 @@ msgstr "" msgid "Unsupported or missing response type" msgstr "" -#: src/Module/OAuth/Authorize.php:59 src/Module/OAuth/Token.php:78 +#: src/Module/OAuth/Authorize.php:59 src/Module/OAuth/Token.php:75 msgid "Incomplete request data" msgstr "" @@ -8886,11 +8886,11 @@ msgid "" "close this window: %s" msgstr "" -#: src/Module/OAuth/Token.php:83 +#: src/Module/OAuth/Token.php:80 msgid "Invalid data or unknown client" msgstr "" -#: src/Module/OAuth/Token.php:108 +#: src/Module/OAuth/Token.php:105 msgid "Unsupported or missing grant type" msgstr "" @@ -10630,7 +10630,7 @@ msgid "Content Settings" msgstr "" #: src/Module/Settings/Display.php:316 view/theme/duepuntozero/config.php:86 -#: view/theme/frio/config.php:172 view/theme/quattro/config.php:88 +#: view/theme/frio/config.php:151 view/theme/quattro/config.php:88 #: view/theme/vier/config.php:136 msgid "Theme settings" msgstr "" @@ -12696,124 +12696,100 @@ msgstr "" msgid "Variations" msgstr "" -#: view/theme/frio/config.php:153 -msgid "Light (Accented)" -msgstr "" - -#: view/theme/frio/config.php:154 -msgid "Dark (Accented)" -msgstr "" - -#: view/theme/frio/config.php:155 -msgid "Black (Accented)" -msgstr "" - -#: view/theme/frio/config.php:167 +#: view/theme/frio/config.php:146 msgid "Note" msgstr "" -#: view/theme/frio/config.php:167 +#: view/theme/frio/config.php:146 msgid "Check image permissions if all users are allowed to see the image" msgstr "" -#: view/theme/frio/config.php:173 -msgid "Custom" +#: view/theme/frio/config.php:152 +msgid "Appearance" msgstr "" -#: view/theme/frio/config.php:174 -msgid "Legacy" +#: view/theme/frio/config.php:153 +msgid "Accent color" msgstr "" -#: view/theme/frio/config.php:175 -msgid "Accented" -msgstr "" - -#: view/theme/frio/config.php:176 -msgid "Select color scheme" -msgstr "" - -#: view/theme/frio/config.php:177 -msgid "Select scheme accent" -msgstr "" - -#: view/theme/frio/config.php:177 +#: view/theme/frio/config.php:153 msgid "Blue" msgstr "" -#: view/theme/frio/config.php:177 +#: view/theme/frio/config.php:153 msgid "Red" msgstr "" -#: view/theme/frio/config.php:177 +#: view/theme/frio/config.php:153 msgid "Purple" msgstr "" -#: view/theme/frio/config.php:177 +#: view/theme/frio/config.php:153 msgid "Green" msgstr "" -#: view/theme/frio/config.php:177 +#: view/theme/frio/config.php:153 msgid "Pink" msgstr "" -#: view/theme/frio/config.php:178 +#: view/theme/frio/config.php:154 msgid "Copy or paste schemestring" msgstr "" -#: view/theme/frio/config.php:178 +#: view/theme/frio/config.php:154 msgid "" "You can copy this string to share your theme with others. Pasting here " "applies the schemestring" msgstr "" -#: view/theme/frio/config.php:179 +#: view/theme/frio/config.php:155 msgid "Navigation bar background color" msgstr "" -#: view/theme/frio/config.php:180 +#: view/theme/frio/config.php:156 msgid "Navigation bar icon color " msgstr "" -#: view/theme/frio/config.php:181 +#: view/theme/frio/config.php:157 msgid "Link color" msgstr "" -#: view/theme/frio/config.php:182 +#: view/theme/frio/config.php:158 msgid "Set the background color" msgstr "" -#: view/theme/frio/config.php:183 +#: view/theme/frio/config.php:159 msgid "Content background opacity" msgstr "" -#: view/theme/frio/config.php:184 +#: view/theme/frio/config.php:160 msgid "Set the background image" msgstr "" -#: view/theme/frio/config.php:185 +#: view/theme/frio/config.php:161 msgid "Background image style" msgstr "" -#: view/theme/frio/config.php:188 +#: view/theme/frio/config.php:164 msgid "Always open Compose page" msgstr "" -#: view/theme/frio/config.php:188 +#: view/theme/frio/config.php:164 msgid "" "The New Post button always open the Compose page " "instead of the modal form. When this is disabled, the Compose page can be " "accessed with a middle click on the link or from the modal." msgstr "" -#: view/theme/frio/config.php:192 +#: view/theme/frio/config.php:168 msgid "Login page background image" msgstr "" -#: view/theme/frio/config.php:196 +#: view/theme/frio/config.php:172 msgid "Login page background color" msgstr "" -#: view/theme/frio/config.php:196 +#: view/theme/frio/config.php:172 msgid "Leave background image and color empty for theme defaults" msgstr "" @@ -12853,19 +12829,35 @@ msgstr "" msgid "Repeat image to fill the screen." msgstr "" -#: view/theme/frio/php/default.php:81 view/theme/frio/php/standard.php:40 +#: view/theme/frio/php/default.php:82 view/theme/frio/php/standard.php:40 msgid "Skip to main content" msgstr "" -#: view/theme/frio/php/default.php:152 view/theme/frio/php/standard.php:75 +#: view/theme/frio/php/default.php:153 view/theme/frio/php/standard.php:75 msgid "Back to top" msgstr "" -#: view/theme/frio/theme.php:211 -msgid "Guest" +#: view/theme/frio/php/scheme.php:105 +msgid "Light" +msgstr "" + +#: view/theme/frio/php/scheme.php:106 +msgid "Dark" +msgstr "" + +#: view/theme/frio/php/scheme.php:107 +msgid "Black" +msgstr "" + +#: view/theme/frio/php/scheme.php:118 +msgid "Custom" msgstr "" #: view/theme/frio/theme.php:214 +msgid "Guest" +msgstr "" + +#: view/theme/frio/theme.php:217 msgid "Visitor" msgstr "" diff --git a/view/theme/frio/config.php b/view/theme/frio/config.php index 3703912d3f..62969badeb 100644 --- a/view/theme/frio/config.php +++ b/view/theme/frio/config.php @@ -24,6 +24,7 @@ use Friendica\Core\Renderer; use Friendica\DI; require_once 'view/theme/frio/php/Image.php'; +require_once 'view/theme/frio/php/scheme.php'; function theme_post(App $a) { @@ -93,14 +94,7 @@ function theme_content(): string } $arr = [ - 'scheme' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'scheme', - DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'schema', - DI::config()->get('frio', 'scheme', - DI::config()->get('frio', 'schema') - ) - ) - ), - + 'scheme' => frio_scheme_get_current_for_user(DI::userSession()->getLocalUserId()), 'share_string' => '', 'scheme_accent' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'scheme_accent' , DI::config()->get('frio', 'scheme_accent')), 'nav_bg' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'nav_bg' , DI::config()->get('frio', 'nav_bg')), @@ -123,8 +117,8 @@ function theme_admin(): string } $arr = [ - 'scheme' => DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'schema')), - 'scheme_accent' => DI::config()->get('frio', 'scheme_accent'), + 'scheme' => frio_scheme_get_current(), + 'scheme_accent' => DI::config()->get('frio', 'scheme_accent') ?: FRIO_SCHEME_ACCENT_BLUE, 'share_string' => '', 'nav_bg' => DI::config()->get('frio', 'nav_bg'), 'nav_icon_color' => DI::config()->get('frio', 'nav_icon_color'), @@ -149,33 +143,15 @@ function frio_form($arr) $scheme_info = get_scheme_info($arr['scheme']); $disable = $scheme_info['overwrites']; - $schemes = [ - 'light' => DI::l10n()->t('Light (Accented)'), - 'dark' => DI::l10n()->t('Dark (Accented)'), - 'black' => DI::l10n()->t('Black (Accented)'), - ]; - - $legacy_schemes = []; - foreach (glob('view/theme/frio/scheme/*.php') ?: [] as $file) { - $scheme = basename($file, '.php'); - if (!in_array($scheme, ['default', 'light', 'dark', 'black'])) { - $scheme_name = ucfirst($scheme); - $legacy_schemes[$scheme] = $scheme_name; - } - } - $background_image_help = '' . DI::l10n()->t('Note') . ': ' . DI::l10n()->t('Check image permissions if all users are allowed to see the image'); $t = Renderer::getMarkupTemplate('theme_settings.tpl'); $ctx = [ '$submit' => DI::l10n()->t('Submit'), '$title' => DI::l10n()->t('Theme settings'), - '$custom' => DI::l10n()->t('Custom'), - '$legacy' => DI::l10n()->t('Legacy'), - '$accented' => DI::l10n()->t('Accented'), - '$scheme' => ['frio_scheme', DI::l10n()->t('Select color scheme'), $arr['scheme'], $schemes, $legacy_schemes], - '$scheme_accent' => !$scheme_info['accented'] ? '' : ['frio_scheme_accent', DI::l10n()->t('Select scheme accent'), $arr['scheme_accent'], ['blue' => DI::l10n()->t('Blue'), 'red' => DI::l10n()->t('Red'), 'purple' => DI::l10n()->t('Purple'), 'green' => DI::l10n()->t('Green'), 'pink' => DI::l10n()->t('Pink')]], - '$share_string' => $arr['scheme'] != '---' ? '' : ['frio_share_string', DI::l10n()->t('Copy or paste schemestring'), $arr['share_string'], DI::l10n()->t('You can copy this string to share your theme with others. Pasting here applies the schemestring'), false, false], + '$scheme' => ['frio_scheme', DI::l10n()->t('Appearance'), $arr['scheme'], frio_scheme_get_list()], + '$scheme_accent' => !$scheme_info['accented'] ? '' : ['frio_scheme_accent', DI::l10n()->t('Accent color'), $arr['scheme_accent'], ['blue' => DI::l10n()->t('Blue'), 'red' => DI::l10n()->t('Red'), 'purple' => DI::l10n()->t('Purple'), 'green' => DI::l10n()->t('Green'), 'pink' => DI::l10n()->t('Pink')]], + '$share_string' => $arr['scheme'] != FRIO_CUSTOM_SCHEME ? '' : ['frio_share_string', DI::l10n()->t('Copy or paste schemestring'), $arr['share_string'], DI::l10n()->t('You can copy this string to share your theme with others. Pasting here applies the schemestring'), false, false], '$nav_bg' => array_key_exists('nav_bg', $disable) ? '' : ['frio_nav_bg', DI::l10n()->t('Navigation bar background color'), $arr['nav_bg'], '', false], '$nav_icon_color' => array_key_exists('nav_icon_color', $disable) ? '' : ['frio_nav_icon_color', DI::l10n()->t('Navigation bar icon color '), $arr['nav_icon_color'], '', false], '$link_color' => array_key_exists('link_color', $disable) ? '' : ['frio_link_color', DI::l10n()->t('Link color'), $arr['link_color'], '', false], diff --git a/view/theme/frio/php/default.php b/view/theme/frio/php/default.php index 14914288aa..02e073a364 100644 --- a/view/theme/frio/php/default.php +++ b/view/theme/frio/php/default.php @@ -29,6 +29,7 @@ use Friendica\Model\Profile; require_once 'view/theme/frio/theme.php'; require_once 'view/theme/frio/php/frio_boot.php'; +require_once 'view/theme/frio/php/scheme.php'; // $minimal = is_modal(); if (!isset($minimal)) { @@ -59,8 +60,8 @@ $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser"; // Add the theme color meta // It makes mobile Chrome UI match Frio's top bar color. $uid = Profile::getThemeUid($a); - $scheme = DI::pConfig()->get($uid, 'frio', 'scheme', DI::pConfig()->get($uid, 'frio', 'schema')); - if ($scheme && is_string($scheme) && $scheme != '---') { + $scheme = frio_scheme_get_current_for_user($uid); + if ($scheme != FRIO_CUSTOM_SCHEME) { if (file_exists('view/theme/frio/scheme/' . $scheme . '.php')) { $schemefile = 'view/theme/frio/scheme/' . $scheme . '.php'; $scheme_accent = diff --git a/view/theme/frio/php/scheme.php b/view/theme/frio/php/scheme.php index aa6571a4d1..7304d83cd0 100644 --- a/view/theme/frio/php/scheme.php +++ b/view/theme/frio/php/scheme.php @@ -37,15 +37,13 @@ use Friendica\DI; use Friendica\Util\Strings; +require_once 'view/theme/frio/theme.php'; + function get_scheme_info($scheme) { $theme = DI::app()->getCurrentTheme(); $themepath = 'view/theme/' . $theme . '/'; - if (empty($scheme)) { - $scheme = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'scheme', DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'schema', '---')); - } - - $scheme = Strings::sanitizeFilePathItem($scheme); + $scheme = Strings::sanitizeFilePathItem($scheme) ?: FRIO_DEFAULT_SCHEME; $info = [ 'name' => $scheme, @@ -100,3 +98,54 @@ function get_scheme_info($scheme) return $info; } + +function frio_scheme_get_list(): array +{ + $schemes = [ + 'light' => DI::l10n()->t('Light'), + 'dark' => DI::l10n()->t('Dark'), + 'black' => DI::l10n()->t('Black'), + ]; + + foreach (glob('view/theme/frio/scheme/*.php') ?: [] as $file) { + $scheme = basename($file, '.php'); + if (!in_array($scheme, ['default', 'light', 'dark', 'black'])) { + $scheme_info = get_scheme_info($scheme); + $schemes[$scheme] = $scheme_info['name'] ?? ucfirst($scheme); + } + } + + $schemes[FRIO_CUSTOM_SCHEME] = DI::l10n()->t('Custom'); + + return $schemes; +} + +function frio_scheme_get_current() +{ + $available = array_keys(frio_scheme_get_list()); + + $scheme = DI::config()->get('frio', 'scheme') ?: DI::config()->get('frio', 'schema'); + + if (!in_array($scheme, $available)) { + return FRIO_DEFAULT_SCHEME; + } + + return $scheme; +} + +function frio_scheme_get_current_for_user(int $uid) +{ + $available = array_keys(frio_scheme_get_list()); + + $scheme = + DI::pConfig()->get($uid, 'frio', 'scheme') ?: + DI::pConfig()->get($uid, 'frio', 'schema') ?: + DI::config()->get('frio', 'scheme') ?: + DI::config()->get('frio', 'schema'); + + if (!in_array($scheme, $available)) { + return FRIO_DEFAULT_SCHEME; + } + + return $scheme; +} diff --git a/view/theme/frio/scheme/blue.php b/view/theme/frio/scheme/blue.php deleted file mode 100644 index bd98ad6a5a..0000000000 --- a/view/theme/frio/scheme/blue.php +++ /dev/null @@ -1,16 +0,0 @@ - a, -#topbar-first .dropdown.account.open > a, -#topbar-first .dropdown.account > button, -#topbar-first .dropdown.account.open > button, -#topbar-first .dropdown.account > :hover, -#topbar-first .dropdown.account.open > :hover { - background: #111; - border: 0; -} - -.nav-pills .dropdown-menu, -.nav-tabs .dropdown-menu, -.account .dropdown-menu, -.contact-photo-wrapper .dropdown-menu { - background: #111; - -webkit-box-shadow: 0px 0px 69px 4px rgba(0, 0, 0, 0.25); - -moz-box-shadow: 0px 0px 69px 4px rgba(0, 0, 0, 0.25); - box-shadow: 0px 0px 69px 4px rgba(0, 0, 0, 0.25); - border: 0; -} - -.account .dropdown-menu li, -.account .dropdown-menu li:hover { - border: 0; - background: #111; -} - -#topbar-first .topbar-nav .nav-segment > a:hover { - background: #333; -} - -.account .dropdown-menu li:hover { - background: #333 !important; -} - -.account .dropdown-menu li.divider { - background: #111; -} diff --git a/view/theme/frio/scheme/koyu-dark.php b/view/theme/frio/scheme/koyu-dark.php deleted file mode 100644 index a924cff9cb..0000000000 --- a/view/theme/frio/scheme/koyu-dark.php +++ /dev/null @@ -1,10 +0,0 @@ - li > a:hover, -nav.navbar .nav > li > a:hover { - background-color: #000; - color: #15e3ff; -} -#topbar-first .nav > li > a.selected { - background: #e355e0; - color: #000; - padding: 9px; - border-radius: 8px; -} -#topbar-first #nav-notifications-menu li.notif-entry:hover, -#topbar-second .nav > li > ul > li > a:hover, -#topbar-second .nav > li > ul > li > a.active, -#topbar-second .nav > li > a:hover, -#topbar-second .nav .open > a, -#topbar-second .nav > li.active, -.nav-pills .dropdown-menu li:hover, -.nav-tabs .dropdown-menu li:hover, -.account .dropdown-menu li:hover, -.contact-photo-wrapper .dropdown-menu li:hover, -.nav-pills .dropdown-menu li.selected, -.nav-tabs .dropdown-menu li.selected, -.account .dropdown-menu li.selected, -.contact-photo-wrapper .dropdown-menu li.selected, -aside .widget li:hover, -aside .widget li.selected, -.nav-container .widget li:hover { - border-left: 3px solid #15e3ff !important; -} - -.panel, -aside .widget, -.nav-container .widget, -#profile-page, -.photos-content-wrapper, -.settings-content-wrapper { - border-style: solid solid solid solid; - border-width: 1px; - border-color: #dddddd; - box-shadow: none; - border-radius: 15px; - color: #000; -} - -aside .widget li a, -aside .widget li a:hover, -.panel .panel-body .wall-item-content, -.toplevel_item .wall-item-container .btn-link { - color: #000; -} - -.wall-item-content a:hover, -nav.navbar .navbar-brand { - color: #15e3ff !important; -} diff --git a/view/theme/frio/scheme/love-music.php b/view/theme/frio/scheme/love-music.php deleted file mode 100644 index 19228240d7..0000000000 --- a/view/theme/frio/scheme/love-music.php +++ /dev/null @@ -1,15 +0,0 @@ -has(\Friendica\App\Mode::MAINTENANCEDISABLED)) { DI::config()->reload(); // Default to hard-coded values for empty settings - $scheme = DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'schema')); + $scheme = frio_scheme_get_current(); $scheme_accent = DI::config()->get('frio', 'scheme_accent') ?: $scheme_accent; $nav_bg = DI::config()->get('frio', 'nav_bg') ?: $nav_bg; $nav_icon_color = DI::config()->get('frio', 'nav_icon_color') ?: $nav_icon_color; @@ -71,7 +70,7 @@ if (DI::mode()->has(\Friendica\App\Mode::MAINTENANCEDISABLED)) { 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 = frio_scheme_get_current_for_user($uid); $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; @@ -89,18 +88,9 @@ if (!$login_bg_image && !$login_bg_color) { } $login_bg_color = $login_bg_color ?: '#ededed'; -// 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 -// Setting $scheme to '' wasn't working for some reason, so we'll check it's -// not --- like the mobile theme does instead. -// Allow layouts to over-ride the scheme. -if (!empty($_REQUEST['scheme'])) { - $scheme = $_REQUEST['scheme']; -} +$scheme = Strings::sanitizeFilePathItem($scheme); -$scheme = Strings::sanitizeFilePathItem($scheme ?? ''); - -if ($scheme && ($scheme != '---')) { +if ($scheme != FRIO_CUSTOM_SCHEME) { if (file_exists('view/theme/frio/scheme/' . $scheme . '.php')) { $schemefile = 'view/theme/frio/scheme/' . $scheme . '.php'; require_once $schemefile; @@ -110,19 +100,6 @@ if ($scheme && ($scheme != '---')) { } } -// If we haven't got a scheme, load the default. We shouldn't touch this - we -// should leave it for admins to define for themselves. -// default.php and default.css MUST be symlinks to existing scheme files. -if (!$scheme) { - if (file_exists('view/theme/frio/scheme/default.php')) { - $schemefile = 'view/theme/frio/scheme/default.php'; - require_once $schemefile; - } - if (file_exists('view/theme/frio/scheme/default.css')) { - $schemecssfile = 'view/theme/frio/scheme/default.css'; - } -} - $contentbg_transp = $contentbg_transp != '' ? $contentbg_transp : 100; // Calculate some colors in dependance of existing colors. diff --git a/view/theme/frio/templates/theme_settings.tpl b/view/theme/frio/templates/theme_settings.tpl index 7e53429e3b..0e10070684 100644 --- a/view/theme/frio/templates/theme_settings.tpl +++ b/view/theme/frio/templates/theme_settings.tpl @@ -4,17 +4,9 @@
diff --git a/view/theme/frio/theme.php b/view/theme/frio/theme.php index 58eb8268c3..c316f8dbf5 100644 --- a/view/theme/frio/theme.php +++ b/view/theme/frio/theme.php @@ -41,6 +41,9 @@ const FRIO_SCHEME_ACCENT_PURPLE = '#a54bad'; const FRIO_SCHEME_ACCENT_GREEN = '#218f39'; const FRIO_SCHEME_ACCENT_PINK = '#d900a9'; +const FRIO_DEFAULT_SCHEME = 'light'; +const FRIO_CUSTOM_SCHEME = '---'; + /* * This script can be included even when the app is in maintenance mode which requires us to avoid any config call */