From a300616bcbdda691682028c2fc13295dcfb43fbb Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Fri, 13 Apr 2012 22:08:13 +0200 Subject: [PATCH] diabook-themes: theme-settings: users can set font-size and line-height for posts and comments --- view/theme/diabook-aerith/config.php | 71 +++++++++++ view/theme/diabook-aerith/style-network.css | 4 +- view/theme/diabook-aerith/style-profile.css | 4 +- view/theme/diabook-aerith/style.css | 8 +- view/theme/diabook-aerith/style.php | 120 +++++++++++++++++++ view/theme/diabook-aerith/theme.php | 4 +- view/theme/diabook-aerith/theme_settings.tpl | 8 ++ view/theme/diabook-blue/config.php | 71 +++++++++++ view/theme/diabook-blue/style-network.css | 4 +- view/theme/diabook-blue/style-profile.css | 4 +- view/theme/diabook-blue/style.css | 8 +- view/theme/diabook-blue/style.php | 120 +++++++++++++++++++ view/theme/diabook-blue/theme.php | 4 +- view/theme/diabook-blue/theme_settings.tpl | 8 ++ view/theme/diabook-red/config.php | 71 +++++++++++ view/theme/diabook-red/style-network.css | 4 +- view/theme/diabook-red/style-profile.css | 4 +- view/theme/diabook-red/style.css | 8 +- view/theme/diabook-red/style.php | 120 +++++++++++++++++++ view/theme/diabook-red/theme.php | 4 +- view/theme/diabook-red/theme_settings.tpl | 8 ++ view/theme/diabook/config.php | 2 +- 22 files changed, 628 insertions(+), 31 deletions(-) create mode 100644 view/theme/diabook-aerith/config.php create mode 100644 view/theme/diabook-aerith/style.php create mode 100644 view/theme/diabook-aerith/theme_settings.tpl create mode 100644 view/theme/diabook-blue/config.php create mode 100644 view/theme/diabook-blue/style.php create mode 100644 view/theme/diabook-blue/theme_settings.tpl create mode 100644 view/theme/diabook-red/config.php create mode 100644 view/theme/diabook-red/style.php create mode 100644 view/theme/diabook-red/theme_settings.tpl diff --git a/view/theme/diabook-aerith/config.php b/view/theme/diabook-aerith/config.php new file mode 100644 index 00000000..afd3119f --- /dev/null +++ b/view/theme/diabook-aerith/config.php @@ -0,0 +1,71 @@ +"1.4", + "1.3"=>"1.3", + "1.2"=>"1.2", + "1.1"=>"1.1", + ); + + $font_sizes = array( + '14'=>'14', + '13.5'=>'13.5', + '13'=>'13', + '12.5'=>'12.5', + '12'=>'12', + ); + + + + $t = file_get_contents( dirname(__file__). "/theme_settings.tpl" ); + $o .= replace_macros($t, array( + '$submit' => t('Submit'), + '$baseurl' => $a->get_baseurl(), + '$title' => t("Theme settings"), + '$font_size' => array('diabook-aerith_font_size', t('Set font-size for posts and comments'), $font_size, '', $font_sizes), + '$line_height' => array('diabook-aerith_line_height', t('Set line-height for posts and comments'), $line_height, '', $line_heights), + )); + return $o; +} diff --git a/view/theme/diabook-aerith/style-network.css b/view/theme/diabook-aerith/style-network.css index b9754ac3..17335389 100644 --- a/view/theme/diabook-aerith/style-network.css +++ b/view/theme/diabook-aerith/style-network.css @@ -1380,10 +1380,10 @@ transition: all 0.2s ease-in-out; } .wall-item-container .wall-item-content { - font-size: 12.5px; + max-width: 420px; word-wrap: break-word; - line-height: 1.2; + margin-bottom: 14px; } diff --git a/view/theme/diabook-aerith/style-profile.css b/view/theme/diabook-aerith/style-profile.css index 078b6d01..3dea2069 100644 --- a/view/theme/diabook-aerith/style-profile.css +++ b/view/theme/diabook-aerith/style-profile.css @@ -1358,10 +1358,10 @@ transition: all 0.2s ease-in-out; } .wall-item-container .wall-item-content { - font-size: 12.5px; + max-width: 420px; word-wrap: break-word; - line-height: 1.2; + margin-bottom: 14px; } diff --git a/view/theme/diabook-aerith/style.css b/view/theme/diabook-aerith/style.css index 20e91518..a9269f21 100644 --- a/view/theme/diabook-aerith/style.css +++ b/view/theme/diabook-aerith/style.css @@ -1454,10 +1454,10 @@ body .pageheader{ color: #999; } .wall-item-photo-container .wall-item-content { - font-size: 12.5px; + max-width: 720px; word-wrap: break-word; - line-height: 1.2; + margin-bottom: 14px; } .wall-item-photo-container .wall-item-content img { @@ -1599,10 +1599,10 @@ body .pageheader{ } .wall-item-container .wall-item-content { - font-size: 12.5px; + max-width: 720px; word-wrap: break-word; - line-height: 1.2; + margin-bottom: 14px; } diff --git a/view/theme/diabook-aerith/style.php b/view/theme/diabook-aerith/style.php new file mode 100644 index 00000000..1ae62503 --- /dev/null +++ b/view/theme/diabook-aerith/style.php @@ -0,0 +1,120 @@ +page['htmlhead'] .= sprintf('', $diabook_version); diff --git a/view/theme/diabook-aerith/theme_settings.tpl b/view/theme/diabook-aerith/theme_settings.tpl new file mode 100644 index 00000000..002923a2 --- /dev/null +++ b/view/theme/diabook-aerith/theme_settings.tpl @@ -0,0 +1,8 @@ +{{inc field_select.tpl with $field=$font_size}}{{endinc}} + +{{inc field_select.tpl with $field=$line_height}}{{endinc}} + +
+ +
+ diff --git a/view/theme/diabook-blue/config.php b/view/theme/diabook-blue/config.php new file mode 100644 index 00000000..3ad88b5b --- /dev/null +++ b/view/theme/diabook-blue/config.php @@ -0,0 +1,71 @@ +"1.4", + "1.3"=>"1.3", + "1.2"=>"1.2", + "1.1"=>"1.1", + ); + + $font_sizes = array( + '14'=>'14', + '13.5'=>'13.5', + '13'=>'13', + '12.5'=>'12.5', + '12'=>'12', + ); + + + + $t = file_get_contents( dirname(__file__). "/theme_settings.tpl" ); + $o .= replace_macros($t, array( + '$submit' => t('Submit'), + '$baseurl' => $a->get_baseurl(), + '$title' => t("Theme settings"), + '$font_size' => array('diabook-blue_font_size', t('Set font-size for posts and comments'), $font_size, '', $font_sizes), + '$line_height' => array('diabook-blue_line_height', t('Set line-height for posts and comments'), $line_height, '', $line_heights), + )); + return $o; +} diff --git a/view/theme/diabook-blue/style-network.css b/view/theme/diabook-blue/style-network.css index 021edc45..2f25372a 100644 --- a/view/theme/diabook-blue/style-network.css +++ b/view/theme/diabook-blue/style-network.css @@ -1342,10 +1342,10 @@ transition: all 0.2s ease-in-out; } .wall-item-container .wall-item-content { - font-size: 12.5px; + max-width: 420px; word-wrap: break-word; - line-height: 1.2; + margin-bottom: 14px; } diff --git a/view/theme/diabook-blue/style-profile.css b/view/theme/diabook-blue/style-profile.css index ae7fa8d1..f0b4fbd0 100644 --- a/view/theme/diabook-blue/style-profile.css +++ b/view/theme/diabook-blue/style-profile.css @@ -1325,10 +1325,10 @@ transition: all 0.2s ease-in-out; } .wall-item-container .wall-item-content { - font-size: 12.5px; + max-width: 420px; word-wrap: break-word; - line-height: 1.2; + margin-bottom: 14px; } diff --git a/view/theme/diabook-blue/style.css b/view/theme/diabook-blue/style.css index 5d083393..923e63e3 100644 --- a/view/theme/diabook-blue/style.css +++ b/view/theme/diabook-blue/style.css @@ -1411,10 +1411,10 @@ body .pageheader{ color: #999; } .wall-item-photo-container .wall-item-content { - font-size: 12.5px; + max-width: 720px; word-wrap: break-word; - line-height: 1.2; + margin-bottom: 14px; } .wall-item-photo-container .wall-item-content img { @@ -1557,10 +1557,10 @@ body .pageheader{ } .wall-item-container .wall-item-content { - font-size: 12.5px; + max-width: 720px; word-wrap: break-word; - line-height: 1.2; + margin-bottom: 14px; } diff --git a/view/theme/diabook-blue/style.php b/view/theme/diabook-blue/style.php new file mode 100644 index 00000000..330911b7 --- /dev/null +++ b/view/theme/diabook-blue/style.php @@ -0,0 +1,120 @@ +page['htmlhead'] .= sprintf('', $diabook_version); //change css on network and profilepages diff --git a/view/theme/diabook-blue/theme_settings.tpl b/view/theme/diabook-blue/theme_settings.tpl new file mode 100644 index 00000000..a40e0e29 --- /dev/null +++ b/view/theme/diabook-blue/theme_settings.tpl @@ -0,0 +1,8 @@ +{{inc field_select.tpl with $field=$font_size}}{{endinc}} + +{{inc field_select.tpl with $field=$line_height}}{{endinc}} + +
+ +
+ diff --git a/view/theme/diabook-red/config.php b/view/theme/diabook-red/config.php new file mode 100644 index 00000000..0b09a875 --- /dev/null +++ b/view/theme/diabook-red/config.php @@ -0,0 +1,71 @@ +"1.4", + "1.3"=>"1.3", + "1.2"=>"1.2", + "1.1"=>"1.1", + ); + + $font_sizes = array( + '14'=>'14', + '13.5'=>'13.5', + '13'=>'13', + '12.5'=>'12.5', + '12'=>'12', + ); + + + + $t = file_get_contents( dirname(__file__). "/theme_settings.tpl" ); + $o .= replace_macros($t, array( + '$submit' => t('Submit'), + '$baseurl' => $a->get_baseurl(), + '$title' => t("Theme settings"), + '$font_size' => array('diabook-red_font_size', t('Set font-size for posts and comments'), $font_size, '', $font_sizes), + '$line_height' => array('diabook-red_line_height', t('Set line-height for posts and comments'), $line_height, '', $line_heights), + )); + return $o; +} diff --git a/view/theme/diabook-red/style-network.css b/view/theme/diabook-red/style-network.css index ca32be23..17b7af09 100644 --- a/view/theme/diabook-red/style-network.css +++ b/view/theme/diabook-red/style-network.css @@ -1376,10 +1376,10 @@ transition: all 0.2s ease-in-out; } .wall-item-container .wall-item-content { - font-size: 12.5px; + max-width: 420px; word-wrap: break-word; - line-height: 1.2; + margin-bottom: 14px; } diff --git a/view/theme/diabook-red/style-profile.css b/view/theme/diabook-red/style-profile.css index 242c08c6..74566d5c 100644 --- a/view/theme/diabook-red/style-profile.css +++ b/view/theme/diabook-red/style-profile.css @@ -1338,10 +1338,10 @@ transition: all 0.2s ease-in-out; } .wall-item-container .wall-item-content { - font-size: 12.5px; + max-width: 420px; word-wrap: break-word; - line-height: 1.2; + margin-bottom: 14px; } diff --git a/view/theme/diabook-red/style.css b/view/theme/diabook-red/style.css index 7c92590c..a722dbae 100644 --- a/view/theme/diabook-red/style.css +++ b/view/theme/diabook-red/style.css @@ -1440,10 +1440,10 @@ body .pageheader{ color: #999; } .wall-item-photo-container .wall-item-content { - font-size: 12.5px; + max-width: 720px; word-wrap: break-word; - line-height: 1.2; + margin-bottom: 14px; } .wall-item-photo-container .wall-item-content img { @@ -1585,10 +1585,10 @@ body .pageheader{ } .wall-item-container .wall-item-content { - font-size: 12.5px; + max-width: 720px; word-wrap: break-word; - line-height: 1.2; + margin-bottom: 14px; } diff --git a/view/theme/diabook-red/style.php b/view/theme/diabook-red/style.php new file mode 100644 index 00000000..35b82ee9 --- /dev/null +++ b/view/theme/diabook-red/style.php @@ -0,0 +1,120 @@ +page['htmlhead'] .= sprintf('', $diabook_version); //change css on network and profilepages diff --git a/view/theme/diabook-red/theme_settings.tpl b/view/theme/diabook-red/theme_settings.tpl new file mode 100644 index 00000000..9e83ae8f --- /dev/null +++ b/view/theme/diabook-red/theme_settings.tpl @@ -0,0 +1,8 @@ +{{inc field_select.tpl with $field=$font_size}}{{endinc}} + +{{inc field_select.tpl with $field=$line_height}}{{endinc}} + +
+ +
+ diff --git a/view/theme/diabook/config.php b/view/theme/diabook/config.php index f4eb7aae..25b3c4b5 100644 --- a/view/theme/diabook/config.php +++ b/view/theme/diabook/config.php @@ -30,7 +30,7 @@ function theme_admin(&$a){ $font_size = get_config('diabook', 'font_size' ); $line_height = get_config('diabook', 'line_height' ); - return quattro_form($a,$font_size, $line_height); + return diabook_form($a,$font_size, $line_height); } function theme_admin_post(&$a){