diff options
author | Callum Macrae <callum@lynxphp.com> | 2011-08-19 18:11:58 +0100 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2012-03-31 02:09:14 +0200 |
commit | 082c5c5b328e10e3fa99beaff31c4bc28f73bbd0 (patch) | |
tree | 2d1c55c4868f45c5ac2a9d178259dcc866796c7d | |
parent | 83095c2a2d31b81a5f8a9bf5b61f8f2f3976e38a (diff) | |
download | forums-082c5c5b328e10e3fa99beaff31c4bc28f73bbd0.tar forums-082c5c5b328e10e3fa99beaff31c4bc28f73bbd0.tar.gz forums-082c5c5b328e10e3fa99beaff31c4bc28f73bbd0.tar.bz2 forums-082c5c5b328e10e3fa99beaff31c4bc28f73bbd0.tar.xz forums-082c5c5b328e10e3fa99beaff31c4bc28f73bbd0.zip |
[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
-rw-r--r-- | phpBB/includes/ucp/ucp_zebra.php | 4 | ||||
-rw-r--r-- | phpBB/styles/script.js | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index 004f3b80aa..3f0e97b48a 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -201,6 +201,10 @@ class ucp_zebra if ($updated) { + JSON::add(array( + 'message' => $user->lang[$l_mode . '_UPDATED'], + 'success' => true + )); 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>'); trigger_error($message); diff --git a/phpBB/styles/script.js b/phpBB/styles/script.js index 04e768e21e..f1fe2b9a10 100644 --- a/phpBB/styles/script.js +++ b/phpBB/styles/script.js @@ -364,8 +364,8 @@ phpbb.add_ajax_callback('post_delete', function(el) { phpbb.ajaxify({selector: tr.next().find('.up').children('a')}, false, 'forum_up'); } }).add_ajax_callback('zebra', function(el, res) { - if (res.MESSAGE_TEXT.indexOf('successfully') !== -1) { - $('.zebra').html(res.MESSAGE_TEXT.split('<br')[0]); + if (res.success) { + $('.zebra').html(res.message); $($('.zebra').get(1)).remove(); } });; |