MDL-28459 theme-formal_white Added option to specify a special logo for use on the...
authorKordan <kordan@mclink.it>
Sun, 28 Aug 2011 23:52:15 +0000 (11:52 +1200)
committerSam Hemelryk <sam@moodle.com>
Sun, 28 Aug 2011 23:53:55 +0000 (11:53 +1200)
theme/formal_white/lang/en/theme_formal_white.php
theme/formal_white/layout/frontpage.php
theme/formal_white/lib.php
theme/formal_white/settings.php
theme/formal_white/style/formal_white.css
theme/formal_white/style/menu.css

index ed5de00..47d3860 100644 (file)
@@ -65,13 +65,15 @@ $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['frontpagelogo'] = 'Custom front page logo';
+$string['frontpagelogodesc'] = 'Change the logo that is displayed on the front page of your site by entering the URL to the image you wish to use (i.e. http://www.yoursite.local/myfrontpagelogo.png). This setting overrides the custom logo setting. As a reference the default logo is 300px wide, 80px high and a transparent png will work best.';
 $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['logo'] = 'Custom logo';
+$string['logodesc'] = 'Change the logo for this theme by entering the URL to an image you wish to use (i.e. http://www.yoursite.local/mylogo.png). As a reference the default logo is 200px wide, 50px high and a transparent png will work best.';
 $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.';
index 2c0cd10..c8b8274 100644 (file)
@@ -29,7 +29,9 @@ if ($hascustommenu) {
 }
 
 /************************************************************************************************/
-if (!empty($PAGE->theme->settings->logo)) {
+if (!empty($PAGE->theme->settings->frontpagelogo)) {
+    $logourl = $PAGE->theme->settings->frontpagelogo;
+} else if (!empty($PAGE->theme->settings->logo)) {
     $logourl = $PAGE->theme->settings->logo;
 } else {
     $logourl = $OUTPUT->pix_url('logo', 'theme');
index 13ad0b5..2869b80 100644 (file)
@@ -21,7 +21,7 @@ function formal_white_user_settings($css, $theme) {
 
     // Set the page header background color
     if (empty($theme->settings->headerbgc)) {
-        $headerbgc = '#E3DFD4'; // default 
+        $headerbgc = '#E3DFD4'; // default
     } else {
         $headerbgc = $theme->settings->headerbgc;
     }
@@ -124,5 +124,4 @@ function formal_white_set_customcss($css, $customcss) {
     $tag = '[[setting:customcss]]';
     $css = str_replace($tag, $customcss, $css);
     return $css;
-}
-
+}
\ No newline at end of file
index 64826cb..973c033 100644 (file)
@@ -29,11 +29,11 @@ if ($ADMIN->fulltree) {
     $title = get_string('displaylogo','theme_formal_white');
     $description = get_string('displaylogodesc', 'theme_formal_white');
     $default = '1';
-    $choices = array(1=>get_string('moodlelogo', 'theme_formal_white'),0=>get_string('heading', 'theme_formal_white'));
+    $choices = array(1=>get_string('moodlelogo', 'theme_formal_white'), 0=>get_string('heading', 'theme_formal_white'));
     $setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
     $settings->add($setting);
 
-    // Logo file setting
+    // Custom site logo setting
     $name = 'theme_formal_white/logo';
     $title = get_string('logo','theme_formal_white');
     $description = get_string('logodesc', 'theme_formal_white');
@@ -41,6 +41,14 @@ if ($ADMIN->fulltree) {
     $setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_URL);
     $settings->add($setting);
 
+    // Custom front page site logo setting
+    $name = 'theme_formal_white/frontpagelogo';
+    $title = get_string('frontpagelogo','theme_formal_white');
+    $description = get_string('frontpagelogodesc', 'theme_formal_white');
+    $default = '';
+    $setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_URL);
+    $settings->add($setting);
+
     // page header background colour setting
     $name = 'theme_formal_white/headerbgc';
     $title = get_string('headerbgc','theme_formal_white');
@@ -50,6 +58,15 @@ if ($ADMIN->fulltree) {
     $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
     $settings->add($setting);
 
+    // Block region width
+    $name = 'theme_formal_white/blockcolumnwidth';
+    $title = get_string('blockcolumnwidth','theme_formal_white');
+    $description = get_string('blockcolumnwidthdesc', 'theme_formal_white');
+    $default = '200';
+    $choices = array(150=>'150px', 170=>'170px', 200=>'200px', 240=>'240px', 290=>'290px', 350=>'350px', 420=>'420px');
+    $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');
@@ -77,15 +94,6 @@ if ($ADMIN->fulltree) {
     $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
     $settings->add($setting);
 
-    // Block region width
-    $name = 'theme_formal_white/blockcolumnwidth';
-    $title = get_string('blockcolumnwidth','theme_formal_white');
-    $description = get_string('blockcolumnwidthdesc', 'theme_formal_white');
-    $default = '200';
-    $choices = array(150=>'150px', 170=>'170px', 200=>'200px', 240=>'240px', 290=>'290px', 350=>'350px', 420=>'420px');
-    $setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
-    $settings->add($setting);
-
     // Foot note setting
     $name = 'theme_formal_white/footnote';
     $title = get_string('footnote','theme_formal_white');
index b458b4e..33f2e02 100644 (file)
@@ -25,9 +25,9 @@ h2.main, h3.main, h4.main {margin:0;padding:0;text-align: center;}
 h1.headerheading {margin:14px 11px 8px 11px;float:left;font-size:200%;}
 
 /* headermenu */
-#page-header{line-height:0;}
+#page-header{line-height:0;overflow:hidden;}
 /*#headerlogo img {margin:7px;}*/
-.headermenu {position:relative;line-height:1.7em;font-size:90%;margin:0.3em 0.3em 0 0;right:0.3em;margin-bottom:0.3em;}
+.headermenu {position:relative;line-height:1.7em;font-size:90%;margin:0.3em 0.3em 0.3em 0;right:0.3em;}
 
 #dock {background-color:[[setting:blockcontentbgc]];border-right:1px #000 dashed;}
 #dock .dockeditem_container {margin-top: 10px;}
@@ -45,16 +45,16 @@ h1.headerheading {margin:14px 11px 8px 11px;float:left;font-size:200%;}
 .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;
+    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;
+    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,
index d4da06e..db94755 100644 (file)
@@ -101,11 +101,11 @@ div.yui3-menu-content {
 
 /* cancellazione della bordatura superiore alla lista delle voci di menu */
 .yui3-skin-sam .yui3-menu .yui3-menu {
-       border-top:none;
-       padding-left:-1px;
-       border-right:1px #CCC solid;
-       border-bottom:1px #CCC solid;
-       border-left:1px #CCC solid;
+    border-top:none;
+    padding-left:-1px;
+    border-right:1px #CCC solid;
+    border-bottom:1px #CCC solid;
+    border-left:1px #CCC solid;
 }
 
 /* color of selected item in FF */