From 082c5c5b328e10e3fa99beaff31c4bc28f73bbd0 Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Fri, 19 Aug 2011 18:11:58 +0100 Subject: [PATCH] [ticket/10272] Zebra operations using AJAX are now less hacky. Before, they were splitting stuff by the
, and now JSON::add() is being used. PHPBB3-10272 --- phpBB/includes/ucp/ucp_zebra.php | 4 ++++ 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'] . '
' . implode('
', $error) . ((sizeof($error)) ? '
' : '') . '
' . sprintf($user->lang['RETURN_UCP'], '', ''); 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('