mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
- 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
This commit is contained in:
parent
2c25e0f233
commit
b9b70c9ceb
2 changed files with 26 additions and 3 deletions
|
@ -573,7 +573,7 @@ class acp_modules
|
||||||
while ($file = readdir($dh))
|
while ($file = readdir($dh))
|
||||||
{
|
{
|
||||||
// Is module?
|
// Is module?
|
||||||
if (strpos($file, $this->module_class . '_') === 0)
|
if (preg_match('/^' . $this->module_class . '_.+\.' . $phpEx . '$/', $file))
|
||||||
{
|
{
|
||||||
$class = str_replace(".$phpEx", '', $file) . '_info';
|
$class = str_replace(".$phpEx", '', $file) . '_info';
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,6 @@ class p_master
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . MODULES_TABLE . "
|
FROM ' . MODULES_TABLE . "
|
||||||
WHERE module_class = '" . $db->sql_escape($p_class) . "'
|
WHERE module_class = '" . $db->sql_escape($p_class) . "'
|
||||||
AND module_enabled = 1
|
|
||||||
ORDER BY left_id ASC";
|
ORDER BY left_id ASC";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
@ -101,7 +100,7 @@ class p_master
|
||||||
}
|
}
|
||||||
|
|
||||||
$right = $depth = $i = 0;
|
$right = $depth = $i = 0;
|
||||||
$depth_ary = array();
|
$depth_ary = $disable = array();
|
||||||
|
|
||||||
foreach ($this->module_cache['modules'] as $row)
|
foreach ($this->module_cache['modules'] as $row)
|
||||||
{
|
{
|
||||||
|
@ -126,6 +125,30 @@ class p_master
|
||||||
continue;
|
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)
|
if ($row['left_id'] < $right)
|
||||||
{
|
{
|
||||||
$depth++;
|
$depth++;
|
||||||
|
|
Loading…
Add table
Reference in a new issue