]> git.mjollnir.org Git - moodle.git/commitdiff
Updated to latest styles.php and config.php
authormoodler <moodler>
Sun, 30 Jan 2005 18:21:54 +0000 (18:21 +0000)
committermoodler <moodler>
Sun, 30 Jan 2005 18:21:54 +0000 (18:21 +0000)
theme/orangewhite/config.php
theme/orangewhite/styles.php

index 49bfc7473049c9f06ef88881a88a13553344f157..9638eaca1e82f1b4c53662dfb6b8c03c8a775a28 100644 (file)
@@ -5,34 +5,64 @@
 /// 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->sheets = array('styles_layout', 'styles_font', 'styles_color');
+
+/// This variable is an array containing the names of all the 
+/// stylesheet files you want included in this theme, and in what order
 ////////////////////////////////////////////////////////////////////////////////
 
-$THEME->subsheets = array('styles_layout', 'styles_font', 'styles_color');
 
-/// This array specifies the names of .css files from the current 
-/// directory that you want to be loaded for this theme.
+$THEME->standardsheets = false;  
+
+/// 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, then no files are used.
+/// When true or NON-EXISTENT, 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');
+////////////////////////////////////////////////////////////////////////////////
+
+
+$THEME->parent = '';  
+
+/// This variable can be set to the name of a parent theme
+/// which you want to have included before the current theme.
+/// This can make it easy to make modifications to another 
+/// theme without having to actually change the files
+/// If this variable is empty or false then a parent theme 
+/// is not used.
 ////////////////////////////////////////////////////////////////////////////////
 
 
-$THEME->standardsheets = false;
+$THEME->parentsheets = false;  
 
 /// This variable can be set to an array containing
-/// filenames from the *STANDARD* theme.  If the 
+/// filenames from a chosen *PARENT* theme.  If the 
 /// array exists, it will be used to choose the 
 /// files to include in the standard style sheet.
 /// When false, then no files are used.
 /// When true or NON-EXISTENT, 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
+/// Note that the trailing .css should not be included
 /// eg $THEME->standardsheets = array('styles_layout', 'styles_fonts', 
 ///                                   'styles_color', 'styles_moz');
 ////////////////////////////////////////////////////////////////////////////////
 
+
+$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.
+////////////////////////////////////////////////////////////////////////////////
+
+?>
index 97621a943b9fb7a054d78a3468574fc712bc8023..fc007906b1eb4569ef935d1724db6349ddb27d4f 100644 (file)
@@ -4,28 +4,43 @@
 /// up any necessary variables, and lets us include raw CSS files.
 /// The output of this script should be a completely standard CSS file.
 
-/// THERE IS USUALLY NO NEED TO EDIT THIS FILE!  See config.php
-
-    if (!isset($themename)) {
-        $themename = NULL;
-    }
+/// There should be no need to modify this file!!  Use config.php instead.
 
     $nomoodlecookie = true;
     require_once("../../config.php");
 
-    $lastmodified = filemtime('styles.php');
+    $lastmodified = 0;
+    $lifetime = 600;
+
+/// If we are a parent theme, then check for parent definitions
+
+    if (isset($parent)) {
+        if (!isset($THEME->parentsheets) or $THEME->parentsheets === true) {     // Use all the sheets we have
+            $THEME->sheets = array('styles_layout', 'styles_fonts', 'styles_color', 'styles_moz');
+        } else if (empty($THEME->parentsheets)) {                                // We can stop right now!
+            exit;
+        } else {                                                                 // Use the provided subset only
+            $THEME->sheets = $THEME->parentsheets;
+        }
+    }
 
-    foreach ($THEME->subsheets as $subsheet) {
-        $lastmodifiedsub = filemtime($subsheet.'.css');
-        if ($lastmodifiedsub > $lastmodified) {
-            $lastmodified = $lastmodifiedsub;
+/// Work out the last modified date for this theme
+
+    foreach ($THEME->sheets as $sheet) {
+        $sheetmodified = filemtime($sheet.'.css');
+        if ($sheetmodified > $lastmodified) {
+            $lastmodified = $sheetmodified;
         }
     }
 
-    $themeurl = style_sheet_setup($lastmodifiedsub, 600, $themename);
+/// Print out the entire style sheet
+
+    style_sheet_setup($lastmodified, $lifetime);
 
-    foreach ($THEME->subsheets as $subsheet) {
-        include_once($subsheet.'.css');
+    foreach ($THEME->sheets as $sheet) {
+        echo "/***** $sheet.css start *****/\n\n";
+        include_once($sheet.'.css');
+        echo "\n\n/***** $sheet.css end *****/\n\n";
     }
 
 ?>