summaryrefslogtreecommitdiff
path: root/modules/comment/helpers/comment.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-11-01 13:14:11 -0800
committerTim Almdal <tnalmdal@shaw.ca>2009-11-01 13:14:11 -0800
commit809e738536b6639bb42ecae8eb1e183543fed93c (patch)
tree585365cff3fb009ebc4ad1d1485f4467791eacb1 /modules/comment/helpers/comment.php
parent91c5a9abb7b617e45b547ced6a28c14a64ef760f (diff)
Try an new approach to extending forms. Create an extend_form event. For the first attempt replace the comment_add_form and item_add_form events.
Diffstat (limited to 'modules/comment/helpers/comment.php')
-rw-r--r--modules/comment/helpers/comment.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php
index 35685d8c..e2772707 100644
--- a/modules/comment/helpers/comment.php
+++ b/modules/comment/helpers/comment.php
@@ -72,7 +72,11 @@ class comment_Core {
$group->input("url") ->label(t("Website (hidden)"))->id("g-url");
$group->textarea("text")->label(t("Comment")) ->id("g-text");
$group->hidden("item_id")->value($item->id);
- module::event("comment_add_form", $form);
+
+ $extend_form = (object)array("data" => $item, "form" => $form, "id" => "g-comment-form",
+ "append_to" => $group);
+ module::event("extend_form", $extend_form);
+
$group->submit("")->value(t("Add"))->class("ui-state-default ui-corner-all");
$active = identity::active_user();