diff --git a/theme/splash/config.php b/theme/splash/config.php new file mode 100644 index 00000000000..8e2a752bd35 --- /dev/null +++ b/theme/splash/config.php @@ -0,0 +1,138 @@ +name = 'splash'; + +//////////////////////////////////////////////////// +// Name of the theme. +//////////////////////////////////////////////////// + + +$THEME->parents = array( + 'canvas', + 'base', +); + +///////////////////////////////////////////////////// +// List exsisting theme(s) to use as parents. +//////////////////////////////////////////////////// + + +$THEME->sheets = array( + 'green','blue','orange','sl','ie', +); + +//////////////////////////////////////////////////// +// Name of the stylesheet(s) you are including in +// this new theme's /styles/ directory. +//////////////////////////////////////////////////// + +$THEME->enable_dock = true; + +//////////////////////////////////////////////////// +// Do you want to use the new navigation dock? +//////////////////////////////////////////////////// + + +$THEME->layouts = array( + // Most pages - if we encounter an unknown or a missing page type, this one is used. + 'base' => array( + 'file' => 'general.php', + 'regions' => array() + ), + 'standard' => array( + 'file' => 'general.php', + 'regions' => array('side-pre', 'side-post'), + 'defaultregion' => 'side-post' + ), + // Course page + 'course' => array( + 'file' => 'general.php', + 'regions' => array('side-pre', 'side-post'), + 'defaultregion' => 'side-post' + ), + // Course page + 'coursecategory' => array( + 'file' => 'general.php', + 'regions' => array('side-pre', 'side-post'), + 'defaultregion' => 'side-post' + ), + 'incourse' => array( + 'file' => 'general.php', + 'regions' => array('side-pre', 'side-post'), + 'defaultregion' => 'side-post' + ), + 'frontpage' => array( + 'file' => 'general.php', + 'regions' => array('side-pre', 'side-post'), + 'defaultregion' => 'side-post' + ), + 'admin' => array( + 'file' => 'general.php', + 'regions' => array('side-pre'), + 'defaultregion' => 'side-pre' + ), + 'mydashboard' => array( + 'file' => 'general.php', + 'regions' => array('side-pre', 'side-post'), + 'defaultregion' => 'side-post' + ), + 'mypublic' => array( + 'file' => 'general.php', + 'regions' => array('side-pre', 'side-post'), + 'defaultregion' => 'side-post' + ), + 'login' => array( + 'file' => 'general.php', + 'regions' => array() + ), + // Pages that appear in pop-up windows - no navigation, no blocks, no header. + 'popup' => array( + 'file' => 'general.php', + 'regions' => array(), + 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>true), + ), + // No blocks and minimal footer - used for legacy frame layouts only! + 'frametop' => array( + 'file' => 'general.php', + 'regions' => array(), + 'options' => array('nofooter', 'noblocks'=>true), + ), + // Embeded pages, like iframe embeded in moodleform + 'embedded' => array( + 'theme' => 'canvas', + 'file' => 'embedded.php', + 'regions' => array(), + 'options' => array('nofooter'=>true, 'nonavbar'=>true), + ), + // Used during upgrade and install, and for the 'This site is undergoing maintenance' message. + // This must not have any blocks, and it is good idea if it does not have links to + // other places - for example there should not be a home link in the footer... + 'maintenance' => array( + 'file' => 'general.php', + 'regions' => array(), + 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>true), + ) +); + + +/////////////////////////////////////////////////////////////// +// These are all of the possible layouts in Moodle. +/////////////////////////////////////////////////////////////// + + +$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 new file mode 100644 index 00000000000..a3ae3671b07 --- /dev/null +++ b/theme/splash/javascript/styleswitcher.js @@ -0,0 +1,64 @@ +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 new file mode 100644 index 00000000000..b875bbec308 --- /dev/null +++ b/theme/splash/lang/en/theme_splash.php @@ -0,0 +1,45 @@ +. + +/** + * Strings for component 'theme_standard', language 'en', branch 'MOODLE_20_STABLE' + * + * @package theme_standard + * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} + * @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['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['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['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 diff --git a/theme/splash/layout/general.php b/theme/splash/layout/general.php new file mode 100644 index 00000000000..83ac2df7a93 --- /dev/null +++ b/theme/splash/layout/general.php @@ -0,0 +1,236 @@ +heading); +$hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar()); +$hasfooter = (empty($PAGE->layout_options['nofooter'])); +$hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT); +$hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT); + +$custommenu = $OUTPUT->custom_menu(); +$hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu)); + +$bodyclasses = array(); +if ($hassidepre && !$hassidepost) { + $bodyclasses[] = 'side-pre-only'; +} else if ($hassidepost && !$hassidepre) { + $bodyclasses[] = 'side-post-only'; +} else if (!$hassidepost && !$hassidepre) { + $bodyclasses[] = 'content-only'; +} + +if (!empty($PAGE->theme->settings->logo)) { + $logourl = $PAGE->theme->settings->logo; +} else { + $logourl = NULL; +} + +if (!empty($PAGE->theme->settings->tagline)) { + $tagline = $PAGE->theme->settings->tagline; +} else { + $tagline = "Virtual Learning Center"; +} + +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() ?> +
+