diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2011-10-22 02:11:58 +0200 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2011-10-22 02:11:58 +0200 |
commit | b1f758b12b198a51db719578649db9cc95172f3c (patch) | |
tree | f78e4ebf8a49388e2ad96e49a25c3f05c38bb72a | |
parent | fc87f3d31d50ec60fdf4edc3eda68ad77e86e11c (diff) | |
download | dokuwiki-plugin-treenav-master.tar.gz dokuwiki-plugin-treenav-master.zip |
-rw-r--r-- | action.php | 24 | ||||
-rw-r--r-- | plugin.info.txt | 3 |
2 files changed, 17 insertions, 10 deletions
@@ -64,13 +64,18 @@ class action_plugin_treenav extends DokuWiki_Action_Plugin { function hook_beforePage(&$event, $param) { global $ID; - $deps = p_get_metadata($id, 'treenav_deps', true); - $cache = new cache(cleanID($ID), 'plugin_treenav'); + global $INFO; + global $config_cascade; + $deps = p_get_metadata($id, 'treenav_deps', true); + $cache = new cache(cleanID($ID) . $INFO['userinfo']['name'], 'plugin_treenav'); + if (count($deps)>0 && $cache->useCache($deps)) { $doc = $cache->retrieveCache(false); } else { - $deps = array('files' => array()); + $deps = array('files' => array($config_cascade['acl']['default'])); + $deps['files'] = array_merge($deps['files'], getConfigFiles('main')); + $root = new treenav_NamespaceNode('',0); $renderer =& p_get_renderer('xhtml'); @@ -97,7 +102,8 @@ class action_plugin_treenav extends DokuWiki_Action_Plugin { global $ID; foreach ($node->getChildren() as $child) { foreach ($child->getPages() as $page) { - if (noNS($page['id']) === 'start') { + if (noNS($page['id']) === 'start' && + auth_quickaclcheck($page['id']) >= AUTH_READ) { $renderer->listitem_open(); $deps['files'][] = wikiFN($page['id']); // Add page file to dependencies $this->_renderPagelink($page['id'], $renderer); @@ -116,10 +122,12 @@ class action_plugin_treenav extends DokuWiki_Action_Plugin { foreach ($node->getPages() as $page) { if (noNS($page['id']) == 'start' && getNS($page['id']) != '') continue; - $renderer->listitem_open(); - $deps['files'][] = wikiFN($page['id']); // Add page file to dependencies - $this->_renderPagelink($page['id'], $renderer); - $renderer->listitem_close(); + if (auth_quickaclcheck($page['id']) >= AUTH_READ) { + $renderer->listitem_open(); + $deps['files'][] = wikiFN($page['id']); // Add page file to dependencies + $this->_renderPagelink($page['id'], $renderer); + $renderer->listitem_close(); + } } } diff --git a/plugin.info.txt b/plugin.info.txt index bde3922..3c9f2b4 100644 --- a/plugin.info.txt +++ b/plugin.info.txt @@ -3,5 +3,4 @@ author Yves Fischer email yvesf-git@xapek.org date 2011-01-01 name Simple tree navigation -desc Simple tree Navigation -url http://www.example.com +desc Simple tree navigation. Shows a tree-style Navigator. This plugin cannot display nested-accessible namespaces within non-accessible namespaces. |