]> git.mxchange.org Git - friendica.git/commitdiff
[frio] Add background-repeat attribute to background image options
authorHypolite Petovan <mrpetovan@gmail.com>
Wed, 25 Apr 2018 00:42:23 +0000 (20:42 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Wed, 25 Apr 2018 00:42:23 +0000 (20:42 -0400)
- Update background image options names and labels
- Add background image option label tag

view/theme/frio/config.php
view/theme/frio/css/style.css
view/theme/frio/php/Image.php
view/theme/frio/style.php
view/theme/frio/templates/theme_settings.tpl

index e9594b009be03a6903bab9afe4fb3c8080a80973..26f725f25eb9549ea36eddc6e7e987eded78d931 100644 (file)
@@ -111,7 +111,7 @@ function frio_form($arr)
                }
        }
 
-       $background_image_help = '<strong>' . L10n::t('Note') . ': </strong>' . L10n::t('Check image permissions if all users are allowed to visit the image');
+       $background_image_help = '<strong>' . L10n::t('Note') . ': </strong>' . L10n::t('Check image permissions if all users are allowed to see the image');
 
        $t = get_markup_template('theme_settings.tpl');
        $ctx = [
@@ -123,8 +123,9 @@ function frio_form($arr)
                '$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],
                '$background_color' => array_key_exists('background_color', $disable) ? '' : ['frio_background_color', L10n::t('Set the background color'), $arr['background_color'], '', false],
-               '$contentbg_transp' => array_key_exists('contentbg_transp', $disable) ? '' : ['frio_contentbg_transp', L10n::t('Content background opacity'), ((isset($arr['contentbg_transp']) && $arr['contentbg_transp'] != '') ? $arr['contentbg_transp'] : 100), ''],
+               '$contentbg_transp' => array_key_exists('contentbg_transp', $disable) ? '' : ['frio_contentbg_transp', L10n::t('Content background opacity'), defaults($arr, 'contentbg_transp', 100), ''],
                '$background_image' => array_key_exists('background_image', $disable) ? '' : ['frio_background_image', L10n::t('Set the background image'), $arr['background_image'], $background_image_help, false],
+               '$bg_image_options_title' => L10n::t('Background image style'),
                '$bg_image_options' => Image::get_options($arr),
        ];
 
index 839aa9ac377d56bd402ac024e2b777bde96c8fc5..912c6a884cb89ea832c474dd9c171b1a1ad791b7 100644 (file)
@@ -27,6 +27,7 @@ body {
     background-color: $background_color;
     background-image: url("$background_image");
     background-size: $background_size_img;
+    background-repeat: $background_repeat;
     background-attachment: fixed;
     color: #777;
     /*color: #555;*/
index 2b3cf3be8c3593e3ca92c27d760eea39e10d2b30..b1877393b98ec19573e92a206fa467fde6d4190e 100644 (file)
@@ -21,10 +21,10 @@ class Image
        public static function get_options($arr)
        {
                $bg_image_options = [
-                       'repeat'  => ['frio_bg_image_option', L10n::t('Repeat the image'), 'repeat', L10n::t('Will repeat your image to fill the background.'), ($arr['bg_image_option'] == 'repeat')],
-                       'stretch' => ['frio_bg_image_option', L10n::t('Stretch'), 'stretch', L10n::t('Will stretch to width/height of the image.'), ($arr['bg_image_option'] == 'stretch')],
-                       'cover'   => ['frio_bg_image_option', L10n::t('Resize fill and-clip'), 'cover', L10n::t('Resize to fill and retain aspect ratio.'), ($arr['bg_image_option'] == 'cover')],
-                       'contain' => ['frio_bg_image_option', L10n::t('Resize best fit'), 'contain', L10n::t('Resize to best fit and retain aspect ratio.'), ($arr['bg_image_option'] == 'contain')],
+                       'stretch' => ['frio_bg_image_option', L10n::t("Stretch"), "stretch", L10n::t("Resize image to the width of the screen and show background color below on long pages."), ($arr["bg_image_option"] == "stretch")],
+                       'cover'   => ['frio_bg_image_option', L10n::t("Resize, fill and clip"), "cover", L10n::t("Resize image to fill entire screen, clipping either the right or the bottom."), ($arr["bg_image_option"] == "cover")],
+                       'repeat'  => ['frio_bg_image_option', L10n::t("Repeat"), "repeat", L10n::t("Repeat image to fill the screen."), ($arr["bg_image_option"] == "repeat")],
+                       'contain' => ['frio_bg_image_option', L10n::t("Repeat one row"), "contain", L10n::t("Resize image to repeat it on a single row, either vertical or horizontal."), ($arr["bg_image_option"] == "contain")],
                ];
 
                return $bg_image_options;
index 811db092a21e7fad932aeecb4269d2ad48f63594..393dca2f900d62aa61cd70c868b6e31ecd5c6862 100644 (file)
@@ -152,22 +152,28 @@ if (!isset($link_hover_color)) {
 if (!isset($bg_image_option)) {
        $bg_image_option = null;
 }
+
 switch ($bg_image_option) {
        case 'stretch':
                $background_size_img = '100%';
+               $background_repeat = 'no-repeat';
                break;
        case 'cover':
                $background_size_img = 'cover';
+               $background_repeat = 'no-repeat';
                break;
        case 'repeat':
                $background_size_img = 'auto';
+               $background_repeat = 'repeat';
                break;
        case 'contain':
                $background_size_img = 'contain';
+               $background_repeat = 'repeat';
                break;
 
        default:
                $background_size_img = 'auto';
+               $background_repeat = 'no-repeat';
                break;
 }
 
@@ -187,6 +193,7 @@ $options = [
        '$contentbg_transp'            => $contentbg_transp,
        '$background_image'            => $background_image,
        '$background_size_img'         => $background_size_img,
+       '$background_repeat'           => $background_repeat,
        '$login_bg_image'              => $login_bg_image,
        '$login_bg_color'              => $login_bg_color
 ];
index f524dd6e0e91cf1ddb781207489f773b0cd28833..50a8934d1ba1cacd519a92a4e5d36a74c2f32880 100644 (file)
@@ -25,6 +25,7 @@
 {{if $background_image}}{{include file="field_fileinput.tpl" field=$background_image}}{{/if}}
 
 <div id="frio_bg_image_options" style="display: none;">
+       <label>{{$bg_image_options_title}}:</label>
 {{foreach $bg_image_options as $options}}
        {{include file="field_radio.tpl" field=$options}}
 {{/foreach}}