19declare(strict_types=1);
51 if ($identification ===
null) {
54 $this->identification = $identification;
64 $this->disableAfterDelivery = $value;
90 $this->iconPath =
$path;
101 public function setTitleVar(
string $name, array $parameters = [],
string $language_module =
'notification'): void
108 return $this->title->getName();
116 array $parameters = [],
117 string $language_module =
'notification'
124 return $this->short_description->getName();
132 array $parameters = [],
133 string $language_module =
'notification'
140 return $this->long_description->getName();
149 'title' => $this->title,
150 'longDescription' => $this->long_description,
151 'shortDescription' => $this->short_description,
154 foreach ($this->links as
$id => $link) {
155 $params[
'link_' .
$id] = $link->getTitleParameter();
163 $this->validForSeconds = $seconds;
168 return $this->validForSeconds;
173 return $this->visibleForSeconds;
181 $this->visibleForSeconds = $visibleForSeconds;
203 final public function notifyByUsers(array $recipients,
bool $processAsync =
false): void
205 $this->beforeSendToUsers();
206 ilNotificationSystem::sendNotificationToUsers($this, $recipients, $processAsync);
207 $this->afterSendToUsers();
212 $this->beforeSendToListeners();
213 ilNotificationSystem::sendNotificationToListeners($this,
$ref_id, $processAsync);
214 $this->afterSendToListeners();
220 final public function notifyByRoles(array $roles,
bool $processAsync =
false): void
222 ilNotificationSystem::sendNotificationToRoles($this, $roles, $processAsync);
232 $title = $this->title->
getName();
233 if (isset($languageVars[$this->title->getName()])) {
234 $var = $languageVars[$this->title->getName()]->lang;
241 $notificationObject->title = $title;
243 $short = $this->short_description->
getName();
244 if (isset($languageVars[$this->short_description->getName()])) {
245 $var = $languageVars[$this->short_description->getName()]->lang;
252 $notificationObject->shortDescription = $short;
254 $long = $this->long_description->getName();
255 if (isset($languageVars[$this->long_description->getName()])) {
256 $var = $languageVars[$this->long_description->getName()]->lang;
263 $notificationObject->longDescription = $long;
266 foreach ($this->links as $link) {
267 $link_title = $link->getTitleParameter()->getName();
268 if (isset($languageVars[$link->getTitleParameter()->getName()])) {
269 $var = $languageVars[$link->getTitleParameter()->getName()]->lang;
277 $process_link = clone $link;
278 $process_link->setTitle($link_title);
279 $process_links[] = $process_link;
281 $notificationObject->links = $process_links;
283 $notificationObject->iconPath = $this->iconPath;
285 return $notificationObject;
290 if (strpos($name,
'.')) {
291 $nsParts = explode(
'.', $name, 2);
293 $field = $nsParts[1];
294 $this->handlerParams[$ns][$field] = $value;
296 $this->handlerParams[
''][$name] = $value;
305 return $this->handlerParams;
310 unset($this->handlerParams[$name]);
315 $this->identification = $identification;
320 return $this->identification;
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
hasDisableAfterDeliverySet()
setTitleVar(string $name, array $parameters=[], string $language_module='notification')
notifyByListeners(int $ref_id, bool $processAsync=false)
setIconPath(string $path)
ilNotificationParameter $title
notifyByUsers(array $recipients, bool $processAsync=false)
setVisibleForSeconds(int $visibleForSeconds)
setAutoDisable(bool $value)
ilNotificationParameter $long_description
bool $disableAfterDelivery
setIdentification(NotificationIdentification $identification)
getUserInstance(ilObjUser $user, array $languageVars, string $defaultLanguage)
notifyByRoles(array $roles, bool $processAsync=false)
__construct(private readonly string $provider, private ?NotificationIdentification $identification=null)
setLongDescriptionVar(string $name, array $parameters=[], string $language_module='notification')
unsetHandlerParam(string $name)
setShortDescriptionVar(string $name, array $parameters=[], string $language_module='notification')
setHandlerParam(string $name, string $value)
ilNotificationParameter $short_description
setValidForSeconds(int $seconds)
description of a localized parameter this information is used locate translations while processing no...
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params