Skip to content
Browse files

Don't rely on the global $NS

This variable isn't documented, the plugin now works with the current devel version of DW
  • Loading branch information...
1 parent cee0510 commit c9417dced1c6f3768f8afa91ed4bf07acdb839cd @gturri committed
Showing with 3 additions and 4 deletions.
  1. +1 −1 plugin.info.txt
  2. +2 −3 syntax.php
View
2 plugin.info.txt
@@ -1,7 +1,7 @@
base nspages
author Guillaume Turri
email guillaume.turri@gmail.com
-date 2010-10-18
+date 2011-01-08
name nspages plugin
desc Presents a toc of the selected namespace using <nspages>
url http://www.dokuwiki.org/plugin:nspages
View
5 syntax.php
@@ -22,7 +22,7 @@
if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
require_once(DOKU_PLUGIN.'syntax.php');
require_once(DOKU_INC . 'inc/search.php');//to use the search() functions
-require_once(DOKU_INC . 'inc/pageutils.php');//to use the noNS() and resolve_pageid() functions
+require_once(DOKU_INC . 'inc/pageutils.php');//to use noNS, getNS and resolve_pageid
require_once(DOKU_INC . 'inc/parserutils.php');//to use the p_get_first_heading function
@@ -131,8 +131,7 @@ function handle($match, $state, $pos, &$handler) {
}
if ( $wantedNS[0] == '.' ){
//if it start with a '.', it is a relative path
- global $NS;
- $return['wantedNS'] = $NS;
+ $return['wantedNS'] = getNS($ID);
}
$return['wantedNS'] .= ':'.$wantedNS.':';

0 comments on commit c9417dc

Please sign in to comment.
Something went wrong with that request. Please try again.