19 declare(strict_types=1);
46 return $this->
ui->factory()->legacy()->content(
"Cannot render item of type " . $item::class .
"");
50 $toast = $this->
ui->factory()->toast()->standard(
55 if ($item->getDescription() !==
null) {
56 $toast = $toast->withDescription($item->getDescription());
60 if ($item->hasClosedAction()) {
62 $item->getClosedAction()->getIdentifier(),
65 $toast = $toast->withAdditionalOnLoadCode(fn(
$id):
string =>
" 66 $('#$id').on('removeToast', function() { 76 if ($item->hasShownAction()) {
78 $item->getShownAction()->getIdentifier(),
81 $toast = $toast->withAdditionalOnLoadCode(fn(
$id):
string =>
" 82 $('#$id').on('showToast', function() { 92 if ($item->hasVanishedAction()) {
94 $item->getVanishedAction()->getIdentifier(),
97 $toast = $toast->withAdditionalOnLoadCode(fn(
$id):
string =>
" 98 $('#$id').on('vanishToast', function() { 102 url: '$vanished_action' 108 foreach ($item->getAdditionalToastActions() as $toast_action) {
110 $toast_action->getIdentifier(),
113 $link = $this->
ui->factory()->link()->standard(
114 $toast_action->getTitle(),
118 $toast = $toast->withAdditionalLink($link);
127 if ($icon !==
null) {
130 return $this->
ui->factory()->symbol()->icon()->standard(
"nota", $item->
getTitle());
135 $query = http_build_query([
136 ClientNotifications::MODE => ClientNotifications::MODE_HANDLE_TOAST_ACTION,
137 ClientNotifications::ADDITIONAL_ACTION => $action,
138 ClientNotifications::ITEM_ID => $this->
hash($id->serialize()),
141 return rtrim(ILIAS_HTTP_PATH,
"/") .
"/" . ClientNotifications::NOTIFY_ENDPOINT .
"?" . $query;
__construct(protected UIServices $ui)
Interface IdentificationInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
buildURL(string $action, IdentificationInterface $id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Provides fluid interface to RBAC services.
getToastComponentForItem(isItem $item)
Returns the UI Component for the past item.
getIconOrFallback(isStandardItem $item)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getProviderIdentification()
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins