Permalink
Browse files

MDL-27588 Fixed up several bugs with the formal_white theme

-> MDL-26934 has been fixed
-> MDL-27474 has been fixed
-> one more option to have blocks column with different background colours
-> one more option to use custom font size
-> version.php, and b/install.php to handle upgrades
-> increased the font size in the table with plugin list shown at upgrade time
-> minor fixes in IE7 when images from remote web sites are shown in the header
-> conformed the dock background colour to the block background colour to avoid unpleasant color combinations
-> conformed a.link, a.visited and a.active colours in tabs
-> conformed a.link, a.visited and a.active colours in the navigation block
-> deleted an awful box border from enrolment page
-> right aligned commands for resources and activities in the course page
-> increased the width of field item title column in mform
-> increased the padding-top to the help popup box messages
-> user menu restyled to fix some minor tweaks in IE7
-> minor repair to tabs to improve its look
-> restyling of the docked item panel header to look like all the other blocks
-> reduced the distance between elements in headermenu to look better even when only headings are shown in the header
-> links wherever and always black
-> the "search courses" field in the navigation bar does not force extra height
-> some unpleasant generalbox border duplicating some other border have been removed
-> some unpleasant margin/padding in notices and mtables has been removed
  • Loading branch information...
1 parent d1c96f6 commit b396e1678b22c6d8728793008ce3831a072da719 @kordan kordan committed with Sam Hemelryk May 23, 2011
@@ -255,4 +255,4 @@
////////////////////////////////////////////////////
// Sets a custom render factory to use with the
// theme, used when working with custom renderers.
-////////////////////////////////////////////////////
+////////////////////////////////////////////////////
@@ -0,0 +1,67 @@
+<?php
+
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * formal_white module upgrade code
+ *
+ * This file keeps track of upgrades to
+ * the theme plugin
+ *
+ * Sometimes, changes between versions involve
+ * alterations to database structures and other
+ * major things that may lose the effort they've put
+ * into customising and setting up your theme.
+ *
+ * The upgrade function in this file will attempt
+ * to perform all the necessary actions to upgrade
+ * your older installation to the current version.
+ *
+ * If there's something it cannot do itself, it
+ * will tell you what you need to do.
+ *
+ * The commands in here will all be database-neutral,
+ * using the methods of database_manager class
+ *
+ * Please do not forget to use upgrade_set_timeout()
+ * before any action that may take longer time to finish.
+ *
+ * @package theme
+ * @subpackage formal_white
+ * @copyright Mediatouch 2000 (http://mediatouch.it/)
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+function xmldb_theme_formal_white_install() {
+ $currentsetting = get_config('theme_formal_white');
+
+ // Remove all the useless settings of the first pre-release
+ // Remove backgroundcolor
+ unset_config('backgroundcolor', 'theme_formal_white');
+ // Remove regionwidth
+ unset_config('regionwidth', 'theme_formal_white');
+ // Remove alwayslangmenu
+ unset_config('alwayslangmenu', 'theme_formal_white');
+
+ // Create a new config setting called lblockcolumnbgc and give it blockcolumnbgc's value.
+ set_config('lblockcolumnbgc', $currentsetting->blockcolumnbgc, 'theme_formal_white');
+ // Remove blockcolumnbgc
+ unset_config('blockcolumnbgc', 'theme_formal_white');
+
+ return true;
+}
@@ -23,9 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$string['blockcolumnbgc'] = 'Blocks columns background colour';
-$string['blockcolumnbgcdesc'] = 'This sets the blocks columns background colour for the theme.';
-$string['blockcolumnwidth'] = 'Blocks colum width';
+$string['blockcolumnwidth'] = 'Blocks column width';
$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.';
@@ -63,18 +61,22 @@
$string['customcssdesc'] = 'Any CSS you enter here will be added to every page allowing your to easily customise this theme.';
$string['displaylogo'] = 'Pages header content';
$string['displaylogodesc'] = 'Choose whether display moodle logo or page heading text in the header.';
+$string['fontsizereference'] = 'Font size reference';
+$string['fontsizereferencedesc'] = 'This allows you to set the default font size for this theme. It is not recommended to set this higher than 13px as it is known to cause display problems with certain blocks.';
$string['footnote'] = 'Footnote';
$string['footnotedesc'] = 'The content from this textarea will be displayed in the footer of every page.';
$string['headerbgc'] = 'Header background colour';
$string['headerbgcdesc'] = 'This sets the blocks header background colour for the theme.';
$string['heading'] = 'Display page heading';
+$string['lblockcolumnbgc'] = 'Left column background colour';
+$string['lblockcolumnbgcdesc'] = 'This sets the left column background colour for the theme.';
$string['logo'] = 'logo';
$string['logodesc'] = 'Change the logo of this theme by entering the URL to a new one (i.e., http://www.somesite/animage.png). As a reference, the default logo is 300px wide by 80px high. A transparent .png will work best.<br />The chosen logo will be shown in each page of the site without any distinction between front page and other pages.';
$string['moodlelogo'] = 'Display moodle logo';
$string['noframe'] = 'Formal white 1.9 look';
$string['noframedesc'] = 'Select this option to require your moodle page to look like moodle 1.*, alias, without the surrounding frame.';
$string['pluginname'] = 'Formal white';
+$string['rblockcolumnbgc'] = 'Right column background colour';
+$string['rblockcolumnbgcdesc'] = 'This sets the right column background colour for the theme. If you leave this empty the left column background color will be used.';
$string['region-side-post'] = 'Right';
-$string['region-side-pre'] = 'Left';
-$string['regionwidth'] = 'Column width';
-$string['regionwidthdesc'] = 'This sets the width of the two block regions that form the left and right columns.';
+$string['region-side-pre'] = 'Left';
@@ -168,7 +168,7 @@
</div>
<div id="footerframeleft">
<div id="footerframeright">
- <!-- the content to show -->
+ <!-- the content to show -->
<div id="footerwrapper">
<?php echo $PAGE->theme->settings->footnote; ?>
</div> <!-- end of footerwrapper -->
@@ -180,7 +180,7 @@
</div>
</div> <!-- </footerframebottom></footerframetop> -->
<?php }
- //manco di una div da chiudere
+ //one more div is waiting to be closed
} else { ?>
@@ -196,7 +196,7 @@
</div> <!-- end of page-footer_noframe-content -->
<?php }
- //manco di una div da chiudere
+ //one more div is waiting to be closed
} ?>
<div class="moodledocsleft">
<?php
@@ -209,7 +209,7 @@
<?php echo page_doc_link(get_string('moodledocslink')); ?>
</div>
</div> <!-- end of page-footer or page-footer_noframe -->
-<?php //ho chiuso la div di cui mancavo prima
+<?php //the waiting div has been closed
}
echo $OUTPUT->standard_end_of_body_html(); ?>
</body>
@@ -180,6 +180,7 @@
</div>
</div> <!-- </footerframebottom></footerframetop> -->
<?php }
+ //one more div is waiting to be closed
} else { ?>
@@ -193,9 +194,8 @@
</div> <!-- end of footerwrapper -->
</div> <!-- end of page-footer_noframe-content -->
<?php }
-
+ //one more div is waiting to be closed
} ?>
-
<div class="moodledocsleft">
<?php
//echo $OUTPUT->login_info();
@@ -207,9 +207,8 @@
<?php echo page_doc_link(get_string('moodledocslink')); ?>
</div>
</div> <!-- end of page-footer or page-footer_noframe -->
-<?php //ho chiuso la div di cui mancavo prima
+<?php //the waiting div has been closed
}
-
echo $OUTPUT->standard_end_of_body_html(); ?>
</body>
</html>
View
@@ -11,46 +11,62 @@
*/
function formal_white_user_settings($css, $theme) {
+ // Set the font reference size
+ if (empty($theme->settings->fontsizereference)) {
+ $fontsizereference = '13'; // default
+ } else {
+ $fontsizereference = $theme->settings->fontsizereference;
+ }
+ $css = formal_white_set_fontsizereference($css, $fontsizereference);
+
// Set the page header background color
if (empty($theme->settings->headerbgc)) {
- $headerbgc = '#E3DFD4'; // default (o forse è meglio #FEF9F6?)
+ $headerbgc = '#E3DFD4'; // default
} else {
$headerbgc = $theme->settings->headerbgc;
}
$css = formal_white_set_headerbgc($css, $headerbgc);
// Set the block content background color
if (empty($theme->settings->blockcontentbgc)) {
- $blockcontentbgc = '#F6F6F6'; // default (o forse è meglio #FEF9F6?)
+ $blockcontentbgc = '#F6F6F6'; // default
} else {
$blockcontentbgc = $theme->settings->blockcontentbgc;
}
$css = formal_white_set_blockcontentbgc($css, $blockcontentbgc);
- // Set the block column background color
- if (empty($theme->settings->blockcolumnbgc)) {
- $blockcolumnbgc = '#E3DFD4'; // default
+ // Set the left block column background color
+ if (empty($theme->settings->lblockcolumnbgc)) {
+ $lblockcolumnbgc = '#E3DFD4'; // default
} else {
- $blockcolumnbgc = $theme->settings->blockcolumnbgc;
+ $lblockcolumnbgc = $theme->settings->lblockcolumnbgc;
}
- $css = formal_white_set_blockcolumnbgc($css, $blockcolumnbgc);
+ $css = formal_white_set_lblockcolumnbgc($css, $lblockcolumnbgc);
- // Set the logo image
- if (!empty($theme->settings->logo)) {
- $logo = $theme->settings->logo;
+ // Set the right block column background color
+ if (empty($theme->settings->rblockcolumnbgc)) {
+ $rblockcolumnbgc = $lblockcolumnbgc; // default
} else {
- $logo = null;
+ $rblockcolumnbgc = $theme->settings->rblockcolumnbgc;
}
- $css = formal_white_set_logo($css, $logo);
+ $css = formal_white_set_rblockcolumnbgc($css, $rblockcolumnbgc);
- // set the width of the two blocks colums
+ // set the width of the two blocks columns
if (!empty($theme->settings->blockcolumnwidth)) {
$blockcolumnwidth = $theme->settings->blockcolumnwidth;
} else {
$blockcolumnwidth = '200'; // default
}
$css = formal_white_set_blockcolumnwidth($css, $blockcolumnwidth);
+ // set the customcss
+ if (!empty($theme->settings->customcss)) {
+ $customcss = $theme->settings->customcss;
+ } else {
+ $customcss = null;
+ }
+ $css = formal_white_set_customcss($css, $customcss);
+
// Return the CSS
return $css;
}
@@ -61,6 +77,12 @@ function formal_white_user_settings($css, $theme) {
* Sets the link color variable in CSS
*
*/
+function formal_white_set_fontsizereference($css, $fontsizereference) {
+ $tag = '[[setting:fontsizereference]]';
+ $css = str_replace($tag, $fontsizereference.'px', $css);
+ return $css;
+}
+
function formal_white_set_headerbgc($css, $headerbgc) {
$tag = '[[setting:headerbgc]]';
$css = str_replace($tag, $headerbgc, $css);
@@ -73,20 +95,15 @@ function formal_white_set_blockcontentbgc($css, $blockcontentbgc) {
return $css;
}
-function formal_white_set_blockcolumnbgc($css, $blockcolumnbgc) {
- $tag = '[[setting:blockcolumnbgc]]';
- $css = str_replace($tag, $blockcolumnbgc, $css);
+function formal_white_set_lblockcolumnbgc($css, $lblockcolumnbgc) {
+ $tag = '[[setting:lblockcolumnbgc]]';
+ $css = str_replace($tag, $lblockcolumnbgc, $css);
return $css;
}
-function formal_white_set_logo($css, $logo) {
- global $OUTPUT;
-
- $tag = '[[setting:logo]]';
- if (is_null($logo)) {
- $logo = $OUTPUT->pix_url('logo', 'theme');
- }
- $css = str_replace($tag, $logo, $css);
+function formal_white_set_rblockcolumnbgc($css, $rblockcolumnbgc) {
+ $tag = '[[setting:rblockcolumnbgc]]';
+ $css = str_replace($tag, $rblockcolumnbgc, $css);
return $css;
}
@@ -101,4 +118,11 @@ function formal_white_set_blockcolumnwidth($css, $blockcolumnwidth) {
$css = str_replace($tag, (2*$blockcolumnwidth).'px', $css);
return $css;
-}
+}
+
+function formal_white_set_customcss($css, $customcss) {
+ $tag = '[[setting:customcss]]';
+ $css = str_replace($tag, $customcss, $css);
+ return $css;
+}
+
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Deleted file not rendered
Oops, something went wrong.

0 comments on commit b396e16

Please sign in to comment.