3 declare(strict_types=1);
55 if ($identification === null) {
68 $this->disableAfterDelivery = $value;
94 $this->iconPath =
$path;
105 public function setTitleVar(
string $name, array $parameters = [],
string $language_module =
'notification'): void
112 return $this->title->getName();
125 return $this->short_description->getName();
138 return $this->long_description->getName();
152 foreach ($this->links as
$id => $link) {
161 $this->validForSeconds = $seconds;
201 final public function notifyByUsers(array $recipients,
bool $processAsync =
false): void
218 final public function notifyByRoles(array $roles,
bool $processAsync =
false): void
227 $title = $this->title->
getName();
228 if (isset($languageVars[$this->title->getName()])) {
229 $var = $languageVars[$this->title->getName()]->lang;
232 } elseif (isset($var[$defaultLanguage])) {
236 $notificationObject->title =
$title;
238 $short = $this->short_description->
getName();
239 if (isset($languageVars[$this->short_description->getName()])) {
240 $var = $languageVars[$this->short_description->getName()]->lang;
243 } elseif (isset($var[$defaultLanguage])) {
247 $notificationObject->shortDescription = $short;
249 $long = $this->long_description->getName();
250 if (isset($languageVars[$this->long_description->getName()])) {
251 $var = $languageVars[$this->long_description->getName()]->lang;
254 } elseif (isset($var[$defaultLanguage])) {
258 $notificationObject->longDescription = $long;
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;
267 } elseif (isset($var[$defaultLanguage])) {
272 $process_link = clone $link;
273 $process_link->setTitle($link_title);
274 $process_links[] = $process_link;
276 $notificationObject->links = $process_links;
280 return $notificationObject;
285 if (strpos($name,
'.')) {
286 $nsParts = explode(
'.', $name, 2);
288 $field = $nsParts[1];
289 $this->handlerParams[$ns][$field] = $value;
291 $this->handlerParams[
''][
$name] = $value;
302 unset($this->handlerParams[$name]);
hasDisableAfterDeliverySet()
setVisibleForSeconds(int $visibleForSeconds)
notifyByUsers(array $recipients, bool $processAsync=false)
static sendNotificationToRoles(ilNotificationConfig $notification, array $roles, bool $processAsync=false)
NotificationIdentification $identification
__construct(string $provider, ?NotificationIdentification $identification=null)
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
description of a localized parameter this information is used locate translations while processing no...
setAutoDisable(bool $value)
unsetHandlerParam(string $name)
setHandlerParam(string $name, string $value)
static sendNotificationToUsers(ilNotificationConfig $notification, array $users, bool $processAsync=false)
setShortDescriptionVar(string $name, array $parameters=[], string $language_module='notification')
setTitleVar(string $name, array $parameters=[], string $language_module='notification')
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setValidForSeconds(int $seconds)
static sendNotificationToListeners(ilNotificationConfig $notification, int $ref_id, bool $processAsync=false)
setIconPath(string $path)
notifyByListeners(int $ref_id, $processAsync=false)
setLongDescriptionVar(string $name, array $parameters=[], string $language_module='notification')
ilNotificationParameter $title
ilNotificationParameter $short_description
getUserInstance(ilObjUser $user, array $languageVars, string $defaultLanguage)
setIdentification(NotificationIdentification $identification)
bool $disableAfterDelivery
ilNotificationParameter $long_description
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
notifyByRoles(array $roles, bool $processAsync=false)