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') 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