pagetools footer
This commit is contained in:
53
tpl_pagetools.php
Normal file
53
tpl_pagetools.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Template partial for rendering page tools as a status bar
|
||||
*
|
||||
* This displays the page menu items in a TurboVision-style status bar
|
||||
* at the bottom of the page with prominent accesskey display.
|
||||
*
|
||||
* @var string $menuClass The menu class to use (defaults to \dokuwiki\Menu\PageMenu)
|
||||
*/
|
||||
|
||||
// must be run from within DokuWiki
|
||||
if (!defined('DOKU_INC')) die();
|
||||
|
||||
// Determine which menu to use (PageMenu for main.php, DetailMenu for detail.php)
|
||||
$menuClass = $menuClass ?? \dokuwiki\Menu\PageMenu::class;
|
||||
|
||||
try {
|
||||
$menu = new $menuClass();
|
||||
$items = $menu->getItems();
|
||||
} catch (Exception $e) {
|
||||
$items = [];
|
||||
}
|
||||
|
||||
if (empty($items)) return;
|
||||
?>
|
||||
|
||||
<nav id="dokuwiki__pagetools" class="pagetools-statusbar" aria-labelledby="dokuwiki__pagetools__heading">
|
||||
<h3 class="a11y" id="dokuwiki__pagetools__heading"><?php echo $lang['page_tools']; ?></h3>
|
||||
<ul>
|
||||
<?php foreach ($items as $item): ?>
|
||||
<?php
|
||||
$accesskey = $item->getAccesskey();
|
||||
$label = hsc($item->getLabel());
|
||||
$title = hsc($item->getTitle());
|
||||
$link = $item->getLink();
|
||||
$type = $item->getType();
|
||||
$nofollow = $item->isNofollow() ? ' rel="nofollow"' : '';
|
||||
?>
|
||||
<li class="action <?php echo $type; ?>">
|
||||
<a href="<?php echo $link; ?>"
|
||||
title="<?php echo $title; ?><?php echo $accesskey ? ' [' . $accesskey . ']' : ''; ?>"
|
||||
<?php echo $accesskey ? 'accesskey="' . $accesskey . '"' : ''; ?>
|
||||
<?php echo $nofollow; ?>>
|
||||
<?php if ($accesskey): ?>
|
||||
<span class="accesskey"><?php echo strtoupper(hsc($accesskey)); ?></span>
|
||||
<?php endif; ?>
|
||||
<span class="label"><?php echo $label; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</nav>
|
||||
Reference in New Issue
Block a user