ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
Notification.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 2019 Timon Amstutz <timon.amstutz@ilub.unibe.ch> Extended GPL, see docs/LICENSE */
3 
5 
7 use \ILIAS\UI\Component\Legacy\Legacy;
10 
12 {
17  protected $additional_content = null;
21  protected $lead_icon;
25  protected $close_action;
29  protected $aggregate_notifications = [];
30 
35  public function __construct($title, \ILIAS\UI\Component\Symbol\Icon\Icon $icon)
36  {
37  $this->lead_icon = $icon;
39  }
40 
45  {
46  $clone = clone $this;
47  $clone->additional_content = $additional_content;
48  return $clone;
49  }
50 
54  public function getAdditionalContent() : ?Legacy
55  {
57  }
58 
62  public function withCloseAction(string $url) : INotification
63  {
64  $clone = clone $this;
65  $clone->close_action = $url;
66  return $clone;
67  }
68 
72  public function getCloseAction() : ?string
73  {
74  return $this->close_action;
75  }
76 
81  {
82  $classes = [
83  INotification::class
84  ];
85  $this->checkArgListElements("Notification Item", $aggregate_notifications, $classes);
86  $clone = clone $this;
87  $clone->aggregate_notifications = $aggregate_notifications;
88  return $clone;
89  }
90 
94  public function getAggregateNotifications() : array
95  {
97  }
98 
102  public function withLeadIcon(\ILIAS\UI\Component\Symbol\Icon\Icon $icon) : INotification
103  {
104  $clone = clone $this;
105  $clone->lead_icon = $icon;
106  return $clone;
107  }
108 
112  public function getLeadIcon() : \ILIAS\UI\Component\Symbol\Icon\Icon
113  {
114  return $this->lead_icon;
115  }
116 }
Class Factory.
withCloseAction(string $url)
Get an Item like this with an url to consulted async, when to close button is pressed.With this url, information may be stored persistently in the DB without interrupting the workflow of the user (e.g. setting a flag, that the message was consulted).
Class ChatMainBarProvider .
getAdditionalContent()
Get the additional content of the item or null.
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
Common interface to all items.
Definition: Item.php:13
withAdditionalContent(Legacy $additional_content)
Get a Notification Item like this but with additional content bellow the description.Note this should only be used, if the content section needs to hold legacy content that currently does not have a place in the UI components.
getLeadIcon()
Get icon as lead.Note that Notifications only accept Icons as lead, this is different from the standa...
withLeadIcon(\ILIAS\UI\Component\Symbol\Icon\Icon $icon)
withAggregateNotifications(array $aggregate_notifications)
Get an Notification Item like this, but with a set of Notifications, this Notification Item will aggr...
getCloseAction()
Get the url attached to this Notification Item.
__construct(Container $dic, ilPlugin $plugin)
$url
checkArgListElements($which, array &$values, $classes)
Check every element of the list if it is an instance of one of the given classes. ...
getAggregateNotifications()
Get the list of Notification Items, this Notification Item aggregates or an empty list...
__construct($title, \ILIAS\UI\Component\Symbol\Icon\Icon $icon)