summaryrefslogtreecommitdiff
path: root/modules/tag/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/tag/controllers')
-rw-r--r--modules/tag/controllers/admin_tags.php13
-rw-r--r--modules/tag/controllers/tags.php6
2 files changed, 7 insertions, 12 deletions
diff --git a/modules/tag/controllers/admin_tags.php b/modules/tag/controllers/admin_tags.php
index c2da7bc3..32c54945 100644
--- a/modules/tag/controllers/admin_tags.php
+++ b/modules/tag/controllers/admin_tags.php
@@ -37,7 +37,7 @@ class Admin_Tags_Controller extends Admin_Controller {
public function form_delete($id) {
$tag = ORM::factory("tag", $id);
if ($tag->loaded()) {
- print json_encode(array("form" => (string) tag::get_delete_form($tag)));
+ json::reply(array("form" => (string) tag::get_delete_form($tag)));
}
}
@@ -57,11 +57,9 @@ class Admin_Tags_Controller extends Admin_Controller {
message::success(t("Deleted tag %tag_name", array("tag_name" => $name)));
log::success("tags", t("Deleted tag %tag_name", array("tag_name" => $name)));
- print json_encode(
- array("result" => "success",
- "location" => url::site("admin/tags")));
+ json::reply(array("result" => "success", "location" => url::site("admin/tags")));
} else {
- print json_encode(array("result" => "error", "form" => (string) $form));
+ json::reply(array("result" => "error", "form" => (string) $form));
}
}
@@ -98,10 +96,9 @@ class Admin_Tags_Controller extends Admin_Controller {
message::success($message);
log::success("tags", $message);
- print json_encode(array("result" => "success",
- "location" => url::site("admin/tags")));
+ json::reply(array("result" => "success", "location" => url::site("admin/tags")));
} else {
- print json_encode(array("result" => "error", "form" => $in_place_edit->render()));
+ json::reply(array("result" => "error", "form" => $in_place_edit->render()));
}
}
diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php
index f3d456d3..7fa8534c 100644
--- a/modules/tag/controllers/tags.php
+++ b/modules/tag/controllers/tags.php
@@ -67,11 +67,9 @@ class Tags_Controller extends Controller {
}
}
- print json_encode(
- array("result" => "success",
- "cloud" => (string)tag::cloud(30)));
+ json::reply(array("result" => "success", "cloud" => (string)tag::cloud(30)));
} else {
- print json_encode(array("result" => "error", "form" => (string) $form));
+ json::reply(array("result" => "error", "form" => (string) $form));
}
}