ILIAS  release_8 Revision v8.24
ILIAS\UI\Implementation\Component Namespace Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

Namespaces

namespace  Breadcrumbs
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Button
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Card
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Chart
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Counter
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Deck
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Divider
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Dropdown
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Dropzone
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Image
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Input
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Item
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Layout
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Legacy
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
 
namespace  Listing
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  MainControls
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Menu
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  MessageBox
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Modal
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Panel
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Player
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Popover
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Symbol
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Table
 
namespace  Toast
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  Tree
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 
namespace  ViewControl
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
 

Data Structures

class  ReplaceContentSignal
 Class ReplaceContentSignal. More...
 
class  ReplaceSignal
 Replace Signal. More...
 
class  Signal
 
class  SignalGenerator
 
interface  SignalGeneratorInterface
 
class  TriggeredSignal
 

Functions

 withOnLoadCode (Closure $binder)
 
 withAdditionalOnLoadCode (Closure $binder)
 
 getOnLoadCode ()
 
 checkBinder (Closure $binder)
 
 appendTriggeredSignal (C\Signal $signal, string $event)
 Append a triggered signal to other signals of the same event. More...
 
 withTriggeredSignal (C\Signal $signal, string $event)
 Add a triggered signal, replacing any other signals registered on the same event. More...
 
 setTriggeredSignal (C\Signal $signal, string $event)
 Add a triggered signal, replacing any other signals registered on the same event. More...
 
 getTriggeredSignals ()
 
 getTriggeredSignalsFor (string $event)
 Get signals that are triggered for a certain event. More...
 
 withResetTriggeredSignals ()
 
 flattenArray (array $array)
 Flatten a multidimensional array to a single dimension. More...
 

Variables

trait JavaScriptBindable
 Trait for components implementing JavaScriptBindable providing standard implementation. More...
 
trait Triggerer
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Function Documentation

◆ appendTriggeredSignal()

ILIAS\UI\Implementation\Component\appendTriggeredSignal ( C\Signal  $signal,
string  $event 
)
protected

Append a triggered signal to other signals of the same event.

Returns
static

Definition at line 47 of file Triggerer.php.

48 {
49 $clone = clone $this;
50 if (!isset($clone->triggered_signals[$event])) {
51 $clone->triggered_signals[$event] = array();
52 }
53 $clone->triggered_signals[$event][] = new TriggeredSignal($signal, $event);
54 return $clone;
55 }

Referenced by Triggerermock\_appendTriggeredSignal(), ILIAS\UI\Implementation\Component\Input\Field\Checkbox\appendOnChange(), ILIAS\UI\Implementation\Component\Button\Button\appendOnClick(), ILIAS\UI\Implementation\Component\Button\Close\appendOnClick(), ILIAS\UI\Implementation\Component\Button\Minimize\appendOnClick(), ILIAS\UI\Implementation\Component\Card\Card\appendOnClick(), ILIAS\UI\Implementation\Component\Dropdown\Dropdown\appendOnClick(), ILIAS\UI\Implementation\Component\Image\Image\appendOnClick(), ILIAS\UI\Implementation\Component\Input\Container\Filter\ProxyFilterField\appendOnClick(), ILIAS\UI\Implementation\Component\Symbol\Glyph\Glyph\appendOnClick(), ILIAS\UI\Implementation\Component\Tree\Node\Node\appendOnClick(), ILIAS\UI\Implementation\Component\Button\Button\appendOnHover(), ILIAS\UI\Implementation\Component\Dropdown\Dropdown\appendOnHover(), ILIAS\UI\Implementation\Component\MainControls\Slate\Slate\appendOnInView(), ILIAS\UI\Implementation\Component\Input\Field\Checkbox\appendOnLoad(), ILIAS\UI\Implementation\Component\Modal\Modal\appendOnLoad(), ILIAS\UI\Implementation\Component\Input\Field\FormInput\appendOnUpdate(), ILIAS\UI\Implementation\Component\Dropzone\File\File\withAdditionalDrop(), ILIAS\UI\Implementation\Component\Input\Field\Tag\withAdditionalOnTagAdded(), ILIAS\UI\Implementation\Component\Input\Field\Tag\withAdditionalOnTagRemoved(), ILIAS\UI\Implementation\Component\Button\Toggle\withAdditionalToggleOffSignal(), and ILIAS\UI\Implementation\Component\Button\Toggle\withAdditionalToggleOnSignal().

