From 8d9cc63c19325f4782e7de8f72abd38b7af2657d Mon Sep 17 00:00:00 2001 From: Cesar G Date: Thu, 5 Dec 2013 22:33:03 -0800 Subject: [ticket/12038] AJAXify move up/down buttons in the smilies/topic icons page. PHPBB3-12038 --- phpBB/includes/acp/acp_icons.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'phpBB/includes/acp/acp_icons.php') diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index 658be4cc6b..2d90d42992 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -832,6 +832,7 @@ class acp_icons WHERE {$fields}_order = $switch_order_id AND {$fields}_id <> $icon_id"; $db->sql_query($sql); + $move_executed = (bool) $db->sql_affectedrows(); // Only update the other entry too if the previous entry got updated if ($db->sql_affectedrows()) @@ -846,6 +847,14 @@ class acp_icons $cache->destroy('_icons'); $cache->destroy('sql', $table); + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'success' => $move_executed, + )); + } + break; } -- cgit v1.2.1 From 823d2b697a9bcec96f4ef841a77bfe900ce530f4 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Fri, 6 Dec 2013 00:09:36 -0800 Subject: [ticket/12038] Use $move_executed in place of $db->sql_affectedrows(). PHPBB3-12038 --- phpBB/includes/acp/acp_icons.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/acp/acp_icons.php') diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index 2d90d42992..327b510299 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -835,7 +835,7 @@ class acp_icons $move_executed = (bool) $db->sql_affectedrows(); // Only update the other entry too if the previous entry got updated - if ($db->sql_affectedrows()) + if ($move_executed) { $sql = "UPDATE $table SET {$fields}_order = $switch_order_id -- cgit v1.2.1