3 require_once
'Services/Notifications/classes/class.ilNotificationSetupHelper.php';
4 require_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()),
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);
51 $rset = $ilDB->queryF(
$query, $types, $values);
52 $notifications =
array();
54 while(
$row = $ilDB->fetchAssoc($rset)) {
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) {
63 $row[
'data']->link = self::appendParamToLink(
$row[
'data']->link,
'osd_id',
$row[
'notification_osd_id']);
66 $row[
'data']->shortDescription = self::appendOsdIdToLinks(
$row[
'data']->shortDescription,
$row[
'notification_osd_id']);
67 $row[
'data']->longDescription = self::appendOsdIdToLinks(
$row[
'data']->longDescription,
$row[
'notification_osd_id']);
70 $notifications[] =
$row;
73 self::cleanupOnRandom();
75 return $notifications;
80 preg_match_all(
'/href="(.*?)"/', $subject, $matches);
82 foreach($matches[1] as $match) {
83 $match_appended = self::appendParamToLink($match,
'osd_id', $osd_id);
84 $subject = str_replace($match, $match_appended, $subject);
101 $types =
array(
'integer');
102 $values =
array($notification_osd_id);
104 $rset = $ilDB->queryF(
$query, $types, $values);
106 if (
$row = $ilDB->fetchAssoc($rset)) {
109 $types =
array(
'integer');
110 $values =
array($notification_osd_id);
112 $ilDB->manipulateF(
$query, $types, $values);
135 $ilDB->manipulate(
$query);
142 $rnd = rand(0, 10000);
157 if (strpos($link,
'?') !==
false) {
158 $link .=
'&' . $param .
'=' . $value;
161 $link .=
'?' . $param .
'=' . $value;
static removeNotification($notification_osd_id)
Removes a notifcation and triggers a follow up notification to remove the notification from the brows...
A concrete notification based on the ilNotificationConfiguration and returned by ilNotificationConfig...
static appendParamToLink($link, $param, $value)
Helper to append an additional parameter to an existing url.
static $tbl_notification_osd_handler
Notification handler for senden a notification popup to the recipients browser.
This class represents a text property in a property form.
Basic notification handler that dumps basic notification information to stdout.
Create styles array
The data for the language used.
static cleanup()
Remove orphaned notifications.
static getNotificationsForUser($user_id, $append_osd_id_to_link=true, $max_age_seconds=0)
notify(ilNotificationObject $notification)
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static appendOsdIdToLinks($subject, $osd_id)
static cleanupOnRandom()
Exec self::clean with a probability of 1%.