mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-22 08:13:14 +02:00
Merge pull request #1920 from prototech/ticket/12038
[ticket/12038] AJAXify move up/down buttons for various ACP pages.
This commit is contained in:
@@ -832,9 +832,10 @@ 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())
|
||||
if ($move_executed)
|
||||
{
|
||||
$sql = "UPDATE $table
|
||||
SET {$fields}_order = $switch_order_id
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user