ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilNotificationConfig Class Reference

Describes a notification and provides methods for publishing this notification. More...

+ Collaboration diagram for ilNotificationConfig:

Public Member Functions

 __construct ($type)
 getType ()
 setAutoDisable ($value)
 hasDisableAfterDeliverySet ()
 setLink ($link)
 getLink ()
 setIconPath ($path)
 getIconPath ()
 setTitleVar ($name, $parameters=array(), $language_module= 'notification')
 Sets the name of the language variable to use as title.
 getTitleVar ()
 setShortDescriptionVar ($name, $parameters=array(), $language_module= 'notification')
 Sets the name of the language variable to use as short description text.
 getShortDescriptionVar ()
 setLongDescriptionVar ($name, $parameters=array(), $language_module= 'notification')
 Sets the name of the language variable to use as long description text.
 getLongDescriptionVar ()
 getLanguageParameters ()
 getLinktarget ()
 setLinktarget ($linktarget)
 setValidForSeconds ($seconds)
 getValidForSeconds ()
 notifyByUsers (array $recipients, $processAsync=false)
 sends this notification to a list of users
 notifyByListeners ($ref_id, $processAsync=false)
 notifyByRoles (array $roles, $processAsync=false)
 getUserInstance (ilObjUser $user, $languageVars, $defaultLanguage)
 setHandlerParam ($name, $value)
 getHandlerParams ()
 unsetHandlerParam ($name)

Protected Member Functions

 beforeSendToUsers ()
 afterSendToUsers ()
 beforeSendToListeners ()
 afterSendToListeners ()

Private Attributes

 $type
 $link
 $linktarget = '_self'
 $title
 $iconPath
 $short_description
 $long_description
 $disableAfterDelivery = false
 $validForSeconds = 0
 $handlerParams = array()

Detailed Description

Describes a notification and provides methods for publishing this notification.

Definition at line 6 of file class.ilNotificationConfig.php.

Constructor & Destructor Documentation

ilNotificationConfig::__construct (   $type)

Definition at line 65 of file class.ilNotificationConfig.php.

References $type.

{
$this->type = $type;
}

Member Function Documentation

ilNotificationConfig::afterSendToListeners ( )
protected

Definition at line 199 of file class.ilNotificationConfig.php.

Referenced by notifyByListeners().

{
}

+ Here is the caller graph for this function:

ilNotificationConfig::afterSendToUsers ( )
protected

Definition at line 191 of file class.ilNotificationConfig.php.

Referenced by notifyByUsers().

{
}

+ Here is the caller graph for this function:

ilNotificationConfig::beforeSendToListeners ( )
protected

Definition at line 195 of file class.ilNotificationConfig.php.

Referenced by notifyByListeners().

{
}

+ Here is the caller graph for this function:

ilNotificationConfig::beforeSendToUsers ( )
protected

Definition at line 187 of file class.ilNotificationConfig.php.

Referenced by notifyByUsers().

{
}

+ Here is the caller graph for this function:

ilNotificationConfig::getHandlerParams ( )

Definition at line 288 of file class.ilNotificationConfig.php.

References $handlerParams.

{
}
ilNotificationConfig::getIconPath ( )

Definition at line 93 of file class.ilNotificationConfig.php.

References $iconPath.

{
}
ilNotificationConfig::getLanguageParameters ( )

Definition at line 163 of file class.ilNotificationConfig.php.

Referenced by ilNotificationSystem\toUsers().

{
return array(
'title' => $this->title,
'longDescription' => $this->long_description,
'shortDescription' => $this->short_description,
);
}

+ Here is the caller graph for this function:

ilNotificationConfig::getLink ( )

Definition at line 85 of file class.ilNotificationConfig.php.

References $link.

{
return $this->link;
}
ilNotificationConfig::getLinktarget ( )

Definition at line 171 of file class.ilNotificationConfig.php.

References $linktarget.

{
}
ilNotificationConfig::getLongDescriptionVar ( )

Definition at line 159 of file class.ilNotificationConfig.php.

{
return $this->long_description->getName();
}
ilNotificationConfig::getShortDescriptionVar ( )

Definition at line 136 of file class.ilNotificationConfig.php.

{
return $this->short_description->getName();
}
ilNotificationConfig::getTitleVar ( )

Definition at line 113 of file class.ilNotificationConfig.php.

{
return $this->title->getName();
}
ilNotificationConfig::getType ( )

Definition at line 69 of file class.ilNotificationConfig.php.

References $type.

Referenced by ilNotificationDatabaseHandler\enqueueByListener(), ilNotificationSystem\toListeners(), and ilNotificationSystem\toUsers().

{
return $this->type;
}

+ Here is the caller graph for this function:

ilNotificationConfig::getUserInstance ( ilObjUser  $user,
  $languageVars,
  $defaultLanguage 
)

Definition at line 230 of file class.ilNotificationConfig.php.

References $iconPath, $title, and ilObjUser\getLanguage().

Referenced by ilNotificationSystem\toUsers().

{
$notificationObject = new ilNotificationObject($this, $user);
$title = '';
$short = '';
$long = '';
if ($languageVars[$this->title->getName()]->lang[$user->getLanguage()]) {
$title = $languageVars[$this->title->getName()]->lang[$user->getLanguage()];
}
else if ($languageVars[$this->title->getName()]->lang[$defaultLanguage]) {
$title = $languageVars[$this->title->getName()]->lang[$defaultLanguage];
}
else {
$title = $this->title->getName();
}
if ($languageVars[$this->short_description->getName()]->lang[$user->getLanguage()]) {
$short = $languageVars[$this->short_description->getName()]->lang[$user->getLanguage()];
}
else if ($languageVars[$this->short_description->getName()]->lang[$defaultLanguage]) {
$short = $languageVars[$this->short_description->getName()]->lang[$defaultLanguage];
}
else {
$short = $this->short_description->getName();
}
if ($languageVars[$this->long_description->getName()]->lang[$user->getLanguage()]) {
$long = $languageVars[$this->long_description->getName()]->lang[$user->getLanguage()];
}
else if ($languageVars[$this->long_description->getName()]->lang[$defaultLanguage]) {
$long = $languageVars[$this->long_description->getName()]->lang[$defaultLanguage];
}
else {
$long = $this->long_description->getName();
}
$notificationObject->title = $title;
$notificationObject->shortDescription = $short;
$notificationObject->longDescription = $long;
$notificationObject->iconPath = $this->iconPath;
return $notificationObject;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNotificationConfig::getValidForSeconds ( )

Definition at line 183 of file class.ilNotificationConfig.php.

References $validForSeconds.

Referenced by ilNotificationDatabaseHandler\enqueueByListener(), and ilNotificationDatabaseHandler\enqueueByUsers().

+ Here is the caller graph for this function:

ilNotificationConfig::hasDisableAfterDeliverySet ( )

Definition at line 77 of file class.ilNotificationConfig.php.

References $disableAfterDelivery.

Referenced by ilNotificationSystem\toListeners().

{
}

+ Here is the caller graph for this function:

ilNotificationConfig::notifyByListeners (   $ref_id,
  $processAsync = false 
)
final

Definition at line 216 of file class.ilNotificationConfig.php.

References $ref_id, afterSendToListeners(), beforeSendToListeners(), and ilNotificationSystem\sendNotificationToListeners().

{
require_once 'Services/Notifications/classes/class.ilNotificationSystem.php';
}

+ Here is the call graph for this function:

ilNotificationConfig::notifyByRoles ( array  $roles,
  $processAsync = false 
)
final

Definition at line 223 of file class.ilNotificationConfig.php.

References ilNotificationSystem\sendNotificationToRoles().

{
require_once 'Services/Notifications/classes/class.ilNotificationSystem.php';
//$this->beforeSendToListeners();
ilNotificationSystem::sendNotificationToRoles($this, $roles, $processAsync);
//$this->afterSendToListeners();
}

+ Here is the call graph for this function:

ilNotificationConfig::notifyByUsers ( array  $recipients,
  $processAsync = false 
)
final

sends this notification to a list of users

Parameters
array$recipients

Definition at line 208 of file class.ilNotificationConfig.php.

References afterSendToUsers(), beforeSendToUsers(), and ilNotificationSystem\sendNotificationToUsers().

{
require_once 'Services/Notifications/classes/class.ilNotificationSystem.php';
ilNotificationSystem::sendNotificationToUsers($this, $recipients, $processAsync);
$this->afterSendToUsers();
}

+ Here is the call graph for this function:

ilNotificationConfig::setAutoDisable (   $value)

Definition at line 73 of file class.ilNotificationConfig.php.

{
$this->disableAfterDelivery = $value;
}
ilNotificationConfig::setHandlerParam (   $name,
  $value 
)

Definition at line 276 of file class.ilNotificationConfig.php.

{
if (strpos($name, '.')) {
$nsParts = explode('.', $name, 2);
$ns = $nsParts[0];
$field = $nsParts[1];
$this->handlerParams[$ns][$field] = $value;
}
else {
$this->handlerParams[''][$name] = $value;
}
}
ilNotificationConfig::setIconPath (   $path)

Definition at line 89 of file class.ilNotificationConfig.php.

References $path.

{
$this->iconPath = $path;
}
ilNotificationConfig::setLink (   $link)

Definition at line 81 of file class.ilNotificationConfig.php.

References $link.

{
$this->link = $link;
}
ilNotificationConfig::setLinktarget (   $linktarget)

Definition at line 175 of file class.ilNotificationConfig.php.

References $linktarget.

{
$this->linktarget = $linktarget;
}
ilNotificationConfig::setLongDescriptionVar (   $name,
  $parameters = array(),
  $language_module = 'notification' 
)

Sets the name of the language variable to use as long description text.

The translation may include [name] parts wich will be replaced by the matching parameter found in $parameters. The language var is loaded from the language module given as third parameter.

The channel itself decided if the short description or the long description should be used

Placeholders of type ##name## are deprecated

Parameters
string$name
array$parameters
string$language_module

Definition at line 155 of file class.ilNotificationConfig.php.

{
$this->long_description = new ilNotificationParameter($name, $parameters, $language_module);
}
ilNotificationConfig::setShortDescriptionVar (   $name,
  $parameters = array(),
  $language_module = 'notification' 
)

Sets the name of the language variable to use as short description text.

The translation may include [NAME] parts wich will be replaced by the matching parameter found in $parameters. The language var is loaded from the language module given as third parameter.

Placeholders of type ##name## are deprecated

The channel itself decided if the short description or the long description should be used

Parameters
string$name
array$parameters
string$language_module

Definition at line 132 of file class.ilNotificationConfig.php.

{
$this->short_description = new ilNotificationParameter($name, $parameters, $language_module);
}
ilNotificationConfig::setTitleVar (   $name,
  $parameters = array(),
  $language_module = 'notification' 
)

Sets the name of the language variable to use as title.

The translation may include [NAME] parts wich will be replaced by the matching parameter found in $parameters. The language var is loaded from the language module given as third parameter.

Placeholders of type ##name## are deprecated

Parameters
type$name
type$parameters
type$language_module

Definition at line 109 of file class.ilNotificationConfig.php.

{
$this->title = new ilNotificationParameter($name, $parameters, $language_module);
}
ilNotificationConfig::setValidForSeconds (   $seconds)

Definition at line 179 of file class.ilNotificationConfig.php.

{
$this->validForSeconds = $seconds;
}
ilNotificationConfig::unsetHandlerParam (   $name)

Definition at line 292 of file class.ilNotificationConfig.php.

{
unset($this->handlerParams[$name]);
}

Field Documentation

ilNotificationConfig::$disableAfterDelivery = false
private

Definition at line 49 of file class.ilNotificationConfig.php.

Referenced by hasDisableAfterDeliverySet().

ilNotificationConfig::$handlerParams = array()
private

Definition at line 63 of file class.ilNotificationConfig.php.

Referenced by getHandlerParams().

ilNotificationConfig::$iconPath
private

Definition at line 32 of file class.ilNotificationConfig.php.

Referenced by getIconPath(), and getUserInstance().

ilNotificationConfig::$link
private

Definition at line 21 of file class.ilNotificationConfig.php.

Referenced by getLink(), and setLink().

ilNotificationConfig::$linktarget = '_self'
private

Definition at line 22 of file class.ilNotificationConfig.php.

Referenced by getLinktarget(), and setLinktarget().

ilNotificationConfig::$long_description
private

Definition at line 35 of file class.ilNotificationConfig.php.

ilNotificationConfig::$short_description
private

Definition at line 34 of file class.ilNotificationConfig.php.

ilNotificationConfig::$title
private

Definition at line 24 of file class.ilNotificationConfig.php.

Referenced by getUserInstance().

ilNotificationConfig::$type
private

Definition at line 12 of file class.ilNotificationConfig.php.

Referenced by __construct(), and getType().

ilNotificationConfig::$validForSeconds = 0
private

Definition at line 56 of file class.ilNotificationConfig.php.

Referenced by getValidForSeconds().


The documentation for this class was generated from the following file: