summaryrefslogtreecommitdiff
path: root/modules/comment/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-11-16 07:51:42 +0000
committerBharat Mediratta <bharat@menalto.com>2008-11-16 07:51:42 +0000
commit4610fc8e7f32f1a582b5f6c9c25714151b9a2967 (patch)
treebcfecbae267d03b231eb29b7a4f829fa96af1190 /modules/comment/helpers
parentce7fbf979d249e5e1effb7040d3e51a2c35015e3 (diff)
Create Forge::add_rules_from() which pulls validation rules from the model and
associates them with the form. This replaces the various _add_validation_rules() functions in the user and comment modules. Move user edit form into user helper for consistency with the comment module. Implement missing _form method in the user controller.
Diffstat (limited to 'modules/comment/helpers')
-rw-r--r--modules/comment/helpers/comment.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php
index 1c876f10..8352fae4 100644
--- a/modules/comment/helpers/comment.php
+++ b/modules/comment/helpers/comment.php
@@ -61,8 +61,7 @@ class Comment_Core {
$group->input("email") ->label(_("Email")) ->id("gEmail");
$group->textarea("text")->label(_("Text")) ->id("gText");
$group->submit(_("Add"));
-
- comment::_add_validation_rules("comment", $form);
+ $form->add_rules_from(ORM::factory("comment"));
return $form;
}
@@ -73,8 +72,7 @@ class Comment_Core {
$group->input("email") ->label(_("Email")) ->id("gEmail") ->value($comment->email);
$group->textarea("text")->label(_("Text")) ->id("gText") ->value($comment->text);
$group->submit(_("Edit"));
-
- comment::_add_validation_rules("comment", $form);
+ $form->add_rules_from($comment);
return $form;
}