1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-23 11:28:33 +01:00

[ticket/12038] AJAXify move up/down buttons in report/denial reasons page.

PHPBB3-12038
This commit is contained in:
Cesar G 2013-12-05 22:36:55 -08:00
parent 58a0764759
commit 9e8ee56404
2 changed files with 13 additions and 11 deletions

View File

@ -86,17 +86,11 @@
<br /><span>{reasons.REASON_DESCRIPTION}</span>
</td>
<td style="width: 100px;">{reasons.REASON_COUNT}</td>
<td style="width: 80px; text-align: right; white-space: nowrap;">
<!-- IF reasons.S_FIRST_ROW && not reasons.S_LAST_ROW -->
{ICON_MOVE_UP_DISABLED}
<a href="{reasons.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF not reasons.S_FIRST_ROW && not reasons.S_LAST_ROW-->
<a href="{reasons.U_MOVE_UP}">{ICON_MOVE_UP}</a>
<a href="{reasons.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF reasons.S_LAST_ROW && not reasons.S_FIRST_ROW -->
<a href="{reasons.U_MOVE_UP}">{ICON_MOVE_UP}</a>
{ICON_MOVE_DOWN_DISABLED}
<!-- ENDIF -->
<td class="actions" style="width: 80px;">
<span class="up-disabled" style="display:none;">{ICON_MOVE_UP_DISABLED}</span>
<span class="up"><a href="{reasons.U_MOVE_UP}" data-ajax="row_up">{ICON_MOVE_UP}</a></span>
<span class="down-disabled" style="display:none;">{ICON_MOVE_DOWN_DISABLED}</span>
<span class="down"><a href="{reasons.U_MOVE_DOWN}" data-ajax="row_down">{ICON_MOVE_DOWN}</a></span>
<a href="{reasons.U_EDIT}">{ICON_EDIT}</a>
<!-- IF reasons.U_DELETE -->
<a href="{reasons.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>

View File

@ -26,6 +26,7 @@ class acp_reasons
{
global $db, $user, $auth, $template, $cache;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
global $request;
$user->add_lang(array('mcp', 'acp/posting'));
@ -288,6 +289,13 @@ class acp_reasons
WHERE reason_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;
}