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