summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-02-02 05:00:09 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-02-02 05:00:09 +0000
commite3b5eca50ef1e421b2f4b97309882df4dd9f5855 (patch)
tree58d841e925c3a42cdcb0a438b251926a1e77bdf7
parenta70f3bf38683af21f1e81ec1a5e74aa83ab46e38 (diff)
Add sending notifications when an item is deleted. We are almost
done, just need to do comments.
-rw-r--r--modules/notification/helpers/notification.php9
-rw-r--r--modules/notification/views/item_deleted.html.php18
2 files changed, 25 insertions, 2 deletions
diff --git a/modules/notification/helpers/notification.php b/modules/notification/helpers/notification.php
index 9a942728..c25da16d 100644
--- a/modules/notification/helpers/notification.php
+++ b/modules/notification/helpers/notification.php
@@ -107,9 +107,14 @@ class notification {
self::_send_message($item, $body);
}
- static function send_item_delete($item) {
+ static function send_item_deleted($item) {
+ $parent = $item->parent();
$body = new View("item_deleted.html");
- $body->subject = sprintf(t("Item deleted from %s"), $item->parent()->title);
+ $body->subject = sprintf(t("Item %s deleted from %s"), $item->title, $parent->title);
+ $body->parent_title = $parent->title;
+ $body->type = $item->type;
+ $body->item_title = $item->title;
+ $body->url = url::site("albums/$parent->id", "http");
self::_send_message($item, $body);
}
diff --git a/modules/notification/views/item_deleted.html.php b/modules/notification/views/item_deleted.html.php
index e69de29b..006985ff 100644
--- a/modules/notification/views/item_deleted.html.php
+++ b/modules/notification/views/item_deleted.html.php
@@ -0,0 +1,18 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<html>
+<head>
+ <title><?= $subject ?> </title>
+</head>
+<body>
+ <h2><?= sprintf(t("%s: %s was deleted from %s"), $type, $item_title, $parent_title) ?></h2>
+ <table>
+ <tr>
+ <td colspan="2"><?= sprintf(t("To view the changed album %s use the link below."), $parent_title) ?></td>
+ </tr>
+ <tr>
+ <td><?= t("Url:") ?></td>
+ <td><a href="<?= $url ?>"><?= $url ?></a></td>
+ </tr>
+ </table>
+</body>
+</html>