aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp/ucp_zebra.php
diff options
context:
space:
mode:
authorCallum Macrae <callum@lynxphp.com>2011-08-24 12:25:54 +0100
committerIgor Wiedler <igor@wiedler.ch>2012-03-31 02:09:14 +0200
commit7a933bdb5ad4a9bc4877a7d4d516fa0b21d9e4c0 (patch)
tree67de4f7f19dbde414388b731fb64751fb0092fe3 /phpBB/includes/ucp/ucp_zebra.php
parentc92b30d66cbb2839369c04172eb5ae9bacd27a16 (diff)
downloadforums-7a933bdb5ad4a9bc4877a7d4d516fa0b21d9e4c0.tar
forums-7a933bdb5ad4a9bc4877a7d4d516fa0b21d9e4c0.tar.gz
forums-7a933bdb5ad4a9bc4877a7d4d516fa0b21d9e4c0.tar.bz2
forums-7a933bdb5ad4a9bc4877a7d4d516fa0b21d9e4c0.tar.xz
forums-7a933bdb5ad4a9bc4877a7d4d516fa0b21d9e4c0.zip
[ticket/10328] Renamed the JSON class, also now using autoloading.
It is no longer static, and uses autoloading. It has also been renamed from JSON to phpbb_json_response. PHPBB3-10328
Diffstat (limited to 'phpBB/includes/ucp/ucp_zebra.php')
-rw-r--r--phpBB/includes/ucp/ucp_zebra.php24
1 files changed, 18 insertions, 6 deletions
diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php
index 3f0e97b48a..efe928b387 100644
--- a/phpBB/includes/ucp/ucp_zebra.php
+++ b/phpBB/includes/ucp/ucp_zebra.php
@@ -25,7 +25,7 @@ class ucp_zebra
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
+ global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $request;
$submit = (isset($_POST['submit']) || isset($_GET['add']) || isset($_GET['remove'])) ? true : false;
$s_hidden_fields = '';
@@ -198,13 +198,25 @@ class ucp_zebra
}
}
}
-
- if ($updated)
+
+ if ($request->is_ajax())
{
- JSON::add(array(
- 'message' => $user->lang[$l_mode . '_UPDATED'],
- 'success' => true
+ $message = ($updated) ? $user->lang[$l_mode . '_UPDATED'] : implode('<br />', $error);
+
+ $json_response = new phpbb_json_response;
+ $json_response->send(array(
+ 'success' => $updated,
+
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $message,
+ 'REFRESH_DATA' => array(
+ 'time' => 3,
+ 'url' => $this->u_action
+ )
));
+ }
+ else if ($updated)
+ {
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);