Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-32356 theme_formal_white: added blockpadding setting

  • Loading branch information...
commit f0a8c9192b867e93d289e8f3c4ae222c2ef93285 1 parent 9ad535c
@kordan kordan authored
View
2  theme/formal_white/lang/en/theme_formal_white.php
@@ -27,6 +27,8 @@
$string['blockcolumnwidthdesc'] = 'This sets the blocks column width for the theme. <strong>Using widths lower than 200px, the calendar block is not supposed to fit.</strong>';
$string['blockcontentbgc'] = 'Blocks content background colour';
$string['blockcontentbgcdesc'] = 'This sets the blocks content background colour for the theme.';
+$string['blockpadding'] = 'Margin around blocks';
+$string['blockpaddingdesc'] = 'This sets the margin between each block and the containing column.';
$string['choosereadme'] = '
<div class="clearfix">
<div class="theme_screenshot">
View
14 theme/formal_white/lib.php
@@ -67,6 +67,14 @@ function formal_white_user_settings($css, $theme) {
}
$css = formal_white_set_blockcolumnwidth($css, $blockcolumnwidth);
+ // set blocks margin
+ if (!empty($theme->settings->blockpadding)) {
+ $blockpadding = $theme->settings->blockpadding;
+ } else {
+ $blockpadding = '8'; // default
+ }
+ $css = formal_white_set_blockpadding($css, $blockpadding);
+
// set the customcss
if (!empty($theme->settings->customcss)) {
$customcss = $theme->settings->customcss;
@@ -145,6 +153,12 @@ function formal_white_set_blockcolumnwidth($css, $blockcolumnwidth) {
return $css;
}
+function formal_white_set_blockpadding($css, $blockpadding) {
+ $tag = '[[setting:blockpadding]]';
+ $css = str_replace($tag, $blockpadding.'px', $css);
+ return $css;
+}
+
function formal_white_set_customcss($css, $customcss) {
$tag = '[[setting:customcss]]';
$css = str_replace($tag, $customcss, $css);
View
9 theme/formal_white/settings.php
@@ -85,6 +85,15 @@
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$settings->add($setting);
+ // Block region width
+ $name = 'theme_formal_white/blockpadding';
+ $title = get_string('blockpadding','theme_formal_white');
+ $description = get_string('blockpaddingdesc', 'theme_formal_white');
+ $default = '8';
+ $choices = array(1=>'1px', 2=>'2px', 4=>'4px', 8=>'8px', 12=>'12px', 16=>'16px');
+ $setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
+ $settings->add($setting);
+
// Block content background colour setting
$name = 'theme_formal_white/blockcontentbgc';
$title = get_string('blockcontentbgc','theme_formal_white');
View
2  theme/formal_white/style/formal_white.css
@@ -164,7 +164,7 @@ ul.topics .section span.commands {position:absolute;right:1em;}
table td.cell p {margin:0;}
/* block */
-.block {border:1px #C6BDA8 solid;margin-bottom:0.5em;}
+.block {border:1px #C6BDA8 solid;margin-bottom:[[setting:blockpadding]];}
.block .header h2 {margin:0;padding-left:0.3em;}
.block .header .title {background-image:url([[pix:theme|gradient_h]]);background-repeat:repeat-x;clear:both;line-height:2em;background-color:#E3DFD4;}
.block .header .title .commands {padding-left:0.3em;text-align:right;}
View
4 theme/formal_white/style/pagelayout.css
@@ -88,7 +88,7 @@
}
#page-content .region-content {
- padding:0.6em 8px 0.1em 8px; /* definisco lo spazio sopra e sotto ai blocchi */
+ padding:[[setting:blockpadding]] [[setting:blockpadding]] 0 [[setting:blockpadding]];
}
.pagelayout-report #page-content .region-content {
@@ -113,4 +113,4 @@
/** Stabalise IE6 behaviour on the report layout **/
/* aggiunti/sovrascritti da me */
- .ie6.pagelayout-report #report-region-wrap {float:none;width:[[setting:blockcolumnwidth]];left:auto;position:absolute;top:0;}
+ .ie6.pagelayout-report #report-region-wrap {float:none;width:[[setting:blockcolumnwidth]];left:auto;position:absolute;top:0;}
View
2  theme/formal_white/version.php
@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die;
-$plugin->version = 2012011900; // The current module version (Date: YYYYMMDDXX)
+$plugin->version = 2012040302; // The current module version (Date: YYYYMMDDXX)
$plugin->requires = 2011081700; // Requires this Moodle version
$plugin->component = 'theme_formal_white';
$plugin->maturity = MATURITY_STABLE;
Please sign in to comment.
Something went wrong with that request. Please try again.