]> git.mjollnir.org Git - moodle.git/commitdiff
Modifications to allow parent theme, and some genral cleanups
authormoodler <moodler>
Sun, 30 Jan 2005 18:17:44 +0000 (18:17 +0000)
committermoodler <moodler>
Sun, 30 Jan 2005 18:17:44 +0000 (18:17 +0000)
theme/standard/config.php
theme/standard/styles.css
theme/standard/styles.php
theme/standard/styles_color.css
theme/standard/styles_fonts.css
theme/standard/styles_layout.css
theme/standard/styles_moz.css

index 12b81a115b4da456fdbc1506e2ef0370c9a89264..07b3efe6bd827fbe8d1b010fd30ba45df3f410dd 100644 (file)
@@ -5,15 +5,14 @@
 /// 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_fonts', 'styles_color', 'styles_moz');
+
+/// This variable is an array containing the names of all the 
+/// stylesheet files you want included in this theme, and in what order
 ////////////////////////////////////////////////////////////////////////////////
 
+
 $THEME->standardsheets = true;  
 
 /// This variable can be set to an array containing
@@ -30,6 +29,44 @@ $THEME->standardsheets = true;
 ////////////////////////////////////////////////////////////////////////////////
 
 
+$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->parentsheets = false;  
+
+/// This variable can be set to an array containing
+/// 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
+/// 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.
+////////////////////////////////////////////////////////////////////////////////
+
+
+
 // These colours are not used anymore, so I've set them to 
 // bright green to help identify where they should be removed
 // These lines will be deleted soon
index 81d3e4c510468e3a45fa34ed35712a8c7fa525ba..80a96f774b7de690a51a85c98c93e907282116f3 100644 (file)
@@ -1,4 +1,3 @@
-/*  $Id$ */
 
 .siteinfocontent { }
 
index 12296e23fa01bb747e0d618c63cb6ec2bc546de5..a7295c8dc627f218f379e3ea680a7766fa773f9d 100644 (file)
@@ -4,40 +4,53 @@
 /// up any necessary variables, and lets us include raw CSS files.
 /// The output of this script should be a completely standard CSS file.
 
-    if (!isset($themename)) {
-        $themename = NULL;
-    }
+/// There should be no need to modify this file!!  Use config.php instead.
 
     $nomoodlecookie = true;
     require_once("../../config.php");
 
-/// Following lines are just for standard theme/styles.php
+    $lastmodified = 0;
+    $lifetime = 600;
+
+/// The following lines are only 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');
+        $THEME->sheets = array('styles_layout', 'styles_fonts', 'styles_color', 'styles_moz');
     } else if (empty($THEME->standardsheets)) {                              // We can stop right now!
         exit;
     } else {                                                                 // Use the provided subset only
-        $subsheets = $THEME->standardsheets;
+        $THEME->sheets = $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');
+/// If we are a parent theme, then check for parent definitions
 
-/// There should be no need to touch the following
+    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;
+        }
+    }
 
-    $lastmodified = filemtime('styles.php');
+/// Work out the last modified date for this theme
 
-    foreach ($subsheets as $subsheet) {
-        $lastmodifiedsub = filemtime($subsheet.'.css');
-        if ($lastmodifiedsub > $lastmodified) {
-            $lastmodified = $lastmodifiedsub;
+    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 ($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";
     }
 
 ?>
index 034fb5989e0f15b6822b407d9ea8c934d4587464..1dc029f8908f351ff78c1b99ddeed44e3177de32 100644 (file)
@@ -1,5 +1,3 @@
-/*  $Id$ */
-
 /************************************************* 
 ***
 *** color
index 1cce678d40e7737b0245a6f58bb75f472c406428..149e4a19460bffdca088a3476b4747b31bbf764f 100644 (file)
@@ -1,5 +1,3 @@
-/*  $Id$ */
-
 /************************************************* 
 ***
 *** fonts
@@ -315,4 +313,4 @@ table.calendarmonth tbody td div {
 
 .rssclientdescription {
     font-size:x-small;
-}
\ No newline at end of file
+}
index fb3b113bf25ebcfa1b2993d0c0c565d57443b1bd..41c6217ea49cf04fbc7f48f6e861669940078f90 100644 (file)
@@ -1,5 +1,3 @@
-/*  $Id$ */
-
 /************************************************* 
 ***
 *** layout
index a58b313daf32e25e82ebb18822c0b8655a4f0070..4314923e0602193c691a1a330cbf92152c821061 100644 (file)
@@ -105,4 +105,4 @@ table.calendarmini tbody td {
 .sideblockmain, .sideblocklatestnews, .sideblockrecentactivity, .mycalendar {
     -moz-border-radius-bottomleft:20px;
     -moz-border-radius-bottomright:20px;
-}
\ No newline at end of file
+}