summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/notification/helpers/notification.php11
-rw-r--r--modules/notification/helpers/notification_event.php3
-rw-r--r--modules/notification/views/item_updated.html.php4
3 files changed, 11 insertions, 7 deletions
diff --git a/modules/notification/helpers/notification.php b/modules/notification/helpers/notification.php
index a2271b59..dfeab9fc 100644
--- a/modules/notification/helpers/notification.php
+++ b/modules/notification/helpers/notification.php
@@ -92,19 +92,22 @@ class notification {
return array_keys($subscribers);
}
- static function send_item_updated($item) {
+ static function send_item_updated($original, $item) {
$subscribers = self::get_subscribers($item);
if (!$subscribers) {
return;
}
$v = new View("item_updated.html");
+ $v->original = $original;
$v->item = $item;
$v->subject = $item->is_album() ?
- t("Album \"%title\" updated", array("title" => $item->original()->title)) :
+ t("Album \"%title\" updated", array("title" => $original->title)) :
($item->is_photo() ?
- t("Photo \"%title\" updated", array("title" => $item->original()->title))
- : t("Movie \"%title\" updated", array("title" => $item->original()->title)));
+ t("Photo \"%title\" updated", array("title" => $original->title))
+ : t("Movie \"%title\" updated", array("title" => $original->title)));
+
+ Kohana_Log::add("error",print_r($v->render(),1));
self::_notify($subscribers, $item, $v->render(), $v->subject);
}
diff --git a/modules/notification/helpers/notification_event.php b/modules/notification/helpers/notification_event.php
index bc1303f5..76afac9c 100644
--- a/modules/notification/helpers/notification_event.php
+++ b/modules/notification/helpers/notification_event.php
@@ -22,8 +22,9 @@ class notification_event_Core {
// don't want to screw up the processing that was generating the notification
// so we don't pass the exception up the call stack
static function item_updated($original, $new) {
+ Kohana_Log::add("error",print_r("item_updated({$original->title}, {$new->title})",1));
try {
- notification::send_item_updated($new);
+ notification::send_item_updated($original, $new);
} catch (Exception $e) {
Kohana_Log::add("error", "@todo notification_event::item_updated() failed");
Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString());
diff --git a/modules/notification/views/item_updated.html.php b/modules/notification/views/item_updated.html.php
index 47856cab..7020fd53 100644
--- a/modules/notification/views/item_updated.html.php
+++ b/modules/notification/views/item_updated.html.php
@@ -7,7 +7,7 @@
<h2> <?= html::clean($subject) ?> </h2>
<table>
<tr>
- <? if ($item->original("title") != $item->title): ?>
+ <? if ($original->title != $item->title): ?>
<td><?= t("New title:") ?></td>
<td><?= html::clean($item->title) ?></td>
<? else: ?>
@@ -19,7 +19,7 @@
<td><?= t("Url:") ?></td>
<td><a href="<?= $item->abs_url() ?>"><?= $item->abs_url() ?></a></td>
</tr>
- <? if ($item->original("description") != $item->description): ?>
+ <? if ($original->description != $item->description): ?>
<tr>
<td><?= t("New description:") ?></td>
<td><?= html::clean($item->description) ?></td>