From: Hypolite Petovan Date: Wed, 25 Apr 2018 00:26:14 +0000 (-0400) Subject: [frio] Fix typo schema -> scheme X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3bfa6facfc1294707368877d68caed50cbedf064;p=friendica.git [frio] Fix typo schema -> scheme --- diff --git a/view/theme/frio/README.md b/view/theme/frio/README.md index 037028ff44..c729d12820 100644 --- a/view/theme/frio/README.md +++ b/view/theme/frio/README.md @@ -37,11 +37,11 @@ Don't blame me too much for ugly code and hacks. Fix it ;-) **Theme - Settings** ![Theme - Settings](https://github.com/rabuzarus/frio/blob/master/img/screenshots/screenshot-settings.png) -**Red schema** -![Red schema](https://github.com/rabuzarus/frio/blob/master/img/screenshots/screenshot-schema-red.png) +**Red scheme** +![Red scheme](https://github.com/rabuzarus/frio/blob/master/img/screenshots/screenshot-scheme-red.png) -**Love Music schema** -![Love Music schema](https://github.com/rabuzarus/frio/blob/master/img/screenshots/screenshot-schema-love-music.png) +**Love Music scheme** +![Love Music scheme](https://github.com/rabuzarus/frio/blob/master/img/screenshots/screenshot-scheme-love-music.png) **frio on mobile** diff --git a/view/theme/frio/config.php b/view/theme/frio/config.php index 05fcd3f9e0..a3d8d94bdf 100644 --- a/view/theme/frio/config.php +++ b/view/theme/frio/config.php @@ -15,7 +15,7 @@ function theme_post(App $a) } if (isset($_POST['frio-settings-submit'])) { - PConfig::set(local_user(), 'frio', 'schema', $_POST['frio_schema']); + PConfig::set(local_user(), 'frio', 'scheme', $_POST['frio_scheme']); PConfig::set(local_user(), 'frio', 'nav_bg', $_POST['frio_nav_bg']); PConfig::set(local_user(), 'frio', 'nav_icon_color', $_POST['frio_nav_icon_color']); PConfig::set(local_user(), 'frio', 'link_color', $_POST['frio_link_color']); @@ -34,7 +34,7 @@ function theme_admin_post(App $a) } if (isset($_POST['frio-settings-submit'])) { - Config::set('frio', 'schema', $_POST['frio_schema']); + Config::set('frio', 'scheme', $_POST['frio_scheme']); Config::set('frio', 'nav_bg', $_POST['frio_nav_bg']); Config::set('frio', 'nav_icon_color', $_POST['frio_nav_icon_color']); Config::set('frio', 'link_color', $_POST['frio_link_color']); @@ -55,7 +55,7 @@ function theme_content(App $a) } $arr = []; - $arr['schema'] = PConfig::get(local_user(), 'frio', 'schema'); + $arr['scheme'] = PConfig::get(local_user(), 'frio', 'scheme'); $arr['nav_bg'] = PConfig::get(local_user(), 'frio', 'nav_bg'); $arr['nav_icon_color'] = PConfig::get(local_user(), 'frio', 'nav_icon_color'); $arr['link_color'] = PConfig::get(local_user(), 'frio', 'link_color'); @@ -74,7 +74,7 @@ function theme_admin(App $a) } $arr = []; - $arr['schema'] = Config::get('frio', 'schema'); + $arr['scheme'] = Config::get('frio', 'scheme'); $arr['nav_bg'] = Config::get('frio', 'nav_bg'); $arr['nav_icon_color'] = Config::get('frio', 'nav_icon_color'); $arr['link_color'] = Config::get('frio', 'link_color'); @@ -90,9 +90,9 @@ function theme_admin(App $a) function frio_form($arr) { - require_once 'view/theme/frio/php/schema.php'; + require_once 'view/theme/frio/php/scheme.php'; - $scheme_info = get_schema_info($arr['schema']); + $scheme_info = get_scheme_info($arr['scheme']); $disable = $scheme_info['overwrites']; if (!is_array($disable)) { $disable = []; @@ -100,7 +100,7 @@ function frio_form($arr) $scheme_choices = []; $scheme_choices['---'] = L10n::t('Default'); - $files = glob('view/theme/frio/schema/*.php'); + $files = glob('view/theme/frio/scheme/*.php'); if ($files) { foreach ($files as $file) { $f = basename($file, '.php'); @@ -118,7 +118,7 @@ function frio_form($arr) '$submit' => L10n::t('Submit'), '$baseurl' => System::baseUrl(), '$title' => L10n::t('Theme settings'), - '$schema' => ['frio_schema', L10n::t('Select scheme'), $arr['schema'], '', $scheme_choices], + '$scheme' => ['frio_scheme', L10n::t('Select scheme'), $arr['scheme'], '', $scheme_choices], '$nav_bg' => array_key_exists('nav_bg', $disable) ? '' : ['frio_nav_bg', L10n::t('Navigation bar background color'), $arr['nav_bg'], '', false], '$nav_icon_color' => array_key_exists('nav_icon_color', $disable) ? '' : ['frio_nav_icon_color', L10n::t('Navigation bar icon color '), $arr['nav_icon_color'], '', false], '$link_color' => array_key_exists('link_color', $disable) ? '' : ['frio_link_color', L10n::t('Link color'), $arr['link_color'], '', false], diff --git a/view/theme/frio/img/screenshots/screenshot-schema-love-music.png b/view/theme/frio/img/screenshots/screenshot-schema-love-music.png deleted file mode 100644 index 8b73e58f62..0000000000 Binary files a/view/theme/frio/img/screenshots/screenshot-schema-love-music.png and /dev/null differ diff --git a/view/theme/frio/img/screenshots/screenshot-schema-red.png b/view/theme/frio/img/screenshots/screenshot-schema-red.png deleted file mode 100644 index c6d49f25b0..0000000000 Binary files a/view/theme/frio/img/screenshots/screenshot-schema-red.png and /dev/null differ diff --git a/view/theme/frio/img/screenshots/screenshot-scheme-love-music.png b/view/theme/frio/img/screenshots/screenshot-scheme-love-music.png new file mode 100644 index 0000000000..8b73e58f62 Binary files /dev/null and b/view/theme/frio/img/screenshots/screenshot-scheme-love-music.png differ diff --git a/view/theme/frio/img/screenshots/screenshot-scheme-red.png b/view/theme/frio/img/screenshots/screenshot-scheme-red.png new file mode 100644 index 0000000000..c6d49f25b0 Binary files /dev/null and b/view/theme/frio/img/screenshots/screenshot-scheme-red.png differ diff --git a/view/theme/frio/php/default.php b/view/theme/frio/php/default.php index 62b98b79ca..234e1476f9 100644 --- a/view/theme/frio/php/default.php +++ b/view/theme/frio/php/default.php @@ -43,10 +43,10 @@ if (!isset($minimal)) { if (is_null($uid)) { $uid = Profile::getThemeUid(); } - $schema = PConfig::get($uid, 'frio', 'schema'); - if (($schema) && ($schema != '---')) { - if (file_exists('view/theme/frio/schema/' . $schema . '.php')) { - $schemefile = 'view/theme/frio/schema/' . $schema . '.php'; + $scheme = PConfig::get($uid, 'frio', 'scheme'); + if (($scheme) && ($scheme != '---')) { + if (file_exists('view/theme/frio/scheme/' . $scheme . '.php')) { + $schemefile = 'view/theme/frio/scheme/' . $scheme . '.php'; require_once $schemefile; } } else { diff --git a/view/theme/frio/php/schema.php b/view/theme/frio/php/schema.php deleted file mode 100644 index 29ad00e044..0000000000 --- a/view/theme/frio/php/schema.php +++ /dev/null @@ -1,71 +0,0 @@ - Author Name - * 'description' => Schema description - * 'version' => Schema version - * 'overwrites' => Variables which overwriting custom settings - */ -use Friendica\Core\PConfig; - -function get_schema_info($schema) -{ - $theme = current_theme(); - $themepath = 'view/theme/' . $theme . '/'; - $schema = PConfig::get(local_user(), 'frio', 'schema'); - - $info = [ - 'name' => $schema, - 'description' => '', - 'author' => [], - 'version' => '', - 'overwrites' => [] - ]; - - if (!is_file($themepath . 'schema/' . $schema . '.php')) return $info; - - $f = file_get_contents($themepath . 'schema/' . $schema . '.php'); - - $r = preg_match('|/\*.*\*/|msU', $f, $m); - - if ($r) { - $ll = explode("\n", $m[0]); - foreach ($ll as $l) { - $l = trim($l, "\t\n\r */"); - if ($l != '') { - list($k, $v) = array_map('trim', explode(':', $l, 2)); - $k = strtolower($k); - if ($k == 'author') { - $r = preg_match('|([^<]+)<([^>]+)>|', $v, $m); - if ($r) { - $info['author'][] = ['name' => $m[1], 'link' => $m[2]]; - } else { - $info['author'][] = ['name' => $v]; - } - } elseif ($k == 'overwrites') { - $theme_settings = explode(',', str_replace(' ', '', $v)); - foreach ($theme_settings as $key => $value) { - $info['overwrites'][$value] = true; - } - } else { - if (array_key_exists($k, $info)) { - $info[$k] = $v; - } - } - } - } - } - - return $info; -} diff --git a/view/theme/frio/php/scheme.php b/view/theme/frio/php/scheme.php new file mode 100644 index 0000000000..e52f861260 --- /dev/null +++ b/view/theme/frio/php/scheme.php @@ -0,0 +1,71 @@ + Author Name + * 'description' => Scheme description + * 'version' => Scheme version + * 'overwrites' => Variables which overwriting custom settings + */ +use Friendica\Core\PConfig; + +function get_scheme_info($scheme) +{ + $theme = current_theme(); + $themepath = 'view/theme/' . $theme . '/'; + $scheme = PConfig::get(local_user(), 'frio', 'scheme'); + + $info = [ + 'name' => $scheme, + 'description' => '', + 'author' => [], + 'version' => '', + 'overwrites' => [] + ]; + + if (!is_file($themepath . 'scheme/' . $scheme . '.php')) return $info; + + $f = file_get_contents($themepath . 'scheme/' . $scheme . '.php'); + + $r = preg_match('|/\*.*\*/|msU', $f, $m); + + if ($r) { + $ll = explode("\n", $m[0]); + foreach ($ll as $l) { + $l = trim($l, "\t\n\r */"); + if ($l != '') { + list($k, $v) = array_map('trim', explode(':', $l, 2)); + $k = strtolower($k); + if ($k == 'author') { + $r = preg_match('|([^<]+)<([^>]+)>|', $v, $m); + if ($r) { + $info['author'][] = ['name' => $m[1], 'link' => $m[2]]; + } else { + $info['author'][] = ['name' => $v]; + } + } elseif ($k == 'overwrites') { + $theme_settings = explode(',', str_replace(' ', '', $v)); + foreach ($theme_settings as $key => $value) { + $info['overwrites'][$value] = true; + } + } else { + if (array_key_exists($k, $info)) { + $info[$k] = $v; + } + } + } + } + } + + return $info; +} diff --git a/view/theme/frio/schema/love-music.css b/view/theme/frio/schema/love-music.css deleted file mode 100644 index 19ce590cb0..0000000000 --- a/view/theme/frio/schema/love-music.css +++ /dev/null @@ -1,72 +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; -} diff --git a/view/theme/frio/schema/love-music.php b/view/theme/frio/schema/love-music.php deleted file mode 100644 index 528093e3a9..0000000000 --- a/view/theme/frio/schema/love-music.php +++ /dev/null @@ -1,15 +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 new file mode 100644 index 0000000000..19228240d7 --- /dev/null +++ b/view/theme/frio/scheme/love-music.php @@ -0,0 +1,15 @@ +module !== 'install') { PConfig::load($uid, 'frio'); // Load the profile owners pconfig. - $schema = PConfig::get($uid, 'frio', 'schema'); + $scheme = PConfig::get($uid, 'frio', 'scheme'); $nav_bg = PConfig::get($uid, 'frio', 'nav_bg'); $nav_icon_color = PConfig::get($uid, 'frio', 'nav_icon_color'); $link_color = PConfig::get($uid, 'frio', 'link_color'); @@ -38,7 +38,7 @@ if ($a->module !== 'install') { Config::load('frio'); // Load frios system config. - $schema = Config::get('frio', 'schema'); + $scheme = Config::get('frio', 'scheme'); $nav_bg = Config::get('frio', 'nav_bg'); $nav_icon_color = Config::get('frio', 'nav_icon_color'); $link_color = Config::get('frio', 'link_color'); @@ -59,38 +59,38 @@ if ($a->module !== 'install') { } // Now load the scheme. If a value is changed above, we'll keep the settings -// If not, we'll keep those defined by the schema -// Setting $schema to '' wasn't working for some reason, so we'll check it's +// 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 schema. -if (x($_REQUEST, 'schema')) { - $schema = $_REQUEST['schema']; +// Allow layouts to over-ride the scheme. +if (x($_REQUEST, 'scheme')) { + $scheme = $_REQUEST['scheme']; } // Sanitize the data. -$schema = !empty($schema) ? basename($schema) : ''; +$scheme = !empty($scheme) ? basename($scheme) : ''; -if (($schema) && ($schema != '---')) { - if (file_exists('view/theme/frio/schema/' . $schema . '.php')) { - $schemefile = 'view/theme/frio/schema/' . $schema . '.php'; +if (($scheme) && ($scheme != '---')) { + if (file_exists('view/theme/frio/scheme/' . $scheme . '.php')) { + $schemefile = 'view/theme/frio/scheme/' . $scheme . '.php'; require_once $schemefile; } - if (file_exists('view/theme/frio/schema/' . $schema . '.css')) { - $schemecssfile = 'view/theme/frio/schema/' . $schema . '.css'; + if (file_exists('view/theme/frio/scheme/' . $scheme . '.css')) { + $schemecssfile = 'view/theme/frio/scheme/' . $scheme . '.css'; } } -// If we haven't got a schema, load the default. We shouldn't touch this - we +// 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 schema files. -if (!$schema) { - if (file_exists('view/theme/frio/schema/default.php')) { - $schemefile = 'view/theme/frio/schema/default.php'; +// 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/schema/default.css')) { - $schemecssfile = 'view/theme/frio/schema/default.css'; + if (file_exists('view/theme/frio/scheme/default.css')) { + $schemecssfile = 'view/theme/frio/scheme/default.css'; } } diff --git a/view/theme/frio/templates/theme_settings.tpl b/view/theme/frio/templates/theme_settings.tpl index adc2150cf9..c88641e74b 100644 --- a/view/theme/frio/templates/theme_settings.tpl +++ b/view/theme/frio/templates/theme_settings.tpl @@ -4,7 +4,7 @@ -{{include file="field_select.tpl" field=$schema}} +{{include file="field_select.tpl" field=$scheme}} {{if $nav_bg}}{{include file="field_colorinput.tpl" field=$nav_bg}}{{/if}} {{if $nav_icon_color}}{{include file="field_colorinput.tpl" field=$nav_icon_color}}{{/if}}