From c857afe0fad63243c0edb6067c1bb9678d552df0 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Fri, 24 Aug 2012 14:31:13 +0200 Subject: Allow the $check parameter of sectionID to be false --- inc/pageutils.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index d6abff894..55cc081a1 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -199,7 +199,8 @@ function noNSorNS($id) { * Creates a XHTML valid linkid from a given headline title * * @param string $title The headline title - * @param array $check Existing IDs (title => number) + * @param array|bool $check Existing IDs (title => number) + * @return string the title * @author Andreas Gohr */ function sectionID($title,&$check) { -- cgit v1.2.3 From 8449cc9d82848df24eb88a73dd81d7e048933287 Mon Sep 17 00:00:00 2001 From: Dominik Eckelmann Date: Wed, 31 Oct 2012 16:51:54 +0100 Subject: added event PAGEUTILS_ID_HIDEPAGE --- inc/pageutils.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index 55cc081a1..853d3fb4d 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -538,6 +538,14 @@ function getCacheName($data,$ext=''){ function isHiddenPage($id){ global $conf; global $ACT; + + $data = array( + 'id' => $id, + 'hidden' => false + ); + trigger_event('PAGEUTILS_ID_HIDEPAGE', $id); + + if ($data['hidden']) return true; if(empty($conf['hidepages'])) return false; if($ACT == 'admin') return false; -- cgit v1.2.3 From fb55b51ef82bc3066173e7547500d9e79c410e34 Mon Sep 17 00:00:00 2001 From: Dominik Eckelmann Date: Mon, 5 Nov 2012 10:57:42 +0100 Subject: changed PAGEUTILS_ID_HIDEPAGE to has BEFORE/AFTER --- inc/pageutils.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index 853d3fb4d..3bb10883f 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -536,23 +536,25 @@ function getCacheName($data,$ext=''){ * @author Andreas Gohr */ function isHiddenPage($id){ - global $conf; - global $ACT; - $data = array( 'id' => $id, 'hidden' => false ); - trigger_event('PAGEUTILS_ID_HIDEPAGE', $id); + trigger_event('PAGEUTILS_ID_HIDEPAGE', $data, '_isHiddenPage'); + return $data['hidden']; +} - if ($data['hidden']) return true; - if(empty($conf['hidepages'])) return false; - if($ACT == 'admin') return false; +function _isHiddenPage(&$data) { + global $conf; + global $ACT; - if(preg_match('/'.$conf['hidepages'].'/ui',':'.$id)){ - return true; + if ($data['hidden']) return; + if(empty($conf['hidepages'])) return; + if($ACT == 'admin') return; + + if(preg_match('/'.$conf['hidepages'].'/ui',':'.$data['id'])){ + $data['hidden'] = true; } - return false; } /** -- cgit v1.2.3 From c786a1b6200b051466db67a1791f46bbd375bb3b Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sun, 18 Nov 2012 12:02:20 +0000 Subject: fixed wrong sidebar showing in namespaces when sidebar is disabled --- inc/pageutils.php | 1 + 1 file changed, 1 insertion(+) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index 3bb10883f..ef82eebcd 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -645,6 +645,7 @@ function utf8_decodeFN($file){ * @return string|false the full page id of the found page, false if any */ function page_findnearest($page){ + if (!$page) return false; global $ID; $ns = $ID; -- cgit v1.2.3 From 3755fc25fd2934f8d887f713a48b342ef252cfee Mon Sep 17 00:00:00 2001 From: Tom N Harris Date: Mon, 14 Mar 2011 20:39:30 -0400 Subject: Combine subsequent calls to strtr into a single transformation --- inc/pageutils.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'inc/pageutils.php') diff --git a/inc/pageutils.php b/inc/pageutils.php index ef82eebcd..ca4936a82 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -115,11 +115,10 @@ function cleanID($raw_id,$ascii=false,$media=false){ $id = utf8_strtolower($id); //alternative namespace seperator - $id = strtr($id,';',':'); if($conf['useslash']){ - $id = strtr($id,'/',':'); + $id = strtr($id,';/','::'); }else{ - $id = strtr($id,'/',$sepchar); + $id = strtr($id,';/',':'.$sepchar); } if($conf['deaccent'] == 2 || $ascii) $id = utf8_romanize($id); -- cgit v1.2.3