+ Here is the caller graph for this function:

◆ checkBinder()

ILIAS\UI\Implementation\Component\checkBinder ( Closure  $binder)
private
Exceptions

InvalidArgumentException if closure does not take one argument

Definition at line 71 of file JavaScriptBindable.php.

71 : void
72 {
73 $refl = new ReflectionFunction($binder);
74 $args = array_map(fn ($arg) => $arg->name, $refl->getParameters());
75 if (array("id") !== $args) {
76 throw new InvalidArgumentException('Expected closure "$binder" to have exactly one argument "$id".');
77 }
78 }

Referenced by ILIAS\UI\Implementation\Component\withAdditionalOnLoadCode(), and ILIAS\UI\Implementation\Component\withOnLoadCode().

+ Here is the caller graph for this function:

◆ flattenArray()

ILIAS\UI\Implementation\Component\flattenArray ( array  $array)
private

Flatten a multidimensional array to a single dimension.

Definition at line 115 of file Triggerer.php.

115 : array
116 {
117 $flatten = array();
118 array_walk_recursive($array, function ($a) use (&$flatten) {
119 $flatten[] = $a;
120 });
121 return $flatten;
122 }
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples

References Vendor\Package\$a.

Referenced by ILIAS\UI\Implementation\Component\getTriggeredSignals().

+ Here is the caller graph for this function:

◆ getOnLoadCode()

ILIAS\UI\Implementation\Component\getOnLoadCode ( )
See also
\ILIAS\UI\Component\JavaScriptBindablegetOnLoadCode

Definition at line 63 of file JavaScriptBindable.php.

63 : ?Closure
64 {
65 return $this->on_load_code_binder;
66 }

Referenced by ilOverlayGUI\add(), and ILIAS\UI\Implementation\Component\withAdditionalOnLoadCode().

+ Here is the caller graph for this function:

◆ getTriggeredSignals()

ILIAS\UI\Implementation\Component\getTriggeredSignals ( )
Returns
TriggeredSignal[]

Definition at line 84 of file Triggerer.php.

84 : array
85 {
86 return $this->flattenArray($this->triggered_signals);
87 }
flattenArray(array $array)
Flatten a multidimensional array to a single dimension.
Definition: Triggerer.php:115

References ILIAS\UI\Implementation\Component\flattenArray().

+ Here is the call graph for this function:

◆ getTriggeredSignalsFor()

ILIAS\UI\Implementation\Component\getTriggeredSignalsFor ( string  $event)

Get signals that are triggered for a certain event.

Returns
C\Signal[]

Definition at line 94 of file Triggerer.php.

94 : array
95 {
96 if (!isset($this->triggered_signals[$event])) {
97 return [];
98 }
99 return array_map(
100 fn ($ts) => $ts->getSignal(),
101 $this->triggered_signals[$event]
102 );
103 }

Referenced by ILIAS\UI\Implementation\Component\Button\Button\getAction(), ILIAS\UI\Implementation\Component\Image\Image\getAction(), ILIAS\UI\Implementation\Component\Button\Toggle\getActionOff(), ILIAS\UI\Implementation\Component\Button\Toggle\getActionOn(), and ILIAS\UI\Implementation\Component\Card\Card\getTitleAction().

+ Here is the caller graph for this function:

◆ setTriggeredSignal()

ILIAS\UI\Implementation\Component\setTriggeredSignal ( C\Signal  $signal,
string  $event 
)
protected

Add a triggered signal, replacing any other signals registered on the same event.

ATTENTION: This mutates the original object and should only be used when there is no other possibility.

Definition at line 75 of file Triggerer.php.

75 : void
76 {
77 $this->triggered_signals[$event] = array();
78 $this->triggered_signals[$event][] = new TriggeredSignal($signal, $event);
79 }

Referenced by ILIAS\UI\Implementation\Component\Button\Button\__construct(), ILIAS\UI\Implementation\Component\Button\Toggle\__construct(), and Triggerermock\_setTriggeredSignal().

+ Here is the caller graph for this function:

◆ withAdditionalOnLoadCode()

ILIAS\UI\Implementation\Component\withAdditionalOnLoadCode ( Closure  $binder)
See also
\ILIAS\UI\Component\JavaScriptBindablewithAdditionalOnLoadCode

Definition at line 49 of file JavaScriptBindable.php.

