summaryrefslogtreecommitdiff
path: root/lib/exe
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2015-01-08 12:06:46 +0100
committerAndreas Gohr <andi@splitbrain.org>2015-01-08 12:06:46 +0100
commit32e9be23a7c06ab5c4515e1f72809c67da2e9441 (patch)
tree4e4dffd7876368d21acc8cadd731bbc16bebf26f /lib/exe
parentf25cd1636fcec40f99f368d9dfb61c0812ed575c (diff)
parentfc30ac3acbd4e17e25955ccdd0c5539ee2c9beca (diff)
downloadrpg-32e9be23a7c06ab5c4515e1f72809c67da2e9441.tar.gz
rpg-32e9be23a7c06ab5c4515e1f72809c67da2e9441.tar.bz2
Merge pull request #982 from gamma/css.php
Allow arbitrary mediatype names for CSS
Diffstat (limited to 'lib/exe')
-rw-r--r--lib/exe/css.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/exe/css.php b/lib/exe/css.php
index e0bc68312..3b8bc80bc 100644
--- a/lib/exe/css.php
+++ b/lib/exe/css.php
@@ -32,24 +32,25 @@ function css_out(){
global $config_cascade;
global $INPUT;
+ // decide from where to get the template
+ $tpl = trim(preg_replace('/[^\w-]+/','',$INPUT->str('t')));
+ if(!$tpl) $tpl = $conf['template'];
+
+ // load styl.ini
+ $styleini = css_styleini($tpl);
+
+ // find mediatypes
if ($INPUT->str('s') == 'feed') {
$mediatypes = array('feed');
$type = 'feed';
} else {
- $mediatypes = array('screen', 'all', 'print');
+ $mediatypes = array_unique(array_merge(array('screen', 'all', 'print'), array_keys($styleini['stylesheets'])));
$type = '';
}
- // decide from where to get the template
- $tpl = trim(preg_replace('/[^\w-]+/','',$INPUT->str('t')));
- if(!$tpl) $tpl = $conf['template'];
-
// The generated script depends on some dynamic options
$cache = new cache('styles'.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'].DOKU_BASE.$tpl.$type,'.css');
- // load styl.ini
- $styleini = css_styleini($tpl);
-
// if old 'default' userstyle setting exists, make it 'screen' userstyle for backwards compatibility
if (isset($config_cascade['userstyle']['default'])) {
$config_cascade['userstyle']['screen'] = array($config_cascade['userstyle']['default']);