summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/comment/controllers/comments.php20
-rw-r--r--modules/user/controllers/users.php17
2 files changed, 21 insertions, 16 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);
}
}
diff --git a/modules/user/controllers/users.php b/modules/user/controllers/users.php
index d381d399..871af942 100644
--- a/modules/user/controllers/users.php
+++ b/modules/user/controllers/users.php
@@ -71,12 +71,15 @@ class Users_Controller extends REST_Controller {
* Present a form for editing a user
* @see Rest_Controller::form($resource)
*/
- public function _form($user, $form_type) {
- if ($form_type == "edit") {
- $form = user::get_edit_form($user);
- print $form;
- } else {
- return Kohana::show_404();
- }
+ public function _form_edit($user) {
+ print user::get_edit_form($user);
+ }
+
+ /**
+ * Present a form for adding a user
+ * @see Rest_Controller::form($resource)
+ */
+ public function _form_add($parameters) {
+ throw new Exception("@todo User_Controller::_form_add NOT IMPLEMENTED");
}
}