ILIAS  release_8 Revision v8.24
ILIAS\Notifications\Model\ilNotificationConfig Class Reference
+ Collaboration diagram for ILIAS\Notifications\Model\ilNotificationConfig:

Public Member Functions

 __construct (string $provider, ?NotificationIdentification $identification=null)
 
 getType ()
 
 setAutoDisable (bool $value)
 
 hasDisableAfterDeliverySet ()
 
 setLinks (array $links)
 
 getLinks ()
 
 setIconPath (string $path)
 
 getIconPath ()
 
 setTitleVar (string $name, array $parameters=[], string $language_module='notification')
 
 getTitleVar ()
 
 setShortDescriptionVar (string $name, array $parameters=[], string $language_module='notification')
 
 getShortDescriptionVar ()
 
 setLongDescriptionVar (string $name, array $parameters=[], string $language_module='notification')
 
 getLongDescriptionVar ()
 
 getLanguageParameters ()
 
 setValidForSeconds (int $seconds)
 
 getValidForSeconds ()
 
 getVisibleForSeconds ()
 
 setVisibleForSeconds (int $visibleForSeconds)
 
 notifyByUsers (array $recipients, bool $processAsync=false)
 
 notifyByListeners (int $ref_id, $processAsync=false)
 
 notifyByRoles (array $roles, bool $processAsync=false)
 
 getUserInstance (ilObjUser $user, array $languageVars, string $defaultLanguage)
 
 setHandlerParam (string $name, string $value)
 
 getHandlerParams ()
 
 unsetHandlerParam (string $name)
 
 setIdentification (NotificationIdentification $identification)
 
 getIdentification ()
 

Data Fields

const TTL_LONG = 1800
 
const TTL_SHORT = 120
 
const DEFAULT_TTS = 5
 

Protected Member Functions

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

Protected Attributes

int $visibleForSeconds = 0
 

Private Attributes

string $type
 
array $links = []
 
ilNotificationParameter $title
 
string $iconPath
 
ilNotificationParameter $short_description
 
ilNotificationParameter $long_description
 
bool $disableAfterDelivery = false
 
int $validForSeconds = 0
 
array $handlerParams = []
 
NotificationIdentification $identification
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Notifications\Model\ilNotificationConfig::__construct ( string  $provider,
?NotificationIdentification  $identification = null 
)

Member Function Documentation

◆ afterSendToListeners()

ILIAS\Notifications\Model\ilNotificationConfig::afterSendToListeners ( )
protected

Definition at line 194 of file ilNotificationConfig.php.

194 : void
195 {
196 }

Referenced by ILIAS\Notifications\Model\ilNotificationConfig\notifyByListeners().

+ Here is the caller graph for this function:

◆ afterSendToUsers()

ILIAS\Notifications\Model\ilNotificationConfig::afterSendToUsers ( )
protected

Definition at line 186 of file ilNotificationConfig.php.

186 : void
187 {
188 }

Referenced by ILIAS\Notifications\Model\ilNotificationConfig\notifyByUsers().

+ Here is the caller graph for this function:

◆ beforeSendToListeners()

ILIAS\Notifications\Model\ilNotificationConfig::beforeSendToListeners ( )
protected

Definition at line 190 of file ilNotificationConfig.php.

190 : void
191 {
192 }

Referenced by ILIAS\Notifications\Model\ilNotificationConfig\notifyByListeners().

+ Here is the caller graph for this function:

◆ beforeSendToUsers()

ILIAS\Notifications\Model\ilNotificationConfig::beforeSendToUsers ( )
protected

Definition at line 182 of file ilNotificationConfig.php.

182 : void
183 {
184 }

Referenced by ILIAS\Notifications\Model\ilNotificationConfig\notifyByUsers().

+ Here is the caller graph for this function:

◆ getHandlerParams()

ILIAS\Notifications\Model\ilNotificationConfig::getHandlerParams ( )

◆ getIconPath()

ILIAS\Notifications\Model\ilNotificationConfig::getIconPath ( )

◆ getIdentification()

ILIAS\Notifications\Model\ilNotificationConfig::getIdentification ( )

◆ getLanguageParameters()

