MDL-24485 fixed lowercase theme names (credit goes to Anthony Borrow) + using get_string() to show real theme name on the theme selection page

This commit is contained in:
Petr Skoda 2010-10-03 10:38:48 +00:00
parent 7f38a28d41
commit edda2b9af6
3 changed files with 7 additions and 6 deletions

View File

@ -100,6 +100,7 @@ foreach ($themes as $themename => $themedir) {
// designer mode is switched off we will respect that decision. // designer mode is switched off we will respect that decision.
continue; continue;
} }
$strthemename = get_string('pluginname', 'theme_'.$themename);
// Build the table row, and also a list of items to go in the second cell. // Build the table row, and also a list of items to go in the second cell.
$row = array(); $row = array();
@ -122,10 +123,10 @@ foreach ($themes as $themename => $themedir) {
// link to the screenshot, now mandatory - the image path is hardcoded because we need image from other themes, not the current one // link to the screenshot, now mandatory - the image path is hardcoded because we need image from other themes, not the current one
$screenshotpath = new moodle_url('/theme/image.php', array('theme'=>$themename, 'image'=>'screenshot','component'=>'theme')); $screenshotpath = new moodle_url('/theme/image.php', array('theme'=>$themename, 'image'=>'screenshot','component'=>'theme'));
// Contents of the first screenshot/preview cell. // Contents of the first screenshot/preview cell.
$row[] = html_writer::empty_tag('img', array('src'=>$screenshotpath, 'alt'=>$themename)); $row[] = html_writer::empty_tag('img', array('src'=>$screenshotpath, 'alt'=>$strthemename));
// Contents of the second cell. // Contents of the second cell.
$infocell = $OUTPUT->heading($themename, 3); $infocell = $OUTPUT->heading($strthemename, 3);
// Button to choose this as the main theme // Button to choose this as the main theme
$maintheme = new single_button(new moodle_url('/theme/index.php', array('choose' => $themename, 'sesskey' => sesskey())), get_string('useformaintheme'), 'get'); $maintheme = new single_button(new moodle_url('/theme/index.php', array('choose' => $themename, 'sesskey' => sesskey())), get_string('useformaintheme'), 'get');
@ -136,9 +137,9 @@ foreach ($themes as $themename => $themedir) {
$legacytheme = new single_button(new moodle_url('/theme/index.php', array('chooselegacy' => $themename, 'sesskey' => sesskey())), get_string('useforlegacytheme'), 'get'); $legacytheme = new single_button(new moodle_url('/theme/index.php', array('chooselegacy' => $themename, 'sesskey' => sesskey())), get_string('useforlegacytheme'), 'get');
$legacytheme->disabled = $ischosenlegacytheme; $legacytheme->disabled = $ischosenlegacytheme;
$infocell .= $OUTPUT->render($legacytheme); $infocell .= $OUTPUT->render($legacytheme);
$row[] = $infocell; $row[] = $infocell;
$table->data[$themename] = $row; $table->data[$themename] = $row;
$table->rowclasses[$themename] = join(' ', $rowclasses); $table->rowclasses[$themename] = join(' ', $rowclasses);
} }

View File

@ -1,5 +1,5 @@
<?php <?php
$string['pluginname'] = 'magazine'; $string['pluginname'] = 'Magazine';
$string['region-side-post'] = 'Right'; $string['region-side-post'] = 'Right';
$string['region-side-pre'] = 'Left'; $string['region-side-pre'] = 'Left';
$string['choosereadme'] = '<div class="clearfix"><div class="theme_screenshot"><h2>Magazine</h2><img src="magazine/pix/screenshot.png" /><h3>Theme Discussion Forum:</h3><p><a href="http://moodle.org/mod/forum/view.php?id=46">http://moodle.org/mod/forum/view.php?id=46</a></p><h3>Theme Credits</h3><p><a href="http://docs.moodle.org/en/Theme_credits">http://docs.moodle.org/en/Theme_credits</a></p><h3>Theme Documentation:</h3><p><a href="http://docs.moodle.org/en/Themes">http://docs.moodle.org/en/Themes</a></p><h3>Report a bug:</h3><p><a href="http://tracker.moodle.org">http://tracker.moodle.org</a></p></div><div class="theme_description"><h2>About</h2><p>Magazine is a three column fluid-width theme for Moodle 2.0. <h2>Tweaks</h2><p>This theme is built upon both Base and Canvas, two parent themes included in the Moodle core. If you want to modify this theme, we recommend that you first duplicate it, then rename it before making your changes. This will prevent your customized theme from being overwritten by future Moodle upgrades, and you\'ll still have the original files if you make a mess. More information on modifying themes can be found in the <a href="http://docs.moodle.org/en/Theme">MoodleDocs</a>.</p><h3>License</h3><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>. Some icons used in this theme are from the Splashy Icon set and are freely available at http://splashyfish.com/icons/. </div></div>'; $string['choosereadme'] = '<div class="clearfix"><div class="theme_screenshot"><h2>Magazine</h2><img src="magazine/pix/screenshot.png" /><h3>Theme Discussion Forum:</h3><p><a href="http://moodle.org/mod/forum/view.php?id=46">http://moodle.org/mod/forum/view.php?id=46</a></p><h3>Theme Credits</h3><p><a href="http://docs.moodle.org/en/Theme_credits">http://docs.moodle.org/en/Theme_credits</a></p><h3>Theme Documentation:</h3><p><a href="http://docs.moodle.org/en/Themes">http://docs.moodle.org/en/Themes</a></p><h3>Report a bug:</h3><p><a href="http://tracker.moodle.org">http://tracker.moodle.org</a></p></div><div class="theme_description"><h2>About</h2><p>Magazine is a three column fluid-width theme for Moodle 2.0. <h2>Tweaks</h2><p>This theme is built upon both Base and Canvas, two parent themes included in the Moodle core. If you want to modify this theme, we recommend that you first duplicate it, then rename it before making your changes. This will prevent your customized theme from being overwritten by future Moodle upgrades, and you\'ll still have the original files if you make a mess. More information on modifying themes can be found in the <a href="http://docs.moodle.org/en/Theme">MoodleDocs</a>.</p><h3>License</h3><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>. Some icons used in this theme are from the Splashy Icon set and are freely available at http://splashyfish.com/icons/. </div></div>';

