summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-07-24 14:18:15 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-07-24 14:18:15 -0700
commit078c77a62b623322956457bfd7bfbdaf56203b00 (patch)
tree941a39067f101b4773a642572f24575ffc43db3e /modules/gallery/controllers
parentfa1d32e6466d8c6ffe77d163e2da9c71688a3c61 (diff)
Add tag autocomplete to the album and photo edit pop up dialogs.
This required putting a wrapper view around the forms and passing this view as the parameter to the item_edit_form event. The view contains a $script variable that the modules can add script to be included in the form html when rendered as part of the ajax response.
Diffstat (limited to 'modules/gallery/controllers')
-rw-r--r--modules/gallery/controllers/albums.php5
-rw-r--r--modules/gallery/controllers/movies.php5
-rw-r--r--modules/gallery/controllers/photos.php5
3 files changed, 9 insertions, 6 deletions
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php
index 56b74cb1..4fefd3a1 100644
--- a/modules/gallery/controllers/albums.php
+++ b/modules/gallery/controllers/albums.php
@@ -166,7 +166,8 @@ class Albums_Controller extends Items_Controller {
access::required("view", $album);
access::required("edit", $album);
- $form = album::get_edit_form($album);
+ $view = album::get_edit_form($album);
+ $form = $view->form;
if ($valid = $form->validate()) {
// Make sure that there's not a conflict
if ($album->id != 1 &&
@@ -202,7 +203,7 @@ class Albums_Controller extends Items_Controller {
} else {
print json_encode(
array("result" => "error",
- "form" => $form->__toString()));
+ "form" => $view->__toString()));
}
}
diff --git a/modules/gallery/controllers/movies.php b/modules/gallery/controllers/movies.php
index c8227d74..1391c4b4 100644
--- a/modules/gallery/controllers/movies.php
+++ b/modules/gallery/controllers/movies.php
@@ -70,7 +70,8 @@ class Movies_Controller extends Items_Controller {
access::required("view", $photo);
access::required("edit", $photo);
- $form = photo::get_edit_form($photo);
+ $view = photo::get_edit_form($photo);
+ $form = $view->form;
if ($valid = $form->validate()) {
// Make sure that there's not a conflict
if (Database::instance()
@@ -101,7 +102,7 @@ class Movies_Controller extends Items_Controller {
} else {
print json_encode(
array("result" => "error",
- "form" => $form->__toString()));
+ "form" => $view->__toString()));
}
}
diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php
index 8ee24da8..9d9b25a1 100644
--- a/modules/gallery/controllers/photos.php
+++ b/modules/gallery/controllers/photos.php
@@ -61,7 +61,8 @@ class Photos_Controller extends Items_Controller {
access::required("view", $photo);
access::required("edit", $photo);
- $form = photo::get_edit_form($photo);
+ $view = photo::get_edit_form($photo);
+ $form = $view->form;
if ($valid = $form->validate()) {
if ($form->edit_item->filename->value != $photo->name) {
// Make sure that there's not a conflict
@@ -94,7 +95,7 @@ class Photos_Controller extends Items_Controller {
} else {
print json_encode(
array("result" => "error",
- "form" => $form->__toString()));
+ "form" => $view->__toString()));
}
}