xref: /plugin/qc/helper.php (revision 63ee528d49f5baca633da8a606073561f0606438)
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 getInfo() {
138fce80b1SAndreas Gohr        return confToHash(dirname(__FILE__).'/info.txt');
148fce80b1SAndreas Gohr    }
158fce80b1SAndreas Gohr
168fce80b1SAndreas Gohr    function tpl(){
178fce80b1SAndreas Gohr        global $ACT,$INFO,$ID;
188fce80b1SAndreas Gohr        if($ACT != 'show' || !$INFO['exists']) return;
198fce80b1SAndreas Gohr
209068e431SAndreas Gohr        echo '<div id="plugin__qc__wrapper">';
21*63ee528dSAndreas Gohr        echo '<img src="'.DOKU_BASE.'lib/plugins/qc/icon.php?id='.$ID.'" width="600" height="25" alt="" id="plugin__qc__icon" />';
228fce80b1SAndreas Gohr        echo '<div id="plugin__qc__out" style="display:none"></div>';
239068e431SAndreas Gohr        echo '</div>';
248fce80b1SAndreas Gohr    }
258fce80b1SAndreas Gohr
268fce80b1SAndreas Gohr
278fce80b1SAndreas Gohr
288fce80b1SAndreas Gohr    function getQCData($theid){
298fce80b1SAndreas Gohr        global $ID;
308fce80b1SAndreas Gohr        $oldid = $ID;
318fce80b1SAndreas Gohr        $ID = $theid;
328fce80b1SAndreas Gohr        require_once(DOKU_INC.'inc/parserutils.php');
338fce80b1SAndreas Gohr        $data = unserialize(p_cached_output(wikiFN($ID), 'qc'));
348fce80b1SAndreas Gohr        $ID = $oldid;
358fce80b1SAndreas Gohr        return $data;
368fce80b1SAndreas Gohr    }
378fce80b1SAndreas Gohr
388fce80b1SAndreas Gohr}
398fce80b1SAndreas Gohr// vim:ts=4:sw=4:et:enc=utf-8:
40