mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/12038] AJAXify move up/down buttons in the permission roles page.
PHPBB3-12038
This commit is contained in:
parent
d399d255b6
commit
97558e5fd4
2 changed files with 14 additions and 14 deletions
|
@ -157,20 +157,11 @@
|
||||||
<!-- IF roles.ROLE_DESCRIPTION --><br /><span>{roles.ROLE_DESCRIPTION}</span><!-- ENDIF -->
|
<!-- IF roles.ROLE_DESCRIPTION --><br /><span>{roles.ROLE_DESCRIPTION}</span><!-- ENDIF -->
|
||||||
</td>
|
</td>
|
||||||
<td style="width: 30%; text-align: center; vertical-align: top; white-space: nowrap;"><!-- IF roles.U_DISPLAY_ITEMS --><a href="{roles.U_DISPLAY_ITEMS}">{L_VIEW_ASSIGNED_ITEMS}</a><!-- ELSE -->{L_VIEW_ASSIGNED_ITEMS}<!-- ENDIF --></td>
|
<td style="width: 30%; text-align: center; vertical-align: top; white-space: nowrap;"><!-- IF roles.U_DISPLAY_ITEMS --><a href="{roles.U_DISPLAY_ITEMS}">{L_VIEW_ASSIGNED_ITEMS}</a><!-- ELSE -->{L_VIEW_ASSIGNED_ITEMS}<!-- ENDIF --></td>
|
||||||
<td style="width: 80px; text-align: right; vertical-align: top; white-space: nowrap;">
|
<td class="actions">
|
||||||
<!-- IF roles.S_FIRST_ROW && not roles.S_LAST_ROW -->
|
<span class="up-disabled" style="display:none;">{ICON_MOVE_UP_DISABLED}</span>
|
||||||
{ICON_MOVE_UP_DISABLED}
|
<span class="up"><a href="{roles.U_MOVE_UP}" data-ajax="row_up">{ICON_MOVE_UP}</a></span>
|
||||||
<a href="{roles.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
|
<span class="down-disabled" style="display:none;">{ICON_MOVE_DOWN_DISABLED}</span>
|
||||||
<!-- ELSEIF not roles.S_FIRST_ROW && not roles.S_LAST_ROW-->
|
<span class="down"><a href="{roles.U_MOVE_DOWN}" data-ajax="row_down">{ICON_MOVE_DOWN}</a></span>
|
||||||
<a href="{roles.U_MOVE_UP}">{ICON_MOVE_UP}</a>
|
|
||||||
<a href="{roles.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
|
|
||||||
<!-- ELSEIF roles.S_LAST_ROW && not roles.S_FIRST_ROW -->
|
|
||||||
<a href="{roles.U_MOVE_UP}">{ICON_MOVE_UP}</a>
|
|
||||||
{ICON_MOVE_DOWN_DISABLED}
|
|
||||||
<!-- ELSE -->
|
|
||||||
{ICON_MOVE_UP_DISABLED}
|
|
||||||
{ICON_MOVE_DOWN_DISABLED}
|
|
||||||
<!-- ENDIF -->
|
|
||||||
<a href="{roles.U_EDIT}" title="{L_EDIT_ROLE}">{ICON_EDIT}</a>
|
<a href="{roles.U_EDIT}" title="{L_EDIT_ROLE}">{ICON_EDIT}</a>
|
||||||
<a href="{roles.U_REMOVE}" title="{L_REMOVE_ROLE}" data-ajax="row_delete">{ICON_DELETE}</a>
|
<a href="{roles.U_REMOVE}" title="{L_REMOVE_ROLE}" data-ajax="row_delete">{ICON_DELETE}</a>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -27,6 +27,7 @@ class acp_permission_roles
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache, $phpbb_container;
|
global $db, $user, $auth, $template, $cache, $phpbb_container;
|
||||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
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/functions_user.' . $phpEx);
|
||||||
include_once($phpbb_root_path . 'includes/acp/auth.' . $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) . ')';
|
AND role_order IN ($order, " . (($action == 'move_up') ? $order - 1 : $order + 1) . ')';
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
|
if ($request->is_ajax())
|
||||||
|
{
|
||||||
|
$json_response = new \phpbb\json_response;
|
||||||
|
$json_response->send(array(
|
||||||
|
'success' => (bool) $db->sql_affectedrows(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue