summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/common.php2
-rw-r--r--inc/pageutils.php29
2 files changed, 29 insertions, 2 deletions
diff --git a/inc/common.php b/inc/common.php
index 2c200cf5a..df1017f61 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -236,7 +236,7 @@ function breadcrumbs(){
}
// page names
- $name = noNS($ID);
+ $name = noNSorNS($ID);
if ($conf['useheading']) {
// get page title
$title = p_get_first_heading($ID);
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
*