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';
 
Describes a notification and provides methods for publishing this notification.
getUserInstance(ilObjUser $user, $languageVars, $defaultLanguage)
hasDisableAfterDeliverySet()
static getUsersByListener($module, $sender_id)
static getUsersWithCustomConfig(array $userid)
static getAvailableChannels($config_types=array(), $includeDisabled=false)
static loadUserConfig($userid)
static enqueueByListener(ilNotificationConfig $notification, $ref_id)
static getAvailableTypes($config_types=array())
static disableListeners($module, $sender_id)
static enableListeners($module, $sender_id, array $users=array())
static enqueueByUsers(ilNotificationConfig $notification, array $userids)
Basic notification handler that dumps basic notification information to stdout.
Base class for notification handlers.
Notification handler for sending notifications the to recipients email address.
Notification handler for senden a notification popup to the recipients browser.
Main notification handling routines for sending notifications to recipients.
toUsers(ilNotificationConfig $notification, $users, $processAsync=false)
Creates the user notifications and send them.
static sendNotificationToRoles(ilNotificationConfig $notification, array $roles, $processAsync=false)
toListeners(ilNotificationConfig $notification, $ref_id, $processAsync=false)
Sends the notification to all listener which are subscribed to the given ref_id.
addHandler($channel, ilNotificationHandler $handler)
Registers a new handler for the given channel name.
static sendNotificationToListeners(ilNotificationConfig $notification, $ref_id, $processAsync=false)
static enableListeners($module, $ref_id)
static enableUserListeners($module, $ref_id, array $users)
toRoles(ilNotificationConfig $notification, array $roles, $processAsync=false)
Send a notification to a list of roles.
static sendNotificationToUsers(ilNotificationConfig $notification, $users, $processAsync=false)
wrapper for iterating a list of user settings by providing the user ids