/** * sends this notification to a list of users * * @param array $recipients */ public final function notifyByUsers(array $recipients, $processAsync = false) { require_once 'Services/Notifications/classes/class.ilNotificationSystem.php'; $this->beforeSendToUsers(); ilNotificationSystem::sendNotificationToUsers($this, $recipients, $processAsync); $this->afterSendToUsers(); }
/** * Removes a notifcation and triggers a follow up notification to remove * the notification from the browser view of the original recipient * * @global ilDB $ilDB * @param integer $notification_osd_id */ public static function removeNotification($notification_osd_id) { global $ilDB; $query = 'SELECT usr_id FROM ' . ilNotificationSetupHelper::$tbl_notification_osd_handler . ' WHERE notification_osd_id = %s'; $types = array('integer'); $values = array($notification_osd_id); $rset = $ilDB->queryF($query, $types, $values); if ($row = $ilDB->fetchAssoc($rset)) { $query = 'DELETE FROM ' . ilNotificationSetupHelper::$tbl_notification_osd_handler . ' WHERE notification_osd_id = %s'; $types = array('integer'); $values = array($notification_osd_id); $ilDB->manipulateF($query, $types, $values); // sends a "delete the given notification" notification using the // osd_maint channel $deletedNotification = new ilNotificationConfig('osd_maint'); $deletedNotification->setValidForSeconds(120); $deletedNotification->setTitleVar('deleted'); $deletedNotification->setShortDescriptionVar($notification_osd_id); $deletedNotification->setLongDescriptionVar('dummy'); require_once 'Services/Notifications/classes/class.ilNotificationSystem.php'; ilNotificationSystem::sendNotificationToUsers($deletedNotification, array($row['usr_id'])); } }