diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-16 11:12:27 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-16 11:12:27 -0800 |
commit | 5a8449f16d3c0db8fb47acf515d319d6eb9e87f4 (patch) | |
tree | 12a282ee486d0726409ec9e9f9232ce5d2714876 /modules/gallery/helpers/photo.php | |
parent | 9f6dba723842cc16dd3f3787d232028c6c0c2e19 (diff) |
Convert Photos_Controller::update() to use model based validation.
Diffstat (limited to 'modules/gallery/helpers/photo.php')
-rw-r--r-- | modules/gallery/helpers/photo.php | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/modules/gallery/helpers/photo.php b/modules/gallery/helpers/photo.php index 74e30409..cb94772e 100644 --- a/modules/gallery/helpers/photo.php +++ b/modules/gallery/helpers/photo.php @@ -31,18 +31,13 @@ class photo_Core { $group->input("title")->label(t("Title"))->value($photo->title); $group->textarea("description")->label(t("Description"))->value($photo->description); $group->input("filename")->label(t("Filename"))->value($photo->name) - ->rules("required") - ->error_messages( - "name_conflict", t("There is already a movie, photo or album with this name")) - ->callback("item::validate_no_slashes") + ->error_messages("conflict", t("There is already a movie, photo or album with this name")) ->error_messages("no_slashes", t("The photo name can't contain a \"/\"")) - ->callback("item::validate_no_trailing_period") ->error_messages("no_trailing_period", t("The photo name can't end in \".\"")) ->error_messages("illegal_extension", t("You cannot change the filename extension")); $group->input("slug")->label(t("Internet Address"))->value($photo->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 +46,6 @@ class photo_Core { $group = $form->group("buttons")->label(""); $group->submit("")->value(t("Modify")); - $form->add_rules_from(ORM::factory("item")); return $form; } |