1<?php 2if(!defined('DOKU_INC')) die(); 3 4/** @var \helper_plugin_do $doPlugin */ 5$doPlugin = plugin_load('helper', 'do'); 6/** @var \helper_plugin_qc $qcPlugin */ 7$qcPlugin = plugin_load('helper', 'qc'); 8/** @var \action_plugin_starred $starredPlugin */ 9$starredPlugin = plugin_load('action', 'starred'); 10 11if($doPlugin !== null || $qcPlugin !== null || $starredPlugin !== null) { 12 echo '<ul class="page-attributes">'; 13} 14 15 16if($qcPlugin && $qcPlugin->shouldShow()) { 17 echo '<li class="plugin_qc"><a href="#">…</a></li>'; // filled by javascript 18} 19 20 21if($doPlugin !== null) { 22 $count = $doPlugin->getPageTaskCount(); 23 $num = $count['count']; 24 $title = ""; 25 26 if($num == 0) { // no tasks - does not exist do in plug-in 27 $class = "do_none"; 28 $title = tpl_getLang('tasks_page_none'); 29 } elseif($count['undone'] == 0) { // all tasks done 30 $class = 'do_done'; 31 $title = $this->getLang('title_alldone'); 32 } elseif($count['late'] == 0) { // open tasks but none late 33 $class = 'do_undone'; 34 $title = sprintf(tpl_getLang('title_intime'), $count['undone']); 35 } else { // late tasks 36 $class = 'do_late'; 37 $title = sprintf(tpl_getLang('title_late'), $count['undone'], $count['late']); 38 } 39 $markup = "<li class=\"plugin__do_pagetasks " . $class . "\" title=\"'.$title.'\"><strong><span class=\"prefix\">" . tpl_getLang('prefix_tasks_page') . " </span><span class=\"num\">" . $num . "</span></strong></li>"; 40 41 echo $markup; 42} 43 44if($starredPlugin !== null) { 45 echo '<li>'; 46 $starredPlugin->tpl_starred(); 47 echo '</li>'; 48} 49 50if($doPlugin !== null || $qcPlugin !== null || $starredPlugin !== null) { 51 echo "</ul>"; 52} 53 54 55 56/* 57 58 59$out = '<div class="plugin__do_pagetasks" title="' . $title . '"><span class="' . $class . '">'; 60$out .= $count['undone']; 61$out .= '</span></div>'; 62 63if($return) return $out; 64echo $out;*/ 65