xref: /template/sprintdoc/tpl/nav-page-attributes.php (revision 434e76cf75bae61d76428f37e7b0c1baf5ac0ac9)
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');
10ed91dc00SAndreas Gohr/** @var \helper_plugin_quicksubscribe $quickSubPlugin */
11ed91dc00SAndreas Gohr$quickSubPlugin = plugin_load('helper', 'quicksubscribe');
1264ac6e3fSSzymon Olewniczak/** @var \helper_plugin_approve_tpl $approvePlugin */
1364ac6e3fSSzymon Olewniczak$approvePlugin = plugin_load('helper', 'approve_tpl');
14fbf9e9d6SAndreas Gohr
15*434e76cfSAnna Dabrowskaif ($doPlugin !== null || $qcPlugin !== null || $starredPlugin !== null || $quickSubPlugin !== null || $approvePlugin !== null) {
16fbf9e9d6SAndreas Gohr    echo '<ul class="page-attributes">';
17fbf9e9d6SAndreas Gohr}
18fbf9e9d6SAndreas Gohr
19fbf9e9d6SAndreas Gohr
20fbf9e9d6SAndreas Gohrif ($qcPlugin && $qcPlugin->shouldShow()) {
21d9d97457SSilke Pisulla    $qcPrefix = tpl_getLang('quality_trigger');
22d9d97457SSilke Pisulla    echo '<li class="plugin_qc"><strong class="sr-out">'.$qcPrefix.':</strong><a href="#"></a></li>'; // filled by javascript
23fbf9e9d6SAndreas Gohr}
24fbf9e9d6SAndreas Gohr
25fbf9e9d6SAndreas Gohr
26fbf9e9d6SAndreas Gohrif ($doPlugin !== null) {
27fbf9e9d6SAndreas Gohr    $count = $doPlugin->getPageTaskCount();
28fbf9e9d6SAndreas Gohr    $num = $count['count'];
29fbf9e9d6SAndreas Gohr    $title = "";
30fbf9e9d6SAndreas Gohr
31fbf9e9d6SAndreas Gohr    if($num == 0) { // no tasks - does not exist do in plug-in
32fbf9e9d6SAndreas Gohr        $class = "do_none";
33fbf9e9d6SAndreas Gohr        $title = tpl_getLang('tasks_page_none');
34fbf9e9d6SAndreas Gohr    } elseif($count['undone'] == 0) { // all tasks done
35fbf9e9d6SAndreas Gohr        $class = 'do_done';
361140677fSMichael Große        $title = $doPlugin->getLang('title_alldone');
37fbf9e9d6SAndreas Gohr    } elseif($count['late'] == 0) { // open tasks but none late
38fbf9e9d6SAndreas Gohr        $class = 'do_undone';
391140677fSMichael Große        $title = sprintf(tpl_getLang('tasks_page_intime'), $count['undone']);
40fbf9e9d6SAndreas Gohr    } else { // late tasks
41fbf9e9d6SAndreas Gohr        $class = 'do_late';
421140677fSMichael Große        $title = sprintf(tpl_getLang('tasks_page_late'), $count['undone'], $count['late']);
43fbf9e9d6SAndreas Gohr    }
44fbf9e9d6SAndreas Gohr
45b8adbb9eSAndreas Gohr    echo '<li class="plugin_do_pagetasks">';
46b8adbb9eSAndreas Gohr    echo '<span title="'.$title.'" class="'.$class.'">';
47b8adbb9eSAndreas Gohr    echo inlineSVG(DOKU_PLUGIN . 'do/pix/clipboard-text.svg');
48b8adbb9eSAndreas Gohr    echo '</span>';
49b8adbb9eSAndreas Gohr    echo '<span class="num">' . $count['undone'] . '</span>';
50b8adbb9eSAndreas Gohr    echo '</li>';
51fbf9e9d6SAndreas Gohr}
52fbf9e9d6SAndreas Gohr
53d4c5a424SAndreas Gohrif ($starredPlugin !== null) {
54728071e8SAndreas Gohr    echo '<li class="plugin_starred">';
55d4c5a424SAndreas Gohr    $starredPlugin->tpl_starred();
56d4c5a424SAndreas Gohr    echo '</li>';
57d4c5a424SAndreas Gohr}
58d4c5a424SAndreas Gohr
59ed91dc00SAndreas Gohrif ($quickSubPlugin !== null) {
60ed91dc00SAndreas Gohr    echo '<li class="plugin_quicksubscribe">';
61ed91dc00SAndreas Gohr    echo $quickSubPlugin->tpl_subscribe();
62ed91dc00SAndreas Gohr    echo '</li>';
63ed91dc00SAndreas Gohr}
64ed91dc00SAndreas Gohr
65*434e76cfSAnna Dabrowskaif ($approvePlugin !== null && $approvePlugin->shouldDisplay()) {
66*434e76cfSAnna Dabrowska    echo '<li class="plugin_approve">';
67*434e76cfSAnna Dabrowska    echo '<span class="plugin_approve-icon">' . inlineSVG(DOKU_PLUGIN . 'approve/admin.svg') . '</span>';
68*434e76cfSAnna Dabrowska    echo '<div class="plugin_approve-banner-content">';
6964ac6e3fSSzymon Olewniczak    global $ACT;
7064ac6e3fSSzymon Olewniczak    echo $approvePlugin->banner($ACT);
71*434e76cfSAnna Dabrowska    echo '</div>';
72*434e76cfSAnna Dabrowska    echo '</li>';
73*434e76cfSAnna Dabrowska}
74*434e76cfSAnna Dabrowska
75*434e76cfSAnna Dabrowskaif ($doPlugin !== null || $qcPlugin !== null || $starredPlugin !== null || $quickSubPlugin !== null || $approvePlugin !== null) {
76*434e76cfSAnna Dabrowska    echo "</ul>";
7764ac6e3fSSzymon Olewniczak}
78