aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_module.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-06-06 10:45:43 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-06-06 10:45:43 +0000
commit2ab88e7c56619d303c991251522aaaf6ae454fa7 (patch)
tree6943dbd024f85bb8b98c0583260dbf84605fe6e8 /phpBB/includes/functions_module.php
parent69f132fec866034a1f532f65828ccae5c34680aa (diff)
downloadforums-2ab88e7c56619d303c991251522aaaf6ae454fa7.tar
forums-2ab88e7c56619d303c991251522aaaf6ae454fa7.tar.gz
forums-2ab88e7c56619d303c991251522aaaf6ae454fa7.tar.bz2
forums-2ab88e7c56619d303c991251522aaaf6ae454fa7.tar.xz
forums-2ab88e7c56619d303c991251522aaaf6ae454fa7.zip
ok, try this one. :) Hopefully not breaking anything.
git-svn-id: file:///svn/phpbb/trunk@6013 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_module.php')
-rw-r--r--phpBB/includes/functions_module.php43
1 files changed, 42 insertions, 1 deletions
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index cc8b093d4b..e1a629ca7c 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -463,7 +463,7 @@ class p_master
{
global $template;
- $current_id = false;
+ $current_id = $right_id = false;
// Make sure the module_url has a question mark set, effectively determining the delimiter to use
$delim = (strpos($module_url, '?') === false) ? '?' : '&amp;';
@@ -478,11 +478,52 @@ class p_master
// and a linear list for subcategories/items
foreach ($this->module_ary as $row_id => $itep_ary)
{
+ // Skip hidden modules
if (!$itep_ary['display'])
{
continue;
}
+ // Skip branch
+ if ($right_id !== false)
+ {
+ if ($itep_ary['left'] < $right_id)
+ {
+ continue;
+ }
+
+ $right_id = false;
+ }
+
+ // Category with no members on their way down (we have to check every level)
+ if (!$itep_ary['name'])
+ {
+ $empty_category = true;
+
+ // We go through the branch and look for an activated module
+ foreach (array_slice($this->module_ary, $row_id + 1) as $temp_row)
+ {
+ if ($temp_row['left'] > $itep_ary['left'] && $temp_row['left'] < $itep_ary['right'])
+ {
+ // Module there and displayed?
+ if ($temp_row['name'] && $temp_row['display'])
+ {
+ $empty_category = false;
+ break;
+ }
+ continue;
+ }
+ break;
+ }
+
+ // Skip the branch
+ if ($empty_category)
+ {
+ $right_id = $itep_ary['right'];
+ continue;
+ }
+ }
+
// Select first id we can get
if (!$current_id && (in_array($itep_ary['id'], array_keys($this->module_cache['parents'])) || $itep_ary['id'] == $this->p_id))
{