Permalink
Browse files

MDL-32905 theme_formal_white: changed three setting name, some string…

… name and string content

AMOS BEGIN
 MOV [displaylogodesc,theme_formal_white],[headercontentdesc,theme_formal_white]
 MOV [frontpagelogo,theme_formal_white],[frontpagelogourl,theme_formal_white]
 MOV [frontpagelogodesc,theme_formal_white],[frontpagelogourldesc,theme_formal_white]
 MOV [heading,theme_formal_white],[displayheading,theme_formal_white]
 MOV [logo,theme_formal_white],[customlogourl,theme_formal_white]
 MOV [logodesc,theme_formal_white],[customlogourldesc,theme_formal_white]
 CPY [moodlelogo,theme_formal_white],[displaylogo,theme_formal_white]
AMOS END
  • Loading branch information...
1 parent 238858e commit 9ad11a6c70da361d732453191145dfc8adaf98cd @kordan kordan committed with Sam Hemelryk May 15, 2012
@@ -52,5 +52,29 @@ function xmldb_theme_formal_white_upgrade($oldversion) {
// Moodle v2.2.0 release upgrade line
// Put any upgrade step following this
+ if ($oldversion < 2012051503) {
+ $currentsetting = get_config('theme_formal_white');
+
+ if (isset($currentsetting->displaylogo)) { // useless but safer
+ // Create a new config setting called headercontent and give it the current displaylogo value.
+ set_config('headercontent', $currentsetting->displaylogo, 'theme_formal_white');
+ unset_config('displaylogo', 'theme_formal_white');
+ }
+
+ if (isset($currentsetting->logo)) { // useless but safer
+ // Create a new config setting called headercontent and give it the current displaylogo value.
+ set_config('customlogourl', $currentsetting->logo, 'theme_formal_white');
+ unset_config('logo', 'theme_formal_white');
+ }
+
+ if (isset($currentsetting->frontpagelogo)) { // useless but safer
+ // Create a new config setting called headercontent and give it the current displaylogo value.
+ set_config('frontpagelogourl', $currentsetting->frontpagelogo, 'theme_formal_white');
+ unset_config('frontpagelogo', 'theme_formal_white');
+ }
+
+ upgrade_plugin_savepoint(true, 2012051503, 'theme', 'formal_white');
+ }
+
return true;
}
@@ -58,32 +58,32 @@
<p>This, and all other themes included in the Moodle core, are licensed under the <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>.
</div>
</div>';
+$string['configtitle'] = 'Formal white theme';
$string['creditstomoodleorg'] = 'Display credits to moodle.org';
$string['creditstomoodleorgdesc'] = 'Display the usual small moodle logo at the bottom of the page';
-$string['configtitle'] = 'Formal white theme';
+$string['ctmo_ineverypage'] = 'in every page'; // ctmo == credits to moodle org
$string['ctmo_no'] = 'never'; // ctmo == credits to moodle org
$string['ctmo_onfrontpageonly'] = 'in the front page only'; // ctmo == credits to moodle org
-$string['ctmo_ineverypage'] = 'in every page'; // ctmo == credits to moodle org
$string['customcss'] = 'Custom CSS';
$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['customlogourl'] = 'Custom logo';
+$string['customlogourldesc'] = '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['displayheading'] = 'Display page heading';
+$string['displaylogo'] = 'Display logo';
$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['framemargin'] = 'Frame margin';
$string['framemargindesc'] = 'Room between the frame and the edge of the browser window. (This setting will be ignored if "{$a}" is requested).';
-$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['frontpagelogourl'] = 'Custom front page logo';
+$string['frontpagelogourldesc'] = '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['headercontent'] = 'Header content';
+$string['headercontentdesc'] = 'Choose whether display moodle logo or page heading text in the header.';
$string['lblockcolumnbgc'] = 'Left column background colour';
$string['lblockcolumnbgcdesc'] = 'This sets the left column background colour for the theme.';
-$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.';
$string['pluginname'] = 'Formal white';
@@ -29,17 +29,17 @@
}
/************************************************************************************************/
-if (!empty($PAGE->theme->settings->frontpagelogo)) {
- $logourl = $PAGE->theme->settings->frontpagelogo;
-} else if (!empty($PAGE->theme->settings->logo)) {
- $logourl = $PAGE->theme->settings->logo;
+if (!empty($PAGE->theme->settings->frontpagelogourl)) {
+ $logourl = $PAGE->theme->settings->frontpagelogourl;
+} else if (!empty($PAGE->theme->settings->customlogourl)) {
+ $logourl = $PAGE->theme->settings->customlogourl;
} else {
$logourl = $OUTPUT->pix_url('logo', 'theme');
}
$hasframe = !isset($PAGE->theme->settings->noframe) || !$PAGE->theme->settings->noframe;
-$displaylogo = !isset($PAGE->theme->settings->displaylogo) || $PAGE->theme->settings->displaylogo;
+$displaylogo = !isset($PAGE->theme->settings->headercontent) || $PAGE->theme->settings->headercontent;
/************************************************************************************************/
echo $OUTPUT->doctype() ?>
@@ -29,15 +29,15 @@
}
/************************************************************************************************/
-if (!empty($PAGE->theme->settings->logo)) {
- $logourl = $PAGE->theme->settings->logo;
+if (!empty($PAGE->theme->settings->customlogourl)) {
+ $logourl = $PAGE->theme->settings->customlogourl;
} else {
$logourl = $OUTPUT->pix_url('logo_small', 'theme');
}
$hasframe = !isset($PAGE->theme->settings->noframe) || !$PAGE->theme->settings->noframe;
-$displaylogo = !isset($PAGE->theme->settings->displaylogo) || $PAGE->theme->settings->displaylogo;
+$displaylogo = !isset($PAGE->theme->settings->headercontent) || $PAGE->theme->settings->headercontent;
/************************************************************************************************/
echo $OUTPUT->doctype() ?>
@@ -24,15 +24,15 @@
}
/************************************************************************************************/
-if (!empty($PAGE->theme->settings->logo)) {
- $logourl = $PAGE->theme->settings->logo;
+if (!empty($PAGE->theme->settings->customlogourl)) {
+ $logourl = $PAGE->theme->settings->customlogourl;
} else {
$logourl = $OUTPUT->pix_url('logo_small', 'theme');
}
$hasframe = !isset($PAGE->theme->settings->noframe) || !$PAGE->theme->settings->noframe;
-$displaylogo = !isset($PAGE->theme->settings->displaylogo) || $PAGE->theme->settings->displaylogo;
+$displaylogo = !isset($PAGE->theme->settings->headercontent) || $PAGE->theme->settings->headercontent;
/************************************************************************************************/
echo $OUTPUT->doctype() ?>
@@ -34,26 +34,26 @@
$settings->add($setting);
// Display logo or heading
- $name = 'theme_formal_white/displaylogo';
- $title = get_string('displaylogo','theme_formal_white');
- $description = get_string('displaylogodesc', 'theme_formal_white');
+ $name = 'theme_formal_white/headercontent';
+ $title = get_string('headercontent','theme_formal_white');
+ $description = get_string('headercontentdesc', '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('displaylogo', 'theme_formal_white'), 0=>get_string('displayheading', 'theme_formal_white'));
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$settings->add($setting);
// Custom site logo setting
- $name = 'theme_formal_white/logo';
- $title = get_string('logo','theme_formal_white');
- $description = get_string('logodesc', 'theme_formal_white');
+ $name = 'theme_formal_white/customlogourl';
+ $title = get_string('customlogourl','theme_formal_white');
+ $description = get_string('customlogourldesc', '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');
+ $name = 'theme_formal_white/frontpagelogourl';
+ $title = get_string('frontpagelogourl','theme_formal_white');
+ $description = get_string('frontpagelogourldesc', 'theme_formal_white');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_URL);
$settings->add($setting);
@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die;
-$plugin->version = 2012040302; // The current module version (Date: YYYYMMDDXX)
+$plugin->version = 2012051503; // The current module version (Date: YYYYMMDDXX)
$plugin->requires = 2011081700; // Requires this Moodle version
$plugin->component = 'theme_formal_white';
$plugin->maturity = MATURITY_STABLE;

0 comments on commit 9ad11a6

Please sign in to comment.