xref: /plugin/qc/helper.php (revision 32905264e6e1f7d6fca10acd314f1637aeed4627)
18fce80b1SAndreas Gohr<?php
28fce80b1SAndreas Gohr/**
38fce80b1SAndreas Gohr * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
48fce80b1SAndreas Gohr */
58fce80b1SAndreas Gohr
68fce80b1SAndreas Gohr// must be run within Dokuwiki
78fce80b1SAndreas Gohrif (!defined('DOKU_INC')) die();
82e820792SAndreas Gohrrequire_once(DOKU_INC.'inc/plugin.php');
98fce80b1SAndreas Gohr
108fce80b1SAndreas Gohrclass helper_plugin_qc extends DokuWiki_Plugin {
118fce80b1SAndreas Gohr
128fce80b1SAndreas Gohr    function tpl(){
138fce80b1SAndreas Gohr        global $ACT,$INFO,$ID;
148fce80b1SAndreas Gohr        if($ACT != 'show' || !$INFO['exists']) return;
15*32905264SAndreas Gohr        if(p_get_metadata($ID, 'relation qcplugin_disabled')) return;
169068e431SAndreas Gohr        echo '<div id="plugin__qc__wrapper">';
1763ee528dSAndreas Gohr        echo '<img src="'.DOKU_BASE.'lib/plugins/qc/icon.php?id='.$ID.'" width="600" height="25" alt="" id="plugin__qc__icon" />';
188fce80b1SAndreas Gohr        echo '<div id="plugin__qc__out" style="display:none"></div>';
199068e431SAndreas Gohr        echo '</div>';
208fce80b1SAndreas Gohr    }
218fce80b1SAndreas Gohr
228fce80b1SAndreas Gohr
238fce80b1SAndreas Gohr
248fce80b1SAndreas Gohr    function getQCData($theid){
258fce80b1SAndreas Gohr        global $ID;
268fce80b1SAndreas Gohr        $oldid = $ID;
278fce80b1SAndreas Gohr        $ID = $theid;
288fce80b1SAndreas Gohr        require_once(DOKU_INC.'inc/parserutils.php');
298fce80b1SAndreas Gohr        $data = unserialize(p_cached_output(wikiFN($ID), 'qc'));
308fce80b1SAndreas Gohr        $ID = $oldid;
318fce80b1SAndreas Gohr        return $data;
328fce80b1SAndreas Gohr    }
338fce80b1SAndreas Gohr
348fce80b1SAndreas Gohr}
358fce80b1SAndreas Gohr// vim:ts=4:sw=4:et:enc=utf-8:
36