mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Merge branch 'MDL-32566_master' of git://github.com/kordan/moodle
This commit is contained in:
commit
cb626376c1
7 changed files with 103 additions and 50 deletions
|
@ -67,7 +67,7 @@ $THEME->parents_exclude_sheets = array(
|
|||
$THEME->sheets = array('frame' ,'menu', 'course',
|
||||
'pagelayout','core', 'calendar',
|
||||
'tabs' ,'quiz', 'forum',
|
||||
'formal_white');
|
||||
'block' ,'formal_white');
|
||||
////////////////////////////////////////////////////
|
||||
// Name of the stylesheet(s) you've including in
|
||||
// this theme's /styles/ directory.
|
||||
|
|
|
@ -73,7 +73,7 @@ function formal_white_user_settings($css, $theme) {
|
|||
} else {
|
||||
$blockpadding = '8'; // default
|
||||
}
|
||||
$css = formal_white_set_blockpadding($css, $blockpadding);
|
||||
$css = formal_white_set_blockpadding($css, $blockcolumnwidth, $blockpadding);
|
||||
|
||||
// set the customcss
|
||||
if (!empty($theme->settings->customcss)) {
|
||||
|
@ -103,8 +103,9 @@ function formal_white_set_framemargin($css, $framemargin) {
|
|||
$css = str_replace($tag, $framemargin.'px', $css);
|
||||
|
||||
// Set .headermenu right
|
||||
$tag = '[[setting:headermenuright]]';
|
||||
$css = str_replace($tag, ($framemargin+17).'px', $css); // 17px is the width of the frame
|
||||
$calculated = $framemargin + 17; // 17px is the width of the frame
|
||||
$tag = '[[calculated:headermenuright]]';
|
||||
$css = str_replace($tag, $calculated.'px', $css);
|
||||
|
||||
return $css;
|
||||
}
|
||||
|
@ -137,25 +138,63 @@ function formal_white_set_blockcolumnwidth($css, $blockcolumnwidth) {
|
|||
$tag = '[[setting:blockcolumnwidth]]';
|
||||
$css = str_replace($tag, $blockcolumnwidth.'px', $css);
|
||||
|
||||
$tag = '[[setting:minusdoubleblockcolumnwidth]]';
|
||||
$css = str_replace($tag, (-2*$blockcolumnwidth).'px', $css);
|
||||
$calculated = -2*$blockcolumnwidth;
|
||||
$tag = '[[calculated:minusdoubleblockcolumnwidth]]';
|
||||
$css = str_replace($tag, $calculated.'px', $css);
|
||||
|
||||
$tag = '[[setting:doubleblockcolumnwidth]]';
|
||||
$css = str_replace($tag, (2*$blockcolumnwidth).'px', $css);
|
||||
$calculated = 2*$blockcolumnwidth;
|
||||
$tag = '[[calculated:doubleblockcolumnwidth]]';
|
||||
$css = str_replace($tag, $calculated.'px', $css);
|
||||
|
||||
// set the min-width of the page to provide: content region min-width = block region width
|
||||
// I do not care $framemargin because the min-width applies to #frametop that is free from $framemargin
|
||||
// I need to add twice the width of the frame because it is inside #frametop
|
||||
// (this code here because it HAS TO come later than $blockcolumnwidth definition)
|
||||
$tag = '[[setting:minwidth]]';
|
||||
$css = str_replace($tag, (3*$blockcolumnwidth + 34).'px', $css); // 34 = 2*17 (17px is the width of the frame)
|
||||
$calculated = 3*$blockcolumnwidth + 34; // 34 = 2*17 (17px is the width of the frame)
|
||||
$tag = '[[calculated:minwidth]]';
|
||||
$css = str_replace($tag, $calculated.'px', $css);
|
||||
|
||||
return $css;
|
||||
}
|
||||
|
||||
function formal_white_set_blockpadding($css, $blockpadding) {
|
||||
function formal_white_set_blockpadding($css, $blockcolumnwidth, $blockpadding) {
|
||||
$tag = '[[setting:blockpadding]]';
|
||||
$css = str_replace($tag, $blockpadding.'px', $css);
|
||||
|
||||
// I need to know the field width in pixel because width:100%; and width:auto; don't work as expected
|
||||
// once $blockcolumnwidth and $blockpadding are known, $lb_fieldswidth can be applied
|
||||
// the process has not been optimized at all but it is executed only once
|
||||
$lb_fieldswidth = $blockcolumnwidth;
|
||||
|
||||
// #page-content .region-content {padding:[[setting:blockpadding]] [[setting:blockpadding]] 0 [[setting:blockpadding]];} in pagelayout.css
|
||||
$lb_fieldswidth -= 2*$blockpadding;
|
||||
|
||||
// .block {border:[[static:lb_blockborderwidth]] solid #C6BDA8; [...] }
|
||||
$lb_fieldsborderwidth = 1;
|
||||
$tag = '[[static:lb_blockborderwidth]]'; // It is static, it is not a setting. I just hardcoded its definition here.
|
||||
$css = str_replace($tag, $lb_fieldsborderwidth.'px', $css);
|
||||
$lb_fieldswidth -= 2*$lb_fieldsborderwidth;
|
||||
|
||||
// .block_login .content {padding:[[static:lb_contentpadding]];}
|
||||
$lb_fieldspadding = 4;
|
||||
$tag = '[[static:lb_contentpadding]]'; // It is static, it is not a setting. I just hardcoded its definition here.
|
||||
$css = str_replace($tag, $lb_fieldspadding.'px', $css);
|
||||
$lb_fieldswidth -= 2*$lb_fieldspadding;
|
||||
|
||||
// .block_login #login_username, .block_login #login_password {margin:4px 0 4px [[static:lb_fieldsmargin]];}
|
||||
$lb_fieldsmargin = 14;
|
||||
$tag = '[[static:lb_fieldsmargin]]'; // It is static, it is not a setting. I just hardcoded its definition here.
|
||||
$css = str_replace($tag, $lb_fieldsmargin.'px', $css);
|
||||
$lb_fieldswidth -= $lb_fieldsmargin; // without 2* because it is only left margin
|
||||
|
||||
// fields default factory border: 3px
|
||||
$lb_fieldswidth -= 2*3;
|
||||
|
||||
// leave few pixel on the right reducing once again the field length
|
||||
$lb_fieldswidth -= 12;
|
||||
|
||||
$tag = '[[static:lb_fieldswidth]]';
|
||||
$css = str_replace($tag, $lb_fieldswidth.'px', $css);
|
||||
return $css;
|
||||
}
|
||||
|
||||
|
|
43
theme/formal_white/style/block.css
Normal file
43
theme/formal_white/style/block.css
Normal file
|
@ -0,0 +1,43 @@
|
|||
/***
|
||||
*** block
|
||||
***/
|
||||
|
||||
.block {border:[[static:lb_blockborderwidth]] solid #C6BDA8;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;}
|
||||
.block .content {background-color:[[setting:blockcontentbgc]];}
|
||||
.block img.icon {padding-right:0}
|
||||
|
||||
/* block login */
|
||||
.block_login .btn {margin-top:0.5em;text-align:center;}
|
||||
.block_login .content {padding:[[static:lb_contentpadding]];} /* to overwrite canvas->blocks->padding: 5px 10% 5px 0; */
|
||||
.block_login label {margin-left:0;}
|
||||
.block_login #login_username, .block_login #login_password {margin:4px 0 4px [[static:lb_fieldsmargin]];}
|
||||
.block_login #login_username, .block_login #login_password {width:[[static:lb_fieldswidth]];}
|
||||
|
||||
/* block_settings */
|
||||
.block_settings .block_tree .tree_item a:link,
|
||||
.block_settings .block_tree .tree_item a:visited,
|
||||
.block_settings .block_tree .tree_item a:active,
|
||||
|
||||
/* block_navigation */
|
||||
/*.block_navigation .block_tree li.type_category.contains_branch>p span {
|
||||
padding-left: 20px;
|
||||
background-image: url([[pix:theme|folderopen]]);
|
||||
background-repeat: no-repeat;
|
||||
background-position: 0 -1px;
|
||||
}
|
||||
|
||||
.block_navigation .block_tree li.type_category.contains_branch.collapsed>p span {
|
||||
padding-left: 20px;
|
||||
background-image: url([[pix:theme|folderclose]]);
|
||||
background-repeat: no-repeat;
|
||||
background-position: 0 -1px;
|
||||
}*/
|
||||
.block_navigation .block_tree .tree_item a:link,
|
||||
.block_navigation .block_tree .tree_item a:visited,
|
||||
.block_navigation .block_tree .tree_item a:active {
|
||||
color:#000;
|
||||
}
|
||||
.block_navigation .block_tree .tree_item {padding-left:19px}
|
|
@ -7,7 +7,7 @@
|
|||
}
|
||||
|
||||
label {
|
||||
margin-right: 0.3em;
|
||||
margin-right:0.3em;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
|
|
|
@ -33,7 +33,7 @@ p {margin:0}
|
|||
/* if I use: position:relative; z-index doesn't work*/
|
||||
|
||||
/* headermenu */
|
||||
.headermenu {position:absolute;text-align:right;line-height:1.7em;font-size:90%;margin:0.3em;right:[[setting:headermenuright]];top:15px;}
|
||||
.headermenu {position:absolute;text-align:right;line-height:1.7em;font-size:90%;margin:0.3em;right:[[calculated:headermenuright]];top:15px;}
|
||||
|
||||
#dock {background-color:[[setting:blockcontentbgc]];border-right:1px dashed #000;}
|
||||
#dock .dockeditem_container {margin-top: 10px;}
|
||||
|
@ -57,29 +57,6 @@ p {margin:0}
|
|||
.navbutton {padding-right:0.5em;}
|
||||
.navbutton table td {padding:0;}
|
||||
|
||||
/*.block_navigation .block_tree li.type_category.contains_branch>p span {
|
||||
padding-left: 20px;
|
||||
background-image: url([[pix:theme|folderopen]]);
|
||||
background-repeat: no-repeat;
|
||||
background-position: 0 -1px;
|
||||
}
|
||||
|
||||
.block_navigation .block_tree li.type_category.contains_branch.collapsed>p span {
|
||||
padding-left: 20px;
|
||||
background-image: url([[pix:theme|folderclose]]);
|
||||
background-repeat: no-repeat;
|
||||
background-position: 0 -1px;
|
||||
}*/
|
||||
|
||||
.block_settings .block_tree .tree_item a:link,
|
||||
.block_settings .block_tree .tree_item a:visited,
|
||||
.block_settings .block_tree .tree_item a:active,
|
||||
.block_navigation .block_tree .tree_item a:link,
|
||||
.block_navigation .block_tree .tree_item a:visited,
|
||||
.block_navigation .block_tree .tree_item a:active {
|
||||
color:#000;
|
||||
}
|
||||
|
||||
/* breadcrumb */
|
||||
.breadcrumb {margin-left:0.8em;}
|
||||
|
||||
|
@ -165,16 +142,6 @@ ul.topics .section span.commands {position:absolute;right:1em;}
|
|||
.mform .fsubmit {text-align:left}
|
||||
table td.cell p {margin:0;}
|
||||
|
||||
/* block */
|
||||
.block {border:1px solid #C6BDA8;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;}
|
||||
.block .content {background-color:[[setting:blockcontentbgc]];}
|
||||
|
||||
/* block login */
|
||||
.block_login .btn {margin-top:0.5em;text-align:center;}
|
||||
|
||||
/* pagelayout-report */
|
||||
.pagelayout-report #page-header {float:left;}
|
||||
.pagelayout-report #page-content {overflow:hidden;}
|
||||
|
@ -231,10 +198,14 @@ pre, code, tt {
|
|||
table#defineroletable th {border-top:none;}
|
||||
|
||||
form.loginform .rememberusername {
|
||||
padding-left:0.3em;
|
||||
padding-left:13px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
form.loginform #rememberusername {
|
||||
margin-right:0;
|
||||
}
|
||||
|
||||
/* RSS - MDL-29367 */
|
||||
.block_rss_client .list li:first-child {
|
||||
border-top-width: 0;
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
margin:[[setting:framemargin]] [[setting:framemargin]] 0;
|
||||
background-position:0 0;
|
||||
background-repeat:repeat-x;
|
||||
min-width:[[setting:minwidth]];
|
||||
min-width:[[calculated:minwidth]];
|
||||
}
|
||||
|
||||
#frametopright,
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
}
|
||||
|
||||
#page-content #region-post-box {
|
||||
margin-left:[[setting:minusdoubleblockcolumnwidth]]; /*-2*[[setting:blockcolumnwidth]]*/
|
||||
margin-left:[[calculated:minusdoubleblockcolumnwidth]];
|
||||
/* arrotonadamento angolo in basso a dx */
|
||||
/* -moz-border-radius:0px 0px 6px 0px; /* Firefox */
|
||||
/* -webkit-border-radius:0px 0px 6px 0px; /* Safari, Chrome */
|
||||
|
@ -72,7 +72,7 @@
|
|||
}
|
||||
|
||||
#page-content #region-main {
|
||||
margin-left:[[setting:doubleblockcolumnwidth]];/*2*[[setting:blockcolumnwidth]]*/
|
||||
margin-left:[[calculated:doubleblockcolumnwidth]];
|
||||
background-color:white; /* questo serve a togliere la curvatura dagli angoli della zona centrale */
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue