22 require_once
'Services/Notifications/classes/class.ilNotificationEchoHandler.php';
23 require_once
'Services/Notifications/classes/class.ilNotificationOSDHandler.php';
24 require_once
'Services/Notifications/classes/class.ilNotificationMailHandler.php';
34 if (!self::$instance) {
35 self::$instance =
new self();
47 if (!array_key_exists($channel, $this->handler) || !is_array($this->handler[$channel]))
48 $this->handler[$channel] = array();
50 $this->handler[$channel][] =
$handler;
63 require_once
'Services/Notifications/classes/class.ilNotificationUserIterator.php';
64 require_once
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
68 if ($processAsync ==
false) {
75 foreach($users as $user_id) {
76 if ($usersWithCustomConfig[$user_id]) {
86 $lang = ilNotificationDatabaseHandler::getTranslatedLanguageVariablesOfNotificationParameters($notification->
getLanguageParameters());
88 $user_by_handler = array();
92 if ($types[$notification->
getType()][
'config_type'] ==
'set_by_user') {
95 $channelsByAdmin =
false;
98 foreach($it as
$usr_id => $data) {
100 if (!$channels[$data[
'channel']])
103 if (!$user_by_handler[$data[
'channel']])
104 $user_by_handler[$data[
'channel']] = array();
106 $user_by_handler[$data[
'channel']][] =
$usr_id;
110 else if ($types[$notification->
getType()][
'config_type'] !=
'disabled') {
111 $channelsByAdmin =
true;
114 if (isset($adminConfig[$notification->
getType()])) {
116 foreach($adminConfig[$notification->
getType()] as $channel) {
117 if (!$channels[$channel])
119 $user_by_handler[$channel] = $users;
126 $userCache = array();
129 foreach($user_by_handler as
$handler => $users) {
132 foreach($users as $userId) {
133 if (!$userCache[$userId]) {
134 $userCache[$userId] =
new ilObjUser($userId);
136 $user = $userCache[$userId];
165 require_once
'Services/Notifications/classes/class.ilNotificationUserIterator.php';
166 require_once
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
168 if ($processAsync ==
false) {
190 require_once
'Services/Notifications/classes/class.ilNotificationUserIterator.php';
191 require_once
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
196 foreach($roles as $role) {
197 $users[] = $rbacreview->assignedUsers($role);
200 $users = array_unique(call_user_func_array(
'array_merge', $users));
239 require_once
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
246 require_once
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';