50 {
51 $current_binder = $this->getOnLoadCode();
52 if ($current_binder === null) {
53 return $this->withOnLoadCode($binder);
54 }
55
56 $this->checkBinder($binder);
57 return $this->withOnLoadCode(fn ($id) => $current_binder($id) . "\n" . $binder($id));
58 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id, ILIAS\UI\Implementation\Component\checkBinder(), ILIAS\UI\Implementation\Component\getOnLoadCode(), and ILIAS\UI\Implementation\Component\withOnLoadCode().

Referenced by ilNoteGUI\getCommentsWidget(), and JavaScriptBindableTest\test_withAdditionalOnLoadCode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withOnLoadCode()

ILIAS\UI\Implementation\Component\withOnLoadCode ( Closure  $binder)
See also
\ILIAS\UI\Component\JavaScriptBindablewithOnLoadCode

Definition at line 38 of file JavaScriptBindable.php.

39 {
40 $this->checkBinder($binder);
41 $clone = clone $this;
42 $clone->on_load_code_binder = $binder;
43 return $clone;
44 }

References ILIAS\UI\Implementation\Component\checkBinder().

Referenced by ilHelpGUI\showPage(), and ILIAS\UI\Implementation\Component\withAdditionalOnLoadCode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withResetTriggeredSignals()

ILIAS\UI\Implementation\Component\withResetTriggeredSignals ( )

Definition at line 105 of file Triggerer.php.

106 {
107 $clone = clone $this;
108 $clone->triggered_signals = array();
109 return $clone;
110 }

◆ withTriggeredSignal()

ILIAS\UI\Implementation\Component\withTriggeredSignal ( C\Signal  $signal,
string  $event 
)
protected

Add a triggered signal, replacing any other signals registered on the same event.

Returns
static

Definition at line 62 of file Triggerer.php.

63 {
64 $clone = clone $this;
65 $clone->setTriggeredSignal($signal, $event);
66 return $clone;
67 }

Referenced by Triggerermock\_withTriggeredSignal(), ILIAS\UI\Implementation\Component\Modal\Modal\appendOnClose(), ILIAS\UI\Implementation\Component\Input\Field\Checkbox\withOnChange(), ILIAS\UI\Implementation\Component\Button\Button\withOnClick(), ILIAS\UI\Implementation\Component\Button\Close\withOnClick(), ILIAS\UI\Implementation\Component\Button\Minimize\withOnClick(), ILIAS\UI\Implementation\Component\Card\Card\withOnClick(), ILIAS\UI\Implementation\Component\Dropdown\Dropdown\withOnClick(), ILIAS\UI\Implementation\Component\Image\Image\withOnClick(), ILIAS\UI\Implementation\Component\Input\Container\Filter\ProxyFilterField\withOnClick(), ILIAS\UI\Implementation\Component\Symbol\Glyph\Glyph\withOnClick(), ILIAS\UI\Implementation\Component\Tree\Node\Node\withOnClick(), ILIAS\UI\Implementation\Component\Modal\Modal\withOnClose(), ILIAS\UI\Implementation\Component\Dropzone\File\File\withOnDrop(), ILIAS\UI\Implementation\Component\Button\Button\withOnHover(), ILIAS\UI\Implementation\Component\Dropdown\Dropdown\withOnHover(), ILIAS\UI\Implementation\Component\Input\Field\Checkbox\withOnLoad(), ILIAS\UI\Implementation\Component\Modal\Modal\withOnLoad(), ILIAS\UI\Implementation\Component\ViewControl\Pagination\withOnSelect(), ILIAS\UI\Implementation\Component\ViewControl\Sortation\withOnSort(), and ILIAS\UI\Implementation\Component\Input\Field\FormInput\withOnUpdate().

+ Here is the caller graph for this function:

Variable Documentation

◆ JavaScriptBindable

trait ILIAS::UI::Implementation::Component\JavaScriptBindable
Initial value:
{
private ?Closure $on_load_code_binder = null

Trait for components implementing JavaScriptBindable providing standard implementation.

Examples
/usr/local/src/ilias/release_8/src/UI/Component/JavaScriptBindable.php.

Definition at line 31 of file JavaScriptBindable.php.

◆ Triggerer

trait ILIAS::UI::Implementation::Component\Triggerer
Initial value:
{
private array $triggered_signals = array()

Definition at line 35 of file Triggerer.php.