3 require_once
'Services/Notifications/classes/class.ilNotificationSetupHelper.php';
4 require_once
'Services/Notifications/classes/class.ilNotificationEchoHandler.php';
15 'notification_osd_id' => array(
'integer', $id),
16 'usr_id' => array(
'integer', $notification->user->getId()),
17 'serialized' => array(
'text', serialize($notification)),
18 'valid_until' => array(
'integer', $notification->baseNotification->getValidForSeconds() ? ($notification->baseNotification->getValidForSeconds() + time()) : 0),
19 'type' => array(
'text', $notification->baseNotification->getType()),
20 'time_added' => array(
'integer', time()),
27 $txt =
new ilTextInputGUI($lng->txt(
'polling_intervall'),
'osd_polling_intervall');
29 $txt->setInfo($lng->txt(
'polling_in_seconds'));
30 $txt->setValue(
'300');
32 $item->addSubItem($txt);
34 return array(
'osd_polling_intervall');
41 .
' WHERE usr_id = %s AND (valid_until = 0 OR valid_until > ' . $ilDB->quote( time() ,
'integer') .
') AND time_added > %s';
43 $types = array(
'integer',
'integer');
44 $values = array($user_id, $max_age_seconds ? (time() - $max_age_seconds) : 0);
46 $rset = $ilDB->queryF(
$query, $types, $values);
47 $notifications = array();
49 while(
$row = $ilDB->fetchAssoc($rset)) {
50 $row[
'data'] = unserialize(
$row[
'serialized']);
51 unset(
$row[
'serialized']);
53 $row[
'data']->handlerParams = array(
'general' =>
$row[
'data']->handlerParams[
''],
'osd' =>
$row[
'data']->handlerParams[
'osd']);
55 if ($append_osd_id_to_link) {
57 if (
$row[
'data']->link) {
65 $notifications[] =
$row;
70 return $notifications;
75 preg_match_all(
'/href="(.*?)"/', $subject, $matches);
77 foreach($matches[1] as $match) {
79 $subject = str_replace($match, $match_appended, $subject);
89 $types = array(
'integer');
90 $values = array($notification_osd_id);
92 $rset = $ilDB->queryF(
$query, $types, $values);
94 if (
$row = $ilDB->fetchAssoc($rset)) {
97 $types = array(
'integer');
98 $values = array($notification_osd_id);
100 $ilDB->manipulateF(
$query, $types, $values);
103 $deletedNotification->setValidForSeconds(120);
104 $deletedNotification->setTitleVar(
'deleted');
105 $deletedNotification->setShortDescriptionVar($notification_osd_id);
106 $deletedNotification->setLongDescriptionVar(
'dummy');
108 require_once
'Services/Notifications/classes/class.ilNotificationSystem.php';
116 $ilDB->manipulate(
$query);
120 $rnd = rand(0, 10000);
127 if (strpos($link,
'?') !==
false) {
128 $link .=
'&' . $param .
'=' . $value;
131 $link .=
'?' . $param .
'=' . $value;