diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-06-15 21:39:44 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-06-15 21:39:44 +0000 |
commit | e9110c666e18cb10b1299da1150095390bbe3cd7 (patch) | |
tree | b079be0726bfe30d1c62f9ab7fbb0d97ea7e20ba /phpBB | |
parent | 86cc481f1c534362191ab54248eb94847c294d65 (diff) | |
download | forums-e9110c666e18cb10b1299da1150095390bbe3cd7.tar forums-e9110c666e18cb10b1299da1150095390bbe3cd7.tar.gz forums-e9110c666e18cb10b1299da1150095390bbe3cd7.tar.bz2 forums-e9110c666e18cb10b1299da1150095390bbe3cd7.tar.xz forums-e9110c666e18cb10b1299da1150095390bbe3cd7.zip |
re-allow moving modules around
git-svn-id: file:///svn/phpbb/trunk@6071 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/acp/acp_modules.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index 8f6f44f7f9..3416377262 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -112,17 +112,18 @@ class acp_modules trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id)); } - $sql = 'SELECT parent_id, left_id, right_id, module_langname + $sql = 'SELECT * FROM ' . MODULES_TABLE . " WHERE module_class = '" . $db->sql_escape($this->module_class) . "' AND module_id = $module_id"; $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!($row = $db->sql_fetchrow($result))) + if (!$row) { trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id)); } - $db->sql_freeresult($result); $move_module_name = $this->move_module_by($row, $action, 1); @@ -932,10 +933,10 @@ class acp_modules } /** - * Move module position by $amount up/down - * @todo support more than one step up/down (at the moment $amount needs to be 1)! + * Move module position by $steps up/down + * @todo support more than one step up/down (at the moment $steps needs to be 1)! */ - function move_module_by($module_row, $action = 'move_up', $amount) + function move_module_by($module_row, $action = 'move_up', $steps = 1) { global $db; @@ -948,7 +949,7 @@ class acp_modules WHERE module_class = '" . $db->sql_escape($this->module_class) . "' AND parent_id = {$module_row['parent_id']} AND " . (($action == 'move_up') ? "right_id < {$module_row['right_id']} ORDER BY right_id DESC" : "left_id > {$module_row['left_id']} ORDER BY left_id ASC"); - $result = $db->sql_query_limit($sql, 1, ($amount - 1)); + $result = $db->sql_query_limit($sql, 1, ($steps - 1)); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); |