-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtpl_toolbar.php
45 lines (38 loc) · 1.54 KB
/
tpl_toolbar.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php // must be run from within DokuWiki
if (!defined('DOKU_INC')) die();
?> <div id="site-toolbar">
<div id="tb-siteinfo">
<?php
$tbStyle = tpl_getConf('toolbarstyle');
/* lists of tb items that should *not* be shown: */
$exTB = ['top', 'profile', 'login','logout']; /* don't show in toolbar */
$exPop = ['top']; /* don't show in popup menu */
if (tpl_getConf('userinfo') == 'toolbar') {
my_userinfo(str_repeat(chr(9),5));
} else {
tpl_includeFile('toolbarinfo.html');
}
/* collect all toolbar items from various DW menus: */
$list = array_merge(
(new \dokuwiki\Menu\PageMenu())->getItems(),
(new \dokuwiki\Menu\SiteMenu())->getItems(),
(new \dokuwiki\Menu\UserMenu())->getItems(),
);
$svgIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5.59,7.41L7,6L13,12L7,18L5.59,16.59L10.17,12L5.59,7.41M11.59,7.41L13,6L19,12L13,18L11.59,16.59L16.17,12L11.59,7.41Z" /></svg>';
?>
</div>
<div id="site-toolbar-group">
<?php
my_actionlist(str_repeat(chr(9),4), 'pagetools-menu', $list, $exTB, $tbStyle, false);
?>
<div id="tb-menu-group">
<button id="pagetools-btn" aria-haspopup="menu" aria-controls="pagetools-popup" title="<?php echo htmlentities($lang['tools']); ?>" data-align_menu="right">
<?php echo $svgIcon; ?>
<span class="label sr-only"><?php echo htmlentities($lang['tools']); ?></span>
</button>
<?php
my_actionlist(str_repeat(chr(9),6), 'pagetools-popup', $list, $exPop, '', true);
?>
</div>
</div>
</div>