xref: /template/sprintdoc/tpl/nav-page-attributes.php (revision 81a9f400e799758c364128e4206d06969172defd)
1fbf9e9d6SAndreas Gohr<?php
2fbf9e9d6SAndreas Gohrif(!defined('DOKU_INC')) die();
3fbf9e9d6SAndreas Gohr
4fbf9e9d6SAndreas Gohr/** @var \helper_plugin_do $doPlugin */
5fbf9e9d6SAndreas Gohr$doPlugin = plugin_load('helper', 'do');
6fbf9e9d6SAndreas Gohr/** @var \helper_plugin_qc $qcPlugin */
7fbf9e9d6SAndreas Gohr$qcPlugin = plugin_load('helper', 'qc');
8fbf9e9d6SAndreas Gohr
9fbf9e9d6SAndreas Gohr
10fbf9e9d6SAndreas Gohrif($doPlugin !== null || $qcPlugin !== null) {
11fbf9e9d6SAndreas Gohr    echo '<ul class="page-attributes">';
12fbf9e9d6SAndreas Gohr}
13fbf9e9d6SAndreas Gohr
14fbf9e9d6SAndreas Gohr
15fbf9e9d6SAndreas Gohrif($qcPlugin && $qcPlugin->shouldShow()) {
16fbf9e9d6SAndreas Gohr    echo '<li class="plugin_qc"><a href="#">…</a></li>'; // filled by javascript
17fbf9e9d6SAndreas Gohr}
18fbf9e9d6SAndreas Gohr
19fbf9e9d6SAndreas Gohr
20fbf9e9d6SAndreas Gohrif($doPlugin !== null) {
21fbf9e9d6SAndreas Gohr    $count = $doPlugin->getPageTaskCount();
22fbf9e9d6SAndreas Gohr    $num = $count['count'];
23fbf9e9d6SAndreas Gohr    $title = "";
24fbf9e9d6SAndreas Gohr
25fbf9e9d6SAndreas Gohr    if($num == 0) { // no tasks - does not exist do in plug-in
26fbf9e9d6SAndreas Gohr        $class = "do_none";
27fbf9e9d6SAndreas Gohr        $title = tpl_getLang('tasks_page_none');
28fbf9e9d6SAndreas Gohr    } elseif($count['undone'] == 0) { // all tasks done
29fbf9e9d6SAndreas Gohr        $class = 'do_done';
301140677fSMichael Große        $title = $doPlugin->getLang('title_alldone');
31fbf9e9d6SAndreas Gohr    } elseif($count['late'] == 0) { // open tasks but none late
32fbf9e9d6SAndreas Gohr        $class = 'do_undone';
331140677fSMichael Große        $title = sprintf(tpl_getLang('tasks_page_intime'), $count['undone']);
34fbf9e9d6SAndreas Gohr    } else { // late tasks
35fbf9e9d6SAndreas Gohr        $class = 'do_late';
361140677fSMichael Große        $title = sprintf(tpl_getLang('tasks_page_late'), $count['undone'], $count['late']);
37fbf9e9d6SAndreas Gohr    }
38*81a9f400SMichael Große    $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>";
39fbf9e9d6SAndreas Gohr
40fbf9e9d6SAndreas Gohr    echo $markup;
41fbf9e9d6SAndreas Gohr}
42fbf9e9d6SAndreas Gohr
43fbf9e9d6SAndreas Gohrif($doPlugin !== null || $qcPlugin !== null) {
44fbf9e9d6SAndreas Gohr    echo "</ul>";
45fbf9e9d6SAndreas Gohr}
46