From 6f358291733b5844f5e9beaa747f554a0049e27a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 1 Feb 2009 03:58:31 +0000 Subject: Simplify the setting of a notifications. Notifications are not only set on a album. The notifications are implicitly active for all child elements. It now sends emails if the email address of the subscribed user has been set. No email, no attempt to send the notification. Still to do, come up with better messages as the current ones are just place holders. --- modules/notification/helpers/notification_event.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'modules/notification/helpers/notification_event.php') diff --git a/modules/notification/helpers/notification_event.php b/modules/notification/helpers/notification_event.php index 06b5b1f6..415093a5 100644 --- a/modules/notification/helpers/notification_event.php +++ b/modules/notification/helpers/notification_event.php @@ -18,9 +18,27 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class notification_event_Core { + static function item_updated($old, $new) { + notification::send_item_changed($old, $new); + } + + static function item_created($item) { + notification::send_item_add($item); + } + + static function item_before_delete($item) { + notification::send_item_deleted($item); + + if (notification::is_watching($item)) { + notification::remove_watch($item); + } + } + static function comment_created($comment) { + notification::send_comment_added($comment); } static function comment_updated($old, $new) { + notification::send_comment_changed($old, $new); } } -- cgit v1.2.3