ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
Factory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\UI\Implementation;
22 
23 use ILIAS\UI\Component as C;
24 use ILIAS\UI\Help;
25 // TODO: This might cache the created factories.
27 
28 class Factory implements \ILIAS\UI\Factory
29 {
30  public function __construct(
31  protected C\Counter\Factory $counter_factory,
32  protected C\Button\Factory $button_factory,
33  protected C\Listing\Factory $listing_factory,
34  protected C\Image\Factory $image_factory,
35  protected C\Panel\Factory $panel_factory,
36  protected C\Modal\Factory $modal_factory,
37  protected C\Progress\Factory $progress_factory,
38  protected C\Dropzone\Factory $dropzone_factory,
39  protected C\Popover\Factory $popover_factory,
40  protected C\Divider\Factory $divider_factory,
41  protected C\Link\Factory $link_factory,
42  protected C\Dropdown\Factory $dropdown_factory,
43  protected C\Item\Factory $item_factory,
44  protected C\ViewControl\Factory $viewcontrol_factory,
45  protected C\Chart\Factory $chart_factory,
46  protected C\Input\Factory $input_factory,
47  protected C\Table\Factory $table_factory,
48  protected C\MessageBox\Factory $messagebox_factory,
49  protected C\Card\Factory $card_factory,
50  protected C\Layout\Factory $layout_factory,
51  protected C\MainControls\Factory $maincontrols_factory,
52  protected C\Tree\Factory $tree_factory,
53  protected C\Menu\Factory $menu_factory,
54  protected C\Symbol\Factory $symbol_factory,
55  protected C\Toast\Factory $toast_factory,
56  protected C\Legacy\Factory $legacy_factory,
57  protected C\launcher\Factory $launcher_factory,
58  protected C\Entity\Factory $entity_factory,
59  protected C\Prompt\Factory $prompt_factory,
60  ) {
61  }
62 
66  public function counter(): C\Counter\Factory
67  {
68  return $this->counter_factory;
69  }
70 
74  public function button(): C\Button\Factory
75  {
76  return $this->button_factory;
77  }
78 
82  public function card(): C\Card\Factory
83  {
84  return $this->card_factory;
85  }
86 
90  public function deck(array $cards): C\Deck\Deck
91  {
92  return new Component\Deck\Deck($cards, C\Deck\Deck::SIZE_S);
93  }
94 
98  public function listing(): C\Listing\Factory
99  {
100  return $this->listing_factory;
101  }
102 
106  public function image(): C\Image\Factory
107  {
108  return $this->image_factory;
109  }
110 
111  public function player(): C\Player\Factory
112  {
113  return new Component\Player\Factory();
114  }
115 
119  public function legacy(string $content): C\Legacy\Legacy
120  {
121  return $this->legacy_factory->legacy($content);
122  }
123 
127  public function panel(): C\Panel\Factory
128  {
129  return $this->panel_factory;
130  }
131 
135  public function modal(): C\Modal\Factory
136  {
137  return $this->modal_factory;
138  }
139 
140  public function progress(): C\Progress\Factory
141  {
142  return $this->progress_factory;
143  }
144 
148  public function dropzone(): C\Dropzone\Factory
149  {
150  return $this->dropzone_factory;
151  }
152 
156  public function popover(): C\Popover\Factory
157  {
158  return $this->popover_factory;
159  }
160 
164  public function divider(): C\Divider\Factory
165  {
166  return $this->divider_factory;
167  }
168 
172  public function link(): C\Link\Factory
173  {
174  return $this->link_factory;
175  }
176 
180  public function dropdown(): C\Dropdown\Factory
181  {
182  return $this->dropdown_factory;
183  }
184 
188  public function item(): C\Item\Factory
189  {
190  return $this->item_factory;
191  }
192 
193 
197  public function viewControl(): C\ViewControl\Factory
198  {
199  return $this->viewcontrol_factory;
200  }
201 
205  public function breadcrumbs(array $crumbs): C\Breadcrumbs\Breadcrumbs
206  {
207  return new Component\Breadcrumbs\Breadcrumbs($crumbs);
208  }
209 
213  public function chart(): C\Chart\Factory
214  {
215  return $this->chart_factory;
216  }
217 
221  public function input(): C\Input\Factory
222  {
223  return $this->input_factory;
224  }
225 
229  public function table(): C\Table\Factory
230  {
231  return $this->table_factory;
232  }
233 
237  public function messageBox(): C\MessageBox\Factory
238  {
239  return $this->messagebox_factory;
240  }
241 
245  public function layout(): C\Layout\Factory
246  {
247  return $this->layout_factory;
248  }
249 
253  public function mainControls(): C\MainControls\Factory
254  {
255  return $this->maincontrols_factory;
256  }
257 
261  public function tree(): C\Tree\Factory
262  {
263  return $this->tree_factory;
264  }
265 
269  public function menu(): C\Menu\Factory
270  {
271  return $this->menu_factory;
272  }
273 
277  public function symbol(): C\Symbol\Factory
278  {
279  return $this->symbol_factory;
280  }
281 
282  public function toast(): C\Toast\Factory
283  {
284  return $this->toast_factory;
285  }
286 
287  public function helpTopics(string ...$topics): array
288  {
289  return array_map(
290  fn($t) => new Help\Topic($t),
291  $topics
292  );
293  }
294 
295  public function launcher(): C\Launcher\Factory
296  {
297  return $this->launcher_factory;
298  }
299 
300  public function entity(): C\Entity\Factory
301  {
302  return $this->entity_factory;
303  }
304 
305  public function prompt(): C\Prompt\Factory
306  {
307  return $this->prompt_factory;
308  }
309 }
link()
description: purpose: > Links are used navigate to other resources or views of the system by clickin...
Definition: Factory.php:172
input()
description: purpose: > In opposite to components with a purely receptive or at most navigational ch...
Definition: Factory.php:221
deck(array $cards)
description: purpose: > Decks are used to display multiple Cards in a grid.They should be used if a ...
Definition: Factory.php:90
This is just a class that marks a string as a help topic.
Definition: Topic.php:26
symbol()
description: purpose: > Symbols are graphical representations of concepts or contexts quickly compre...
Definition: Factory.php:277
menu()
description: purpose: > Menus let the user choose from several (navigational) options.
Definition: Factory.php:269
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
prompt()
description: purpose: > A Prompt requires a user to make some inputs to the system, like making choices, acknowleding an important information or filling out a form.
Definition: Factory.php:305
progress()
description: purpose: > A Progress component is designed to represent the users advancement within a...
Definition: Factory.php:140
chart()
description: purpose: > Charts are used to graphically represent data in various forms such as maps...
Definition: Factory.php:213
helpTopics(string ... $topics)
description: purpose: > Help Topics can be attached to certain components.
Definition: Factory.php:287
__construct(protected C\Counter\Factory $counter_factory, protected C\Button\Factory $button_factory, protected C\Listing\Factory $listing_factory, protected C\Image\Factory $image_factory, protected C\Panel\Factory $panel_factory, protected C\Modal\Factory $modal_factory, protected C\Progress\Factory $progress_factory, protected C\Dropzone\Factory $dropzone_factory, protected C\Popover\Factory $popover_factory, protected C\Divider\Factory $divider_factory, protected C\Link\Factory $link_factory, protected C\Dropdown\Factory $dropdown_factory, protected C\Item\Factory $item_factory, protected C\ViewControl\Factory $viewcontrol_factory, protected C\Chart\Factory $chart_factory, protected C\Input\Factory $input_factory, protected C\Table\Factory $table_factory, protected C\MessageBox\Factory $messagebox_factory, protected C\Card\Factory $card_factory, protected C\Layout\Factory $layout_factory, protected C\MainControls\Factory $maincontrols_factory, protected C\Tree\Factory $tree_factory, protected C\Menu\Factory $menu_factory, protected C\Symbol\Factory $symbol_factory, protected C\Toast\Factory $toast_factory, protected C\Legacy\Factory $legacy_factory, protected C\launcher\Factory $launcher_factory, protected C\Entity\Factory $entity_factory, protected C\Prompt\Factory $prompt_factory,)
Definition: Factory.php:30
tree()
description: purpose: > Trees present hierarchically structured data.rivals: Drilldown: > A Drilldow...
Definition: Factory.php:261
table()
description: purpose: > Tables present a set of uniformly structured data.
Definition: Factory.php:229
listing()
description: purpose: > Listings are used to structure itemised textual information.composition: > Listings may contain ordered, unordered, or labeled items. effect: > Listings hold only textual information. They may contain Links but no Buttons. rules: composition: 1: Listings MUST NOT contain Buttons.
Definition: Factory.php:98
layout()
description: purpose: > Layout components are components used for the overall construction of the us...
Definition: Factory.php:245
popover()
description: purpose: > Popovers can be used when space is scarce i.e.within List GUI items...
Definition: Factory.php:156
dropdown()
description: purpose: > Dropdowns reveal a list of interactions that change the system’s status or ...
Definition: Factory.php:180
dropzone()
description: purpose: > Dropzones are containers used to drop either files or other HTML elements...
Definition: Factory.php:148
divider()
description: purpose: > A divider marks a thematic change in a sequence of other components...
Definition: Factory.php:164
toast()
description: purpose: Toasts are temporary messages from the system published to the user...
Definition: Factory.php:282
card()
description: purpose: > A card is a flexible content container for small chunks of structured data...
Definition: Factory.php:82
counter()
description: purpose: > Counter inform users about the quantity of items indicated by a glyph...
Definition: Factory.php:66
viewControl()
description: purpose: > View Controls switch between different visualisation of data.composition: > View Controls are composed mainly of buttons, they are often found in toolbars. effect: Interacting with a view control changes to display in some content area.
Definition: Factory.php:197
mainControls()
description: purpose: > Main Controls are components that are always usable, depending only on overa...
Definition: Factory.php:253
legacy(string $content)
description: purpose: > This component is used to wrap an existing ILIAS UI element into a UI compon...
Definition: Factory.php:119
image()
description: purpose: The Image component is used to display images of various sources.composition: > An Image is composed of the image and an alternative text for screen readers. An Image MAY contain an initial source of reduced size and additional higher resolution sources optimized for different display sizes to be loaded asynchronously once the actual size on the screen is known.rules: interaction: 1: > Images MAY be included in interactive components. Images MAY also be interactive on their own. Clicking on an Image can e.g. provide navigation to another screen or showing a Modal on the same screen. The usage of an interactive Image MUST be confirmed by the JF to make sure that interactive Images will only be used in meaningful cases. accessibility: 1: > Images MUST contain the alt attribute. This attribute MAY be left empty (alt="") if the image is of decorative nature. According to the WAI, decorative images don’t add information to the content of a page. For example, the information provided by the image might already be given using adjacent text, or the image might be included to make the website more visually attractive (see https://www.w3.org/WAI/tutorials/images/decorative/). composition: 1: > If an Image may be displayed in widely differing sizes differently sized sources SHOULD be added as additional high resolution resource sources to reduce loading times without diminishing the user experience.
Definition: Factory.php:106
launcher()
description: purpose: > The Launcher starts an object, a process or a workflow.
Definition: Factory.php:295
breadcrumbs(array $crumbs)
description: purpose: > Breadcrumbs is a supplemental navigation scheme.It eases the user&#39;s navigati...
Definition: Factory.php:205
item()
description: purpose: > An item displays a unique entity within the system.It shows information abou...
Definition: Factory.php:188
modal()
description: purpose: The Modal forces users to focus on the task at hand.composition: > A Modal is ...
Definition: Factory.php:135
entity()
description: purpose: > An Entity displays information about entities within the system...
Definition: Factory.php:300
button()
description: purpose: > Buttons trigger interactions that change the system’s or view&#39;s status...
Definition: Factory.php:74
panel()
description: purpose: > Panels are used to group titled content.composition: > Panels consist of a h...
Definition: Factory.php:127
messageBox()
description: purpose: > Message Boxes inform the user about the state of the system or an ongoing us...
Definition: Factory.php:237
player()
description: purpose: > The Player component is used to play and control a media source...
Definition: Factory.php:111
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Purpose.php:21