Skip to content

Commit

Permalink
Adding new core theme splash MDL-23661
Browse files Browse the repository at this point in the history
  • Loading branch information
jstabinger committed Aug 4, 2010
1 parent ff065f9 commit 9e39091
Show file tree
Hide file tree
Showing 68 changed files with 1,740 additions and 0 deletions.
138 changes: 138 additions & 0 deletions theme/splash/config.php
@@ -0,0 +1,138 @@
<?php

$THEME->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.
///////////////////////////////////////////////////////////////
64 changes: 64 additions & 0 deletions 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);
45 changes: 45 additions & 0 deletions theme/splash/lang/en/theme_splash.php
@@ -0,0 +1,45 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* 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!";

0 comments on commit 9e39091

Please sign in to comment.