diff --git a/modules/basket/controllers/admin_postage_bands.php b/modules/basket/controllers/admin_postage_bands.php index 26598bd7..d1b9dc97 100644 --- a/modules/basket/controllers/admin_postage_bands.php +++ b/modules/basket/controllers/admin_postage_bands.php @@ -62,7 +62,7 @@ class Admin_Postage_Bands_Controller extends Controller "postage_name" => html::clean($postage_band->name)))); json::reply(array("result" => "success")); } else { - json::reply(array("result" => "error", "form" => (string)$form)); + json::reply(array("result" => "error", "html" => (string)$form)); } } @@ -91,7 +91,7 @@ class Admin_Postage_Bands_Controller extends Controller $name = $postage->name; $postage->delete(); } else { - json::reply(array("result" => "error", "form" => (string)$form)); + json::reply(array("result" => "error", "html" => (string)$form)); } $message = t("Deleted user %postage_band", array("postage_band" => html::clean($name))); @@ -129,7 +129,7 @@ class Admin_Postage_Bands_Controller extends Controller array("postage_name" => html::clean($postage->name)))); json::reply(array("result" => "success")); } else { - json::reply(array("result" => "error", "form" => (string)$form)); + json::reply(array("result" => "error", "html" => (string)$form)); } } diff --git a/modules/basket/controllers/admin_product_lines.php b/modules/basket/controllers/admin_product_lines.php index 197b7291..bc01c19b 100644 --- a/modules/basket/controllers/admin_product_lines.php +++ b/modules/basket/controllers/admin_product_lines.php @@ -62,7 +62,7 @@ class Admin_Product_Lines_Controller extends Controller "product_name" => html::clean($product->name)))); json::reply(array("result" => "success")); } else { - json::reply(array("result" => "error", "form" => (string)$form)); + json::reply(array("result" => "error", "html" => (string)$form)); } } @@ -91,8 +91,7 @@ class Admin_Product_Lines_Controller extends Controller $name = $product->name; $product->delete(); } else { - json::reply(array("result" => "error", - "form" => $form->__toString())); + json::reply(array("result" => "error", "html" => (string)$form)); } $message = t("Deleted user %product_name", array("product_name" => html::clean($name))); @@ -131,7 +130,7 @@ class Admin_Product_Lines_Controller extends Controller array("product_name" => html::clean($product->name)))); json::reply(array("result" => "success")); } else { - json::reply(array("result" => "error", "form" => (string)$form)); + json::reply(array("result" => "error", "html" => (string)$form)); } } diff --git a/modules/developer/controllers/admin_developer.php b/modules/developer/controllers/admin_developer.php index 64f66dc3..a7d334bd 100644 --- a/modules/developer/controllers/admin_developer.php +++ b/modules/developer/controllers/admin_developer.php @@ -69,15 +69,14 @@ class Admin_Developer_Controller extends Admin_Controller { $task = task::create($task_def, array_merge($task_context, $post->as_array())); json::reply(array("result" => "started", - "max_iterations" => 15, - "url" => url::site("admin/developer/run_task/{$task->id}?csrf=" . - access::csrf_token()), - "task" => $task->as_array())); + "max_iterations" => 15, + "url" => url::site("admin/developer/run_task/{$task->id}?csrf=" . + access::csrf_token()), + "task" => $task->as_array())); } else { $v = $this->_get_module_create_content(arr::overwrite($form, $post->as_array()), arr::overwrite($errors, $post->errors())); - json::reply(array("result" => "error", - "form" => $v->__toString())); + json::reply(array("result" => "error", "html" => (string)$v)); } } @@ -120,15 +119,14 @@ class Admin_Developer_Controller extends Admin_Controller { batch::start(); json::reply(array("result" => "started", - "max_iterations" => $total + 5, - "url" => url::site("admin/developer/run_task/{$task->id}?csrf=" . - access::csrf_token()), - "task" => $task->as_array())); + "max_iterations" => $total + 5, + "url" => url::site("admin/developer/run_task/{$task->id}?csrf=" . + access::csrf_token()), + "task" => $task->as_array())); } else { $v = $this->_get_test_data_view(arr::overwrite($form, $post->as_array()), - arr::overwrite($errors, $post->errors())); - json::reply(array("result" => "error", - "form" => $v->__toString())); + arr::overwrite($errors, $post->errors())); + json::reply(array("result" => "error", "html" => (string)$v)); } } @@ -152,12 +150,10 @@ class Admin_Developer_Controller extends Admin_Controller { message::success(empty($error_msg) ? $context["error_msg"] : $error_msg); break; } - json::reply(array("result" => "success", - "task" => $task->as_array())); + json::reply(array("result" => "success", "task" => $task->as_array())); } else { - json::reply(array("result" => "in_progress", - "task" => $task->as_array())); + json::reply(array("result" => "in_progress", "task" => $task->as_array())); } } diff --git a/modules/developer/views/controller.txt.php b/modules/developer/views/controller.txt.php index 84e527f3..b73ae815 100644 --- a/modules/developer/views/controller.txt.php +++ b/modules/developer/views/controller.txt.php @@ -32,12 +32,9 @@ class _Controller extends Controller { message::success(t(" Processing Successfully")); - json::reply( - array("result" => "success")); + json::reply(array("result" => "success")); } else { - json::reply( - array("result" => "error", - "form" => $form->__toString())); + json::reply(array("result" => "error", "html" => (string)$form)); } } diff --git a/modules/favourites/controllers/favourites.php b/modules/favourites/controllers/favourites.php index 68e91a8f..d7989682 100644 --- a/modules/favourites/controllers/favourites.php +++ b/modules/favourites/controllers/favourites.php @@ -184,10 +184,10 @@ class Favourites_Controller extends Controller { mail($email_address,$name."'s Favourites",$email, $from); - json::reply(array("result" => "success","location" => url::site("favourites"))); + json::reply(array("result" => "success", "location" => url::site("favourites"))); return; } - json::reply(array("result" => "error", "form" => (string) $form)); + json::reply(array("result" => "error", "html" => (string)$form)); } public function toggle_favourites($id){ @@ -195,9 +195,9 @@ class Favourites_Controller extends Controller { $infavour = $favourites ->toggle($id); $title = $infavour?t("Remove from favourites"):t("Add to favourites"); json::reply(array("result" => "success", - "favourite" => $infavour, - "hasfavourites" => $favourites->hasFavourites(), - "title" => (string)$title)); + "favourite" => $infavour, + "hasfavourites" => $favourites->hasFavourites(), + "title" => (string)$title)); } public function clear_favourites(){ diff --git a/modules/gwtorganise/controllers/admin_upload_configure.php b/modules/gwtorganise/controllers/admin_upload_configure.php index d4a0d04c..e204904a 100644 --- a/modules/gwtorganise/controllers/admin_upload_configure.php +++ b/modules/gwtorganise/controllers/admin_upload_configure.php @@ -38,8 +38,7 @@ class Admin_Upload_Configure_Controller extends Controller } else { - json::reply -s(array("result" => "error", "form" => (string) $form)); + json::reply(array("result" => "error", "html" => (string) $form)); return; } diff --git a/modules/html_uploader/controllers/uploader.php b/modules/html_uploader/controllers/uploader.php index 3bd05ece..5928ad03 100644 --- a/modules/html_uploader/controllers/uploader.php +++ b/modules/html_uploader/controllers/uploader.php @@ -26,7 +26,7 @@ class Uploader_Controller extends Controller { $album = $album->parent(); } - json::reply(array("form" => (string) $this->_get_add_form($album))); + print $this->_get_add_form($album); } public function add($id) { @@ -85,7 +85,7 @@ class Uploader_Controller extends Controller { batch::stop(); json::reply(array("result" => "success")); } else { - json::reply(array("result" => "error", "form" => (string) $form)); + json::reply(array("result" => "error", "html" => (string) $form)); } } diff --git a/modules/register/controllers/register.php b/modules/register/controllers/register.php index 92b3b21e..93c183a2 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() { - json::reply(array("form" => (string) $this->_get_form())); + print $this->_get_form(); } public function handler() { @@ -59,7 +59,7 @@ class register_Controller extends Controller { json::reply(array("result" => "success")); } else { - json::reply(array("result" => "error", "form" => (string) $form)); + json::reply(array("result" => "error", "html" => (string)$form)); } } @@ -126,7 +126,7 @@ class register_Controller extends Controller { public function change_password($id, $password) { $user = user::lookup($id); - json::reply(array("form" => (string) $this->_get_change_password_form($user, $password))); + print $this->_get_change_password_form($user, $password); } private function _get_form() { diff --git a/modules/scheduler/controllers/admin_schedule.php b/modules/scheduler/controllers/admin_schedule.php index 46725eb8..fbf84919 100644 --- a/modules/scheduler/controllers/admin_schedule.php +++ b/modules/scheduler/controllers/admin_schedule.php @@ -123,7 +123,7 @@ class Admin_Schedule_Controller extends Admin_Maintenance_Controller { } json::reply(array("result" => "success", "reload" => 1)); } else { - json::reply(array("result" => "error", "form" => (string) $form)); + json::reply(array("result" => "error", "html" => (string)$form)); } }