summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-01-16 12:07:36 -0800
committerBharat Mediratta <bharat@menalto.com>2010-01-16 12:07:36 -0800
commit8ce11ac97062f63eb6d0c5ef261bdf9ff6727ed2 (patch)
tree2556e7e7424634f9d91e0ef790e8b6120294b790 /modules/gallery/helpers
parentefdb73cb986002806dfe3c9241f792652e4b56fa (diff)
Convert Movies_Controller::update() over to model based validation.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/movie.php10
1 files changed, 3 insertions, 7 deletions
diff --git a/modules/gallery/helpers/movie.php b/modules/gallery/helpers/movie.php
index 0a27ac94..b2e846d3 100644
--- a/modules/gallery/helpers/movie.php
+++ b/modules/gallery/helpers/movie.php
@@ -31,18 +31,14 @@ class movie_Core {
$group->input("title")->label(t("Title"))->value($movie->title);
$group->textarea("description")->label(t("Description"))->value($movie->description);
$group->input("filename")->label(t("Filename"))->value($movie->name)
- ->rules("required")
->error_messages(
- "name_conflict", t("There is already a movie, photo or album with this name"))
- ->callback("item::validate_no_slashes")
+ "conflict", t("There is already a movie, photo or album with this name"))
->error_messages("no_slashes", t("The movie name can't contain a \"/\""))
- ->callback("item::validate_no_trailing_period")
->error_messages("no_trailing_period", t("The movie name can't end in \".\""))
->error_messages("illegal_extension", t("You cannot change the filename extension"));
$group->input("slug")->label(t("Internet Address"))->value($movie->slug)
- ->callback("item::validate_url_safe")
->error_messages(
- "slug_conflict", t("There is already a movie, photo or album with this internet address"))
+ "conflict", t("There is already a movie, photo or album with this internet address"))
->error_messages(
"not_url_safe",
t("The internet address should contain only letters, numbers, hyphens and underscores"));
@@ -51,7 +47,7 @@ class movie_Core {
$group = $form->group("buttons")->label("");
$group->submit("")->value(t("Modify"));
- $form->add_rules_from(ORM::factory("item"));
+
return $form;
}