View File

@ -23,7 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
$string['pluginname'] = 'overlay'; $string['pluginname'] = 'Overlay';
$string['region-side-post'] = 'Right'; $string['region-side-post'] = 'Right';
$string['region-side-pre'] = 'Left'; $string['region-side-pre'] = 'Left';
$string['choosereadme'] = '<div class="clearfix"><div class="theme_screenshot"><h2>overlay</h2><img src="overlay/pix/screenshot.jpg" /><h3>Theme Discussion Forum:</h3><p><a href="http://moodle.org/mod/forum/view.php?id=46">http://moodle.org/mod/forum/view.php?id=46</a></p><h3>Theme Credits</h3><p><a href="http://docs.moodle.org/en/Theme_credits">http://docs.moodle.org/en/Theme_credits</a></p><h3>Theme Documentation:</h3><p><a href="http://docs.moodle.org/en/Themes">http://docs.moodle.org/en/Themes</a></p><h3>Report a bug:</h3><p><a href="http://tracker.moodle.org">http://tracker.moodle.org</a></p></div><div class="theme_description"><h2>About</h2><p>overlay is a nontraditional, three-column, fluid-width theme for Moodle. It\'s nontraditional in the sense that it uses a fresh three-column layout that displays the content to the left of both block columns.<h2>Tweaks</h2><p>This theme is built upon both Base and Canvas, two parent themes included in the Moodle core. If you want to modify this theme, we recommend that you first duplicate it, then rename it before making your changes. This will prevent your customized theme from being overwritten by future Moodle upgrades, and you\'ll still have the original files if you make a mess. More information on modifying themes can be found in the <a href="http://docs.moodle.org/en/Theme">MoodleDocs</a>.</p><h3>License</h3><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['choosereadme'] = '<div class="clearfix"><div class="theme_screenshot"><h2>overlay</h2><img src="overlay/pix/screenshot.jpg" /><h3>Theme Discussion Forum:</h3><p><a href="http://moodle.org/mod/forum/view.php?id=46">http://moodle.org/mod/forum/view.php?id=46</a></p><h3>Theme Credits</h3><p><a href="http://docs.moodle.org/en/Theme_credits">http://docs.moodle.org/en/Theme_credits</a></p><h3>Theme Documentation:</h3><p><a href="http://docs.moodle.org/en/Themes">http://docs.moodle.org/en/Themes</a></p><h3>Report a bug:</h3><p><a href="http://tracker.moodle.org">http://tracker.moodle.org</a></p></div><div class="theme_description"><h2>About</h2><p>overlay is a nontraditional, three-column, fluid-width theme for Moodle. It\'s nontraditional in the sense that it uses a fresh three-column layout that displays the content to the left of both block columns.<h2>Tweaks</h2><p>This theme is built upon both Base and Canvas, two parent themes included in the Moodle core. If you want to modify this theme, we recommend that you first duplicate it, then rename it before making your changes. This will prevent your customized theme from being overwritten by future Moodle upgrades, and you\'ll still have the original files if you make a mess. More information on modifying themes can be found in the <a href="http://docs.moodle.org/en/Theme">MoodleDocs</a>.</p><h3>License</h3><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>';