summaryrefslogtreecommitdiff
path: root/lib/exe/css.php
diff options
context:
space:
mode:
authorTom N Harris <tnharris@whoopdedo.org>2006-11-15 11:15:49 +0100
committerTom N Harris <tnharris@whoopdedo.org>2006-11-15 11:15:49 +0100
commit615960fefc1892e98e1e20725b11d535324f8c34 (patch)
tree14d953145aabda1b9cbe7d2eae1caecaf9394e49 /lib/exe/css.php
parentafe99d0069da42f65e958174bf6d68e66eee5c41 (diff)
downloadrpg-615960fefc1892e98e1e20725b11d535324f8c34.tar.gz
rpg-615960fefc1892e98e1e20725b11d535324f8c34.tar.bz2
use generated CSS for RSS feeds
plugins can include styles with feed.css, templates can use the media type feed in style.ini darcs-hash:20061115101549-6942e-d1de56b343ce0cc11ca6b911c444197316f4a4eb.gz
Diffstat (limited to 'lib/exe/css.php')
-rw-r--r--lib/exe/css.php22
1 files changed, 17 insertions, 5 deletions
diff --git a/lib/exe/css.php b/lib/exe/css.php
index 81f7f3489..561927c49 100644
--- a/lib/exe/css.php
+++ b/lib/exe/css.php
@@ -30,7 +30,15 @@ if(!defined('SIMPLE_TEST')){
function css_out(){
global $conf;
global $lang;
- $print = (bool) $_REQUEST['print']; //print mode?
+ switch ($_REQUEST['s']) {
+ case 'print':
+ case 'feed':
+ $style = $_REQUEST['s'];
+ break;
+ default:
+ $style = '';
+ break;
+ }
// The generated script depends on some dynamic options
$cache = getCacheName('styles'.$conf['template'].$print,'.css');
@@ -48,11 +56,12 @@ function css_out(){
// are needed to fix relative paths in the stylesheets
$files = array();
if (isset($tplstyles['all'])) $files = array_merge($files, $tplstyles['all']);
- if($print){
+ if(!empty($style)){
+ $files[DOKU_INC.'lib/styles/'.$style.'.css'] = DOKU_BASE.'lib/styles/';
// load plugin, template, user styles
- $files = array_merge($files, css_pluginstyles('print'));
- if (isset($tplstyles['print'])) $files = array_merge($files, $tplstyles['print']);
- $files[DOKU_CONF.'userprint.css'] = '';
+ $files = array_merge($files, css_pluginstyles($style));
+ if (isset($tplstyles[$style])) $files = array_merge($files, $tplstyles[$style]);
+ $files[DOKU_CONF.'user'.$style.'.css'] = '';
}else{
$files[DOKU_INC.'lib/styles/style.css'] = DOKU_BASE.'lib/styles/';
if($conf['spellchecker']){
@@ -241,6 +250,9 @@ function css_pluginstyles($mode='screen'){
if($mode == 'print'){
$list[DOKU_PLUGIN."$p/print.css"] = DOKU_BASE."lib/plugins/$p/";
$list[DOKU_PLUGIN."$p/all.css"] = DOKU_BASE."lib/plugins/$p/";
+ }elseif($mode == 'feed'){
+ $list[DOKU_PLUGIN."$p/feed.css"] = DOKU_BASE."lib/plugins/$p/";
+ $list[DOKU_PLUGIN."$p/all.css"] = DOKU_BASE."lib/plugins/$p/";
}else{
$list[DOKU_PLUGIN."$p/style.css"] = DOKU_BASE."lib/plugins/$p/";
$list[DOKU_PLUGIN."$p/screen.css"] = DOKU_BASE."lib/plugins/$p/";