mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-25 19:38:53 +00:00
[ticket/12038] AJAXify move up/down buttons in the smilies/topic icons page.
PHPBB3-12038
This commit is contained in:
parent
7b86a5bc60
commit
8d9cc63c19
2 changed files with 15 additions and 4 deletions
|
@ -242,10 +242,12 @@
|
|||
<td style="text-align: center;">{items.CODE}</td>
|
||||
<td style="text-align: center;">{items.EMOTION}</td>
|
||||
<!-- ENDIF -->
|
||||
<td style="text-align: right; white-space: nowrap;">
|
||||
<!-- IF items.S_FIRST_ROW and not U_PREVIOUS_PAGE -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF -->
|
||||
<!-- IF items.S_LAST_ROW and not U_NEXT_PAGE -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF -->
|
||||
<a href="{items.U_EDIT}">{ICON_EDIT}</a> <a href="{items.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>
|
||||
<td class="actions" style="text-align: right;">
|
||||
<span class="up-disabled" style="display:none;">{ICON_MOVE_UP_DISABLED}</span>
|
||||
<span class="up"><a href="{items.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="{items.U_MOVE_DOWN}" data-ajax="row_down">{ICON_MOVE_DOWN}</a></span>
|
||||
<a href="{items.U_EDIT}">{ICON_EDIT}</a> <a href="{items.U_DELETE}" data-ajax="row_delete">{ICON_DELETE}</a>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- BEGINELSE -->
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue