diff --git a/tpl/nav-page-attributes.php b/tpl/nav-page-attributes.php index b5c90bd..ebee0f7 100755 --- a/tpl/nav-page-attributes.php +++ b/tpl/nav-page-attributes.php @@ -1,5 +1,6 @@ '; -} +$items = []; if ($qcPlugin && $qcPlugin->shouldShow()) { $qcPrefix = tpl_getLang('quality_trigger'); - echo '
  • '.$qcPrefix.':
  • '; // filled by javascript + // filled by javascript + $items[] = '
  • ' . hsc($qcPrefix) . ':
  • '; } if ($doPlugin !== null) { $count = $doPlugin->getPageTaskCount(); - $num = $count['count']; - $title = ""; + $num = (int) $count['count']; + $title = ''; - if($num == 0) { // no tasks - does not exist do in plug-in - $class = "do_none"; + 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 + } elseif ($count['undone'] == 0) { // all tasks done $class = 'do_done'; $title = $doPlugin->getLang('title_alldone'); - } elseif($count['late'] == 0) { // open tasks but none late + } elseif ($count['late'] == 0) { // open tasks but none late $class = 'do_undone'; $title = sprintf(tpl_getLang('tasks_page_intime'), $count['undone']); } else { // late tasks @@ -42,36 +42,32 @@ if ($doPlugin !== null) { $title = sprintf(tpl_getLang('tasks_page_late'), $count['undone'], $count['late']); } - echo '
  • '; - echo ''; - echo inlineSVG(DOKU_PLUGIN . 'do/pix/clipboard-text.svg'); - echo ''; - echo '' . $count['undone'] . ''; - echo '
  • '; + $items[] = '
  • ' . + '' . + inlineSVG(DOKU_PLUGIN . 'do/pix/clipboard-text.svg') . + '' . + '' . (int) $count['undone'] . '' . + '
  • '; } if ($starredPlugin !== null) { - echo '
  • '; - $starredPlugin->tpl_starred(); - echo '
  • '; + $items[] = '
  • ' . $starredPlugin->tpl_starred(false, false) . '
  • '; } if ($quickSubPlugin !== null) { - echo '
  • '; - echo $quickSubPlugin->tpl_subscribe(); - echo '
  • '; + $items[] = '
  • ' . $quickSubPlugin->tpl_subscribe() . '
  • '; } if ($approvePlugin !== null && $approvePlugin->shouldDisplay()) { - echo '
  • '; - echo '' . inlineSVG(DOKU_PLUGIN . 'approve/admin.svg') . ''; - echo '
    '; global $ACT; - echo $approvePlugin->banner($ACT); - echo '
    '; - echo '
  • '; + $items[] = '
  • ' . + '' . inlineSVG(DOKU_PLUGIN . 'approve/admin.svg') . '' . + '
    ' . + $approvePlugin->banner($ACT) . + '
    ' . + '
  • '; } -if ($doPlugin !== null || $qcPlugin !== null || $starredPlugin !== null || $quickSubPlugin !== null || $approvePlugin !== null) { - echo ""; +if (!empty($items)) { + echo ''; }