<p>Programmers working on Moodle should always design for this
theme, and add new styles to this theme.</p>
-<p>Other themes should always reference the style sheet from
-this theme before defining their own styles to augment or
-replace the standard styles. In this way custom themes
-are not as affected by Moodle upgrades.</p>
-
-
-<p>The standard stylesheet is:
-<pre>
- $CFG->wwwroot/theme/standard/styles.php
-</pre>
-</p>
+<p>By default, these styles are automatically loaded before any other
+themes, so that all custom themes need to do is to define their
+own styles to augment or overwrite particular standard styles.</p>
+<p>In this way custom themes are not "left behind" by Moodle upgrades.</p>
<?PHP // $Id$
+////////////////////////////////////////////////////////////////////////////////
+/// This file contains a few configuration variables that control
+/// how Moodle uses this theme.
+////////////////////////////////////////////////////////////////////////////////
+
+$THEME->custompix = false;
+
+/// If true, then this theme must have a "pix"
+/// subdirectory that contains copies of all
+/// files from the moodle/pix directory, plus a
+/// "pix/mod" directory containing all the icons
+/// for all the activity modules.
+////////////////////////////////////////////////////////////////////////////////
+
+$THEME->standardsheets = true;
+
+/// This variable can be set to an array containing
+/// filenames from the *STANDARD* theme. If the
+/// array exists, it will be used to choose the
+/// files to include in the standard style sheet.
+/// When false or non-existent, then no files are used.
+/// When true, then ALL standard files are used.
+/// This parameter can be used, for example, to prevent
+/// having to override too many classes.
+/// Note that the trailing .css should not be included
+/// eg $THEME->standardsheets = array('styles_layout', 'styles_fonts',
+/// 'styles_color', 'styles_moz');
+////////////////////////////////////////////////////////////////////////////////
+
+
// These colours are not used anymore, so I've set them to
-// bright red to help identify where they should be removed
+// bright green to help identify where they should be removed
+// These lines will be deleted soon
$THEME->body = "#22FF22"; // Main page color
$THEME->cellheading = "#22FF22"; // Standard headings of big tables
$THEME->hidden = "#22FF22"; // To color things that are hidden
$THEME->autolink = "#22FF22"; // To color auto-generated links (eg glossary)
-$THEME->custompix = false; // If true, then this theme must have a "pix"
- // subdirectory that contains copies of all
- // files from the moodle/pix directory
- // See "cordoroyblue" for an up-to-date example.
?>
/// up any necessary variables, and lets us include raw CSS files.
/// The output of this script should be a completely standard CSS file.
-
-/// These are the stylesheets this theme uses
- $subsheets = array('styles_layout.css', 'styles_fonts.css', 'styles_color.css', 'styles_moz.css');
-
-
-/// There should be no need to touch the following
-
if (!isset($themename)) {
$themename = NULL;
}
$nomoodlecookie = true;
require_once("../../config.php");
+/// Following lines are just for standard theme/styles.php
+ if (!isset($THEME->standardsheets) or $THEME->standardsheets === true) { // Use all the sheets we have
+ $subsheets = array('styles_layout', 'styles_fonts', 'styles_color', 'styles_moz');
+ } else if ($THEME->standardsheets === false) { // We can stop right now!
+ exit;
+ } else { // Use the provided subset only
+ $subsheets = $THEME->standardsheets;
+ }
+
+/// Normal themes will just use a line like this instead of the above.
+/// $subsheets = array('styles_layout', 'styles_fonts', 'styles_color', 'styles_moz');
+
+/// There should be no need to touch the following
+
$lastmodified = filemtime('styles.php');
foreach ($subsheets as $subsheet) {
- $lastmodifiedsub = filemtime($subsheet);
+ $lastmodifiedsub = filemtime($subsheet.'.css');
if ($lastmodifiedsub > $lastmodified) {
$lastmodified = $lastmodifiedsub;
}
$themeurl = style_sheet_setup($lastmodifiedsub, 600, $themename);
foreach ($subsheets as $subsheet) {
- include_once($subsheet);
+ include_once($subsheet.'.css');
}
?>