3require_once
'Services/Notifications/classes/class.ilNotificationSetupHelper.php';
4require_once
'Services/Notifications/classes/class.ilNotificationEchoHandler.php';
19 'notification_osd_id' => array(
'integer', $id),
20 'usr_id' => array(
'integer', $notification->user->getId()),
21 'serialized' => array(
'text', serialize($notification)),
22 'valid_until' => array(
'integer', $notification->baseNotification->getValidForSeconds() ? ($notification->baseNotification->getValidForSeconds() + time()) : 0),
23 'visible_for' => array(
'integer', $notification->baseNotification->getVisibleForSeconds() ? $notification->baseNotification->getVisibleForSeconds() : 0),
24 'type' => array(
'text', $notification->baseNotification->getType()),
25 'time_added' => array(
'integer', time()),
33 $txt->setRequired(
true);
34 $txt->setInfo(
$lng->txt(
'polling_in_seconds'));
35 $txt->setValue(
'300');
37 $item->addSubItem(
$txt);
39 return array(
'osd_polling_intervall');
46 .
' WHERE usr_id = %s AND (valid_until = 0 OR valid_until > ' .
$ilDB->quote( time() ,
'integer') .
') AND time_added > %s';
48 $types = array(
'integer',
'integer');
49 $values = array($user_id, $max_age_seconds ? (time() - $max_age_seconds) : 0);
52 $notifications = array();
55 $row[
'data'] = unserialize(
$row[
'serialized']);
56 unset(
$row[
'serialized']);
58 $row[
'data']->handlerParams = array(
'general' =>
$row[
'data']->handlerParams[
''],
'osd' =>
$row[
'data']->handlerParams[
'osd']);
60 if ($append_osd_id_to_link) {
62 if (
$row[
'data']->link) {
70 $notifications[] =
$row;
75 return $notifications;
80 preg_match_all(
'/href="(.*?)"/', $subject, $matches);
82 foreach($matches[1] as $match) {
84 $subject = str_replace($match, $match_appended, $subject);
101 $types = array(
'integer');
102 $values = array($notification_osd_id);
109 $types = array(
'integer');
110 $values = array($notification_osd_id);
142 $rnd = rand(0, 10000);
157 if (strpos($link,
'?') !==
false) {
158 $link .=
'&' . $param .
'=' . $value;
161 $link .=
'?' . $param .
'=' . $value;
Basic notification handler that dumps basic notification information to stdout.
Notification handler for senden a notification popup to the recipients browser.
static appendOsdIdToLinks($subject, $osd_id)
static removeNotification($notification_osd_id)
Removes a notifcation and triggers a follow up notification to remove the notification from the brows...
static cleanup()
Remove orphaned notifications.
static cleanupOnRandom()
Exec self::clean with a probability of 1%.
notify(ilNotificationObject $notification)
static getNotificationsForUser($user_id, $append_osd_id_to_link=true, $max_age_seconds=0)
static appendParamToLink($link, $param, $value)
Helper to append an additional parameter to an existing url.
A concrete notification based on the ilNotificationConfiguration and returned by ilNotificationConfig...
static $tbl_notification_osd_handler
This class represents a text property in a property form.