12 require_once
'Services/Notifications/classes/class.ilNotificationEchoHandler.php';
13 require_once
'Services/Notifications/classes/class.ilNotificationOSDHandler.php';
14 require_once
'Services/Notifications/classes/class.ilNotificationMailHandler.php';
23 if (!self::$instance) {
24 self::$instance =
new self();
30 if (!array_key_exists($channel, $this->handler) || !is_array($this->handler[$channel]))
31 $this->handler[$channel] = array();
33 $this->handler[$channel][] =
$handler;
38 require_once
'Services/Notifications/classes/class.ilNotificationUserIterator.php';
39 require_once
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
42 if ($processAsync ==
false) {
47 foreach($users as $user_id) {
48 if ($usersWithCustomConfig[$user_id]) {
56 $lang = ilNotificationDatabaseHandler::getTranslatedLanguageVariablesOfNotificationParameters($notification->
getLanguageParameters());
58 $user_by_handler = array();
60 if ($types[$notification->
getType()][
'config_type'] ==
'set_by_user') {
63 $channelsByAdmin =
false;
66 if (!$channels[
$data[
'channel']])
69 if (!$user_by_handler[$data[
'channel']])
70 $user_by_handler[$data[
'channel']] = array();
72 $user_by_handler[$data[
'channel']][] =
$usr_id;
75 else if ($types[$notification->
getType()][
'config_type'] !=
'disabled') {
76 $channelsByAdmin =
true;
79 if (isset($adminConfig[$notification->
getType()])) {
81 foreach($adminConfig[$notification->
getType()] as $channel) {
82 if (!$channels[$channel])
84 $user_by_handler[$channel] = $users;
93 foreach($user_by_handler as
$handler => $users) {
95 foreach($users as $userId) {
96 if (!$userCache[$userId]) {
97 $userCache[$userId] =
new ilObjUser($userId);
99 $user = $userCache[$userId];
114 require_once
'Services/Notifications/classes/class.ilNotificationUserIterator.php';
115 require_once
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
117 if ($processAsync ==
false) {
130 require_once
'Services/Notifications/classes/class.ilNotificationUserIterator.php';
131 require_once
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
136 foreach($roles as $role) {
137 $users[] = $rbacreview->assignedUsers($role);
139 $users = array_unique(call_user_func_array(
'array_merge', $users));
158 require_once
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
165 require_once
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';