mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Really big cleanup of how "forced" themes were implemented.
Course themes now work better. theme/xxxx/styles.php is now really short because all the logic is in weblib.php.
- Loading branch information
moodler
committed
Feb 13, 2005
1 parent
373d5f2
commit 9c4e6e2
Showing
4 changed files
with
99 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,18 @@ | ||
<?PHP /* $Id$ */ | ||
|
||
/// This PHP script is used because it provides a place for setting | ||
/// up any necessary variables, and lets us include raw CSS files. | ||
/// Every theme should contain a copy of this script. It lets us | ||
/// set up variables and so on before we include the raw CSS files. | ||
/// The output of this script should be a completely standard CSS file. | ||
|
||
/// There should be no need to modify this file!! Use config.php instead. | ||
/// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. | ||
|
||
$nomoodlecookie = true; | ||
require_once("../../config.php"); | ||
|
||
if (isset($localconfig)) { | ||
unset($THEME); | ||
include('config.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; | ||
} | ||
} | ||
|
||
/// Work out the last modified date for this theme | ||
|
||
foreach ($THEME->sheets as $sheet) { | ||
if (file_exists($sheet.'.css')) { | ||
$sheetmodified = @filemtime($sheet.'.css'); | ||
if ($sheetmodified > $lastmodified) { | ||
$lastmodified = $sheetmodified; | ||
} | ||
} | ||
} | ||
|
||
/// Print out the entire style sheet | ||
|
||
style_sheet_setup($lastmodified, $lifetime); | ||
|
||
foreach ($THEME->sheets as $sheet) { | ||
echo "/***** $sheet.css start *****/\n\n"; | ||
include_once($sheet.'.css'); | ||
echo "\n\n/***** $sheet.css end *****/\n\n"; | ||
} | ||
$lifetime = 600; // Seconds to cache this stylesheet | ||
$nomoodlecookie = true; // Cookies prevent caching, so don't use them | ||
require_once("../../config.php"); // Load up the Moodle libraries | ||
$themename = basename(dirname(__FILE__)); // Name of the folder we are in | ||
$forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme | ||
|
||
style_sheet_setup(filemtime('styles.php'), $lifetime, $themename, $forceconfig); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,18 @@ | ||
<?PHP /* $Id$ */ | ||
|
||
/// This PHP script is used because it provides a place for setting | ||
/// up any necessary variables, and lets us include raw CSS files. | ||
/// Every theme should contain a copy of this script. It lets us | ||
/// set up variables and so on before we include the raw CSS files. | ||
/// The output of this script should be a completely standard CSS file. | ||
|
||
/// There should be no need to modify this file!! Use config.php instead. | ||
/// THERE SHOULD BE NO NEED TO MODIFY THIS FILE!! USE CONFIG.PHP INSTEAD. | ||
|
||
$nomoodlecookie = true; | ||
require_once("../../config.php"); | ||
|
||
if (isset($localconfig)) { | ||
unset($THEME); | ||
include('config.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 | ||
$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 | ||
$THEME->sheets = $THEME->standardsheets; | ||
} | ||
|
||
/// 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; | ||
} | ||
} | ||
|
||
/// Work out the last modified date for this theme | ||
|
||
foreach ($THEME->sheets as $sheet) { | ||
if (file_exists($sheet.'.css')) { | ||
$sheetmodified = filemtime($sheet.'.css'); | ||
if ($sheetmodified > $lastmodified) { | ||
$lastmodified = $sheetmodified; | ||
} | ||
} | ||
} | ||
|
||
/// Print out the entire style sheet | ||
|
||
style_sheet_setup($lastmodified, $lifetime); | ||
|
||
foreach ($THEME->sheets as $sheet) { | ||
echo "/***** $sheet.css start *****/\n\n"; | ||
include_once($sheet.'.css'); | ||
echo "\n\n/***** $sheet.css end *****/\n\n"; | ||
} | ||
$lifetime = 600; // Seconds to cache this stylesheet | ||
$nomoodlecookie = true; // Cookies prevent caching, so don't use them | ||
require_once("../../config.php"); // Load up the Moodle libraries | ||
$themename = basename(dirname(__FILE__)); // Name of the folder we are in | ||
$forceconfig = optional_param('forceconfig', '', PARAM_FILE); // Get config from this theme | ||
|
||
style_sheet_setup(filemtime('styles.php'), $lifetime, $themename, $forceconfig); | ||
|
||
?> |