summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-07-28 05:40:28 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-07-28 05:40:28 -0700
commit2e8f73d4e96e4e114493f703a5c2c0207fad5cf5 (patch)
tree8592f39f104bc40a6778d30cfd900a912fd3e8f8 /modules/gallery/helpers
parent69f9aea5db38c020a350c5505c2694f3e79f77b5 (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.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/album.php14
-rw-r--r--modules/gallery/helpers/photo.php14
2 files changed, 12 insertions, 16 deletions
diff --git a/modules/gallery/helpers/album.php b/modules/gallery/helpers/album.php
index f146bfb3..6065f580 100644
--- a/modules/gallery/helpers/album.php
+++ b/modules/gallery/helpers/album.php
@@ -94,11 +94,9 @@ class album_Core {
}
static function get_edit_form($parent) {
- $view = new View("item_edit.html");
- $view->script = array();
- $view->form = new Forge("albums/{$parent->id}", "", "post", array("id" => "gEditAlbumForm"));
- $view->form->hidden("_method")->value("put");
- $group = $view->form->group("edit_item")->label(t("Edit Album"));
+ $form = new Forge("albums/{$parent->id}", "", "post", array("id" => "gEditAlbumForm"));
+ $form->hidden("_method")->value("put");
+ $group = $form->group("edit_item")->label(t("Edit Album"));
$group->input("title")->label(t("Title"))->value($parent->title);
$group->textarea("description")->label(t("Description"))->value($parent->description);
@@ -130,11 +128,11 @@ class album_Core {
"DESC" => t("Descending")))
->selected($parent->sort_order);
- module::event("item_edit_form", $parent, $view);
+ module::event("item_edit_form", $parent, $form);
$group->hidden("type")->value("album");
$group->submit("")->value(t("Modify"));
- $view->form->add_rules_from(ORM::factory("item"));
- return $view;
+ $form->add_rules_from(ORM::factory("item"));
+ return $form;
}
}
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;
}
/**