1<?php
2if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../../').'/');
3if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
4require_once(DOKU_PLUGIN.'action.php');
5
6/**
7 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
8 * @author     Pierre Spring <pierre.spring@liip.ch>
9 */
10
11class action_plugin_npd_new extends DokuWiki_Action_Plugin {
12    var $fck_location = false;
13    var $helper       = false;
14    var $toc          = false;
15    var $cache        = true;
16
17    function getInfo()
18    {
19        return confToHash(dirname(__FILE__).'../plugin.info.txt');
20    }
21
22    function register(&$controller)
23    {
24        $controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this, 'fckw_index');
25    }
26
27    function fckw_index(&$event)
28    {
29        global $ACT;
30        // we only change the edit behaviour
31        if ($ACT != 'index' || !isset($_REQUEST['npd']) ){
32            return;
33        }
34        global $conf;
35        $conf['template_original'] = $conf['template'];
36        $conf['template'] = "../plugins/npd/tpl";
37    }
38}
39
40