25        require_once 
'Services/Notifications/classes/class.ilNotificationEchoHandler.php';
 
   26        require_once 
'Services/Notifications/classes/class.ilNotificationOSDHandler.php';
 
   27        require_once 
'Services/Notifications/classes/class.ilNotificationMailHandler.php';
 
   43        if (!self::$instance) {
 
   44            self::$instance = 
new self();
 
   57        if (!array_key_exists($channel, $this->handler) || !is_array($this->handler[$channel])) {
 
   58            $this->handler[$channel] = array();
 
   61        $this->handler[$channel][] = 
$handler;
 
   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];
 
  182        require_once 
'Services/Notifications/classes/class.ilNotificationUserIterator.php';
 
  183        require_once 
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
 
  185        if ($processAsync == 
false) {
 
  206        require_once 
'Services/Notifications/classes/class.ilNotificationUserIterator.php';
 
  207        require_once 
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
 
  210        foreach ($roles as $role) {
 
  211            $users[] = $this->rbacReview->assignedUsers($role);
 
  214        $users = array_unique(call_user_func_array(
'array_merge', 
$users));
 
  257        require_once 
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
 
  266        require_once 
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
 
An exception for terminatinating execution or to throw for unit testing.
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.
__construct(\ilRbacReview $rbacReview=null)
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
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
class ilRbacReview Contains Review functions of core Rbac.
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
if($modEnd===false) $module