summaryrefslogtreecommitdiff
path: root/inc/pageutils.php
diff options
context:
space:
mode:
authorAnika Henke <a.c.henke@arcor.de>2007-03-31 23:34:01 +0200
committerAnika Henke <a.c.henke@arcor.de>2007-03-31 23:34:01 +0200
commit1a84a0f3f56866c0f2d06bda411a8020e7e823e5 (patch)
tree878414a87c6441ea156df92b09b76cd88ff9adf8 /inc/pageutils.php
parent671a58a68aaa7c847262d0c5c34541e6d214b5fc (diff)
downloadrpg-1a84a0f3f56866c0f2d06bda411a8020e7e823e5.tar.gz
rpg-1a84a0f3f56866c0f2d06bda411a8020e7e823e5.tar.bz2
fix for breadcrumbs and "namespace:start" pages (FS#927) by Nathan Fritz <fritzn@crown.edu>
darcs-hash:20070331213401-d5083-2c30028ab1c81465b0295106ce6a52ce18ad87cf.gz
Diffstat (limited to 'inc/pageutils.php')
-rw-r--r--inc/pageutils.php29
1 files changed, 28 insertions, 1 deletions
diff --git a/inc/pageutils.php b/inc/pageutils.php
index 659f82298..6f21a6e2e 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -98,7 +98,7 @@ function cleanID($raw_id,$ascii=false){
// check if it's already in the memory cache
if (isset($cache[$raw_id])) {
return $cache[$raw_id];
- }
+ }
$sepchar = $conf['sepchar'];
if($sepcharpat == null) // build string only once to save clock cycles
@@ -161,6 +161,33 @@ function noNS($id) {
}
/**
+* Returns the current namespace
+*
+* @author Nathan Fritz <fritzn@crown.edu>
+*/
+function curNS($id) {
+ return noNS(getNS($id));
+}
+
+/**
+* Returns the ID without the namespace or current namespace for 'start' pages
+*
+* @author Nathan Fritz <fritzn@crown.edu>
+*/
+function noNSorNS($id) {
+ global $conf;
+
+ $p = noNS($id);
+ if ($p == $conf['start']) {
+ $p = curNS($id);
+ if ($p == false) {
+ return noNS($id);
+ }
+ }
+ return $p;
+}
+
+/**
* returns the full path to the datafile specified by ID and
* optional revision
*