summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/config_cascade.php9
-rw-r--r--lib/exe/css.php11
-rw-r--r--lib/exe/js.php5
3 files changed, 22 insertions, 3 deletions
diff --git a/inc/config_cascade.php b/inc/config_cascade.php
index 81c455dc3..3ae68a000 100644
--- a/inc/config_cascade.php
+++ b/inc/config_cascade.php
@@ -47,6 +47,15 @@ $config_cascade = array(
'default' => array(DOKU_CONF.'wordblock.conf'),
'local' => array(DOKU_CONF.'wordblock.local.conf'),
),
+ 'userstyle' => array(
+ 'default' => DOKU_CONF.'userstyle.css',
+ 'print' => DOKU_CONF.'printstyle.css',
+ 'feed' => DOKU_CONF.'feedstyle.css',
+ 'all' => DOKU_CONF.'allstyle.css',
+ ),
+ 'userscript' => array(
+ 'default' => DOKU_CONF.'userscript.js'
+ ),
'acl' => array(
'default' => DOKU_CONF.'acl.auth.php',
),
diff --git a/lib/exe/css.php b/lib/exe/css.php
index 38017af9d..76f40c7bb 100644
--- a/lib/exe/css.php
+++ b/lib/exe/css.php
@@ -28,6 +28,8 @@ if(!defined('SIMPLE_TEST')){
function css_out(){
global $conf;
global $lang;
+ global $config_cascade;
+
$style = '';
if (isset($_REQUEST['s']) &&
in_array($_REQUEST['s'], array('all', 'print', 'feed'))) {
@@ -64,7 +66,10 @@ function css_out(){
// load plugin, template, user styles
$files = array_merge($files, css_pluginstyles($style));
if (isset($tplstyles[$style])) $files = array_merge($files, $tplstyles[$style]);
- $files[DOKU_CONF.'user'.$style.'.css'] = DOKU_BASE;
+
+ if(isset($config_cascade['userstyle'][$style])){
+ $files[$config_cascade['userstyle'][$style]] = DOKU_BASE;
+ }
}else{
$files[DOKU_INC.'lib/styles/style.css'] = DOKU_BASE.'lib/styles/';
// load plugin, template, user styles
@@ -73,7 +78,9 @@ function css_out(){
if($lang['direction'] == 'rtl'){
if (isset($tplstyles['rtl'])) $files = array_merge($files, $tplstyles['rtl']);
}
- $files[DOKU_CONF.'userstyle.css'] = DOKU_BASE;
+ if(isset($config_cascade['userstyle']['default'])){
+ $files[$config_cascade['userstyle']['default']] = DOKU_BASE;
+ }
}
// check cache age & handle conditional request
diff --git a/lib/exe/js.php b/lib/exe/js.php
index f2f9dfe6b..3756c43b9 100644
--- a/lib/exe/js.php
+++ b/lib/exe/js.php
@@ -29,6 +29,7 @@ if(!defined('SIMPLE_TEST')){
function js_out(){
global $conf;
global $lang;
+ global $config_cascade;
// The generated script depends on some dynamic options
$cache = getCacheName('scripts'.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'],'.js');
@@ -56,7 +57,9 @@ function js_out(){
// add possible plugin scripts and userscript
$files = array_merge($files,js_pluginscripts());
- $files[] = DOKU_CONF.'userscript.js';
+ if(isset($config_cascade['userscript']['default'])){
+ $files[] = $config_cascade['userscript']['default'];
+ }
// check cache age & handle conditional request
header('Cache-Control: public, max-age=3600');