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 'type' => array(
'text', $notification->baseNotification->getType()),
24 'time_added' => array(
'integer', time()),
31 $txt =
new ilTextInputGUI($lng->txt(
'polling_intervall'),
'osd_polling_intervall');
33 $txt->setInfo($lng->txt(
'polling_in_seconds'));
34 $txt->setValue(
'300');
36 $item->addSubItem($txt);
38 return array(
'osd_polling_intervall');
45 .
' WHERE usr_id = %s AND (valid_until = 0 OR valid_until > ' . $ilDB->quote( time() ,
'integer') .
') AND time_added > %s';
47 $types = array(
'integer',
'integer');
48 $values = array($user_id, $max_age_seconds ? (time() - $max_age_seconds) : 0);
50 $rset = $ilDB->queryF(
$query, $types, $values);
51 $notifications = array();
53 while(
$row = $ilDB->fetchAssoc($rset)) {
54 $row[
'data'] = unserialize(
$row[
'serialized']);
55 unset(
$row[
'serialized']);
57 $row[
'data']->handlerParams = array(
'general' =>
$row[
'data']->handlerParams[
''],
'osd' =>
$row[
'data']->handlerParams[
'osd']);
59 if ($append_osd_id_to_link) {
61 if (
$row[
'data']->link) {
69 $notifications[] =
$row;
74 return $notifications;
79 preg_match_all(
'/href="(.*?)"/', $subject, $matches);
81 foreach($matches[1] as $match) {
83 $subject = str_replace($match, $match_appended, $subject);
100 $types = array(
'integer');
101 $values = array($notification_osd_id);
103 $rset = $ilDB->queryF(
$query, $types, $values);
105 if (
$row = $ilDB->fetchAssoc($rset)) {
108 $types = array(
'integer');
109 $values = array($notification_osd_id);
111 $ilDB->manipulateF(
$query, $types, $values);
116 $deletedNotification->setValidForSeconds(120);
117 $deletedNotification->setTitleVar(
'deleted');
118 $deletedNotification->setShortDescriptionVar($notification_osd_id);
119 $deletedNotification->setLongDescriptionVar(
'dummy');
121 require_once
'Services/Notifications/classes/class.ilNotificationSystem.php';
134 $ilDB->manipulate(
$query);
141 $rnd = rand(0, 10000);
156 if (strpos($link,
'?') !==
false) {
157 $link .=
'&' . $param .
'=' . $value;
160 $link .=
'?' . $param .
'=' . $value;