From 4354cda6dc695806dc01fdad1e4d11b2749ee9d4 Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Wed, 31 May 2006 20:26:48 +0000 Subject: Misc module ordering stuff/missing modules. There's still 1 minor bit to fix up.... git-svn-id: file:///svn/phpbb/trunk@5994 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_install.php | 69 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 2 deletions(-) (limited to 'phpBB/install/install_install.php') diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index ae3048122c..233bfb391e 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1262,6 +1262,53 @@ class install_install extends module } } + // And now for the special ones + // (these are modules which appear in multiple categories and thus get added manually to some for more control) + if (isset($this->module_extras[$module_class])) + { + foreach ($this->module_extras[$module_class] as $cat_name => $mods) + { + $sql = 'SELECT module_id, left_id, right_id FROM ' . MODULES_TABLE . " + WHERE module_langname = '$cat_name' + AND module_class = '$module_class' + LIMIT 1"; + $result = $db->sql_query($sql); + $row2 = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + foreach ($mods as $mod_name) + { + $sql = 'SELECT * FROM ' . MODULES_TABLE . " + WHERE module_langname = '$mod_name' + AND module_class = '$module_class' + LIMIT 1"; + $result = $db->sql_query($sql); + $module_data = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $sql = 'UPDATE ' . MODULES_TABLE . " + SET left_id = left_id + 2, right_id = right_id + 2 + WHERE module_class = '" . $module_class . "' + AND left_id > {$row2['right_id']}"; + $db->sql_query($sql); + + $sql = 'UPDATE ' . MODULES_TABLE . " + SET right_id = right_id + 2 + WHERE module_class = '" . $module_class . "' + AND {$row2['left_id']} BETWEEN left_id AND right_id"; + $db->sql_query($sql); + + unset($module_data['module_id']); + $module_data['parent_id'] = $row2['module_id']; + $module_data['left_id'] = $row2['right_id']; + $module_data['right_id'] = $row2['right_id'] + 1; + + $sql = 'INSERT INTO ' . MODULES_TABLE . ' ' . $db->sql_build_array('INSERT', $module_data); + $db->sql_query($sql); + } + } + } + recalc_btree('module_id', MODULES_TABLE, $module_class); $_module->remove_cache_file(); } @@ -1649,8 +1696,8 @@ class install_install extends module 'ACP_SERVER_CONFIGURATION', ), 'ACP_CAT_FORUMS' => array( - 'ACP_CAT_FORUMS', - 'FORUM_BASED_PERMISSIONS', + 'ACP_MANAGE_FORUMS', + 'ACP_FORUM_BASED_PERMISSIONS', ), 'ACP_CAT_POSTING' => array( 'ACP_MESSAGES', @@ -1701,6 +1748,24 @@ class install_install extends module 'UCP_ZEBRA' => null, ), ); + var $module_extras = array( + 'acp' => array( + 'ACP_QUICK_ACCESS' => array( + 'ACP_MANAGE_USERS', + 'ACP_GROUPS_MANAGE', + 'ACP_MANAGE_FORUMS', + 'ACP_MOD_LOGS', + 'ACP_BOTS', + 'ACP_PHP_INFO', + ), + 'ACP_FORUM_BASED_PERMISSIONS' => array( + 'ACP_FORUM_PERMISSIONS', + 'ACP_FORUM_MODERATORS', + 'ACP_USERS_FORUM_PERMISSIONS', + 'ACP_GROUPS_FORUM_PERMISSIONS', + ), + ), + ); } ?> \ No newline at end of file -- cgit v1.2.1