xref: /template/sprintdoc/tpl/nav-page-attributes.php (revision 1140677f445af8d22b4c4984c69123bec72f3202)
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';
30*1140677fSMichael Große        $title = $doPlugin->getLang('title_alldone');
31fbf9e9d6SAndreas Gohr    } elseif($count['late'] == 0) { // open tasks but none late
32fbf9e9d6SAndreas Gohr        $class = 'do_undone';
33*1140677fSMichael Große        $title = sprintf(tpl_getLang('tasks_page_intime'), $count['undone']);
34fbf9e9d6SAndreas Gohr    } else { // late tasks
35fbf9e9d6SAndreas Gohr        $class = 'do_late';
36*1140677fSMichael Große        $title = sprintf(tpl_getLang('tasks_page_late'), $count['undone'], $count['late']);
37fbf9e9d6SAndreas Gohr    }
38*1140677fSMichael Große    $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>";
39fbf9e9d6SAndreas Gohr
40fbf9e9d6SAndreas Gohr    echo $markup;
41fbf9e9d6SAndreas Gohr}
42fbf9e9d6SAndreas Gohr
43fbf9e9d6SAndreas Gohrif($doPlugin !== null || $qcPlugin !== null) {
44fbf9e9d6SAndreas Gohr    echo "</ul>";
45fbf9e9d6SAndreas Gohr}
46fbf9e9d6SAndreas Gohr
47fbf9e9d6SAndreas Gohr
48fbf9e9d6SAndreas Gohr
49fbf9e9d6SAndreas Gohr/*
50fbf9e9d6SAndreas Gohr
51fbf9e9d6SAndreas Gohr
52fbf9e9d6SAndreas Gohr$out = '<div class="plugin__do_pagetasks" title="' . $title . '"><span class="' . $class . '">';
53fbf9e9d6SAndreas Gohr$out .= $count['undone'];
54fbf9e9d6SAndreas Gohr$out .= '</span></div>';
55fbf9e9d6SAndreas Gohr
56fbf9e9d6SAndreas Gohrif($return) return $out;
57fbf9e9d6SAndreas Gohrecho $out;*/
58