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

@ -9,3 +9,4 @@ $conf['logo'] = 'logo.png';
$conf['discussionPage'] = 'discussion:@ID@';
$conf['userPage'] = 'user:@USER@:';
$conf['hideTools'] = 0;
$conf['tasks_page'] = 'dashboard';

View file

@ -9,3 +9,4 @@ $meta['logo'] = array('string');
$meta['discussionPage'] = array('string');
$meta['userPage'] = array('string');
$meta['hideTools'] = array('onoff');
$meta['tasks_page'] = array('string');

View file

@ -1,6 +1,6 @@
<?php
/**
* German language file
* German language file for template
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*/
@ -16,6 +16,13 @@ $lang['nav-area-head'] = 'Navigationsmenüs und Suche';
$lang['head_magic_matcher'] = 'MagicMatcher';
$lang['head_quick_search'] = 'wikiübergreifende Schnellsuche';
$lang['head_menu_main'] = 'Hauptmenü';
$lang['head_menu_status'] = 'Seitenstatus';
$lang['head_breadcrumb'] = 'Standortanzeiger';
$lang['prefix_tasks'] = 'offene Aufgaben: ';
$lang['prefix_tasks_user'] = 'Ihre offenen Aufgaben: ';
$lang['prefix_tasks_page'] = 'offene Aufgaben auf dieser Seite: ';
$lang['tasks_page_none'] = 'keine offenen Aufgaben für diese Seite';
$lang['discussion'] = 'Diskussion';
$lang['back_to_article'] = 'Zurück zum Artikel';

View file

@ -2,6 +2,7 @@
/**
* English language file for template
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*/
$lang['direct_prefix'] = 'jump to';
@ -15,6 +16,13 @@ $lang['nav-area-head'] = 'menus and quick search';
$lang['head_magic_matcher'] = 'MagicMatcher';
$lang['head_quick_search'] = 'quick search';
$lang['head_menu_main'] = 'main menu';
$lang['head_menu_status'] = 'site status';
$lang['head_breadcrumb'] = 'location indicator';
$lang['prefix_tasks'] = 'open tasks: ';
$lang['prefix_tasks_user'] = 'your open tasks: ';
$lang['prefix_tasks_page'] = 'open tasks for this page: ';
$lang['tasks_page_none'] = 'no open tasks for this page';
$lang['discussion'] = 'Discussion';
$lang['back_to_article'] = 'Back to article';

126
main.php
View file

@ -119,7 +119,6 @@ $showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');
<div class="row">
<div class="col-xs-12">
<div class="headings main-sidebar">
<?php if (tpl_getConf('logo') && file_exists(mediaFN(tpl_getConf('logo')))){
@ -132,6 +131,7 @@ $showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');
<?php if ($conf['tagline']): ?>
<p class="claim"><?php echo $conf['tagline'] ?></p>
<?php endif ?>
</div><!-- .headings -->
</div><!-- .col -->
</div><!-- .row -->
@ -141,14 +141,15 @@ $showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* Headline Menu AREA */
/* headline menu area (Accessibility ) */
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
?>
<div class="sr-only nav-area-head">
<h5 class="sr-only" role="heading" aria-level="1"><?php echo tpl_getLang('nav-area-head') ?></h5>
</div><!-- .nav-area-head -->
<?php if ($showSidebar): ?>
<div class="tools">
<div class="container">
<div class="row">
@ -162,17 +163,19 @@ $showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');
/* Include Hook: sidebarheader.html */
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
tpl_includeFile('sidebarheader.html') ?>
</div><!-- .sidebarheader -->
<div class="search main-sidebar">
<?php
<?php
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* Searchform */
/* search form */
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
include('tpl/main-sidebar-search.php');
?>
include('tpl/main-sidebar-search.php'); ?>
</div><!-- .search -->
<div id="dokuwiki__aside" class="menu main-sidebar">
@ -184,17 +187,18 @@ $showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
include('tpl/nav-main.php');
?>
</div><!-- .search -->
</div><!-- .menu -->
<div class="site-tools main-sidebar">
<?php
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* Sitetools */
/* site tools */
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
include('tpl/nav-sitetools.php');
?>
include('tpl/nav-sitetools.php'); ?>
</div><!-- .site-tools -->
@ -205,8 +209,8 @@ $showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* Include Hook: sidebarfooter.html */
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
tpl_includeFile('sidebarfooter.html')
?>
tpl_includeFile('sidebarfooter.html') ?>
</div><!-- .sidebarheader -->
</div><!-- .col -->
@ -216,53 +220,92 @@ $showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');
<?php endif ?>
<div class="top-header">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="top-header">
<div class="container">
<div class="row">
<div class="col-xs-12">
<?php
<?php
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* User Tools */
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
include('tpl/nav-usertools.php');
?>
<?php
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* MagicMatcher */
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
include('tpl/nav-magicmatcher.php');
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* Include Hook: header.html */
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
tpl_includeFile('header.html');
?>
</div><!-- .col -->
</div><!-- .row -->
</div><!-- .container -->
</div><!-- /top-header -->
<div class="content">
<div class="container">
<div class="row">
<div class="col-xs-12">
<?php tpl_flush(); /* flush the output buffer */
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* MagicMatcher */
/* Include Hook: pageheader.html */
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
include('tpl/nav-magicmatcher.php');
tpl_includeFile('pageheader.html')
?>
<?php
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* User Tools */
/* breadcrumb */
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
include('tpl/nav-usertools.php');
include('tpl/nav-breadcrumb.php'); ?>
<?php
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* Include Hook: header.html */
/* page quality / page tasks */
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
tpl_includeFile('header.html');
?>
include('tpl/nav-page-quality-tasks.php'); ?>
<div id="dokuwiki__content" class="page main-content">
<?php
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* wikipage start / main content */
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
tpl_content() /* the main content */ ?>
+
</div><!-- .main-content -->
</div><!-- .col -->
</div><!-- .row -->
</div><!-- .container -->
</div><!-- .col -->
</div><!-- .row -->
</div><!-- .container -->
</div><!-- /top-header -->
<div class="wrapper">
<!-- ********** CONTENT ********** -->
<div id="dokuwiki__content"><div class="pad">
<?php tpl_flush() /* flush the output buffer */ ?>
<?php tpl_includeFile('pageheader.html') ?>
<div class="page">
<!-- wikipage start -->
<?php tpl_content() /* the main content */ ?>
<!-- wikipage stop -->
<div class="clearer"></div>
</div>
<?php tpl_flush() ?>
<?php tpl_includeFile('pagefooter.html') ?>
@ -274,6 +317,9 @@ $showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');
<!-- PAGE ACTIONS -->
<?php if ($showTools): ?>
<div id="dokuwiki__pagetools">
<?php include('tpl/nav-status.php');?>
<h3 class="a11y"><?php echo $lang['page_tools'] ?></h3>
<ul>
<?php tpl_toolsevent('pagetools', array(

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 ?>