page tools / user tools

This commit is contained in:
Jana Deutschländer 2016-12-15 17:22:34 +01:00
commit cb680b1364
14 changed files with 242 additions and 92 deletions

View file

@ -1,6 +1,5 @@
<?php
if (!defined('DOKU_INC')) die();
echo '<div class="logo">';
/* homepage logo should not link to itself (BITV accessibility requirement) */
@ -8,6 +7,5 @@
echo '<img src="'.ml(tpl_getConf('logo')).'" alt="'.tpl_getLang('adjunct_start_logo_text').$conf['title'].'" />';
} else{
tpl_link( wl(),'<img src="'.ml(tpl_getConf('logo')).'" alt="'.$conf['title'].tpl_getLang('adjunct_linked_logo_text').'" />','accesskey="h" title="[H]"' );
}
echo "</div><!-- .logo -->";
echo "</div>";

View file

@ -1,5 +1,6 @@
<?php
if (!defined('DOKU_INC')) die();
echo '<h6 class="sr-only" role="heading" aria-level="2">'.tpl_getLang('head_quick_search').'</h6>';
tpl_searchform();

11
tpl/nav-breadcrumb.php Normal file
View file

@ -0,0 +1,11 @@
<?php
if (!defined('DOKU_INC')) die();
if ($conf['breadcrumbs']): ?>
<div class="breadcrumbs">
<h6 class="sr-only" role="heading" aria-level="2"><?php echo tpl_getLang('head_breadcrumb') ?></h6>
<p><?php tpl_youarehere() ?></p>
</div>
<?php endif ?>

View file

@ -2,18 +2,16 @@
if (!defined('DOKU_INC')) die();
?>
<div id="dokuwiki_magic-matcher" class="magic-matcher no-print">
<div class="container">
<?php
$mm = plugin_load('helper', 'magicmatcher_context');
if($mm){
echo "<h6 class=\"sr-only\" role=\"heading\" aria-level=\"2\">";
echo tpl_getLang('head_magic_matcher');
echo "</h6>";
$mm->tpl();
}
?>
</div><!-- .container -->
</div><!-- .magic-matcher -->
<div id="dokuwiki_magic-matcher" class="magic-matcher no-print">
<div class="container">
<?php
$mm = plugin_load('helper', 'magicmatcher_context');
if($mm){
echo "<h6 class=\"sr-only\" role=\"heading\" aria-level=\"2\">".tpl_getLang('head_magic_matcher')."</h6>";
echo PHP_EOL;
$mm->tpl();
echo PHP_EOL;
}
?>
</div><!-- .container -->
</div><!-- .magic-matcher -->

View file

@ -1,7 +1,10 @@
<?php
if (!defined('DOKU_INC')) die();
?>
<nav class="nav-main">
<h6 class="sr-only" role="heading" aria-level="2"><?php echo $lang['site_tools']; ?></h6>
<?php tpl_include_page($conf['sidebar'], 1, 1) /* includes the nearest sidebar page */ ?>
</nav>
echo "<nav class=\"nav-main\">";
echo "<h6 class=\"sr-only\" role=\"heading\" aria-level=\"2\">".tpl_getLang('head_menu_main')."</h6>";
echo PHP_EOL;
tpl_include_page($conf['sidebar'], 1, 1);
echo PHP_EOL;
echo "</nav>";

View file

@ -0,0 +1,41 @@
<?php
if (!defined('DOKU_INC')) die();
?>
<?php
$doplugin = plugin_load('helper','do');
if ($doplugin !== null) {
echo "<ul>";
$tasks = $doplugin->getPageTaskCount();
$num = $tasks[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;
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;*/

View file

@ -1,15 +1,14 @@
<?php
if (!defined('DOKU_INC')) die();
?>
<nav id="dokuwiki__sitetools" class="nav-usertools">
<h6 class="sr-only" role="heading" aria-level="2"><?php echo $lang['site_tools']; ?></h6>
<ul>
<?php
tpl_toolsevent('sitetools', array(
'recent' => tpl_action('recent', 1, 'li', 1),
'media' => tpl_action('media', 1, 'li', 1),
'index' => tpl_action('index', 1, 'li', 1),
));
?>
</ul>
</nav>
if ($showSidebar): ?>
<nav id="dokuwiki__sitetools" class="nav-sitetools">
<h6 class="sr-only" role="heading" aria-level="2"><?php echo $lang['site_tools']; ?></h6>
<ul><?php tpl_toolsevent('sitetools', array(
'recent' => tpl_action('recent', 1, 'li', 1),
'media' => tpl_action('media', 1, 'li', 1),
'index' => tpl_action('index', 1, 'li', 1),
)); ?></ul>
</nav>
<?php endif ?>

7
tpl/nav-status.php Normal file
View file

@ -0,0 +1,7 @@
<?php
if (!defined('DOKU_INC')) die();
?>
<nav class="nav-status">
<h6 class="sr-only" role="heading" aria-level="2"><?php echo $lang['site_status']; ?></h6>
<?php tpl_include_page($conf['statusbar'], 1, 1) /* includes the nearest statusbar page */ ?>
</nav>

View file

@ -3,20 +3,49 @@
if ($conf['useacl'] && $showTools): ?>
<nav id="dokuwiki__usertools" class="nav-usertools">
<h6 class="sr-only" role="heading" aria-level="2"><?php echo $lang['user_tools']; ?></h6>
<ul>
<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>';
}?>
<nav id="dokuwiki__usertools" class="nav-usertools">
<h6 class="sr-only" role="heading" aria-level="2"><?php echo $lang['user_tools']; ?></h6>
<ul>
<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 tpl_toolsevent('usertools', array(
'admin' => tpl_action('admin', 1, 'li', 1),
'register' => tpl_action('register', 1, 'li', 1),
)); ?>
<?php /* tasks do Plug-In */
$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 = '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 */
tpl_toolsevent('usertools', array(
'admin' => tpl_action('admin', 1, 'li', 1),
'register' => tpl_action('register', 1, 'li', 1),
)); ?>
</ul>
</nav><!-- #dokuwiki__usertools -->
<?php endif ?>
</ul>
</nav><!-- #dokuwiki__usertools -->
<?php endif ?>