Merge pull request #13948 from MrPetovan/task/12420-frio-remove-legacy-scheme

[frio] Remove legacy schemes
This commit is contained in:
Michael Vogel 2024-03-02 06:06:15 +01:00 committed by GitHub
commit f2ccce05b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 145 additions and 522 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2024.03-rc\n" "Project-Id-Version: 2024.03-rc\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -244,7 +244,7 @@ msgstr ""
msgid "Discard" msgid "Discard"
msgstr "" 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" msgid "Messages"
msgstr "" msgstr ""
@ -315,7 +315,7 @@ msgstr ""
#: src/Module/Profile/Profile.php:274 src/Module/Settings/Profile/Index.php:257 #: 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/Module/Settings/Server/Action.php:79 src/Module/User/Delegation.php:189
#: src/Object/Post.php:1154 view/theme/duepuntozero/config.php:85 #: 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 #: view/theme/vier/config.php:135
msgid "Submit" msgid "Submit"
msgstr "" msgstr ""
@ -1807,7 +1807,7 @@ msgstr ""
msgid "%1$s tagged %2$s's %3$s with %4$s" msgid "%1$s tagged %2$s's %3$s with %4$s"
msgstr "" 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" msgid "Follow Thread"
msgstr "" msgstr ""
@ -1925,42 +1925,42 @@ msgstr ""
#: src/Content/Nav.php:230 src/Module/BaseProfile.php:49 #: src/Content/Nav.php:230 src/Module/BaseProfile.php:49
#: src/Module/BaseSettings.php:98 src/Module/Contact.php:503 #: src/Module/BaseSettings.php:98 src/Module/Contact.php:503
#: src/Module/Contact/Profile.php:419 src/Module/Profile/Profile.php:268 #: 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" msgid "Profile"
msgstr "" 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" msgid "Your profile page"
msgstr "" msgstr ""
#: src/Content/Nav.php:231 src/Module/BaseProfile.php:65 #: 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" msgid "Photos"
msgstr "" 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" msgid "Your photos"
msgstr "" msgstr ""
#: src/Content/Nav.php:232 src/Module/BaseProfile.php:73 #: src/Content/Nav.php:232 src/Module/BaseProfile.php:73
#: src/Module/BaseProfile.php:76 src/Module/Contact.php:527 #: src/Module/BaseProfile.php:76 src/Module/Contact.php:527
#: view/theme/frio/theme.php:235 #: view/theme/frio/theme.php:238
msgid "Media" msgid "Media"
msgstr "" 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" msgid "Your postings with media"
msgstr "" msgstr ""
#: src/Content/Nav.php:233 src/Content/Nav.php:293 #: src/Content/Nav.php:233 src/Content/Nav.php:293
#: src/Module/BaseProfile.php:85 src/Module/BaseProfile.php:88 #: src/Module/BaseProfile.php:85 src/Module/BaseProfile.php:88
#: src/Module/BaseProfile.php:96 src/Module/BaseProfile.php:99 #: src/Module/BaseProfile.php:96 src/Module/BaseProfile.php:99
#: src/Module/Settings/Display.php:319 view/theme/frio/theme.php:236 #: src/Module/Settings/Display.php:319 view/theme/frio/theme.php:239
#: view/theme/frio/theme.php:240 #: view/theme/frio/theme.php:243
msgid "Calendar" msgid "Calendar"
msgstr "" 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" msgid "Your calendar"
msgstr "" msgstr ""
@ -2030,7 +2030,7 @@ msgstr ""
#: src/Content/Nav.php:274 src/Content/Nav.php:329 #: src/Content/Nav.php:274 src/Content/Nav.php:329
#: src/Content/Text/HTML.php:877 src/Module/BaseProfile.php:127 #: src/Content/Text/HTML.php:877 src/Module/BaseProfile.php:127
#: src/Module/BaseProfile.php:130 src/Module/Contact.php:426 #: 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" msgid "Contacts"
msgstr "" msgstr ""
@ -2069,15 +2069,15 @@ msgstr ""
msgid "Terms of Service of this Friendica instance" msgid "Terms of Service of this Friendica instance"
msgstr "" 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" msgid "Network"
msgstr "" 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" msgid "Conversations from your friends"
msgstr "" 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" msgid "Your posts and conversations"
msgstr "" msgstr ""
@ -2106,7 +2106,7 @@ msgstr ""
msgid "Mark all system notifications as seen" msgid "Mark all system notifications as seen"
msgstr "" 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" msgid "Private mail"
msgstr "" msgstr ""
@ -2128,15 +2128,15 @@ msgstr ""
#: src/Content/Nav.php:327 src/Module/Admin/Addons/Details.php:114 #: 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/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" msgid "Settings"
msgstr "" 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" msgid "Account settings"
msgstr "" 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" msgid "Manage/edit friends and contacts"
msgstr "" msgstr ""
@ -6892,7 +6892,7 @@ msgid "Actions"
msgstr "" msgstr ""
#: src/Module/Contact/Profile.php:417 #: 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" msgid "Status"
msgstr "" msgstr ""
@ -8875,7 +8875,7 @@ msgstr ""
msgid "Unsupported or missing response type" msgid "Unsupported or missing response type"
msgstr "" 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" msgid "Incomplete request data"
msgstr "" msgstr ""
@ -8886,11 +8886,11 @@ msgid ""
"close this window: %s" "close this window: %s"
msgstr "" msgstr ""
#: src/Module/OAuth/Token.php:83 #: src/Module/OAuth/Token.php:80
msgid "Invalid data or unknown client" msgid "Invalid data or unknown client"
msgstr "" msgstr ""
#: src/Module/OAuth/Token.php:108 #: src/Module/OAuth/Token.php:105
msgid "Unsupported or missing grant type" msgid "Unsupported or missing grant type"
msgstr "" msgstr ""
@ -10630,7 +10630,7 @@ msgid "Content Settings"
msgstr "" msgstr ""
#: src/Module/Settings/Display.php:316 view/theme/duepuntozero/config.php:86 #: 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 #: view/theme/vier/config.php:136
msgid "Theme settings" msgid "Theme settings"
msgstr "" msgstr ""
@ -12696,124 +12696,100 @@ msgstr ""
msgid "Variations" msgid "Variations"
msgstr "" msgstr ""
#: view/theme/frio/config.php:153 #: view/theme/frio/config.php:146
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
msgid "Note" msgid "Note"
msgstr "" 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" msgid "Check image permissions if all users are allowed to see the image"
msgstr "" msgstr ""
#: view/theme/frio/config.php:173 #: view/theme/frio/config.php:152
msgid "Custom" msgid "Appearance"
msgstr "" msgstr ""
#: view/theme/frio/config.php:174 #: view/theme/frio/config.php:153
msgid "Legacy" msgid "Accent color"
msgstr "" msgstr ""
#: view/theme/frio/config.php:175 #: view/theme/frio/config.php:153
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
msgid "Blue" msgid "Blue"
msgstr "" msgstr ""
#: view/theme/frio/config.php:177 #: view/theme/frio/config.php:153
msgid "Red" msgid "Red"
msgstr "" msgstr ""
#: view/theme/frio/config.php:177 #: view/theme/frio/config.php:153
msgid "Purple" msgid "Purple"
msgstr "" msgstr ""
#: view/theme/frio/config.php:177 #: view/theme/frio/config.php:153
msgid "Green" msgid "Green"
msgstr "" msgstr ""
#: view/theme/frio/config.php:177 #: view/theme/frio/config.php:153
msgid "Pink" msgid "Pink"
msgstr "" msgstr ""
#: view/theme/frio/config.php:178 #: view/theme/frio/config.php:154
msgid "Copy or paste schemestring" msgid "Copy or paste schemestring"
msgstr "" msgstr ""
#: view/theme/frio/config.php:178 #: view/theme/frio/config.php:154
msgid "" msgid ""
"You can copy this string to share your theme with others. Pasting here " "You can copy this string to share your theme with others. Pasting here "
"applies the schemestring" "applies the schemestring"
msgstr "" msgstr ""
#: view/theme/frio/config.php:179 #: view/theme/frio/config.php:155
msgid "Navigation bar background color" msgid "Navigation bar background color"
msgstr "" msgstr ""
#: view/theme/frio/config.php:180 #: view/theme/frio/config.php:156
msgid "Navigation bar icon color " msgid "Navigation bar icon color "
msgstr "" msgstr ""
#: view/theme/frio/config.php:181 #: view/theme/frio/config.php:157
msgid "Link color" msgid "Link color"
msgstr "" msgstr ""
#: view/theme/frio/config.php:182 #: view/theme/frio/config.php:158
msgid "Set the background color" msgid "Set the background color"
msgstr "" msgstr ""
#: view/theme/frio/config.php:183 #: view/theme/frio/config.php:159
msgid "Content background opacity" msgid "Content background opacity"
msgstr "" msgstr ""
#: view/theme/frio/config.php:184 #: view/theme/frio/config.php:160
msgid "Set the background image" msgid "Set the background image"
msgstr "" msgstr ""
#: view/theme/frio/config.php:185 #: view/theme/frio/config.php:161
msgid "Background image style" msgid "Background image style"
msgstr "" msgstr ""
#: view/theme/frio/config.php:188 #: view/theme/frio/config.php:164
msgid "Always open Compose page" msgid "Always open Compose page"
msgstr "" msgstr ""
#: view/theme/frio/config.php:188 #: view/theme/frio/config.php:164
msgid "" msgid ""
"The New Post button always open the <a href=\"/compose\">Compose page</a> " "The New Post button always open the <a href=\"/compose\">Compose page</a> "
"instead of the modal form. When this is disabled, the Compose page can be " "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." "accessed with a middle click on the link or from the modal."
msgstr "" msgstr ""
#: view/theme/frio/config.php:192 #: view/theme/frio/config.php:168
msgid "Login page background image" msgid "Login page background image"
msgstr "" msgstr ""
#: view/theme/frio/config.php:196 #: view/theme/frio/config.php:172
msgid "Login page background color" msgid "Login page background color"
msgstr "" msgstr ""
#: view/theme/frio/config.php:196 #: view/theme/frio/config.php:172
msgid "Leave background image and color empty for theme defaults" msgid "Leave background image and color empty for theme defaults"
msgstr "" msgstr ""
@ -12853,19 +12829,35 @@ msgstr ""
msgid "Repeat image to fill the screen." msgid "Repeat image to fill the screen."
msgstr "" 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" msgid "Skip to main content"
msgstr "" 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" msgid "Back to top"
msgstr "" msgstr ""
#: view/theme/frio/theme.php:211 #: view/theme/frio/php/scheme.php:105
msgid "Guest" 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 "" msgstr ""
#: view/theme/frio/theme.php:214 #: view/theme/frio/theme.php:214
msgid "Guest"
msgstr ""
#: view/theme/frio/theme.php:217
msgid "Visitor" msgid "Visitor"
msgstr "" msgstr ""

View File

@ -24,6 +24,7 @@ use Friendica\Core\Renderer;
use Friendica\DI; use Friendica\DI;
require_once 'view/theme/frio/php/Image.php'; require_once 'view/theme/frio/php/Image.php';
require_once 'view/theme/frio/php/scheme.php';
function theme_post(App $a) function theme_post(App $a)
{ {
@ -93,14 +94,7 @@ function theme_content(): string
} }
$arr = [ $arr = [
'scheme' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'scheme', 'scheme' => frio_scheme_get_current_for_user(DI::userSession()->getLocalUserId()),
DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'schema',
DI::config()->get('frio', 'scheme',
DI::config()->get('frio', 'schema')
)
)
),
'share_string' => '', 'share_string' => '',
'scheme_accent' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'scheme_accent' , DI::config()->get('frio', 'scheme_accent')), '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')), '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 = [ $arr = [
'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' => DI::config()->get('frio', 'scheme_accent') ?: FRIO_SCHEME_ACCENT_BLUE,
'share_string' => '', 'share_string' => '',
'nav_bg' => DI::config()->get('frio', 'nav_bg'), 'nav_bg' => DI::config()->get('frio', 'nav_bg'),
'nav_icon_color' => DI::config()->get('frio', 'nav_icon_color'), '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']); $scheme_info = get_scheme_info($arr['scheme']);
$disable = $scheme_info['overwrites']; $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 = '<strong>' . DI::l10n()->t('Note') . ': </strong>' . DI::l10n()->t('Check image permissions if all users are allowed to see the image'); $background_image_help = '<strong>' . DI::l10n()->t('Note') . ': </strong>' . DI::l10n()->t('Check image permissions if all users are allowed to see the image');
$t = Renderer::getMarkupTemplate('theme_settings.tpl'); $t = Renderer::getMarkupTemplate('theme_settings.tpl');
$ctx = [ $ctx = [
'$submit' => DI::l10n()->t('Submit'), '$submit' => DI::l10n()->t('Submit'),
'$title' => DI::l10n()->t('Theme settings'), '$title' => DI::l10n()->t('Theme settings'),
'$custom' => DI::l10n()->t('Custom'), '$scheme' => ['frio_scheme', DI::l10n()->t('Appearance'), $arr['scheme'], frio_scheme_get_list()],
'$legacy' => DI::l10n()->t('Legacy'), '$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')]],
'$accented' => DI::l10n()->t('Accented'), '$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],
'$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],
'$nav_bg' => array_key_exists('nav_bg', $disable) ? '' : ['frio_nav_bg', DI::l10n()->t('Navigation bar background color'), $arr['nav_bg'], '', 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], '$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], '$link_color' => array_key_exists('link_color', $disable) ? '' : ['frio_link_color', DI::l10n()->t('Link color'), $arr['link_color'], '', false],

