summaryrefslogtreecommitdiff
path: root/action.php
diff options
context:
space:
mode:
Diffstat (limited to 'action.php')
-rw-r--r--action.php38
1 files changed, 20 insertions, 18 deletions
diff --git a/action.php b/action.php
index cbf20c9..941937c 100644
--- a/action.php
+++ b/action.php
@@ -11,6 +11,7 @@ require_once DOKU_PLUGIN.'action.php';
function search_namespaces1(&$data,$base,$file,$type,$lvl,$opts){
$opts['listdirs'] = true;
+ $opts['depth'] = 1;
return search_universal($data,$base,$file,$type,$lvl,$opts);
}
@@ -71,24 +72,20 @@ class action_plugin_treenav extends DokuWiki_Action_Plugin {
global $ID;
foreach ($node->getChildren() as $child) {
foreach ($child->getPages() as $page) {
- if ($page['id'] == $child->name . ':start') {
- $page_id_start = $page['id'];
+ if (noNS($page['id']) === 'start') {
+ $renderer->listitem_open();
+ $renderer->cdata('>');
+ $this->_renderPagelink($page['id'], $renderer);
+ if (strpos(getNS($ID), $child->name) === 0) {
+ // Recursive Call with Sub-Namespace that contains
+ // current Page ($ID)
+ $renderer->listu_open();
+ $this->_print($child, $renderer);
+ $renderer->listu_close();
+ }
+ $renderer->listitem_close();
}
}
- if ($page_id_start) {
- $renderer->listitem_open();
- $renderer->cdata('>');
- $this->_renderPagelink($page['id'], $renderer);
- if (strpos(getNS($ID), $child->name) === 0) {
- // Recursive Call with Sub-Namespace that contains
- // current Page ($ID)
- $renderer->listu_open();
- $this->_print($child, $renderer);
- $renderer->listu_close();
- }
- $renderer->listitem_close();
- $page_id_start = NULL;
- }
}
foreach ($node->getPages() as $page) {
@@ -109,7 +106,12 @@ class action_plugin_treenav extends DokuWiki_Action_Plugin {
$renderer->_media($mediaid, NULL, NULL, 32, 32);
}
}
- // 432 function resolve_mediaid($ns,&$page,&$exists){
- $renderer->internallink($id);
+ if ($options['title']) {
+ $title = $options['title'];
+ } else {
+ $title = p_get_first_heading($id);
+ }
+
+ $renderer->internallink($id, $title);
}
}