xref: /template/sprintdoc/tpl/nav-page-attributes.php (revision 6a2e017953cff1e673760fb67a9a9a97bca2a1cd)
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    $qcPrefix = tpl_getLang('quality_trigger');
18    echo '<li class="plugin_qc"><strong class="sr-out">'.$qcPrefix.':</strong><a href="#"></a></li>'; // filled by javascript
19}
20
21
22if($doPlugin !== null) {
23    $count = $doPlugin->getPageTaskCount();
24    $num = $count['count'];
25    $title = "";
26
27    if($num == 0) { // no tasks - does not exist do in plug-in
28        $class = "do_none";
29        $title = tpl_getLang('tasks_page_none');
30    } elseif($count['undone'] == 0) { // all tasks done
31        $class = 'do_done';
32        $title = $doPlugin->getLang('title_alldone');
33    } elseif($count['late'] == 0) { // open tasks but none late
34        $class = 'do_undone';
35        $title = sprintf(tpl_getLang('tasks_page_intime'), $count['undone']);
36    } else { // late tasks
37        $class = 'do_late';
38        $title = sprintf(tpl_getLang('tasks_page_late'), $count['undone'], $count['late']);
39    }
40    $markup = "<li class=\"plugin_do_pagetasks $class\" title=\"$title\"><strong><span class=\"num\">{$count['undone']}</span><span class=\"prefix\">" . tpl_getLang('prefix_tasks_page') . " </span></strong></li>";
41
42    echo $markup;
43}
44
45if($starredPlugin !== null) {
46    echo '<li class="plugin_starred">';
47    $starredPlugin->tpl_starred();
48    echo '</li>';
49}
50
51if($doPlugin !== null || $qcPlugin !== null || $starredPlugin !== null) {
52    echo "</ul>";
53}
54