xref: /template/sprintdoc/tpl/nav-page-attributes.php (revision fbf9e9d682e580dc2d020d23ecc173315327ec1e)
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
9
10if($doPlugin !== null || $qcPlugin !== null) {
11    echo '<ul class="page-attributes">';
12}
13
14
15if($qcPlugin && $qcPlugin->shouldShow()) {
16    echo '<li class="plugin_qc"><a href="#">…</a></li>'; // filled by javascript
17}
18
19
20if($doPlugin !== null) {
21    $count = $doPlugin->getPageTaskCount();
22    $num = $count['count'];
23    $title = "";
24
25    if($num == 0) { // no tasks - does not exist do in plug-in
26        $class = "do_none";
27        $title = tpl_getLang('tasks_page_none');
28    } elseif($count['undone'] == 0) { // all tasks done
29        $class = 'do_done';
30        $title = $this->getLang('title_alldone');
31    } elseif($count['late'] == 0) { // open tasks but none late
32        $class = 'do_undone';
33        $title = sprintf($this->getLang('title_intime'), $count['undone']);
34    } else { // late tasks
35        $class = 'do_late';
36        $title = sprintf($this->getLang('title_late'), $count['undone'], $count['late']);
37    }
38    $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>";
39
40    echo $markup;
41}
42
43if($doPlugin !== null || $qcPlugin !== null) {
44    echo "</ul>";
45}
46
47
48
49/*
50
51
52$out = '<div class="plugin__do_pagetasks" title="' . $title . '"><span class="' . $class . '">';
53$out .= $count['undone'];
54$out .= '</span></div>';
55
56if($return) return $out;
57echo $out;*/
58