View File

@ -29,6 +29,7 @@ use Friendica\Model\Profile;
require_once 'view/theme/frio/theme.php'; require_once 'view/theme/frio/theme.php';
require_once 'view/theme/frio/php/frio_boot.php'; require_once 'view/theme/frio/php/frio_boot.php';
require_once 'view/theme/frio/php/scheme.php';
// $minimal = is_modal(); // $minimal = is_modal();
if (!isset($minimal)) { if (!isset($minimal)) {
@ -59,8 +60,8 @@ $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser";
// Add the theme color meta // Add the theme color meta
// It makes mobile Chrome UI match Frio's top bar color. // It makes mobile Chrome UI match Frio's top bar color.
$uid = Profile::getThemeUid($a); $uid = Profile::getThemeUid($a);
$scheme = DI::pConfig()->get($uid, 'frio', 'scheme', DI::pConfig()->get($uid, 'frio', 'schema')); $scheme = frio_scheme_get_current_for_user($uid);
if ($scheme && is_string($scheme) && $scheme != '---') { if ($scheme != FRIO_CUSTOM_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';
$scheme_accent = $scheme_accent =

View File

@ -37,15 +37,13 @@
use Friendica\DI; use Friendica\DI;
use Friendica\Util\Strings; use Friendica\Util\Strings;
require_once 'view/theme/frio/theme.php';
function get_scheme_info($scheme) function get_scheme_info($scheme)
{ {
$theme = DI::app()->getCurrentTheme(); $theme = DI::app()->getCurrentTheme();
$themepath = 'view/theme/' . $theme . '/'; $themepath = 'view/theme/' . $theme . '/';
if (empty($scheme)) { $scheme = Strings::sanitizeFilePathItem($scheme) ?: FRIO_DEFAULT_SCHEME;
$scheme = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'scheme', DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'schema', '---'));
}
$scheme = Strings::sanitizeFilePathItem($scheme);
$info = [ $info = [
'name' => $scheme, 'name' => $scheme,
@ -100,3 +98,54 @@ function get_scheme_info($scheme)
return $info; 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;
}

View File

@ -1,16 +0,0 @@
<?php
/*
* Name: Blue
* Author: Rabuzarus
*
* List here all variables which will get overwritten through this scheme
* Overwrites: nav_bg, nav_icon_color, link_color, background_color, login_bg_color, contentbg_transp
*/
$nav_bg = "#708fa0";
$nav_icon_color = "#fff";
$link_color = "#6fdbe8";
$background_color = "#ededed";
$login_bg_color = "#ededed";
$contentbg_transp = 100;

View File

@ -1,52 +0,0 @@
/*
Licence : AGPL
Created on : 30.04.2018, 15:03:06
Author : koyu
*/
#topbar-first,
#topbar-second,
body {
background: #111;
border: 0;
}
#topbar-first .dropdown.account > 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;
}

View File

@ -1,10 +0,0 @@
<?php
/* Licence: AGPL
* Author: koyu
* Overwrites: nav_bg, nav_icon_color, link_color, background_color
*/
$nav_bg = "#111";
$nav_icon_color = "#fff";
$link_color = "#6fdbe8";
$background_color = "#111";

View File

@ -1,74 +0,0 @@
/*
Licence : AGPL
Created on : 28.03.2016, 03:13:19
Author : rabuzarus
*/
body {
color: #000;
}
/*
* Navbar
*/
#topbar-first,
nav.navbar {
box-shadow: 0 -1px 5px 2px #000;
}
#topbar-first .nav > 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;
}

View File

@ -1,15 +0,0 @@
<?php
/* Licence: AGP
* Author: rabuzarus
* Overwrites: nav_bg, nav_icon_color, link_color, background_color, contentbg_transp, background_image, bg_image_option, link_hover_color
*/
$nav_bg = "#000";
$nav_icon_color = "#e355e0";
$link_color = "#e355e0";
$background_color = "#fff";
$contentbg_transp = 100;
$background_image = "img/bg_circle.png";
$bg_image_option = "repeat";
$link_hover_color ="#15e3ff";

View File

@ -1,168 +0,0 @@
/*
Licence : AGPL
Created on : 29.06.2018, 15:03:06
Author : hoergen
Color picker : https://www.w3schools.com/colors/colors_names.asp
CSS UTF8 icons : https://www.utf8icons.com
*/
body {
background: url(scheme/plusminus.jpg);
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
height: auto;
}
aside .widget,
.form-control,
.panel,
.nav-container,
.wall-item-content,
.e-content,
.p-name,
.topbar,
post,
shiny,
tread-wrapper,
#topbar-second {
color: #000;
background-color: #f5f5f5;
}
.form-control {
font-family: ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande",
Helvetica, Arial, sans-serif;
}
#topbar-first #nav-notifications-menu li.notification-unseen {
border-left: 3px solid #e3eff3;
background-color: antiquewhite;
}
#topbar-first #nav-notifications-menu li.notif-entry {
padding: 0px;
}
.birthday-notice {
background-color: #cc0000;
color: white;
}
#birthday-title {
background-color: #ff0000;
color: white;
text-indent: 6px;
}
.birthday-list:before {
content: "\1F382 ";
}
.birthday-list {
margin: 1px;
color: black;
background-color: yellow;
text-indent: 10px;
border-radius: 5px;
}
#event-notice {
color: white;
background-color: #004c5b;
text-indent: 2px;
}
#event-title {
color: whitesmoke;
background-color: #006c83;
text-indent: 6px;
}
.event-list:before {
content: "\1F5D3 ";
}
.event-list {
margin: 1px;
color: black;
background-color: #00c7f0;
text-indent: 10px;
border-radius: 5px;
}
.panel .panel-body {
padding-top: 1px;
padding-bottom: 1px;
padding-left: 5px;
padding-right: 5px;
border: 1px;
}
.wall-item-network {
font-size: 12px;
}
.wall-item-content
.clearfix
.post
.comment-container
.well
.well-sm
.wall-item-body
.e-content
.p-name
.media
.comment
.wall-item-bottom
.wall-item-links
.wall-item-tags
.wall-item-actions
.wall-item-responses
#hr {
box-sizing: border-box;
margin-top: 0px;
margin-bottom: 0px;
border: 0px;
padding: 0px;
color: black;
}
.wall-spacer {
height: 0px;
}
/* Contact-page */
#connect-desc {
color: grey;
}
.search-input.form-control.form-search {
background-color: #ebebeb;
border-color: lightgrey;
}
.search-input.form-control.form-search:focus {
background-color: white;
border-color: grey;
}
/* Addon-Showmore*/
.showmore-wrap {
background-color: lightgrey;
text-decoration: underline;
text-decoration-color: black;
text-decoration-style: wavy;
}
/* New compose popup */
.profile-jot-net {
background: #dff0d8;
}
.profile-jot-net summary {
color: #3c763d;
font-weight: bold;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

View File

@ -1,17 +0,0 @@
<?php
/*
* Name: Plusminus
* Author: hoergen
*
* List here all variables which will get overwritten through this scheme
* Overwrites: nav_bg, nav_icon_color, link_color, background_color, contentbg_transp
*/
$nav_bg = "#000b95";
$nav_icon_color = "#eee";
$link_color = "#000b95";
//$background_color = "#ededed";
//$login_bg_color = "#ededed";
$contentbg_transp = 100;

View File

@ -1,15 +0,0 @@
<?php
/*
* Name: Red
* Author: Rabuzarus
*
* List here all variables which will get overwritten through this scheme
* Overwrites: nav_bg, nav_icon_color, link_color, background_color, contentbg_transp
*/
$nav_bg = "#870000";
$nav_icon_color = "#f5f5f5";
$link_color = "#b50404";
$background_color = "#ededed";
$contentbg_transp = 95;

View File

@ -24,10 +24,9 @@ use Friendica\Network\HTTPException\NotModifiedException;
use Friendica\Util\Strings; use Friendica\Util\Strings;
require_once 'view/theme/frio/theme.php'; require_once 'view/theme/frio/theme.php';
require_once 'view/theme/frio/php/scheme.php';
require_once 'view/theme/frio/php/PHPColors/Color.php'; require_once 'view/theme/frio/php/PHPColors/Color.php';
$scheme = '';
$schemecss = '';
$schemecssfile = false; $schemecssfile = false;
$scheme_modified = 0; $scheme_modified = 0;
@ -35,7 +34,7 @@ $scheme_modified = 0;
* This script can be included when the maintenance mode is on, which requires us to avoid any config call and * 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 * use the following hardcoded defaults
*/ */
$scheme = null; $scheme = FRIO_DEFAULT_SCHEME;
$scheme_accent = FRIO_SCHEME_ACCENT_BLUE; $scheme_accent = FRIO_SCHEME_ACCENT_BLUE;
$nav_bg = '#708fa0'; $nav_bg = '#708fa0';
$nav_icon_color = '#ffffff'; $nav_icon_color = '#ffffff';
@ -52,7 +51,7 @@ if (DI::mode()->has(\Friendica\App\Mode::MAINTENANCEDISABLED)) {
DI::config()->reload(); DI::config()->reload();
// Default to hard-coded values for empty settings // 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; $scheme_accent = DI::config()->get('frio', 'scheme_accent') ?: $scheme_accent;
$nav_bg = DI::config()->get('frio', 'nav_bg') ?: $nav_bg; $nav_bg = DI::config()->get('frio', 'nav_bg') ?: $nav_bg;
$nav_icon_color = DI::config()->get('frio', 'nav_icon_color') ?: $nav_icon_color; $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'); DI::pConfig()->load($uid, 'frio');
// Only override display settings that have actually been set // 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; $scheme_accent = DI::pConfig()->get($uid, 'frio', 'scheme_accent') ?: $scheme_accent;
$nav_bg = DI::pConfig()->get($uid, 'frio', 'nav_bg') ?: $nav_bg; $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; $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'; $login_bg_color = $login_bg_color ?: '#ededed';
// Now load the scheme. If a value is changed above, we'll keep the settings $scheme = Strings::sanitizeFilePathItem($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
// 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 ?? ''); if ($scheme != FRIO_CUSTOM_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;
@ -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; $contentbg_transp = $contentbg_transp != '' ? $contentbg_transp : 100;
// Calculate some colors in dependance of existing colors. // Calculate some colors in dependance of existing colors.

View File

@ -4,17 +4,9 @@
<div class="form-group field select"> <div class="form-group field select">
<label for="id_{{$scheme.0}}">{{$scheme.1}}</label> <label for="id_{{$scheme.0}}">{{$scheme.1}}</label>
<select name="{{$scheme.0}}" id="id_{{$scheme.0}}" class="form-control"> <select name="{{$scheme.0}}" id="id_{{$scheme.0}}" class="form-control">
<option value="---" {{if '---' == $scheme.2}}selected="selected"{{/if}}>{{$custom}}</option>
<optgroup label="{{$accented}}">
{{foreach $scheme.3 as $value => $label}} {{foreach $scheme.3 as $value => $label}}
<option value="{{$value}}" {{if $value == $scheme.2}}selected="selected"{{/if}}>{{$label}}</option> <option value="{{$value}}" {{if $value == $scheme.2}}selected="selected"{{/if}}>{{$label}}</option>
{{/foreach}} {{/foreach}}
</optgroup>
<optgroup label="{{$legacy}}">
{{foreach $scheme.4 as $value => $label}}
<option value="{{$value}}" {{if $value == $scheme.2}}selected="selected"{{/if}}>{{$label}}</option>
{{/foreach}}
</optgroup>
</select> </select>
</div> </div>

View File

@ -41,6 +41,9 @@ 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';
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 * This script can be included even when the app is in maintenance mode which requires us to avoid any config call
*/ */