summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/movie.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-09-23 15:00:32 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-09-23 15:00:32 -0700
commit3efaf4b1a11fbc7ef1cfd265086e92a9b1ef4eb8 (patch)
tree06fc546b7f221cac00b0568bc0b2b91eec30e287 /modules/gallery/helpers/movie.php
parenta24d9d67a6d6ee0b976068880476e69b432b1406 (diff)
parent719b111219608f6a19a3a460d2953bc3362c9c28 (diff)
Merge branch 'master' into talmdal_dev
Diffstat (limited to 'modules/gallery/helpers/movie.php')
-rw-r--r--modules/gallery/helpers/movie.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/modules/gallery/helpers/movie.php b/modules/gallery/helpers/movie.php
index 59bf5c19..6c8c6c88 100644
--- a/modules/gallery/helpers/movie.php
+++ b/modules/gallery/helpers/movie.php
@@ -128,6 +128,36 @@ class movie_Core {
return $movie;
}
+ static function get_edit_form($movie) {
+ $form = new Forge("movies/$movie->id", "", "post", array("id" => "gEditMovieForm"));
+ $form->hidden("_method")->value("put");
+ $group = $form->group("edit_item")->label(t("Edit Movie"));
+ $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)
+ ->error_messages(
+ "name_conflict", t("There is already a movie, photo or album with this name"))
+ ->callback("item::validate_no_slashes")
+ ->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 \".\""));
+ $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"))
+ ->error_messages(
+ "not_url_safe",
+ t("The internet address should contain only letters, numbers, hyphens and underscores"));
+
+ module::event("item_edit_form", $movie, $form);
+
+ $group = $form->group("buttons")->label("");
+ $group->submit("")->value(t("Modify"));
+ $form->add_rules_from(ORM::factory("item"));
+ return $form;
+ }
+
+
static function getmoviesize($filename) {
$ffmpeg = self::find_ffmpeg();
if (empty($ffmpeg)) {