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(); 8 9class helper_plugin_qc extends DokuWiki_Plugin { 10 11 /** 12 * Output the standard quality header. Needs to be called formt he template 13 */ 14 function tpl() { 15 global $ACT, $INFO, $ID; 16 if($ACT != 'show' || !$INFO['exists']) return; 17 if(p_get_metadata($ID, 'relation qcplugin_disabled')) return; 18 if($this->getConf('adminonly')) { 19 if(!isset($_SERVER['REMOTE_USER']) || !auth_isadmin()) 20 return; 21 } 22 23 echo '<div id="plugin__qc__wrapper">'; 24 echo '<div class="summary">'; 25 echo $this->getLang('i_qcscore'); 26 echo '</div>'; 27 echo '<div class="output"></div>'; 28 echo '</div>'; 29 } 30 31 /** 32 * Return the raw quality data 33 * 34 * Always call this asynchronly! 35 * 36 * @param $theid 37 * @return array 38 */ 39 function getQCData($theid) { 40 global $ID; 41 $oldid = $ID; 42 $ID = $theid; 43 $data = unserialize(p_cached_output(wikiFN($ID), 'qc', $ID)); 44 $ID = $oldid; 45 return $data; 46 } 47} 48