SPR-863: better order for usertool icons
This commit is contained in:
parent
3184beecb0
commit
31170e6e05
1 changed files with 45 additions and 44 deletions
|
@ -3,52 +3,53 @@
|
||||||
|
|
||||||
if ($conf['useacl'] && $showTools): ?>
|
if ($conf['useacl'] && $showTools): ?>
|
||||||
|
|
||||||
<nav id="dokuwiki__usertools" class="nav-usertools <?php echo $navClass?>">
|
<nav id="dokuwiki__usertools" class="nav-usertools <?php echo $navClass?>">
|
||||||
<h6 class="sr-only" role="heading" aria-level="2"><?php echo $lang['user_tools']; ?></h6>
|
<h6 class="sr-only" role="heading" aria-level="2"><?php echo $lang['user_tools']; ?></h6>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="log"><?php tpl_actionlink('login'); ?></li>
|
<li class="log"><?php tpl_actionlink('login'); ?></li>
|
||||||
<?php
|
|
||||||
if (!empty($_SERVER['REMOTE_USER'])) {
|
|
||||||
echo '<li class="user"><span class="sr-only">'.$lang['loggedinas'].' </span>'.userlink().'</li>';
|
|
||||||
}?>
|
|
||||||
|
|
||||||
<?php /* tasks do Plug-In */
|
<?php
|
||||||
/** @var \helper_plugin_do $doplugin */
|
if (!empty($_SERVER['REMOTE_USER'])) {
|
||||||
$doplugin = plugin_load('helper','do');
|
echo '<li class="user"><span class="sr-only">'.$lang['loggedinas'].' </span>'.userlink().'</li>';
|
||||||
if ($doplugin !== null && isset($_SERVER['REMOTE_USER'])) {
|
}?>
|
||||||
$tasks = $doplugin->loadTasks(array('status' => array('undone'),'user' => $_SERVER['REMOTE_USER']));
|
|
||||||
$num = count($tasks);
|
|
||||||
switch ($num) {
|
|
||||||
case 0: $class = 'noopentasks'; break;
|
|
||||||
case 1: $class = 'opentask'; break;
|
|
||||||
default:
|
|
||||||
$class = 'opentask opentasks';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$linktarget = tpl_getConf('tasks_page');
|
|
||||||
$doInner = "<span class=\"prefix\">".tpl_getLang('prefix_tasks_user')." </span><span class=\"num\">".count($tasks)."</span>";
|
|
||||||
if($linktarget){
|
|
||||||
if (substr($linktarget, 0, 1) !== ':') {
|
|
||||||
$linktarget = tpl_getConf('user_ns'). $_SERVER['REMOTE_USER'] .':' . $linktarget;
|
|
||||||
}
|
|
||||||
if($num == 0){
|
|
||||||
echo '<li class="user-task '.$class.'"><strong>'.$doInner.'</strong></li>';
|
|
||||||
}else{
|
|
||||||
echo '<li class="user-task '.$class.'"><a href="'.wl($linktarget).'">'.$doInner.'</a></li>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
echo '<li class="user-task '.$class.'"><strong>'.$doInner.'</strong></li>';
|
|
||||||
}
|
|
||||||
} ?>
|
|
||||||
|
|
||||||
<?php /* dokuwiki user tools */
|
<?php /* dokuwiki user tools */
|
||||||
tpl_toolsevent('usertools', array(
|
tpl_toolsevent('usertools', array(
|
||||||
'admin' => tpl_action('admin', 1, 'li', 1),
|
'admin' => tpl_action('admin', 1, 'li', 1),
|
||||||
'register' => tpl_action('register', 1, 'li', 1),
|
'register' => tpl_action('register', 1, 'li', 1),
|
||||||
)); ?>
|
)); ?>
|
||||||
|
|
||||||
</ul>
|
<?php /* tasks do Plug-In */
|
||||||
</nav><!-- #dokuwiki__usertools -->
|
/** @var \helper_plugin_do $doplugin */
|
||||||
|
$doplugin = plugin_load('helper','do');
|
||||||
|
if ($doplugin !== null && isset($_SERVER['REMOTE_USER'])) {
|
||||||
|
$tasks = $doplugin->loadTasks(array('status' => array('undone'),'user' => $_SERVER['REMOTE_USER']));
|
||||||
|
$num = count($tasks);
|
||||||
|
switch ($num) {
|
||||||
|
case 0: $class = 'noopentasks'; break;
|
||||||
|
case 1: $class = 'opentask'; break;
|
||||||
|
default:
|
||||||
|
$class = 'opentask opentasks';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$linktarget = tpl_getConf('tasks_page');
|
||||||
|
$doInner = "<span class=\"prefix\">".tpl_getLang('prefix_tasks_user')." </span><span class=\"num\">".count($tasks)."</span>";
|
||||||
|
if($linktarget){
|
||||||
|
if (substr($linktarget, 0, 1) !== ':') {
|
||||||
|
$linktarget = tpl_getConf('user_ns'). $_SERVER['REMOTE_USER'] .':' . $linktarget;
|
||||||
|
}
|
||||||
|
if($num == 0){
|
||||||
|
echo '<li class="user-task '.$class.'"><strong>'.$doInner.'</strong></li>';
|
||||||
|
}else{
|
||||||
|
echo '<li class="user-task '.$class.'"><a href="'.wl($linktarget).'">'.$doInner.'</a></li>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
echo '<li class="user-task '.$class.'"><strong>'.$doInner.'</strong></li>';
|
||||||
|
}
|
||||||
|
} ?>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav><!-- #dokuwiki__usertools -->
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue