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 72 of file class.ilNotificationSystem.php.
References $data, $h, $handler, $instance, $lang, $user, $users, ilNotificationDatabaseHandler\enqueueByUsers(), ilNotificationDatabaseHandler\getAvailableChannels(), ilNotificationDatabaseHandler\getAvailableTypes(), ilObjectFactory\getInstanceByObjId(), ilNotificationConfig\getLanguageParameters(), ilNotificationConfig\getType(), ilNotificationConfig\getUserInstance(), ilNotificationDatabaseHandler\getUsersWithCustomConfig(), and ilNotificationDatabaseHandler\loadUserConfig().
74 require_once
'Services/Notifications/classes/class.ilNotificationUserIterator.php';
75 require_once
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
79 if ($processAsync ==
false) {
86 foreach (
$users as $user_id) {
87 if ($usersWithCustomConfig[$user_id]) {
97 $lang = ilNotificationDatabaseHandler::getTranslatedLanguageVariablesOfNotificationParameters($notification->
getLanguageParameters());
99 $user_by_handler = array();
103 if ($types[$notification->
getType()][
'config_type'] ==
'set_by_user') {
106 $channelsByAdmin =
false;
109 foreach ($it as $usr_id =>
$data) {
111 if (!$channels[
$data[
'channel']]) {
115 if (!$user_by_handler[$data[
'channel']]) {
116 $user_by_handler[$data[
'channel']] = array();
119 $user_by_handler[$data[
'channel']][] = $usr_id;
123 elseif ($types[$notification->
getType()][
'config_type'] !=
'disabled') {
124 $channelsByAdmin =
true;
127 if (isset($adminConfig[$notification->
getType()])) {
128 foreach ($adminConfig[$notification->
getType()] as $channel) {
129 if (!$channels[$channel]) {
132 $user_by_handler[$channel] =
$users;
138 $userCache = array();
144 foreach (
$users as $userId) {
145 if (!$userCache[$userId]) {
150 $userCache[$userId] =
$user;
152 $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
static getAvailableTypes($config_types=array())
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
static getAvailableChannels($config_types=array(), $includeDisabled=false)
getUserInstance(ilObjUser $user, $languageVars, $defaultLanguage)
static loadUserConfig($userid)