Permalink
Browse files

MDL-32566 theme_formal_white: restyling of login block

  • Loading branch information...
1 parent ead4f18 commit 011c24fbe986b3a066317f922f8a5f19369822d2 @kordan kordan committed Apr 23, 2012
View
2 theme/formal_white/config.php
@@ -67,7 +67,7 @@
$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.
View
59 theme/formal_white/lib.php
@@ -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;
}
View
43 theme/formal_white/style/block.css
@@ -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}
View
2 theme/formal_white/style/core.css
@@ -7,7 +7,7 @@
}
label {
- margin-right: 0.3em;
+ margin-right:0.3em;
}
input[type="text"],
View
41 theme/formal_white/style/formal_white.css
@@ -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;
View
2 theme/formal_white/style/frame.css
@@ -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,
View
4 theme/formal_white/style/pagelayout.css
@@ -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 */
}

0 comments on commit 011c24f

Please sign in to comment.