summaryrefslogtreecommitdiff
path: root/modules/comment/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-25 05:12:46 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-25 05:12:46 +0000
commitfdc0f83024ee8a10f223132d9e02a9e10466e46a (patch)
tree38dc87629f8063ac3997edbd2a852c318ffb089f /modules/comment/helpers
parent6e68c5ca28e52773fca16e77aecdde2b92351af2 (diff)
Big round of normalization of the way that our controllers
communicate. Almost all controllers now use JSON to speak to the theme when we're dealing with form processing. This means tht we only send the form back and forth, but we use a JSON protocol to tell the browser success/error status as well as the location of any newly created resources, or where the browser should redirect the user. Lots of small changes: 1) Admin -> Edit Profile is gone. Instead I fixed the "Modify Profile" link in the top right corner to be a modal dialog 2) We use json_encode everywhere. No more Atom/XML for now. We can bring those back later, though. For now there's a lot of code duplication but that'll be easy to clean up. 3) REST_Controller is no longer abstract. All methods its subclasses should create throw exceptions, which means that subclasses don't have to implement stubs for those methods. 4) New pattern: helper method get_add_form calls take an Item_Model, not an id since we have to load the Item_Model in the controller anyway to check permissions. 5) User/Groups REST resources are separate from User/Group in the site admin. They do different things, we should avoid confusing overlap.
Diffstat (limited to 'modules/comment/helpers')
-rw-r--r--modules/comment/helpers/comment.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php
index 51246444..79aa9ddc 100644
--- a/modules/comment/helpers/comment.php
+++ b/modules/comment/helpers/comment.php
@@ -52,13 +52,13 @@ class comment_Core {
return $comment;
}
- static function get_add_form($item_id) {
+ static function get_add_form($item) {
$form = new Forge(url::site("comments"), "", "post");
$group = $form->group("add_comment")->label(_("Add comment"));
$group->input("author") ->label(_("Author")) ->id("gAuthor");
$group->input("email") ->label(_("Email")) ->id("gEmail");
$group->textarea("text")->label(_("Text")) ->id("gText");
- $group->hidden("item_id")->value($item_id);
+ $group->hidden("item_id")->value($item->id);
$group->submit(_("Add"));
$form->add_rules_from(ORM::factory("comment"));
return $form;