Skip to content

Commit

Permalink
Added accesskey support
Browse files Browse the repository at this point in the history
  • Loading branch information
nomadjimbob committed Feb 5, 2024
1 parent 9b58a44 commit fd16ea4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,10 @@ If the plugin is installed, the **Template Styles Settings** page will be expand

## Releases

- **_2023-12-12_**
- **_2024-02-05_**
- Added access key support to page elements [#64] (https://github.com/nomadjimbob/mikio/issues/64). Thanks rebeka-catalina.

- **_2023-12-12_**

- `autoDarkLight` configuration setting will override user setting when `showDarkLight` is disabled [#56](https://github.com/nomadjimbob/mikio/issues/56).
- Cookies used in the template now use the upcoming `SameSite` requirement.
Expand Down
8 changes: 6 additions & 2 deletions mikio.php
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,10 @@ public function includeDWMenu(bool $print = true)
(strcasecmp($showItem, 'logged in') === 0 && $loggedIn === true) ||
(strcasecmp($showItem, 'logged out') === 0 && $loggedIn === false))
) {
$title = isset($attr['title']) && $attr['title'] !== 0 ? $attr['title'] : $item->getTitle();

$itemHtml .= '<a class="mikio-nav-link ' . ($isDropDown === true ? 'mikio-dropdown-item' : '') .
' ' . $item->getType() . '" href="' . $item->getLink() . '" title="' . $item->getTitle() . '">';
' ' . $item->getType() . '" href="' . $item->getLink() . '" title="' . $title . '"' . (isset($attr['accesskey']) && $attr['accesskey'] !== '' ? ' accesskey="' . $attr['accesskey'] . '"' : '') . '>';
if ($showIcons === true) {
$itemHtml .= '<span class="mikio-icon">' . inlineSVG($item->getSvg()) . '</span>';
}
Expand Down Expand Up @@ -1064,6 +1066,7 @@ public function includePageTools(bool $print = true, bool $includeId = false)
}

$classes = array_unique($classes);
$title = isset($attr['title']) && $attr['title'] !== 0 ? $attr['title'] : $item->getTitle();

$showItem = $this->getConf('pageToolsShow' . ucfirst($item->getType()), 'always');
if (
Expand All @@ -1073,7 +1076,7 @@ public function includePageTools(bool $print = true, bool $includeId = false)
) {
$html .= '<li class="' . implode(' ', $classes) . '">';
$html .= '<a href="' . $item->getLink() . '" class="' . $item->getType() . '" title="' .
$item->getTitle() . '"><div class="icon">' . inlineSVG($item->getSvg()) .
$title . '"' . (isset($attr['accesskey']) && $attr['accesskey'] !== '' ? ' accesskey="' . $attr['accesskey'] . '"' : '') . '><div class="icon">' . inlineSVG($item->getSvg()) .
'</div><span class="a11y">' . $item->getLabel() . '</span></a>';
$html .= '</li>';
}
Expand Down Expand Up @@ -1452,6 +1455,7 @@ public function includeYouAreHere(bool $print = true, bool $parse = true)
$html .= '<li>' . tpl_pagelink($page, null, true) . '</li>';
}

$exists = false;
resolve_pageid('', $page, $exists);
if ((isset($page) === true && $page === $part . $parts[$i]) === false) {
$page = $part . $parts[$i];
Expand Down
2 changes: 1 addition & 1 deletion template.info.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
base mikio
author James Collins
email james.collins@outlook.com.au
date 2023-12-11
date 2024-02-05
name Mikio theme
desc Mikio template based on Bootstrap 4 with hero element for Dokuwiki
url https://www.dokuwiki.org/template:mikio

0 comments on commit fd16ea4

Please sign in to comment.