diff --git a/theme/splash/config.php b/theme/splash/config.php index 8e2a752bd35..6bb92792ea2 100644 --- a/theme/splash/config.php +++ b/theme/splash/config.php @@ -1,5 +1,28 @@ . + +/** + * Config for the splash theme + * + * @package theme_splash + * @copyright 2010 Caroline Kennedy of Synergy Learning + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + $THEME->name = 'splash'; //////////////////////////////////////////////////// @@ -8,8 +31,8 @@ $THEME->name = 'splash'; $THEME->parents = array( - 'canvas', - 'base', + 'canvas', + 'base', ); ///////////////////////////////////////////////////// @@ -18,7 +41,11 @@ $THEME->parents = array( $THEME->sheets = array( - 'green','blue','orange','sl','ie', + 'sl', + 'green', + 'blue', + 'orange', + 'ie', ); //////////////////////////////////////////////////// @@ -127,12 +154,4 @@ $THEME->csspostprocess = 'splash_process_css'; /////////////////////////////////////////////////////////////// // Splash Theme Specific settings for Administrators to customise // css. -/////////////////////////////////////////////////////////////// - - - -$THEME->javascripts = array('styleswitcher'); - -/////////////////////////////////////////////////////////////// -// Referencing the javascript files required for theme elements. /////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/theme/splash/javascript/styleswitcher.js b/theme/splash/javascript/styleswitcher.js deleted file mode 100644 index a3ae3671b07..00000000000 --- a/theme/splash/javascript/styleswitcher.js +++ /dev/null @@ -1,64 +0,0 @@ -function setActiveStyleSheet(title) { - var i, a, main; - for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { - if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { - a.disabled = true; - if(a.getAttribute("title") == title) a.disabled = false; - } - } -} - -function getActiveStyleSheet() { - var i, a; - for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { - if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title"); - } - return null; -} - -function getPreferredStyleSheet() { - var i, a; - for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { - if(a.getAttribute("rel").indexOf("style") != -1 - && a.getAttribute("rel").indexOf("alt") == -1 - && a.getAttribute("title") - ) return a.getAttribute("title"); - } - return null; -} - -function createCookie(name,value,days) { - if (days) { - var date = new Date(); - date.setTime(date.getTime()+(days*24*60*60*1000)); - var expires = "; expires="+date.toGMTString(); - } - else expires = ""; - document.cookie = name+"="+value+expires+"; path=/"; -} - -function readCookie(name) { - var nameEQ = name + "="; - var ca = document.cookie.split(';'); - for(var i=0;i < ca.length;i++) { - var c = ca[i]; - while (c.charAt(0)==' ') c = c.substring(1,c.length); - if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); - } - return null; -} - -window.onload = function(e) { - var cookie = readCookie("style"); - var title = cookie ? cookie : getPreferredStyleSheet(); - setActiveStyleSheet(title); -} - -window.onunload = function(e) { - var title = getActiveStyleSheet(); - createCookie("style", title, 365); -} - -var cookie = readCookie("style"); -var title = cookie ? cookie : getPreferredStyleSheet(); -setActiveStyleSheet(title); diff --git a/theme/splash/lang/en/theme_splash.php b/theme/splash/lang/en/theme_splash.php index b875bbec308..d0f5f287757 100644 --- a/theme/splash/lang/en/theme_splash.php +++ b/theme/splash/lang/en/theme_splash.php @@ -16,30 +16,28 @@ // along with Moodle. If not, see . /** - * Strings for component 'theme_standard', language 'en', branch 'MOODLE_20_STABLE' + * Strings for component 'theme_splash', language 'en' * * @package theme_standard - * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} + * @copyright 2010 Caroline Kennedy of Synergy Learning * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['pluginname'] = 'Splash'; -$string['choosereadme'] = 'Splash, a Moodle 2.0 theme by Caroline Kennedy of Synergy Learning)'; +$string['choosereadme'] = 'Splash, a Moodle 2.0 theme by Caroline Kennedy of Synergy Learning'; $string['configtitle'] = 'Splash Theme Settings'; $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['defaulttagline'] = 'Virtual learning center'; $string['footnote'] = 'Footnote'; $string['footnotedesc'] = 'The content from this textarea will be displayed in the footer of every page. E.g: your copyright info.'; -$string['tagline'] = 'Tagline'; -$string['taglinedesc'] = 'The content from this textarea will be displayed under the Site logo on the Homepage'; $string['hide_tagline'] = 'Hide Tagline'; $string['hide_taglinedesc'] = 'Check this box to hide the tagline under the logo.'; - - +$string['loginhere'] = "Login here!"; $string['logo'] = 'Logo'; $string['logodesc'] = 'Enter the URL to an image to use as the logo for this site. E.g: http://www.yoursite.com/path/to/logo.png. The logo should be max 230px wide.'; - - -$string['welcome'] = "Welcome"; -$string['loginhere'] = "Login here!"; \ No newline at end of file +$string['pluginname'] = 'Splash'; +$string['tagline'] = 'Tagline'; +$string['taglinedesc'] = 'The content from this textarea will be displayed under the Site logo on the Homepage'; +$string['usergreeting'] = 'Hi {$a}!'; +$string['welcome'] = 'Welcome, {$a}'; \ No newline at end of file diff --git a/theme/splash/layout/general.php b/theme/splash/layout/general.php index 83ac2df7a93..09da6af83a5 100644 --- a/theme/splash/layout/general.php +++ b/theme/splash/layout/general.php @@ -9,7 +9,11 @@ $hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT); $custommenu = $OUTPUT->custom_menu(); $hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu)); +splash_check_colourswitch(); +splash_initialise_colourswitcher($PAGE); + $bodyclasses = array(); +$bodyclasses[] = 'splash-'.splash_get_colour(); if ($hassidepre && !$hassidepost) { $bodyclasses[] = 'side-pre-only'; } else if ($hassidepost && !$hassidepre) { @@ -18,219 +22,144 @@ if ($hassidepre && !$hassidepost) { $bodyclasses[] = 'content-only'; } -if (!empty($PAGE->theme->settings->logo)) { - $logourl = $PAGE->theme->settings->logo; -} else { - $logourl = NULL; -} +$haslogo = (!empty($PAGE->theme->settings->logo)); +$hasfootnote = (!empty($PAGE->theme->settings->footnote)); +$hidetagline = (!empty($PAGE->theme->settings->hide_tagline) && $PAGE->theme->settings->hide_tagline == 1); if (!empty($PAGE->theme->settings->tagline)) { $tagline = $PAGE->theme->settings->tagline; } else { - $tagline = "Virtual Learning Center"; + $tagline = get_string('defaulttagline', 'theme_splash'); } -if (!empty($PAGE->theme->settings->footnote)) { - $footnote = $PAGE->theme->settings->footnote; -} else { - $footnote = ""; -} - -if (!empty($PAGE->theme->settings->hide_tagline) && $PAGE->theme->settings->hide_tagline == 1) -{ - $hidetagline = $PAGE->theme->settings->hide_tagline; -} else { - $hidetagline = ""; -} - - - echo $OUTPUT->doctype() ?> +htmlattributes() ?>> <?php echo $PAGE->title ?> standard_head_html() ?> - - - - - - - - - - -standard_top_of_body_html() ?> - - -
- - -