Skip to content
Permalink
Browse files

Merge branch 'release/2017-11-21'

  • Loading branch information...
micgro42 committed Nov 21, 2017
2 parents e6b00f2 + 87c024e commit 277929b4f3b857ab59790045fda977bd495d32f8
Showing with 8 additions and 8 deletions.
  1. +7 −7 helper.php
  2. +1 −1 plugin.info.txt
@@ -7,19 +7,16 @@
class helper_plugin_sitemapnavi extends DokuWiki_Plugin {
protected $baseNS;
public function getSiteMap($baseNS)
{
global $conf, $INFO;
$this->baseNS = $baseNS;
$base = $conf['datadir'] . '/' . str_replace(':', '/', $baseNS);
$subdir = trim(str_replace(':', '/', $baseNS),'/');
$level = $this->getNumberOfSubnamespaces($baseNS) + 1;
$pages = array();
$currentNS = utf8_encodeFN(str_replace(':', '/', $INFO['namespace']));
search($pages, $base, 'search_index', array('ns' => $currentNS), '', $level);
search($pages, $conf['datadir'], 'search_index', array('ns' => $currentNS), $subdir, $level);
$media = array();
search($media, $conf['mediadir'], [$this, 'searchMediaIndex'], array('ns' => $currentNS, 'depth' => 1, 'showmsg'=>false), str_replace(':', '/', $baseNS));
$media = array_map(function($mediaFile) {
@@ -61,6 +58,9 @@ protected function getNumberOfSubnamespaces($namespace) {
protected function sortMediaAfterPages(array $items) {
$numberOfItems = count($items);
if (empty($items)) {
return $items;
}
$count = 0;
$hasChanged = false;
$isUnsorted = true;
@@ -195,7 +195,7 @@ public function searchMediaIndex(&$data,$base,$file,$type,$lvl,$opts) {
public function listItemCallback($item)
{
$fullId = cleanID($this->baseNS . ':' . $item['id']);
$fullId = cleanID($item['id']);
$ret = '';
$base = ':' . $fullId;
@@ -221,7 +221,7 @@ public function liCallback($item)
{
global $INFO;
$currentClass = '';
$adjustedItemID = str_replace('::', ':', $this->baseNS . ':' . $item['id']);
$adjustedItemID = str_replace('::', ':', ':' . $item['id']);
if (strpos(':' . $INFO['id'] . ':', $adjustedItemID . ':') === 0) {
$currentClass = 'current';
}
@@ -1,7 +1,7 @@
base sitemapnavi
author Michael Große
email grosse@cosmocode.de
date 2017-11-06
date 2017-11-21
name sitemapnavi plugin
desc Syntax to show the sitemap
url https://dokuwiki.org/plugin:sitemapnavi

0 comments on commit 277929b

Please sign in to comment.
You can’t perform that action at this time.