1<?php
2/**
3 * DokuWiki plugin template changing preload
4 *
5 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author     Samuel Fischer <sf@notomorrow.de>
7 */
8
9
10if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
11
12require_once(DOKU_PLUGIN.'templateconfhelper/inc/confutils.php');
13require_once(DOKU_PLUGIN.'templateconfhelper/inc/template.php');
14
15global $config_cascade, $conf;
16if( !isset( $config_cascade['template_dir'] )) {
17   $config_cascade['template_dir'] = array(
18        'default' => array( dirname( DOKU_TPLINC ).'/' ),
19        'local' => array( $conf['savedir'].'/media/tpl/' ),
20   );
21}
22
23
24$conf['default_tpl'] = $conf['template'];
25if( !isset( $conf['base_tpl'] ))
26    $conf['base_tpl'] = $conf['plugin']['templateconfhelper']['base_tpl'];
27
28if( strpos( $_SERVER['PHP_SELF'], 'css.php' ) !== false ) {
29  $e = new action_plugin_templateconfhelper_templateaction( );
30  $e->template_action( );
31  require_once(DOKU_PLUGIN.'templateconfhelper/exe/css.php');
32  exit;
33}
34
35if( strpos( $_SERVER['PHP_SELF'], 'js.php' ) !== false ) {
36  $conf['template'] = $conf['base_tpl'];
37}
38
39