xref: /plugin/qc/helper.php (revision 7592c52e03f4f3da1a537ea2d2e3c101c652b09c)
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();
8require_once(DOKU_INC.'inc/plugin.php');
9
10class helper_plugin_qc extends DokuWiki_Plugin {
11
12    function tpl(){
13        global $ACT,$INFO,$ID;
14        if($ACT != 'show' || !$INFO['exists']) return;
15        if(p_get_metadata($ID, 'relation qcplugin_disabled')) return;
16        echo '<div id="plugin__qc__wrapper">';
17        echo '<img src="'.DOKU_BASE.'lib/plugins/qc/icon.php?id='.$ID.'" width="600" height="25" alt="" id="plugin__qc__icon" />';
18        echo '<div id="plugin__qc__out" style="display:none"></div>';
19        echo '</div>';
20    }
21
22
23
24    function getQCData($theid){
25        global $ID;
26        $oldid = $ID;
27        $ID = $theid;
28        require_once(DOKU_INC.'inc/parserutils.php');
29        $data = unserialize(p_cached_output(wikiFN($ID), 'qc'));
30        $ID = $oldid;
31        return $data;
32    }
33
34}
35// vim:ts=4:sw=4:et:enc=utf-8:
36