summaryrefslogtreecommitdiff
path: root/modules/comment/controllers
diff options
context:
space:
mode:
authorJozef Selesi <jozefs@users.sourceforge.net>2008-11-18 23:40:47 +0000
committerJozef Selesi <jozefs@users.sourceforge.net>2008-11-18 23:40:47 +0000
commit1992343c2e1f2df892f39f971ae629edc59c33d0 (patch)
tree4d0e6365789905cf702324bc77b104a8eeaecb39 /modules/comment/controllers
parent4bf486955cea9e2b67531f044c6bf34a7bc9324f (diff)
* Changed REST API. Now there are two separate methods for forms:
GET /form/edit/{controller}/{resource_id} -> controller::_form_edit($resource) GET /form/add/{controller}/{parameters} -> controller::_form_add($parameters) * Updated comment, user and core modules to reflect the API changes * Cleaned up routing and handling of requests to /{controller}
Diffstat (limited to 'modules/comment/controllers')
-rw-r--r--modules/comment/controllers/comments.php20
1 files changed, 11 insertions, 9 deletions
diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php
index 34557a83..89e42753 100644
--- a/modules/comment/controllers/comments.php
+++ b/modules/comment/controllers/comments.php
@@ -107,15 +107,17 @@ class Comments_Controller extends REST_Controller {
/**
* Present a form for adding a new comment to this item or editing an existing comment.
- * @see Rest_Controller::form($resource)
+ * @see Rest_Controller::form_add($resource)
*/
- public function _form($resource, $form_type) {
- // This code will be clearer if we split form() into two functions.
- if ($form_type == "edit") {
- $form = comment::get_edit_form($resource);
- } else {
- $form = comment::get_add_form($resource);
- }
- print $form;
+ public function _form_add($item_id) {
+ print comment::get_add_form($item_id);
+ }
+
+ /**
+ * Present a form for editing an existing comment.
+ * @see Rest_Controller::form_edit($resource)
+ */
+ public function _form_edit($comment) {
+ print $form = comment::get_edit_form($comment);
}
}