summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/photo.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-07-28 20:40:28 +0800
committerTim Almdal <tnalmdal@shaw.ca>2009-07-28 21:00:25 +0800
commita7f4d7aced009007d36e48685648e9bc3382f8cb (patch)
treef5b13204b496414ccee0f9e997da0b811ef66559 /modules/gallery/helpers/photo.php
parent2f969c80eb2e228f2c5729c6f4660c99555f9c9f (diff)
Revert commit 078c77a62b623322956457bfd7bfbdaf56203b00 and change the
tag_event:item_edit_form to use the new Form_Script library to inject script into a form. Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
Diffstat (limited to 'modules/gallery/helpers/photo.php')
-rw-r--r--modules/gallery/helpers/photo.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/modules/gallery/helpers/photo.php b/modules/gallery/helpers/photo.php
index 299195e9..5cf37de1 100644
--- a/modules/gallery/helpers/photo.php
+++ b/modules/gallery/helpers/photo.php
@@ -135,11 +135,9 @@ class photo_Core {
}
static function get_edit_form($photo) {
- $view = new View("item_edit.html");
- $view->script = array();
- $view->form = new Forge("photos/$photo->id", "", "post", array("id" => "gEditPhotoForm"));
- $view->form->hidden("_method")->value("put");
- $group = $view->form->group("edit_item")->label(t("Edit Photo"));
+ $form = new Forge("photos/$photo->id", "", "post", array("id" => "gEditPhotoForm"));
+ $form->hidden("_method")->value("put");
+ $group = $form->group("edit_item")->label(t("Edit Photo"));
$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)
@@ -149,11 +147,11 @@ class photo_Core {
->callback("item::validate_no_trailing_period")
->error_messages("no_trailing_period", t("The photo name can't end in \".\""));
- module::event("item_edit_form", $photo, $view);
+ module::event("item_edit_form", $photo, $form);
$group->submit("")->value(t("Modify"));
- $view->form->add_rules_from(ORM::factory("item"));
- return $view;
+ $form->add_rules_from(ORM::factory("item"));
+ return $form;
}
/**