summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/photos.php
diff options
context:
space:
mode:
authorRomain LE DISEZ <romain.git@ledisez.net>2009-07-20 18:46:41 +0200
committerRomain LE DISEZ <romain.git@ledisez.net>2009-07-20 18:46:41 +0200
commit00b3ca82de3a4858745988943a46d07b1c0fd006 (patch)
tree158896d430014e1f896df0b19acc57aeb602c9ab /modules/gallery/controllers/photos.php
parent8cbf43ed2abe9772045766e598bb9fe3d4def983 (diff)
parentfb7d99740d9868938ec21449d57b9b3fe991f513 (diff)
Merge commit 'upstream/master'
Diffstat (limited to 'modules/gallery/controllers/photos.php')
-rw-r--r--modules/gallery/controllers/photos.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php
index 9ce6ed23..8ee24da8 100644
--- a/modules/gallery/controllers/photos.php
+++ b/modules/gallery/controllers/photos.php
@@ -63,25 +63,26 @@ class Photos_Controller extends Items_Controller {
$form = photo::get_edit_form($photo);
if ($valid = $form->validate()) {
- if ($form->edit_photo->filename->value != $photo->name) {
+ if ($form->edit_item->filename->value != $photo->name) {
// Make sure that there's not a conflict
if (Database::instance()
->from("items")
->where("parent_id", $photo->parent_id)
->where("id <>", $photo->id)
- ->where("name", $form->edit_photo->filename->value)
+ ->where("name", $form->edit_item->filename->value)
->count_records()) {
- $form->edit_photo->filename->add_error("conflict", 1);
+ $form->edit_item->filename->add_error("conflict", 1);
$valid = false;
}
}
}
if ($valid) {
- $photo->title = $form->edit_photo->title->value;
- $photo->description = $form->edit_photo->description->value;
- $photo->rename($form->edit_photo->filename->value);
+ $photo->title = $form->edit_item->title->value;
+ $photo->description = $form->edit_item->description->value;
+ $photo->rename($form->edit_item->filename->value);
$photo->save();
+ module::event("item_edit_form_completed", $photo, $form);
log::success("content", "Updated photo", "<a href=\"photos/$photo->id\">view</a>");
message::success(