xref: /plugin/qc/helper.php (revision c8193605f5861757a8f70a38a70ff7ef71c9e697)
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        if ($this->getConf('adminonly')) {
17            if (!isset($_SERVER['REMOTE_USER']) || !auth_isadmin())
18                return;
19        }
20        echo '<div id="plugin__qc__wrapper">';
21        echo '<img src="'.DOKU_BASE.'lib/plugins/qc/icon.php?id='.$ID.'" width="600" height="25" alt="" id="plugin__qc__icon" />';
22        echo '<div id="plugin__qc__out" style="display:none"></div>';
23        echo '</div>';
24    }
25
26
27
28    function getQCData($theid){
29        global $ID;
30        $oldid = $ID;
31        $ID = $theid;
32        require_once(DOKU_INC.'inc/parserutils.php');
33        $data = unserialize(p_cached_output(wikiFN($ID), 'qc'));
34        $ID = $oldid;
35        return $data;
36    }
37
38}
39// vim:ts=4:sw=4:et:enc=utf-8:
40