19 declare(strict_types=1);
49 return $this->
ui->factory()->legacy(
"Cannot render item of type " . get_class($item) .
"");
53 $toast = $this->
ui->factory()->toast()->standard(
58 if ($item->getDescription() !== null) {
59 $toast = $toast->withDescription($item->getDescription());
63 if ($item->hasClosedAction()) {
65 $item->getClosedAction()->getIdentifier(),
68 $toast = $toast->withAdditionalOnLoadCode(
function (
$id) use ($closed_action) {
70 $('#$id').on('removeToast', function() { 81 if ($item->hasShownAction()) {
83 $item->getShownAction()->getIdentifier(),
86 $toast = $toast->withAdditionalOnLoadCode(
function (
$id) use ($shown_action) {
88 $('#$id').on('showToast', function() { 99 if ($item->hasVanishedAction()) {
101 $item->getVanishedAction()->getIdentifier(),
104 $toast = $toast->withAdditionalOnLoadCode(
function (
$id) use ($vanished_action) {
106 $('#$id').on('vanishToast', function() { 110 url: '$vanished_action' 117 foreach ($item->getAdditionalToastActions() as $toast_action) {
119 $toast_action->getIdentifier(),
122 $link = $this->
ui->factory()->link()->standard(
123 $toast_action->getTitle(),
127 $toast = $toast->withAdditionalLink($link);
131 if ($item->getVanishTime() !== null) {
135 if ($item->getDelayTime() !== null) {
145 if ($icon !== null) {
148 return $this->
ui->factory()->symbol()->icon()->standard(
"nota", $item->
getTitle());
153 $query = http_build_query([
154 ClientNotifications::MODE => ClientNotifications::MODE_HANDLE_TOAST_ACTION,
155 ClientNotifications::ADDITIONAL_ACTION => $action,
156 ClientNotifications::ITEM_ID => $this->
hash($id->serialize()),
159 return rtrim(ILIAS_HTTP_PATH,
"/") .
"/" . ClientNotifications::NOTIFY_ENDPOINT .
"?" .
$query;
__construct(UIServices $ui)
This describes how an icon could be modified during construction of UI.
Interface IdentificationInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
buildURL(string $action, IdentificationInterface $id)
Provides fluid interface to RBAC services.
getToastComponentForItem(isItem $item)
Returns the UI Component for the past item.
getIconOrFallback(isStandardItem $item)
getProviderIdentification()
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins