From 3bfa6facfc1294707368877d68caed50cbedf064 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 24 Apr 2018 20:26:14 -0400 Subject: [PATCH] [frio] Fix typo schema -> scheme --- view/theme/frio/README.md | 8 ++-- view/theme/frio/config.php | 16 +++---- ...c.png => screenshot-scheme-love-music.png} | Bin ...hema-red.png => screenshot-scheme-red.png} | Bin view/theme/frio/php/default.php | 8 ++-- .../theme/frio/php/{schema.php => scheme.php} | 26 ++++++------ view/theme/frio/scheme/blue.php | 16 +++++++ .../frio/{schema => scheme}/love-music.css | 0 .../frio/{schema => scheme}/love-music.php | 4 +- view/theme/frio/{schema => scheme}/red.php | 6 +-- view/theme/frio/style.php | 40 +++++++++--------- view/theme/frio/templates/theme_settings.tpl | 2 +- 12 files changed, 71 insertions(+), 55 deletions(-) rename view/theme/frio/img/screenshots/{screenshot-schema-love-music.png => screenshot-scheme-love-music.png} (100%) rename view/theme/frio/img/screenshots/{screenshot-schema-red.png => screenshot-scheme-red.png} (100%) rename view/theme/frio/php/{schema.php => scheme.php} (67%) create mode 100644 view/theme/frio/scheme/blue.php rename view/theme/frio/{schema => scheme}/love-music.css (100%) rename view/theme/frio/{schema => scheme}/love-music.php (60%) rename view/theme/frio/{schema => scheme}/red.php (63%) 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-scheme-love-music.png similarity index 100% rename from view/theme/frio/img/screenshots/screenshot-schema-love-music.png rename to view/theme/frio/img/screenshots/screenshot-scheme-love-music.png diff --git a/view/theme/frio/img/screenshots/screenshot-schema-red.png b/view/theme/frio/img/screenshots/screenshot-scheme-red.png similarity index 100% rename from view/theme/frio/img/screenshots/screenshot-schema-red.png rename to view/theme/frio/img/screenshots/screenshot-scheme-red.png 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/scheme.php similarity index 67% rename from view/theme/frio/php/schema.php rename to view/theme/frio/php/scheme.php index 29ad00e044..e52f861260 100644 --- a/view/theme/frio/php/schema.php +++ b/view/theme/frio/php/scheme.php @@ -1,41 +1,41 @@ Author Name - * 'description' => Schema description - * 'version' => Schema version + * 'description' => Scheme description + * 'version' => Scheme version * 'overwrites' => Variables which overwriting custom settings */ use Friendica\Core\PConfig; -function get_schema_info($schema) +function get_scheme_info($scheme) { $theme = current_theme(); $themepath = 'view/theme/' . $theme . '/'; - $schema = PConfig::get(local_user(), 'frio', 'schema'); + $scheme = PConfig::get(local_user(), 'frio', 'scheme'); $info = [ - 'name' => $schema, + 'name' => $scheme, 'description' => '', 'author' => [], 'version' => '', 'overwrites' => [] ]; - if (!is_file($themepath . 'schema/' . $schema . '.php')) return $info; + if (!is_file($themepath . 'scheme/' . $scheme . '.php')) return $info; - $f = file_get_contents($themepath . 'schema/' . $schema . '.php'); + $f = file_get_contents($themepath . 'scheme/' . $scheme . '.php'); $r = preg_match('|/\*.*\*/|msU', $f, $m); diff --git a/view/theme/frio/scheme/blue.php b/view/theme/frio/scheme/blue.php new file mode 100644 index 0000000000..bd98ad6a5a --- /dev/null +++ b/view/theme/frio/scheme/blue.php @@ -0,0 +1,16 @@ +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}}