xref: /template/sprintdoc/tpl/nav-page-attributes.php (revision ed91dc00ee442b02a6e87512608960a7b9578672)
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');
10*ed91dc00SAndreas Gohr/** @var \helper_plugin_quicksubscribe $quickSubPlugin */
11*ed91dc00SAndreas Gohr$quickSubPlugin = plugin_load('helper', 'quicksubscribe');
12fbf9e9d6SAndreas Gohr
13d4c5a424SAndreas Gohrif($doPlugin !== null || $qcPlugin !== null || $starredPlugin !== null) {
14fbf9e9d6SAndreas Gohr    echo '<ul class="page-attributes">';
15fbf9e9d6SAndreas Gohr}
16fbf9e9d6SAndreas Gohr
17fbf9e9d6SAndreas Gohr
18fbf9e9d6SAndreas Gohrif($qcPlugin && $qcPlugin->shouldShow()) {
19d9d97457SSilke Pisulla    $qcPrefix = tpl_getLang('quality_trigger');
20d9d97457SSilke Pisulla    echo '<li class="plugin_qc"><strong class="sr-out">'.$qcPrefix.':</strong><a href="#"></a></li>'; // filled by javascript
21fbf9e9d6SAndreas Gohr}
22fbf9e9d6SAndreas Gohr
23fbf9e9d6SAndreas Gohr
24fbf9e9d6SAndreas Gohrif($doPlugin !== null) {
25fbf9e9d6SAndreas Gohr    $count = $doPlugin->getPageTaskCount();
26fbf9e9d6SAndreas Gohr    $num = $count['count'];
27fbf9e9d6SAndreas Gohr    $title = "";
28fbf9e9d6SAndreas Gohr
29fbf9e9d6SAndreas Gohr    if($num == 0) { // no tasks - does not exist do in plug-in
30fbf9e9d6SAndreas Gohr        $class = "do_none";
31fbf9e9d6SAndreas Gohr        $title = tpl_getLang('tasks_page_none');
32fbf9e9d6SAndreas Gohr    } elseif($count['undone'] == 0) { // all tasks done
33fbf9e9d6SAndreas Gohr        $class = 'do_done';
341140677fSMichael Große        $title = $doPlugin->getLang('title_alldone');
35fbf9e9d6SAndreas Gohr    } elseif($count['late'] == 0) { // open tasks but none late
36fbf9e9d6SAndreas Gohr        $class = 'do_undone';
371140677fSMichael Große        $title = sprintf(tpl_getLang('tasks_page_intime'), $count['undone']);
38fbf9e9d6SAndreas Gohr    } else { // late tasks
39fbf9e9d6SAndreas Gohr        $class = 'do_late';
401140677fSMichael Große        $title = sprintf(tpl_getLang('tasks_page_late'), $count['undone'], $count['late']);
41fbf9e9d6SAndreas Gohr    }
4281a9f400SMichael 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>";
43fbf9e9d6SAndreas Gohr
44fbf9e9d6SAndreas Gohr    echo $markup;
45fbf9e9d6SAndreas Gohr}
46fbf9e9d6SAndreas Gohr
47d4c5a424SAndreas Gohrif($starredPlugin !== null) {
48728071e8SAndreas Gohr    echo '<li class="plugin_starred">';
49d4c5a424SAndreas Gohr    $starredPlugin->tpl_starred();
50d4c5a424SAndreas Gohr    echo '</li>';
51d4c5a424SAndreas Gohr}
52d4c5a424SAndreas Gohr
53*ed91dc00SAndreas Gohrif($quickSubPlugin !== null) {
54*ed91dc00SAndreas Gohr    echo '<li class="plugin_quicksubscribe">';
55*ed91dc00SAndreas Gohr    echo $quickSubPlugin->tpl_subscribe();
56*ed91dc00SAndreas Gohr    echo '</li>';
57*ed91dc00SAndreas Gohr}
58*ed91dc00SAndreas Gohr
59d4c5a424SAndreas Gohrif($doPlugin !== null || $qcPlugin !== null || $starredPlugin !== null) {
60fbf9e9d6SAndreas Gohr    echo "</ul>";
61fbf9e9d6SAndreas Gohr}
62