integrate QC plugin (ajax branch)
This refactors the page-attribute area a bit and intergrates the new ajax branch of the QC plugin. I'm not really happy about the included file - it should probably be moved to our Template class instead.
This commit is contained in:
parent
994d0e8dee
commit
fbf9e9d682
10 changed files with 200 additions and 244 deletions
57
tpl/nav-page-attributes.php
Executable file
57
tpl/nav-page-attributes.php
Executable file
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
if(!defined('DOKU_INC')) die();
|
||||
|
||||
/** @var \helper_plugin_do $doPlugin */
|
||||
$doPlugin = plugin_load('helper', 'do');
|
||||
/** @var \helper_plugin_qc $qcPlugin */
|
||||
$qcPlugin = plugin_load('helper', 'qc');
|
||||
|
||||
|
||||
if($doPlugin !== null || $qcPlugin !== null) {
|
||||
echo '<ul class="page-attributes">';
|
||||
}
|
||||
|
||||
|
||||
if($qcPlugin && $qcPlugin->shouldShow()) {
|
||||
echo '<li class="plugin_qc"><a href="#">…</a></li>'; // filled by javascript
|
||||
}
|
||||
|
||||
|
||||
if($doPlugin !== null) {
|
||||
$count = $doPlugin->getPageTaskCount();
|
||||
$num = $count['count'];
|
||||
$title = "";
|
||||
|
||||
if($num == 0) { // no tasks - does not exist do in plug-in
|
||||
$class = "do_none";
|
||||
$title = tpl_getLang('tasks_page_none');
|
||||
} elseif($count['undone'] == 0) { // all tasks done
|
||||
$class = 'do_done';
|
||||
$title = $this->getLang('title_alldone');
|
||||
} elseif($count['late'] == 0) { // open tasks but none late
|
||||
$class = 'do_undone';
|
||||
$title = sprintf($this->getLang('title_intime'), $count['undone']);
|
||||
} else { // late tasks
|
||||
$class = 'do_late';
|
||||
$title = sprintf($this->getLang('title_late'), $count['undone'], $count['late']);
|
||||
}
|
||||
$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>";
|
||||
|
||||
echo $markup;
|
||||
}
|
||||
|
||||
if($doPlugin !== null || $qcPlugin !== null) {
|
||||
echo "</ul>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
$out = '<div class="plugin__do_pagetasks" title="' . $title . '"><span class="' . $class . '">';
|
||||
$out .= $count['undone'];
|
||||
$out .= '</span></div>';
|
||||
|
||||
if($return) return $out;
|
||||
echo $out;*/
|
Loading…
Add table
Add a link
Reference in a new issue