summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-01-08 02:39:21 +0000
committerBharat Mediratta <bharat@menalto.com>2009-01-08 02:39:21 +0000
commit8620c3fa01cb37506976a944f151d3058b587062 (patch)
treecf89ff7567a1c88620957aa645a3d22f297d328a
parent7bd5105f333f12d66add91b6f8a19e42323b03f2 (diff)
Update event calls to take the orig and new models so that event listeners can do comparisons
-rw-r--r--core/controllers/albums.php3
-rw-r--r--core/controllers/photos.php3
2 files changed, 4 insertions, 2 deletions
diff --git a/core/controllers/albums.php b/core/controllers/albums.php
index 486d57af..20291315 100644
--- a/core/controllers/albums.php
+++ b/core/controllers/albums.php
@@ -147,11 +147,12 @@ class Albums_Controller extends Items_Controller {
// @todo implement changing the name. This is not trivial, we have
// to check for conflicts and rename the album itself, etc. Needs an
// api method.
+ $orig = clone $album;
$album->title = $form->edit_album->title->value;
$album->description = $form->edit_album->description->value;
$album->save();
- module::event("album_changed", $album);
+ module::event("album_changed", $orig, $album);
log::success("content", "Updated album", "<a href=\"albums/$album->id\">view</a>");
message::success(sprintf(_("Saved album %s"), $album->title));
diff --git a/core/controllers/photos.php b/core/controllers/photos.php
index d59ce26d..6b5e84ba 100644
--- a/core/controllers/photos.php
+++ b/core/controllers/photos.php
@@ -73,11 +73,12 @@ class Photos_Controller extends Items_Controller {
// @todo implement changing the name. This is not trivial, we have
// to check for conflicts and rename the album itself, etc. Needs an
// api method.
+ $orig = clone $photo;
$photo->title = $form->edit_photo->title->value;
$photo->description = $form->edit_photo->description->value;
$photo->save();
- module::event("photo_changed", $photo);
+ module::event("photo_changed", $orig, $photo);
log::success("content", "Updated photo", "<a href=\"photos/$photo->id\">view</a>");
message::success(sprintf(_("Saved photo %s"), $photo->title));