diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-03-26 15:42:05 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-03-26 15:42:05 +0000 |
commit | 8ba8caec2dcdfcb755beeeaebc83c5ad1e057758 (patch) | |
tree | 3834d961d46b647ddc22f1f1f9c3a88dc981d2ee /phpBB/includes/functions_module.php | |
parent | b9d77ef8d56a5db128b519f466ed7f4b32c0dc89 (diff) | |
download | forums-8ba8caec2dcdfcb755beeeaebc83c5ad1e057758.tar forums-8ba8caec2dcdfcb755beeeaebc83c5ad1e057758.tar.gz forums-8ba8caec2dcdfcb755beeeaebc83c5ad1e057758.tar.bz2 forums-8ba8caec2dcdfcb755beeeaebc83c5ad1e057758.tar.xz forums-8ba8caec2dcdfcb755beeeaebc83c5ad1e057758.zip |
some tiny bugfixes and changed is_active() a bit...
git-svn-id: file:///svn/phpbb/trunk@7232 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_module.php')
-rw-r--r-- | phpBB/includes/functions_module.php | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 651e35032c..f2494820ae 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -467,39 +467,21 @@ class p_master /** * Check if a module is active */ - function is_active($id = false) + function is_active($id, $mode = false) { - $icat = false; - - $category = false; + // If we find a name by this id and being enabled we have our active one... foreach ($this->module_ary as $row_id => $item_ary) { - // If this is a module and it's selected, active - // If this is a category and the module is the first within it, active - // If this is a module and no mode selected, select first mode - // If no category or module selected, go active for first module in first category - if ( - (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && (($item_ary['mode'] == false && !$item_ary['cat']) || ($icat && $item_ary['cat']))) || - ($item_ary['parent'] === $category && !$item_ary['cat'] && !$icat && $item_ary['display']) || - (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && !$item_ary['cat']) || - (!$id && !$item_ary['cat'] && $item_ary['display']) - ) + if (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && $item_ary['display']) { - if ($item_ary['cat']) + if ($mode === false || $mode === $item_ary['mode']) { - $id = $icat; - $icat = false; - - continue; + return true; } - - return $item_ary['id']; - } - else if (($item_ary['cat'] && $item_ary['id'] === (int) $id) || ($item_ary['parent'] === $category && $item_ary['cat'])) - { - $category = $item_ary['id']; } } + + return false; } /** |