From 97558e5fd489f1cb4d4b7bae025842ff467d97d9 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Thu, 5 Dec 2013 22:35:47 -0800 Subject: [ticket/12038] AJAXify move up/down buttons in the permission roles page. PHPBB3-12038 --- phpBB/adm/style/acp_permission_roles.html | 19 +++++-------------- phpBB/includes/acp/acp_permission_roles.php | 9 +++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/phpBB/adm/style/acp_permission_roles.html b/phpBB/adm/style/acp_permission_roles.html index b8fdaeb837..b3137f134c 100644 --- a/phpBB/adm/style/acp_permission_roles.html +++ b/phpBB/adm/style/acp_permission_roles.html @@ -157,20 +157,11 @@
{roles.ROLE_DESCRIPTION} {L_VIEW_ASSIGNED_ITEMS}{L_VIEW_ASSIGNED_ITEMS} - - - {ICON_MOVE_UP_DISABLED} - {ICON_MOVE_DOWN} - - {ICON_MOVE_UP} - {ICON_MOVE_DOWN} - - {ICON_MOVE_UP} - {ICON_MOVE_DOWN_DISABLED} - - {ICON_MOVE_UP_DISABLED} - {ICON_MOVE_DOWN_DISABLED} - + + + {ICON_MOVE_UP} + + {ICON_MOVE_DOWN} {ICON_EDIT} {ICON_DELETE} diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php index 17e48d6576..21729df4f1 100644 --- a/phpBB/includes/acp/acp_permission_roles.php +++ b/phpBB/includes/acp/acp_permission_roles.php @@ -27,6 +27,7 @@ class acp_permission_roles { global $db, $user, $auth, $template, $cache, $phpbb_container; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $request; include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx); @@ -375,6 +376,14 @@ class acp_permission_roles AND role_order IN ($order, " . (($action == 'move_up') ? $order - 1 : $order + 1) . ')'; $db->sql_query($sql); + if ($request->is_ajax()) + { + $json_response = new \phpbb\json_response; + $json_response->send(array( + 'success' => (bool) $db->sql_affectedrows(), + )); + } + break; } -- cgit v1.2.1