Skip to content

Commit

Permalink
MDL-28459 theme-formal_white Added option to specify a special logo f…
Browse files Browse the repository at this point in the history
…or use on the frontpage
  • Loading branch information
Kordan authored and Sam Hemelryk committed Aug 28, 2011
1 parent 5494168 commit ec14075
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 32 deletions.
6 changes: 4 additions & 2 deletions theme/formal_white/lang/en/theme_formal_white.php
Expand Up @@ -65,13 +65,15 @@
$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.';
Expand Down
4 changes: 3 additions & 1 deletion theme/formal_white/layout/frontpage.php
Expand Up @@ -29,7 +29,9 @@
}

/************************************************************************************************/
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');
Expand Down
5 changes: 2 additions & 3 deletions theme/formal_white/lib.php
Expand Up @@ -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;
}
Expand Down Expand Up @@ -124,5 +124,4 @@ function formal_white_set_customcss($css, $customcss) {
$tag = '[[setting:customcss]]';
$css = str_replace($tag, $customcss, $css);
return $css;
}

}
30 changes: 19 additions & 11 deletions theme/formal_white/settings.php
Expand Up @@ -29,18 +29,26 @@
$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');
$default = '';
$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');
Expand All @@ -50,6 +58,15 @@
$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');
Expand Down Expand Up @@ -77,15 +94,6 @@
$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');
Expand Down
20 changes: 10 additions & 10 deletions theme/formal_white/style/formal_white.css
Expand Up @@ -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;}
Expand All @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions theme/formal_white/style/menu.css
Expand Up @@ -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 */
Expand Down

0 comments on commit ec14075

Please sign in to comment.