xref: /template/sprintdoc/tpl/nav-page-attributes.php (revision d9d97457c39e04d8c09c10facf24ad8712cddae3)
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');
8d4c5a424SAndreas Gohr/** @var \action_plugin_starred $starredPlugin */
9d4c5a424SAndreas Gohr$starredPlugin = plugin_load('action', 'starred');
10fbf9e9d6SAndreas Gohr
11d4c5a424SAndreas Gohrif($doPlugin !== null || $qcPlugin !== null || $starredPlugin !== null) {
12fbf9e9d6SAndreas Gohr    echo '<ul class="page-attributes">';
13fbf9e9d6SAndreas Gohr}
14fbf9e9d6SAndreas Gohr
15fbf9e9d6SAndreas Gohr
16fbf9e9d6SAndreas Gohrif($qcPlugin && $qcPlugin->shouldShow()) {
17*d9d97457SSilke Pisulla    $qcPrefix = tpl_getLang('quality_trigger');
18*d9d97457SSilke Pisulla    echo '<li class="plugin_qc"><strong class="sr-out">'.$qcPrefix.':</strong><a href="#"></a></li>'; // filled by javascript
19fbf9e9d6SAndreas Gohr}
20fbf9e9d6SAndreas Gohr
21fbf9e9d6SAndreas Gohr
22fbf9e9d6SAndreas Gohrif($doPlugin !== null) {
23fbf9e9d6SAndreas Gohr    $count = $doPlugin->getPageTaskCount();
24fbf9e9d6SAndreas Gohr    $num = $count['count'];
25fbf9e9d6SAndreas Gohr    $title = "";
26fbf9e9d6SAndreas Gohr
27fbf9e9d6SAndreas Gohr    if($num == 0) { // no tasks - does not exist do in plug-in
28fbf9e9d6SAndreas Gohr        $class = "do_none";
29fbf9e9d6SAndreas Gohr        $title = tpl_getLang('tasks_page_none');
30fbf9e9d6SAndreas Gohr    } elseif($count['undone'] == 0) { // all tasks done
31fbf9e9d6SAndreas Gohr        $class = 'do_done';
321140677fSMichael Große        $title = $doPlugin->getLang('title_alldone');
33fbf9e9d6SAndreas Gohr    } elseif($count['late'] == 0) { // open tasks but none late
34fbf9e9d6SAndreas Gohr        $class = 'do_undone';
351140677fSMichael Große        $title = sprintf(tpl_getLang('tasks_page_intime'), $count['undone']);
36fbf9e9d6SAndreas Gohr    } else { // late tasks
37fbf9e9d6SAndreas Gohr        $class = 'do_late';
381140677fSMichael Große        $title = sprintf(tpl_getLang('tasks_page_late'), $count['undone'], $count['late']);
39fbf9e9d6SAndreas Gohr    }
4081a9f400SMichael 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>";
41fbf9e9d6SAndreas Gohr
42fbf9e9d6SAndreas Gohr    echo $markup;
43fbf9e9d6SAndreas Gohr}
44fbf9e9d6SAndreas Gohr
45d4c5a424SAndreas Gohrif($starredPlugin !== null) {
46728071e8SAndreas Gohr    echo '<li class="plugin_starred">';
47d4c5a424SAndreas Gohr    $starredPlugin->tpl_starred();
48d4c5a424SAndreas Gohr    echo '</li>';
49d4c5a424SAndreas Gohr}
50d4c5a424SAndreas Gohr
51d4c5a424SAndreas Gohrif($doPlugin !== null || $qcPlugin !== null || $starredPlugin !== null) {
52fbf9e9d6SAndreas Gohr    echo "</ul>";
53fbf9e9d6SAndreas Gohr}
54