diff options
author | Gerry Weißbach <gerry.w@gammaproduction.de> | 2014-09-12 08:41:57 +0200 |
---|---|---|
committer | Gerry Weißbach <gerry.w@gammaproduction.de> | 2014-09-12 08:41:57 +0200 |
commit | de4634ec87b1a277c1686990d993dafc43db05ed (patch) | |
tree | fcba499495b3140039f08ba068a2e0dd54a88284 /lib/exe | |
parent | 5e7f4d50cbbc788c9c0483a0a2ff1b536e4ffe8c (diff) | |
download | rpg-de4634ec87b1a277c1686990d993dafc43db05ed.tar.gz rpg-de4634ec87b1a277c1686990d993dafc43db05ed.tar.bz2 |
Additionally allow more media types
They are generated from the default ones and any additional one given
by the template. This allows to e.g. split admin styles from end user
styles in a closed wiki. You can then deliver only the user styles
using the metaheaders plugin.
Diffstat (limited to 'lib/exe')
-rw-r--r-- | lib/exe/css.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/exe/css.php b/lib/exe/css.php index 6c1d60751..902996062 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'] = $config_cascade['userstyle']['default']; |