xref: /template/sprintdoc/tpl/nav-page-attributes.php (revision 84f9464195fd1a808286d784d9f8370497d1d934)
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 = $doPlugin->getLang('title_alldone');
32    } elseif($count['late'] == 0) { // open tasks but none late
33        $class = 'do_undone';
34        $title = sprintf(tpl_getLang('tasks_page_intime'), $count['undone']);
35    } else { // late tasks
36        $class = 'do_late';
37        $title = sprintf(tpl_getLang('tasks_page_late'), $count['undone'], $count['late']);
38    }
39    $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>";
40
41    echo $markup;
42}
43
44if($starredPlugin !== null) {
45    echo '<li class="plugin_starred">';
46    $starredPlugin->tpl_starred();
47    echo '</li>';
48}
49
50if($doPlugin !== null || $qcPlugin !== null || $starredPlugin !== null) {
51    echo "</ul>";
52}
53