ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
Factory.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 2016 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4 
6 
7 use \ILIAS\UI\Component as C;
9 
10 // TODO: This might cache the created factories.
12 
13 class Factory implements \ILIAS\UI\Factory
14 {
18  protected $counter_factory;
19 
23  protected $button_factory;
24 
28  protected $listing_factory;
29 
33  protected $image_factory;
34 
38  protected $panel_factory;
39 
43  protected $modal_factory;
44 
48  protected $dropzone_factory;
49 
53  protected $popover_factory;
54 
58  protected $divider_factory;
59 
63  protected $link_factory;
64 
68  protected $dropdown_factory;
69 
73  protected $item_factory;
74 
79 
83  protected $chart_factory;
84 
88  protected $input_factory;
89 
93  protected $table_factory;
94 
99 
103  protected $card_factory;
104 
108  protected $menu_factory;
109 
113  protected $layout_factory;
114 
119 
123  protected $tree_factory;
124 
128  protected $symbol_factory;
129 
133  protected $legacy_factory;
134 
135  public function __construct(
136  C\Counter\Factory $counter_factory,
138  C\Listing\Factory $listing_factory,
139  C\Image\Factory $image_factory,
140  C\Panel\Factory $panel_factory,
141  C\Modal\Factory $modal_factory,
142  C\Dropzone\Factory $dropzone_factory,
143  C\Popover\Factory $popover_factory,
144  C\Divider\Factory $divider_factory,
145  C\Link\Factory $link_factory,
146  C\Dropdown\Factory $dropdown_factory,
147  C\Item\Factory $item_factory,
148  C\ViewControl\Factory $viewcontrol_factory,
149  C\Chart\Factory $chart_factory,
151  C\Table\Factory $table_factory,
152  C\MessageBox\Factory $messagebox_factory,
154  C\Layout\Factory $layout_factory,
155  C\MainControls\Factory $maincontrols_factory,
156  C\Tree\Factory $tree_factory,
157  C\Menu\Factory $menu_factory,
158  C\Symbol\Factory $symbol_factory,
159  C\Legacy\Factory $legacy_factory
160  ) {
161  $this->counter_factory = $counter_factory;
162  $this->button_factory = $button_factory;
163  $this->listing_factory = $listing_factory;
164  $this->image_factory = $image_factory;
165  $this->panel_factory = $panel_factory;
166  $this->modal_factory = $modal_factory;
167  $this->dropzone_factory = $dropzone_factory;
168  $this->popover_factory = $popover_factory;
169  $this->divider_factory = $divider_factory;
170  $this->link_factory = $link_factory;
171  $this->dropdown_factory = $dropdown_factory;
172  $this->item_factory = $item_factory;
173  $this->viewcontrol_factory = $viewcontrol_factory;
174  $this->chart_factory = $chart_factory;
175  $this->input_factory = $input_factory;
176  $this->table_factory = $table_factory;
177  $this->messagebox_factory = $messagebox_factory;
178  $this->card_factory = $card_factory;
179  $this->layout_factory = $layout_factory;
180  $this->maincontrols_factory = $maincontrols_factory;
181  $this->tree_factory = $tree_factory;
182  $this->menu_factory = $menu_factory;
183  $this->symbol_factory = $symbol_factory;
184  $this->legacy_factory = $legacy_factory;
185  }
186 
190  public function counter()
191  {
192  return $this->counter_factory;
193  }
194 
198  public function button()
199  {
200  return $this->button_factory;
201  }
202 
206  public function card()
207  {
208  return $this->card_factory;
209  }
210 
214  public function deck(array $cards)
215  {
216  return new Component\Deck\Deck($cards, Component\Deck\Deck::SIZE_S);
217  }
218 
222  public function listing()
223  {
224  return $this->listing_factory;
225  }
226 
230  public function image()
231  {
232  return $this->image_factory;
233  }
234 
238  public function legacy($content)
239  {
240  return $this->legacy_factory->legacy($content);
241  }
242 
246  public function panel()
247  {
248  return $this->panel_factory;
249  }
250 
254  public function modal()
255  {
256  return $this->modal_factory;
257  }
258 
262  public function dropzone()
263  {
265  }
266 
270  public function popover()
271  {
272  return $this->popover_factory;
273  }
274 
278  public function divider()
279  {
280  return $this->divider_factory;
281  }
282 
286  public function link()
287  {
288  return $this->link_factory;
289  }
290 
294  public function dropdown()
295  {
297  }
298 
302  public function item()
303  {
304  return $this->item_factory;
305  }
306 
307 
311  public function viewControl()
312  {
314  }
315 
319  public function breadcrumbs(array $crumbs)
320  {
321  return new Component\Breadcrumbs\Breadcrumbs($crumbs);
322  }
323 
327  public function chart()
328  {
329  return $this->chart_factory;
330  }
331 
335  public function input()
336  {
337  return $this->input_factory;
338  }
339 
343  public function table()
344  {
345  return $this->table_factory;
346  }
347 
351  public function messageBox()
352  {
354  }
355 
359  public function layout() : C\Layout\Factory
360  {
361  return $this->layout_factory;
362  }
363 
367  public function mainControls() : C\MainControls\Factory
368  {
370  }
371 
375  public function tree()
376  {
377  return $this->tree_factory;
378  }
379 
383  public function menu() : C\Menu\Factory
384  {
385  return $this->menu_factory;
386  }
387 
391  public function symbol() : C\Symbol\Factory
392  {
393  return $this->symbol_factory;
394  }
395 }
link()
description: purpose: > Links are used navigate to other resources or views of the system by clickin...
Definition: Factory.php:286
input()
description: purpose: > In opposite to components with a purely receptive or at most navigational ch...
Definition: Factory.php:335
deck(array $cards)
description: purpose: > Decks are used to display multiple Cards in a grid.They should be used if a ...
Definition: Factory.php:214
symbol()
description: purpose: > Symbols are graphical representations of concepts or contexts quickly compre...
Definition: Factory.php:391
menu()
description: purpose: > Menus let the user choose from several (navigational) options.
Definition: Factory.php:383
legacy($content)
description: purpose: > This component is used to wrap an existing ILIAS UI element into a UI compon...
Definition: Factory.php:238
chart()
description: purpose: > Charts are used to graphically represent data in various forms such as maps...
Definition: Factory.php:327
tree()
description: purpose: > Trees present hierarchically structured data.rivals: Drilldown: > A Drilldow...
Definition: Factory.php:375
table()
description: purpose: > Tables present a set of uniformly structured data.
Definition: Factory.php:343
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:222
layout()
description: purpose: > Layout components are compontents used for the overall construction of the u...
Definition: Factory.php:359
This is how the factory for UI elements looks.
Definition: Factory.php:17
popover()
description: purpose: > Popovers can be used when space is scarce i.e.within List GUI items...
Definition: Factory.php:270
dropdown()
description: purpose: > Dropdowns reveal a list of interactions that change the system’s status or ...
Definition: Factory.php:294
dropzone()
description: purpose: > Dropzones are containers used to drop either files or other HTML elements...
Definition: Factory.php:262
divider()
description: purpose: > A divider marks a thematic change in a sequence of other components...
Definition: Factory.php:278
card()
description: purpose: > A card is a flexible content container for small chunks of structured data...
Definition: Factory.php:206
counter()
description: purpose: > Counter inform users about the quantity of items indicated by a glyph...
Definition: Factory.php:190
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:311
mainControls()
description: purpose: > Main Controls are components that are always usable, depending only on overa...
Definition: Factory.php:367
__construct(C\Counter\Factory $counter_factory, C\Button\Factory $button_factory, C\Listing\Factory $listing_factory, C\Image\Factory $image_factory, C\Panel\Factory $panel_factory, C\Modal\Factory $modal_factory, C\Dropzone\Factory $dropzone_factory, C\Popover\Factory $popover_factory, C\Divider\Factory $divider_factory, C\Link\Factory $link_factory, C\Dropdown\Factory $dropdown_factory, C\Item\Factory $item_factory, C\ViewControl\Factory $viewcontrol_factory, C\Chart\Factory $chart_factory, C\Input\Factory $input_factory, C\Table\Factory $table_factory, C\MessageBox\Factory $messagebox_factory, C\Card\Factory $card_factory, C\Layout\Factory $layout_factory, C\MainControls\Factory $maincontrols_factory, C\Tree\Factory $tree_factory, C\Menu\Factory $menu_factory, C\Symbol\Factory $symbol_factory, C\Legacy\Factory $legacy_factory)
Definition: Factory.php:135
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.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/).
Definition: Factory.php:230
breadcrumbs(array $crumbs)
description: purpose: > Breadcrumbs is a supplemental navigation scheme.It eases the user&#39;s navigati...
Definition: Factory.php:319
item()
description: purpose: > An item displays a unique entity within the system.It shows information abou...
Definition: Factory.php:302
modal()
description: purpose: The Modal forces users to focus on the task at hand.composition: > A Modal is ...
Definition: Factory.php:254
button()
description: purpose: > Buttons trigger interactions that change the system’s or view&#39;s status...
Definition: Factory.php:198
panel()
description: purpose: > Panels are used to group titled content.composition: > Panels consist of a h...
Definition: Factory.php:246
messageBox()
description: purpose: > Message Boxes inform the user about the state of the system or an ongoing us...
Definition: Factory.php:351