diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2005-12-25 11:10:06 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2005-12-25 11:10:06 +0000 |
commit | b9b70c9ceb41925e0073199c6fec8fb70c9b796c (patch) | |
tree | 98001bed7b1034d362901563511cfa30c6a437df /phpBB | |
parent | 2c25e0f233e2a72afee4cbe789441ae2fe5e4720 (diff) | |
download | forums-b9b70c9ceb41925e0073199c6fec8fb70c9b796c.tar forums-b9b70c9ceb41925e0073199c6fec8fb70c9b796c.tar.gz forums-b9b70c9ceb41925e0073199c6fec8fb70c9b796c.tar.bz2 forums-b9b70c9ceb41925e0073199c6fec8fb70c9b796c.tar.xz forums-b9b70c9ceb41925e0073199c6fec8fb70c9b796c.zip |
- only include modules with the correct extension. ;)
- fix evaluating if module is enabled or disabled (now disables all childs if parent/category is disabled)
git-svn-id: file:///svn/phpbb/trunk@5376 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/acp/acp_modules.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_module.php | 27 |
2 files changed, 26 insertions, 3 deletions
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index ef890a7f96..bb7adfa988 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -573,7 +573,7 @@ class acp_modules while ($file = readdir($dh)) { // Is module? - if (strpos($file, $this->module_class . '_') === 0) + if (preg_match('/^' . $this->module_class . '_.+\.' . $phpEx . '$/', $file)) { $class = str_replace(".$phpEx", '', $file) . '_info'; diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index ae7e2d47f7..53218402c3 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -69,7 +69,6 @@ class p_master $sql = 'SELECT * FROM ' . MODULES_TABLE . " WHERE module_class = '" . $db->sql_escape($p_class) . "' - AND module_enabled = 1 ORDER BY left_id ASC"; $result = $db->sql_query($sql); @@ -101,7 +100,7 @@ class p_master } $right = $depth = $i = 0; - $depth_ary = array(); + $depth_ary = $disable = array(); foreach ($this->module_cache['modules'] as $row) { @@ -126,6 +125,30 @@ class p_master continue; } + // Not enabled? + if (!$row['module_enabled']) + { + // If category is disabled then disable every child too + if (!$row['module_name']) + { + $disable['left_id'] = $row['left_id']; + $disable['right_id'] = $row['right_id']; + } + + continue; + } + + if (sizeof($disable)) + { + if ($row['left_id'] > $disable['left_id'] && $row['left_id'] < $disable['right_id'] && + $row['right_id'] > $disable['left_id'] && $row['right_id'] < $disable['right_id']) + { + continue; + } + + $disable = array(); + } + if ($row['left_id'] < $right) { $depth++; |