Main notification handling routines for sending notifications to recipients.
Recipients may be
-
a list of user ids
-
roles
-
users which registered a listener to an ref_id
Definition at line 13 of file class.ilNotificationSystem.php.
Creates the user notifications and send them.
If processAsync is true the notifications will be serialized and persisted to the database
- Parameters
-
- Todo:
- was ist hier?
Definition at line 64 of file class.ilNotificationSystem.php.
References $data, $h, $handler, $instance, $lang, $users, array, ilNotificationDatabaseHandler\enqueueByUsers(), ilNotificationDatabaseHandler\getAvailableChannels(), ilNotificationDatabaseHandler\getAvailableTypes(), ilObjectFactory\getInstanceByObjId(), ilNotificationConfig\getLanguageParameters(), ilNotificationConfig\getType(), ilNotificationConfig\getUserInstance(), ilNotificationDatabaseHandler\getUsersWithCustomConfig(), and ilNotificationDatabaseHandler\loadUserConfig().
66 require_once
'Services/Notifications/classes/class.ilNotificationUserIterator.php';
67 require_once
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
71 if ($processAsync ==
false) {
78 foreach (
$users as $user_id) {
79 if ($usersWithCustomConfig[$user_id]) {
89 $lang = ilNotificationDatabaseHandler::getTranslatedLanguageVariablesOfNotificationParameters($notification->
getLanguageParameters());
91 $user_by_handler =
array();
95 if ($types[$notification->
getType()][
'config_type'] ==
'set_by_user') {
98 $channelsByAdmin =
false;
101 foreach ($it as $usr_id =>
$data) {
103 if (!$channels[
$data[
'channel']]) {
107 if (!$user_by_handler[$data[
'channel']]) {
108 $user_by_handler[$data[
'channel']] =
array();
111 $user_by_handler[$data[
'channel']][] = $usr_id;
115 elseif ($types[$notification->
getType()][
'config_type'] !=
'disabled') {
116 $channelsByAdmin =
true;
119 if (isset($adminConfig[$notification->
getType()])) {
120 foreach ($adminConfig[$notification->
getType()] as $channel) {
121 if (!$channels[$channel]) {
124 $user_by_handler[$channel] =
$users;
130 $userCache =
array();
136 foreach (
$users as $userId) {
137 if (!$userCache[$userId]) {
139 if (!$user || !($user instanceof \
ilObjUser)) {
142 $userCache[$userId] = $user;
144 $user = $userCache[$userId];
static enqueueByUsers(ilNotificationConfig $notification, array $userids)
wrapper for iterating a list of user settings by providing the user ids
static getUsersWithCustomConfig(array $userid)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
static getAvailableTypes($config_types=array())
static getAvailableChannels($config_types=array(), $includeDisabled=false)
getUserInstance(ilObjUser $user, $languageVars, $defaultLanguage)
static loadUserConfig($userid)