summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/comment/controllers/comments.php7
-rw-r--r--modules/comment/helpers/comment.php4
-rw-r--r--modules/user/controllers/users.php4
3 files changed, 8 insertions, 7 deletions
diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php
index 89e42753..11a9c2a1 100644
--- a/modules/comment/controllers/comments.php
+++ b/modules/comment/controllers/comments.php
@@ -32,7 +32,7 @@ class Comments_Controller extends REST_Controller {
header("HTTP/1.1 400 Bad Request");
return;
}
- print comment::get_comments($item_id, $this->get_output_format());
+ print comment::get_comments($item_id);
}
/**
@@ -59,9 +59,10 @@ class Comments_Controller extends REST_Controller {
/**
* Display an existing comment.
* @todo Set proper Content-Type in a central place (REST_Controller::dispatch?).
- * @see Rest_Controller::_show($resource, $output_format)
+ * @see Rest_Controller::_show($resource)
*/
- public function _show($comment, $output_format) {
+ public function _show($comment) {
+ $output_format = rest::output_format();
switch ($output_format) {
case "xml":
header("Content-Type: application/xml");
diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php
index e9628a01..1739497c 100644
--- a/modules/comment/helpers/comment.php
+++ b/modules/comment/helpers/comment.php
@@ -106,7 +106,7 @@ class Comment_Core {
}
// @todo Set proper Content-Type in a central place (REST_Controller::dispatch?).
- static function get_comments($item_id, $output_format) {
+ static function get_comments($item_id) {
$comments = ORM::factory('comment')->where('item_id', $item_id)
->orderby('datetime', 'asc')
->find_all();
@@ -116,7 +116,7 @@ class Comment_Core {
return;
}
- switch ($output_format) {
+ switch (rest::output_format()) {
case "xml":
header("Content-Type: application/xml");
return xml::to_xml($comments, array("comments", "comment"));
diff --git a/modules/user/controllers/users.php b/modules/user/controllers/users.php
index 871af942..f6b77d0d 100644
--- a/modules/user/controllers/users.php
+++ b/modules/user/controllers/users.php
@@ -36,9 +36,9 @@ class Users_Controller extends REST_Controller {
}
/**
- * @see Rest_Controller::_show($resource, $output_format)
+ * @see Rest_Controller::_show($resource)
*/
- public function _show($user, $output_format) {
+ public function _show($user) {
throw new Exception("@todo User_Controller::_show NOT IMPLEMENTED");
}