xref: /plugin/qc/helper.php (revision 8fce80b1885d757ecced399340faa4148c7ed378)
1<?php
2/**
3 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
4 */
5
6// must be run within Dokuwiki
7if (!defined('DOKU_INC')) die();
8
9class helper_plugin_qc extends DokuWiki_Plugin {
10
11    function getInfo() {
12        return confToHash(dirname(__FILE__).'/info.txt');
13    }
14
15    function tpl(){
16        global $ACT,$INFO,$ID;
17        if($ACT != 'show' || !$INFO['exists']) return;
18
19        echo '<img src="'.DOKU_BASE.'lib/plugins/qc/icon.php?id='.$ID.'" width="60" height="25" alt="" id="plugin__qc__icon" />';
20        echo '<div id="plugin__qc__out" style="display:none"></div>';
21    }
22
23
24
25    function getQCData($theid){
26        global $ID;
27        $oldid = $ID;
28        $ID = $theid;
29        require_once(DOKU_INC.'inc/parserutils.php');
30        $data = unserialize(p_cached_output(wikiFN($ID), 'qc'));
31        $ID = $oldid;
32        return $data;
33    }
34
35}
36// vim:ts=4:sw=4:et:enc=utf-8:
37