From b5b770cd1b5ad4c110905f3cc222d27dcf930c3e Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 26 Jul 2010 10:08:19 -0700 Subject: [PATCH] Convert the register module to use the json::reply(...) helper. --- modules/register/controllers/register.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/register/controllers/register.php b/modules/register/controllers/register.php index 0de79529..92b3b21e 100755 --- a/modules/register/controllers/register.php +++ b/modules/register/controllers/register.php @@ -18,7 +18,7 @@ */ class register_Controller extends Controller { public function index() { - print $this->_get_form(); + json::reply(array("form" => (string) $this->_get_form())); } public function handler() { @@ -57,11 +57,9 @@ class register_Controller extends Controller { message::success(t("A confirmation email has been sent to your email address.")); } - print json_encode(array("result" => "success")); + json::reply(array("result" => "success")); } else { - print json_encode( - array("result" => "error", - "form" => (string) $form)); + json::reply(array("result" => "error", "form" => (string) $form)); } } @@ -128,7 +126,7 @@ class register_Controller extends Controller { public function change_password($id, $password) { $user = user::lookup($id); - print $this->_get_change_password_form($user, $password); + json::reply(array("form" => (string) $this->_get_change_password_form($user, $password))); } private function _get_form() {