ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\UI\Implementation\Component Namespace Reference

Namespaces

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

Data Structures

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

Functions

 withContentLanguage (LanguageTag $content_language)
 
 getContentLanguage ()
 
 withHelpTopics (Topic ... $topics)
 
 withAdditionalHelpTopics (Topic ... $topics)
 
 getHelpTopics ()
 
 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 HasContentLanguage
 
trait HasHelpTopics
 
trait JavaScriptBindable
 Trait for components implementing JavaScriptBindable providing standard implementation. More...
 
trait Triggerer
 

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:

◆ getContentLanguage()

ILIAS\UI\Implementation\Component\getContentLanguage ( )

Definition at line 36 of file HasContentLanguage.php.

37 {
38 return $this->content_language;
39 }
This class represents a valid language tag that should be used instead of plain strings.
Definition: LanguageTag.php:40

◆ getHelpTopics()

ILIAS\UI\Implementation\Component\getHelpTopics ( )
See also
ILIAS\UI\Component\HasHelpTopicgetHelpTopics

Definition at line 55 of file HasHelpTopics.php.

55 : array
56 {
57 return $this->help_topics;
58 }

◆ 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 ILIAS\Repository\Form\FormAdapterGUI\initJavascript(), ILIAS\Repository\Form\FormAdapterGUI\render(), 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:

◆ withAdditionalHelpTopics()

ILIAS\UI\Implementation\Component\withAdditionalHelpTopics ( Topic ...  $topics)
See also
ILIAS\UI\Component\HasHelpTopicwithAdditionalHelpTopics

Definition at line 44 of file HasHelpTopics.php.

44 : static
45 {
46 $clone = clone $this;
47 $clone->help_topics = array_unique(array_merge($this->help_topics, $topics), SORT_REGULAR);
48 sort($clone->help_topics);
49 return $clone;
50 }

References ILIAS\GlobalScreen\Scope\$topics, and ILIAS\UI\examples\Symbol\Glyph\Sort\sort().

+ Here is the call 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 ILIAS\ILIASObject\Properties\MultiPropertiesManipulator\getAvailabilityPeriodButton(), and JavaScriptBindableTest\testWithAdditionalOnLoadCode().

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

◆ withContentLanguage()

ILIAS\UI\Implementation\Component\withContentLanguage ( LanguageTag  $content_language)

Definition at line 29 of file HasContentLanguage.php.

29 : self
30 {
31 $clone = clone $this;
32 $clone->content_language = $content_language;
33 return $clone;
34 }

◆ withHelpTopics()

ILIAS\UI\Implementation\Component\withHelpTopics ( Topic ...  $topics)
See also
ILIAS\UI\Component\HasHelpTopicwithHelpTopics

Definition at line 33 of file HasHelpTopics.php.

33 : static
34 {
35 $clone = clone $this;
36 $clone->help_topics = array_unique($topics, SORT_REGULAR);
37 sort($clone->help_topics);
38 return $clone;
39 }

References ILIAS\GlobalScreen\Scope\$topics, and ILIAS\UI\examples\Symbol\Glyph\Sort\sort().

+ Here is the call 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

◆ HasContentLanguage

trait ILIAS::UI::Implementation::Component\HasContentLanguage
Initial value:
{
protected ?LanguageTag $content_language = null

Definition at line 25 of file HasContentLanguage.php.

◆ HasHelpTopics

trait ILIAS::UI::Implementation::Component\HasHelpTopics
Initial value:
{
protected array $help_topics = []

Definition at line 25 of file HasHelpTopics.php.

Referenced by HasHelpTopicsTest\setUp().

◆ 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/trunk/components/ILIAS/UI/src/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.