summaryrefslogtreecommitdiff
path: root/modules/comment/controllers/comments.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-24 04:05:47 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-24 04:05:47 +0000
commitb0dff620e2a47be356f85a883875c16f8181c8ae (patch)
tree61629d6bf315e1396f7b1c908f434f7d729fb72a /modules/comment/controllers/comments.php
parent863e3712c71940276f4c227c9bbf5a57b303972e (diff)
Minor cleanups.
Diffstat (limited to 'modules/comment/controllers/comments.php')
-rw-r--r--modules/comment/controllers/comments.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php
index 434aa36f..7dce9d01 100644
--- a/modules/comment/controllers/comments.php
+++ b/modules/comment/controllers/comments.php
@@ -25,14 +25,10 @@ class Comments_Controller extends REST_Controller {
* @see Rest_Controller::_index()
*/
public function _index() {
- $item_id = $this->input->get('item_id');
+ $item = ORM::factory("item", $this->input->get('item_id'));
+ access::required("view", $item);
- if (empty($item_id)) {
- /* We currently do not support getting all comments from the entire gallery. */
- rest::http_status(rest::BAD_REQUEST);
- return;
- }
- print comment::get_comments($item_id);
+ print comment::get_comments($item->id);
}
/**
@@ -81,10 +77,14 @@ class Comments_Controller extends REST_Controller {
print comment::get_atom_entry($comment);
break;
+ case "html":
+ $view = new View("comment.$output_format");
+ $view->comment = $comment;
+ print $view;
+ break;
+
default:
- $v = new View("comment.$output_format");
- $v->comment = $comment;
- print $v;
+ kohana::show_404();
}
}