Integrate ACL page permissions from plugin aclinfo in sidebar

If the aclinfo plugin is installed a new item for the page permissions
will be added to the sidebar menu.

Signed-off-by: Frieder Schrempf <dev@fris.de>
This commit is contained in:
Frieder Schrempf 2021-04-30 15:30:01 +02:00
commit a90ea9c9c0
No known key found for this signature in database
GPG key ID: E7DD51F45F833802
4 changed files with 29 additions and 0 deletions

1
img/key.svg Normal file
View file

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path fill="#000000" d="M7,14A2,2 0 0,1 5,12A2,2 0 0,1 7,10A2,2 0 0,1 9,12A2,2 0 0,1 7,14M12.65,10C11.83,7.67 9.61,6 7,6A6,6 0 0,0 1,12A6,6 0 0,0 7,18C9.61,18 11.83,16.33 12.65,14H17V18H21V14H23V10H12.65Z" /></svg>

After

Width:  |  Height:  |  Size: 491 B

View file

@ -21,6 +21,7 @@ $lang['head_menu_status'] = 'Seitenstatus';
$lang['head_breadcrumb_youarehere'] = 'Standortanzeiger';
$lang['head_menu_trace'] = 'Zuletzt Angesehen';
$lang['head_meta_box'] = 'Metainformationen zur Seite';
$lang['head_menu_aclinfo'] = 'Seitenberechtigungen';
$lang['head_menu_starred'] = 'Gemerkte Seiten';
$lang['head_menu_tool-select'] = 'Werkzeuge';

View file

@ -21,6 +21,7 @@ $lang['head_menu_status'] = 'site status';
$lang['head_breadcrumb_youarehere'] = 'location indicator';
$lang['head_menu_trace'] = 'Last Visited Pages';
$lang['head_meta_box'] = 'meta data for this page';
$lang['head_menu_aclinfo'] = 'Page Permissions';
$lang['head_menu_starred'] = 'Starred Pages';
$lang['head_menu_tool-select'] = 'Tools';

View file

@ -56,6 +56,32 @@ echo \dokuwiki\template\sprintdoc\Template::getInstance()->getNavigation();
</div>
</nav>
<?php
/** @var helper_plugin_aclinfo $plugin_aclinfo */
$plugin_aclinfo = plugin_load('helper', 'aclinfo');
$aclinfo = array();
if($plugin_aclinfo) $aclinfo = $plugin_aclinfo->getACLInfo($ID);
if($aclinfo):
?>
<nav class="nav-aclinfo">
<div class="nav"><a href="#sidebar-menu-aclinfo" role="heading" aria-level="2">
<span class="ico"><?php echo inlineSVG(__DIR__ . '/../img/key.svg') ?></span>
<span class="lbl"><?php echo tpl_getLang('head_menu_aclinfo'); ?></span>
</a></div>
<div class="nav-panel level1 plugin_aclinfo">
<ul id="sidebar-menu-aclinfo">
<?php
foreach($aclinfo as $entry) {
echo '<li>';
echo $plugin_aclinfo->getACLInfoString($entry);
echo '</li>';
}
?>
</ul>
</div>
</nav>
<?php endif; ?>
<?php
/** @var helper_plugin_starred $plugin_starred */
$plugin_starred = plugin_load('helper', 'starred');