mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/10272] Zebra operations using AJAX are now less hacky.
Before, they were splitting stuff by the <br />, and now JSON::add() is being used. PHPBB3-10272
This commit is contained in:
parent
83095c2a2d
commit
082c5c5b32
2 changed files with 6 additions and 2 deletions
|
@ -201,6 +201,10 @@ class ucp_zebra
|
||||||
|
|
||||||
if ($updated)
|
if ($updated)
|
||||||
{
|
{
|
||||||
|
JSON::add(array(
|
||||||
|
'message' => $user->lang[$l_mode . '_UPDATED'],
|
||||||
|
'success' => true
|
||||||
|
));
|
||||||
meta_refresh(3, $this->u_action);
|
meta_refresh(3, $this->u_action);
|
||||||
$message = $user->lang[$l_mode . '_UPDATED'] . '<br />' . implode('<br />', $error) . ((sizeof($error)) ? '<br />' : '') . '<br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
|
$message = $user->lang[$l_mode . '_UPDATED'] . '<br />' . implode('<br />', $error) . ((sizeof($error)) ? '<br />' : '') . '<br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
|
||||||
trigger_error($message);
|
trigger_error($message);
|
||||||
|
|
|
@ -364,8 +364,8 @@ phpbb.add_ajax_callback('post_delete', function(el) {
|
||||||
phpbb.ajaxify({selector: tr.next().find('.up').children('a')}, false, 'forum_up');
|
phpbb.ajaxify({selector: tr.next().find('.up').children('a')}, false, 'forum_up');
|
||||||
}
|
}
|
||||||
}).add_ajax_callback('zebra', function(el, res) {
|
}).add_ajax_callback('zebra', function(el, res) {
|
||||||
if (res.MESSAGE_TEXT.indexOf('successfully') !== -1) {
|
if (res.success) {
|
||||||
$('.zebra').html(res.MESSAGE_TEXT.split('<br')[0]);
|
$('.zebra').html(res.message);
|
||||||
$($('.zebra').get(1)).remove();
|
$($('.zebra').get(1)).remove();
|
||||||
}
|
}
|
||||||
});;
|
});;
|
||||||
|
|
Loading…
Add table
Reference in a new issue