1<?php
2/**
3* DokuMicroBugTracker Plugin: allows to create simple bugtracker
4*
5* @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6* @author     Benoît HERVIER <khertan@khertan.net>
7*/
8
9if(!defined('DOKU_INC')) die();
10if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
11
12require_once(DOKU_PLUGIN.'action.php');
13
14class action_plugin_dokumicrobugtracker extends DokuWiki_Action_Plugin {
15
16    /**
17     * return some info
18     */
19    function getInfo(){
20        return confToHash(dirname(__FILE__).'/INFO.txt');
21    }
22
23    /*
24     * plugin should use this method to register its handlers with the dokuwiki's event controller
25     */
26    function register(&$controller) {
27        $controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'init_css');
28    }
29
30    /*
31     * Add Js & Css after template is displayed
32     */
33    function init_css (&$event, $param)  {
34      $event->data["link"][] = array ("type" => "text/css", "rel" => "stylesheet", "href" => DOKU_BASE."lib/plugins/dokumicrobugtracker/style.css",);
35
36      $event->data["script"][] = array ("type" => "text/javascript", "src" => DOKU_BASE."lib/plugins/dokumicrobugtracker/js/jquery.js",);
37      $event->data["script"][] = array ("type" => "text/javascript", "_data" => 'jQuery.noConflict();',);
38      $event->data["script"][] = array ("type" => "text/javascript", "src" => DOKU_BASE."lib/plugins/dokumicrobugtracker/js/jquery.jeditable.mini.js",);
39      $event->data["script"][] = array ("type" => "text/javascript", "src" => DOKU_BASE."lib/plugins/dokumicrobugtracker/js/jquery.dataTables.min.js",);
40    }
41
42}
43