summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2011-10-15 21:01:44 +0200
committerYves Fischer <yvesf-git@xapek.org>2011-10-15 21:02:11 +0200
commiteb26ead488d64ffd2e9dd02d665450c6489b39b7 (patch)
tree18b93302b9511102797e3562b9a554dafc24f7b4
parent7c67d22073a502e137241fb3659a77529c5711aa (diff)
downloaddokuwiki-plugin-treenav-eb26ead488d64ffd2e9dd02d665450c6489b39b7.tar.gz
dokuwiki-plugin-treenav-eb26ead488d64ffd2e9dd02d665450c6489b39b7.zip
fix css, link title
-rw-r--r--action.php38
-rw-r--r--style.css13
2 files changed, 28 insertions, 23 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);
}
}
diff --git a/style.css b/style.css
index d4b9944..5e061e6 100644
--- a/style.css
+++ b/style.css
@@ -1,9 +1,12 @@
-div.dokuwiki div.treenav {
+div.dokuwiki div.page div.treenav {
width: 300px;
- float: left;
+ position: absolute;
+ background-color: white;
+}
+
+div.dokuwiki div.page div.page__inner {
+ position: relative;
+ margin-left: 300px;
}
-div.dokuwiki div.page__inner {
- float:left;
-} \ No newline at end of file