summaryrefslogtreecommitdiff
path: root/lib/exe/css.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2005-11-27 13:18:49 +0100
committerAndreas Gohr <andi@splitbrain.org>2005-11-27 13:18:49 +0100
commit519b3173fdfbf6418e4d1d8df87ec70dac7ffc60 (patch)
treeaa023ee1065a270994bc96d6339967114deba888 /lib/exe/css.php
parente35e4cbd1e93fb350d9ed782597d68f5a3df5db8 (diff)
downloadrpg-519b3173fdfbf6418e4d1d8df87ec70dac7ffc60.tar.gz
rpg-519b3173fdfbf6418e4d1d8df87ec70dac7ffc60.tar.bz2
Template stylesheets are now defined in sytle.ini
Which stylesheets should be loaded for a template is now defined in the style.ini file. IMPORTANT: template designers need to adjust their style.ini darcs-hash:20051127121849-7ad00-cf5b4d608d72bc9ed57766298a3942c3a2ec88f9.gz
Diffstat (limited to 'lib/exe/css.php')
-rw-r--r--lib/exe/css.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/exe/css.php b/lib/exe/css.php
index 74efe71b6..e1d09fa3b 100644
--- a/lib/exe/css.php
+++ b/lib/exe/css.php
@@ -35,22 +35,29 @@ function css_out(){
// The generated script depends on some dynamic options
$cache = getCacheName('styles'.$print,'.css');
+ // load template styles
+ $tplstyles = array();
+ if(@file_exists(DOKU_TPLINC.'style.ini')){
+ $ini = parse_ini_file(DOKU_TPLINC.'style.ini',true);
+ foreach($ini['stylesheets'] as $file => $mode){
+ $tplstyles[$mode][DOKU_TPLINC.$file] = DOKU_TPL;
+ }
+ }
+
// Array of needed files and their web locations, the latter ones
// are needed to fix relative paths in the stylesheets
$files = array();
if($print){
$files[DOKU_TPLINC.'print.css'] = DOKU_TPL;
+ $files = array_merge($files, $tplstyles['print']);
// load plugin styles
$files = array_merge($files, css_pluginstyles('print'));
$files[DOKU_CONF.'userprint.css'] = '';
}else{
$files[DOKU_INC.'lib/styles/style.css'] = DOKU_BASE.'lib/styles/';
- //fixme extra spellchecker style?
- $files[DOKU_TPLINC.'layout.css'] = DOKU_TPL;
- $files[DOKU_TPLINC.'design.css'] = DOKU_TPL;
- $files[DOKU_TPLINC.'style.css'] = DOKU_TPL;
+ $files = array_merge($files, $tplstyles['screen']);
if($lang['direction'] == 'rtl'){
- $files[DOKU_TPLINC.'rtl.css'] = DOKU_TPL;
+ $files = array_merge($files, $tplstyles['rtl']);
}
// load plugin styles
$files = array_merge($files, css_pluginstyles('screen'));
@@ -126,8 +133,8 @@ function css_cacheok($cache,$files){
*/
function css_applystyle($css){
if(@file_exists(DOKU_TPLINC.'style.ini')){
- $ini = parse_ini_file(DOKU_TPLINC.'style.ini');
- $css = strtr($css,$ini);
+ $ini = parse_ini_file(DOKU_TPLINC.'style.ini',true);
+ $css = strtr($css,$ini['replacements']);
}
return $css;
}