diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-29 22:41:53 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-29 22:41:53 +0000 |
commit | 6ab195854ddee124b24b880ed96bb0db5fdc7805 (patch) | |
tree | 02a91acb7ddaa13eee3730bc8a9366fc94dc9c9c | |
parent | 29c925a3cc30a5b1fc66c658e4be85914a6b515c (diff) |
Remove rest::JSON content type; it's causing lots of problems and it doesn't directly help since text/html works just as well for our JSON communications
-rw-r--r-- | core/controllers/albums.php | 2 | ||||
-rw-r--r-- | core/controllers/photos.php | 1 | ||||
-rw-r--r-- | modules/comment/controllers/comments.php | 4 | ||||
-rw-r--r-- | modules/tag/controllers/tags.php | 1 | ||||
-rw-r--r-- | modules/user/controllers/admin_groups.php | 3 | ||||
-rw-r--r-- | modules/user/controllers/admin_users.php | 3 | ||||
-rw-r--r-- | modules/user/controllers/login.php | 1 | ||||
-rw-r--r-- | modules/user/controllers/users.php | 1 | ||||
-rw-r--r-- | modules/watermark/controllers/admin_watermarks.php | 2 |
9 files changed, 0 insertions, 18 deletions
diff --git a/core/controllers/albums.php b/core/controllers/albums.php index 2bb535e5..668e868a 100644 --- a/core/controllers/albums.php +++ b/core/controllers/albums.php @@ -70,7 +70,6 @@ class Albums_Controller extends Items_Controller { private function _create_album($album) { access::required("edit", $album); - rest::http_content_type(rest::JSON); $form = album::get_add_form($album); if ($form->validate()) { $new_album = album::create( @@ -132,7 +131,6 @@ class Albums_Controller extends Items_Controller { public function _update($album) { access::required("edit", $album); - rest::http_content_type(rest::JSON); $form = album::get_edit_form($album); if ($form->validate()) { // @todo implement changing the name. This is not trivial, we have diff --git a/core/controllers/photos.php b/core/controllers/photos.php index 9ceaa5c9..13185283 100644 --- a/core/controllers/photos.php +++ b/core/controllers/photos.php @@ -45,7 +45,6 @@ class Photos_Controller extends Items_Controller { public function _update($photo) { access::required("edit", $photo); - rest::http_content_type(rest::JSON); $form = photo::get_edit_form($photo); if ($form->validate()) { // @todo implement changing the name. This is not trivial, we have diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php index cb2ebb01..e4eff6a6 100644 --- a/modules/comment/controllers/comments.php +++ b/modules/comment/controllers/comments.php @@ -35,7 +35,6 @@ class Comments_Controller extends REST_Controller { switch (rest::output_format()) { case "json": - rest::http_content_type(rest::JSON); foreach ($comments as $comment) { $data[] = $comment->as_array(); } @@ -55,7 +54,6 @@ class Comments_Controller extends REST_Controller { * @see REST_Controller::_create($resource) */ public function _create($comment) { - rest::http_content_type(rest::JSON); $item = ORM::factory("item", $this->input->post("item_id")); access::required("view", $item); @@ -100,7 +98,6 @@ class Comments_Controller extends REST_Controller { * @see REST_Controller::_update($resource) */ public function _update($comment) { - rest::http_content_type(rest::JSON); $form = comment::get_edit_form($comment); if ($form->validate()) { @@ -125,7 +122,6 @@ class Comments_Controller extends REST_Controller { * @see REST_Controller::_delete($resource) */ public function _delete($comment) { - rest::http_content_type(rest::JSON); $comment->delete(); print json_encode(array("result" => "success")); diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php index 4f8cfa5b..36cf9900 100644 --- a/modules/tag/controllers/tags.php +++ b/modules/tag/controllers/tags.php @@ -46,7 +46,6 @@ class Tags_Controller extends REST_Controller { } public function _create($tag) { - rest::http_content_type(rest::JSON); $item = ORM::factory("item", $this->input->post("item_id")); access::required("edit", $item); diff --git a/modules/user/controllers/admin_groups.php b/modules/user/controllers/admin_groups.php index d0cfe70e..f840fa0b 100644 --- a/modules/user/controllers/admin_groups.php +++ b/modules/user/controllers/admin_groups.php @@ -26,7 +26,6 @@ class Admin_Groups_Controller extends Controller { } public function add() { - rest::http_content_type(rest::JSON); $form = group::get_add_form_admin(); if($form->validate()) { $group = group::create($form->add_group->inputs["name"]->value); @@ -45,7 +44,6 @@ class Admin_Groups_Controller extends Controller { } public function delete($id) { - rest::http_content_type(rest::JSON); $group = ORM::factory("group", $id); if (!$group->loaded) { kohana::show_404(); @@ -75,7 +73,6 @@ class Admin_Groups_Controller extends Controller { } public function edit($id) { - rest::http_content_type(rest::JSON); $group = ORM::factory("group", $id); if (!$group->loaded) { kohana::show_404(); diff --git a/modules/user/controllers/admin_users.php b/modules/user/controllers/admin_users.php index 08618c8c..e6785e7b 100644 --- a/modules/user/controllers/admin_users.php +++ b/modules/user/controllers/admin_users.php @@ -27,7 +27,6 @@ class Admin_Users_Controller extends Controller { public function add() { $form = user::get_add_form_admin(); - rest::http_content_type(rest::JSON); if($form->validate()) { $user = user::create($form->add_user->inputs["name"]->value, $form->add_user->full_name->value, $form->add_user->password->value); @@ -47,7 +46,6 @@ class Admin_Users_Controller extends Controller { } public function delete($id) { - rest::http_content_type(rest::JSON); $user = ORM::factory("user", $id); if (!$user->loaded) { kohana::show_404(); @@ -77,7 +75,6 @@ class Admin_Users_Controller extends Controller { } public function edit($id) { - rest::http_content_type(rest::JSON); $user = ORM::factory("user", $id); if (!$user->loaded) { kohana::show_404(); diff --git a/modules/user/controllers/login.php b/modules/user/controllers/login.php index 88a5ccf9..46957bb0 100644 --- a/modules/user/controllers/login.php +++ b/modules/user/controllers/login.php @@ -28,7 +28,6 @@ class Login_Controller extends Controller { private function _try_login() { $form = $this->_login_form(); - rest::http_content_type(rest::JSON); $valid = $form->validate(); if ($valid) { diff --git a/modules/user/controllers/users.php b/modules/user/controllers/users.php index abc0ae0f..7ccab28f 100644 --- a/modules/user/controllers/users.php +++ b/modules/user/controllers/users.php @@ -25,7 +25,6 @@ class Users_Controller extends REST_Controller { access::forbidden(); } - rest::http_content_type(rest::JSON); $form = user::get_edit_form($user); $form->edit_user->password->rules("-required"); if ($form->validate()) { diff --git a/modules/watermark/controllers/admin_watermarks.php b/modules/watermark/controllers/admin_watermarks.php index 6c6c72bd..6d552dae 100644 --- a/modules/watermark/controllers/admin_watermarks.php +++ b/modules/watermark/controllers/admin_watermarks.php @@ -61,7 +61,6 @@ class Admin_Watermarks_Controller extends Admin_Controller { } public function delete() { - rest::http_content_type(rest::JSON); $form = watermark::get_delete_form(); if ($form->validate()) { if ($name = module::get_var("watermark", "name")) { @@ -92,7 +91,6 @@ class Admin_Watermarks_Controller extends Admin_Controller { } public function add() { - rest::http_content_type(rest::JSON); $form = watermark::get_add_form(); if ($form->validate()) { $file = $_POST["file"]; |