ILIAS\Notifications\Model\ilNotificationConfig::getLanguageParameters ( )
Returns
array<string, ilNotificationParameter>

Definition at line 144 of file ilNotificationConfig.php.

144 : array
145 {
146 $params = [
147 'title' => $this->title,
148 'longDescription' => $this->long_description,
149 'shortDescription' => $this->short_description,
150 ];
151
152 foreach ($this->links as $id => $link) {
153 $params['link_' . $id] = $link->getTitle();
154 }
155
156 return $params;
157 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33

References $id, ILIAS\Notifications\Model\ilNotificationConfig\$long_description, $params, ILIAS\Notifications\Model\ilNotificationConfig\$short_description, and ILIAS\Notifications\Model\ilNotificationConfig\$title.

Referenced by ILIAS\Notifications\ilNotificationSystem\toUsers().

+ Here is the caller graph for this function:

◆ getLinks()

ILIAS\Notifications\Model\ilNotificationConfig::getLinks ( )

◆ getLongDescriptionVar()

ILIAS\Notifications\Model\ilNotificationConfig::getLongDescriptionVar ( )

Definition at line 136 of file ilNotificationConfig.php.

136 : string
137 {
138 return $this->long_description->getName();
139 }

◆ getShortDescriptionVar()

ILIAS\Notifications\Model\ilNotificationConfig::getShortDescriptionVar ( )

Definition at line 123 of file ilNotificationConfig.php.

123 : string
124 {
125 return $this->short_description->getName();
126 }

◆ getTitleVar()

ILIAS\Notifications\Model\ilNotificationConfig::getTitleVar ( )

Definition at line 110 of file ilNotificationConfig.php.

110 : string
111 {
112 return $this->title->getName();
113 }

◆ getType()

ILIAS\Notifications\Model\ilNotificationConfig::getType ( )

◆ getUserInstance()

ILIAS\Notifications\Model\ilNotificationConfig::getUserInstance ( ilObjUser  $user,
array  $languageVars,
string  $defaultLanguage 
)

Definition at line 223 of file ilNotificationConfig.php.

223 : ilNotificationObject
224 {
225 $notificationObject = new ilNotificationObject($this, $user);
226
227 $title = $this->title->getName();
228 if (isset($languageVars[$this->title->getName()])) {
229 $var = $languageVars[$this->title->getName()]->lang;
230 if (isset($var[$user->getLanguage()])) {
231 $title = $var[$user->getLanguage()];
232 } elseif (isset($var[$defaultLanguage])) {
233 $title = $var[$defaultLanguage];
234 }
235 }
236 $notificationObject->title = $title;
237
238 $short = $this->short_description->getName();
239 if (isset($languageVars[$this->short_description->getName()])) {
240 $var = $languageVars[$this->short_description->getName()]->lang;
241 if (isset($var[$user->getLanguage()])) {
242 $short = $var[$user->getLanguage()];
243 } elseif (isset($var[$defaultLanguage])) {
244 $short = $var[$defaultLanguage];
245 }
246 }
247 $notificationObject->shortDescription = $short;
248
249 $long = $this->long_description->getName();
250 if (isset($languageVars[$this->long_description->getName()])) {
251 $var = $languageVars[$this->long_description->getName()]->lang;
252 if (isset($var[$user->getLanguage()])) {
253 $long = $var[$user->getLanguage()];
254 } elseif (isset($var[$defaultLanguage])) {
255 $long = $var[$defaultLanguage];
256 }
257 }
258 $notificationObject->longDescription = $long;
259
260 $process_links = [];
261 foreach ($this->links as $link) {
262 $link_title = $link->getTitle()->getName();
263 if (isset($languageVars[$link->getTitle()->getName()])) {
264 $var = $languageVars[$link->getTitle()->getName()]->lang;
265 if (isset($var[$user->getLanguage()])) {
266 $link_title = $var[$user->getLanguage()];
267 } elseif (isset($var[$defaultLanguage])) {
268 $link_title = $var[$defaultLanguage];
269 }
270 }
271
272 $process_link = clone $link;
273 $process_link->setTitle($link_title);
274 $process_links[] = $process_link;
275 }
276 $notificationObject->links = $process_links;
277
278 $notificationObject->iconPath = $this->iconPath;
279
280 return $notificationObject;
281 }
$defaultLanguage
Definition: xapiexit.php:24

References $defaultLanguage, ILIAS\Notifications\Model\ilNotificationConfig\$iconPath, ILIAS\Notifications\Model\ilNotificationConfig\$title, ilObjUser\getLanguage(), and ILIAS\Notifications\Model\ilNotificationParameter\getName().

Referenced by ILIAS\Notifications\ilNotificationSystem\toUsers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValidForSeconds()

ILIAS\Notifications\Model\ilNotificationConfig::getValidForSeconds ( )

◆ getVisibleForSeconds()

ILIAS\Notifications\Model\ilNotificationConfig::getVisibleForSeconds ( )

◆ hasDisableAfterDeliverySet()

ILIAS\Notifications\Model\ilNotificationConfig::hasDisableAfterDeliverySet ( )

◆ notifyByListeners()

ILIAS\Notifications\Model\ilNotificationConfig::notifyByListeners ( int  $ref_id,
  $processAsync = false 
)
final

◆ notifyByRoles()

ILIAS\Notifications\Model\ilNotificationConfig::notifyByRoles ( array  $roles,
bool  $processAsync = false 
)
final
Parameters
string[]$roles

Definition at line 218 of file ilNotificationConfig.php.

218 : void
219 {
220 ilNotificationSystem::sendNotificationToRoles($this, $roles, $processAsync);
221 }
static sendNotificationToRoles(ilNotificationConfig $notification, array $roles, bool $processAsync=false)

References ILIAS\Notifications\ilNotificationSystem\sendNotificationToRoles().

+ Here is the call graph for this function:

◆ notifyByUsers()

ILIAS\Notifications\Model\ilNotificationConfig::notifyByUsers ( array  $recipients,
bool  $processAsync = false 
)
final
Parameters
int[]$recipients

Definition at line 201 of file ilNotificationConfig.php.

201 : void
202 {
203 $this->beforeSendToUsers();
204 ilNotificationSystem::sendNotificationToUsers($this, $recipients, $processAsync);
205 $this->afterSendToUsers();
206 }
static sendNotificationToUsers(ilNotificationConfig $notification, array $users, bool $processAsync=false)

References ILIAS\Notifications\Model\ilNotificationConfig\afterSendToUsers(), ILIAS\Notifications\Model\ilNotificationConfig\beforeSendToUsers(), and ILIAS\Notifications\ilNotificationSystem\sendNotificationToUsers().

+ Here is the call graph for this function:

◆ setAutoDisable()

ILIAS\Notifications\Model\ilNotificationConfig::setAutoDisable ( bool  $value)

Definition at line 66 of file ilNotificationConfig.php.

66 : void
67 {
68 $this->disableAfterDelivery = $value;
69 }

◆ setHandlerParam()

ILIAS\Notifications\Model\ilNotificationConfig::setHandlerParam ( string  $name,
string  $value 
)

Definition at line 283 of file ilNotificationConfig.php.

283 : void
284 {
285 if (strpos($name, '.')) {
286 $nsParts = explode('.', $name, 2);
287 $ns = $nsParts[0];
288 $field = $nsParts[1];
289 $this->handlerParams[$ns][$field] = $value;
290 } else {
291 $this->handlerParams[''][$name] = $value;
292 }
293 }
if($format !==null) $name
Definition: metadata.php:247

References $name.

◆ setIconPath()

ILIAS\Notifications\Model\ilNotificationConfig::setIconPath ( string  $path)

Definition at line 92 of file ilNotificationConfig.php.

92 : void
93 {
94 $this->iconPath = $path;
95 }
$path
Definition: ltiservices.php:32

References $path.

◆ setIdentification()

ILIAS\Notifications\Model\ilNotificationConfig::setIdentification ( NotificationIdentification  $identification)

Definition at line 305 of file ilNotificationConfig.php.

305 : void
306 {
307 $this->identification = $identification;
308 }

References ILIAS\Notifications\Model\ilNotificationConfig\$identification.

◆ setLinks()

ILIAS\Notifications\Model\ilNotificationConfig::setLinks ( array  $links)
Parameters
ilNotificationLink[]$links

Definition at line 79 of file ilNotificationConfig.php.

79 : void
80 {
81 $this->links = $links;
82 }

References ILIAS\Notifications\Model\ilNotificationConfig\$links.

◆ setLongDescriptionVar()

ILIAS\Notifications\Model\ilNotificationConfig::setLongDescriptionVar ( string  $name,
array  $parameters = [],
string  $language_module = 'notification' 
)
Parameters
string[]$parameters

Definition at line 131 of file ilNotificationConfig.php.

131 : void
132 {
133 $this->long_description = new ilNotificationParameter($name, $parameters, $language_module);
134 }
description of a localized parameter this information is used locate translations while processing no...

References $name.

◆ setShortDescriptionVar()

ILIAS\Notifications\Model\ilNotificationConfig::setShortDescriptionVar ( string  $name,
array  $parameters = [],
string  $language_module = 'notification' 
)
Parameters
string[]$parameters

Definition at line 118 of file ilNotificationConfig.php.

118 : void
119 {
120 $this->short_description = new ilNotificationParameter($name, $parameters, $language_module);
121 }

References $name.

◆ setTitleVar()

ILIAS\Notifications\Model\ilNotificationConfig::setTitleVar ( string  $name,
array  $parameters = [],
string  $language_module = 'notification' 
)
Parameters
string[]$parameters

Definition at line 105 of file ilNotificationConfig.php.

105 : void
106 {
107 $this->title = new ilNotificationParameter($name, $parameters, $language_module);
108 }

References $name.

◆ setValidForSeconds()

ILIAS\Notifications\Model\ilNotificationConfig::setValidForSeconds ( int  $seconds)

Definition at line 159 of file ilNotificationConfig.php.

159 : void
160 {
161 $this->validForSeconds = $seconds;
162 }

◆ setVisibleForSeconds()

ILIAS\Notifications\Model\ilNotificationConfig::setVisibleForSeconds ( int  $visibleForSeconds)
Deprecated:
since notifications are no longer used for popup presentation. See the GS Scope Toast for more information.

Definition at line 177 of file ilNotificationConfig.php.

177 : void
178 {
179 $this->visibleForSeconds = $visibleForSeconds;
180 }

References ILIAS\Notifications\Model\ilNotificationConfig\$visibleForSeconds.

◆ unsetHandlerParam()

ILIAS\Notifications\Model\ilNotificationConfig::unsetHandlerParam ( string  $name)

Definition at line 300 of file ilNotificationConfig.php.

300 : void
301 {
302 unset($this->handlerParams[$name]);
303 }

References $name.

Field Documentation

◆ $disableAfterDelivery

bool ILIAS\Notifications\Model\ilNotificationConfig::$disableAfterDelivery = false
private

◆ $handlerParams

array ILIAS\Notifications\Model\ilNotificationConfig::$handlerParams = []
private

◆ $iconPath

string ILIAS\Notifications\Model\ilNotificationConfig::$iconPath
private

◆ $identification

◆ $links

array ILIAS\Notifications\Model\ilNotificationConfig::$links = []
private

◆ $long_description

ilNotificationParameter ILIAS\Notifications\Model\ilNotificationConfig::$long_description
private

◆ $short_description

ilNotificationParameter ILIAS\Notifications\Model\ilNotificationConfig::$short_description
private

◆ $title

◆ $type

string ILIAS\Notifications\Model\ilNotificationConfig::$type
private

◆ $validForSeconds

int ILIAS\Notifications\Model\ilNotificationConfig::$validForSeconds = 0
private

◆ $visibleForSeconds

int ILIAS\Notifications\Model\ilNotificationConfig::$visibleForSeconds = 0
protected

◆ DEFAULT_TTS

const ILIAS\Notifications\Model\ilNotificationConfig::DEFAULT_TTS = 5

Definition at line 35 of file ilNotificationConfig.php.

◆ TTL_LONG

const ILIAS\Notifications\Model\ilNotificationConfig::TTL_LONG = 1800

Definition at line 33 of file ilNotificationConfig.php.

◆ TTL_SHORT

const ILIAS\Notifications\Model\ilNotificationConfig::TTL_SHORT = 120

Definition at line 34 of file ilNotificationConfig.php.


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