xref: /template/sprintdoc/tpl/nav-page-attributes.php (revision fbf9e9d682e580dc2d020d23ecc173315327ec1e)
1*fbf9e9d6SAndreas Gohr<?php
2*fbf9e9d6SAndreas Gohrif(!defined('DOKU_INC')) die();
3*fbf9e9d6SAndreas Gohr
4*fbf9e9d6SAndreas Gohr/** @var \helper_plugin_do $doPlugin */
5*fbf9e9d6SAndreas Gohr$doPlugin = plugin_load('helper', 'do');
6*fbf9e9d6SAndreas Gohr/** @var \helper_plugin_qc $qcPlugin */
7*fbf9e9d6SAndreas Gohr$qcPlugin = plugin_load('helper', 'qc');
8*fbf9e9d6SAndreas Gohr
9*fbf9e9d6SAndreas Gohr
10*fbf9e9d6SAndreas Gohrif($doPlugin !== null || $qcPlugin !== null) {
11*fbf9e9d6SAndreas Gohr    echo '<ul class="page-attributes">';
12*fbf9e9d6SAndreas Gohr}
13*fbf9e9d6SAndreas Gohr
14*fbf9e9d6SAndreas Gohr
15*fbf9e9d6SAndreas Gohrif($qcPlugin && $qcPlugin->shouldShow()) {
16*fbf9e9d6SAndreas Gohr    echo '<li class="plugin_qc"><a href="#">…</a></li>'; // filled by javascript
17*fbf9e9d6SAndreas Gohr}
18*fbf9e9d6SAndreas Gohr
19*fbf9e9d6SAndreas Gohr
20*fbf9e9d6SAndreas Gohrif($doPlugin !== null) {
21*fbf9e9d6SAndreas Gohr    $count = $doPlugin->getPageTaskCount();
22*fbf9e9d6SAndreas Gohr    $num = $count['count'];
23*fbf9e9d6SAndreas Gohr    $title = "";
24*fbf9e9d6SAndreas Gohr
25*fbf9e9d6SAndreas Gohr    if($num == 0) { // no tasks - does not exist do in plug-in
26*fbf9e9d6SAndreas Gohr        $class = "do_none";
27*fbf9e9d6SAndreas Gohr        $title = tpl_getLang('tasks_page_none');
28*fbf9e9d6SAndreas Gohr    } elseif($count['undone'] == 0) { // all tasks done
29*fbf9e9d6SAndreas Gohr        $class = 'do_done';
30*fbf9e9d6SAndreas Gohr        $title = $this->getLang('title_alldone');
31*fbf9e9d6SAndreas Gohr    } elseif($count['late'] == 0) { // open tasks but none late
32*fbf9e9d6SAndreas Gohr        $class = 'do_undone';
33*fbf9e9d6SAndreas Gohr        $title = sprintf($this->getLang('title_intime'), $count['undone']);
34*fbf9e9d6SAndreas Gohr    } else { // late tasks
35*fbf9e9d6SAndreas Gohr        $class = 'do_late';
36*fbf9e9d6SAndreas Gohr        $title = sprintf($this->getLang('title_late'), $count['undone'], $count['late']);
37*fbf9e9d6SAndreas Gohr    }
38*fbf9e9d6SAndreas Gohr    $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>";
39*fbf9e9d6SAndreas Gohr
40*fbf9e9d6SAndreas Gohr    echo $markup;
41*fbf9e9d6SAndreas Gohr}
42*fbf9e9d6SAndreas Gohr
43*fbf9e9d6SAndreas Gohrif($doPlugin !== null || $qcPlugin !== null) {
44*fbf9e9d6SAndreas Gohr    echo "</ul>";
45*fbf9e9d6SAndreas Gohr}
46*fbf9e9d6SAndreas Gohr
47*fbf9e9d6SAndreas Gohr
48*fbf9e9d6SAndreas Gohr
49*fbf9e9d6SAndreas Gohr/*
50*fbf9e9d6SAndreas Gohr
51*fbf9e9d6SAndreas Gohr
52*fbf9e9d6SAndreas Gohr$out = '<div class="plugin__do_pagetasks" title="' . $title . '"><span class="' . $class . '">';
53*fbf9e9d6SAndreas Gohr$out .= $count['undone'];
54*fbf9e9d6SAndreas Gohr$out .= '</span></div>';
55*fbf9e9d6SAndreas Gohr
56*fbf9e9d6SAndreas Gohrif($return) return $out;
57*fbf9e9d6SAndreas Gohrecho $out;*/
58