ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ILIAS\UI\Implementation\Component Namespace Reference

Namespaces

namespace  Breadcrumbs
 
namespace  Button
 
namespace  Card
 
namespace  Chart
 
namespace  Counter
 
namespace  Deck
 
namespace  Divider
 
namespace  Dropdown
 
namespace  Dropzone
 
namespace  Image
 
namespace  Input
 
namespace  Item
 
namespace  Layout
 
namespace  Legacy
 
 
namespace  Listing
 
namespace  MainControls
 
namespace  Menu
 
namespace  MessageBox
 
namespace  Modal
 
namespace  Panel
 
namespace  Popover
 
namespace  Symbol
 
namespace  Table
 
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

 getCanonicalName ()
 Default implementation uses the namespace of the component up to and excluding "Component", reverses the order and adds spaces. More...
 
 getCanonicalNameByFullyQualifiedName ()
 Does the calculation required for getCanonicalName. More...
 
 checkArg ($which, $check, $message)
 /** Throw an InvalidArgumentException containing the message if $check is false. More...
 
 checkIntArg ($which, $value)
 Throw an InvalidArgumentException if $value is no int. More...
 
 checkStringArg ($which, $value)
 Throw an InvalidArgumentException if $value is no string. More...
 
 checkStringOrSignalArg ($which, $value)
 Throw an InvalidArgumentException if $value is no string or Signal. More...
 
 checkFloatArg ($which, $value)
 Throw an InvalidArgumentException if $value is not a float. More...
 
 checkBoolArg ($which, $value)
 Throw an InvalidArgumentException if $value is not a bool. More...
 
 checkArgInstanceOf ($which, $value, $class)
 Throw an InvalidArgumentException if $value is not an instance of $class. More...
 
 checkArgIsElement ($which, $value, $array, $name)
 Throw an InvalidArgumentException if $value is not an element of array. More...
 
 checkArgList ($which, array &$values, \Closure $check, \Closure $message)
 Check every key and value of the list with a supplied closure. More...
 
 checkArgListElements ($which, array &$values, $classes)
 Check every element of the list if it is an instance of one of the given classes. More...
 
 toArray ($value)
 Wrap the given value in an array if it is no array. More...
 
 wrongTypeMessage ($expected, $value)
 
 withOnLoadCode (\Closure $binder)
 
 withAdditionalOnLoadCode (\Closure $binder)
 
 getOnLoadCode ()
 
 checkBinder (\Closure $binder)
 
 appendTriggeredSignal (Component\Signal $signal, $event)
 Append a triggered signal to other signals of the same event. More...
 
 withTriggeredSignal (Component\Signal $signal, $event)
 Add a triggered signal, replacing any other signals registered on the same event. More...
 
 setTriggeredSignal (Component\Signal $signal, $event)
 Add a triggered signal, replacing any othe signals registered on the same event. More...
 
 getTriggeredSignals ()
 
 getTriggeredSignalsFor ($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 ComponentHelper
 Provides common functionality for component implementations. More...
 
trait JavaScriptBindable
 Trait for components implementing JavaScriptBindable providing standard implementation. More...
 
trait Triggerer
 

Function Documentation

◆ appendTriggeredSignal()

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

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

Parameters
Component\Signal$signal
string$event
Returns
$this

Definition at line 31 of file Triggerer.php.

32 {
33 $clone = clone $this;
34 if (!isset($clone->triggered_signals[$event])) {
35 $clone->triggered_signals[$event] = array();
36 }
37 $clone->triggered_signals[$event][] = new TriggeredSignal($signal, $event);
38 return $clone;
39 }

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\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\MainControls\Slate\Slate\appendOnFirstView(), 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\Input\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:

◆ checkArg()

ILIAS\UI\Implementation\Component\checkArg (   $which,
  $check,
  $message 
)
protected

◆ checkArgInstanceOf()

ILIAS\UI\Implementation\Component\checkArgInstanceOf (   $which,
  $value,
  $class 
)
protected

Throw an InvalidArgumentException if $value is not an instance of $class.

Parameters
string$which
mixed$value
string$class
Exceptions

InvalidArgumentException if $check = false

Returns
null

Definition at line 149 of file ComponentHelper.php.

150 {
151 $this->checkArg($which, $value instanceof $class, $this->wrongTypeMessage($class, $value));
152 }
checkArg($which, $check, $message)
/** Throw an InvalidArgumentException containing the message if $check is false.

References ILIAS\UI\Implementation\Component\checkArg(), and ILIAS\UI\Implementation\Component\wrongTypeMessage().

Referenced by ILIAS\UI\Implementation\Component\ViewControl\Section\__construct(), ILIAS\UI\Implementation\Component\Modal\LightboxImagePage\__construct(), ComponentMock\_checkArgInstanceOf(), ILIAS\UI\Implementation\Component\Breadcrumbs\Breadcrumbs\withAppendedItem(), ILIAS\UI\Implementation\Component\Button\Tag\withBackgroundColor(), ILIAS\UI\Implementation\Component\Dropzone\File\File\withFileSizeLimit(), and ILIAS\UI\Implementation\Component\Button\Tag\withForegroundColor().

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

◆ checkArgIsElement()

ILIAS\UI\Implementation\Component\checkArgIsElement (   $which,
  $value,
  $array,
  $name 
)
protected

Throw an InvalidArgumentException if $value is not an element of array.

Parameters
string$which
mixed$value
array$array
string$nameused in the exception
Exceptions

InvalidArgumentException if $check = false

Returns
null

Definition at line 164 of file ComponentHelper.php.

165 {
166 if (!is_object($value)) {
167 $message = "expected $name, got '$value'";
168 } else {
169 $message = "expected $name, got object.";
170 }
171 $message =
172 $this->checkArg($which, in_array($value, $array), $message);
173 }

References $message, and ILIAS\UI\Implementation\Component\checkArg().

Referenced by ILIAS\UI\Implementation\Component\Deck\Deck\__construct(), ILIAS\UI\Implementation\Component\Symbol\Icon\Custom\__construct(), ILIAS\UI\Implementation\Component\Symbol\Icon\Standard\__construct(), ILIAS\UI\Implementation\Component\Symbol\Glyph\Glyph\__construct(), ILIAS\UI\Implementation\Component\MessageBox\MessageBox\__construct(), ILIAS\UI\Implementation\Component\Counter\Counter\__construct(), ILIAS\UI\Implementation\Component\Image\Image\__construct(), ComponentMock\_checkArgIsElement(), ILIAS\UI\Implementation\Component\Button\Bulky\withAriaRole(), ILIAS\UI\Implementation\Component\MainControls\Slate\Slate\withAriaRole(), ILIAS\UI\Implementation\Component\Listing\Workflow\Step\withAvailability(), ILIAS\UI\Implementation\Component\Deck\Deck\withCardsSize(), ILIAS\UI\Implementation\Component\Button\Tag\withRelevance(), ILIAS\UI\Implementation\Component\Symbol\Icon\Icon\withSize(), and ILIAS\UI\Implementation\Component\Listing\Workflow\Step\withStatus().

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

◆ checkArgList()

ILIAS\UI\Implementation\Component\checkArgList (   $which,
array &  $values,
\Closure  $check,
\Closure  $message 
)
protected

Check every key and value of the list with a supplied closure.

Parameters
string$which
mixed[]&$values
\Closure$checktakes key and value, should return false if those don't fit
\Closure$messagecreate an error message from key and value
Exceptions

InvalidArgumentException if any element is not an instance of $classes

Returns
null

Definition at line 185 of file ComponentHelper.php.

186 {
187 $failed_k = null;
188 $failed_v = null;
189 foreach ($values as $key => $value) {
190 $ok = $check($key, $value);
191 if (!$ok) {
192 $failed_k = $key;
193 $failed_v = $value;
194 break;
195 }
196 }
197
198 if ($failed_k !== null) {
199 $m = $message($failed_k, $failed_v);
200 } else {
201 $m = "";
202 }
203
204 $this->checkArg($which, $failed_k === null, $m);
205 }

References $message, $ok, and ILIAS\UI\Implementation\Component\checkArg().

Referenced by ILIAS\UI\Implementation\Component\Listing\Descriptive\__construct(), ComponentMock\_checkArgList(), ILIAS\UI\Implementation\Component\checkArgListElements(), ILIAS\UI\Implementation\Component\Listing\CharacteristicValue\Text\validateItems(), and ILIAS\UI\Implementation\Component\Listing\Descriptive\withItems().

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

◆ checkArgListElements()

ILIAS\UI\Implementation\Component\checkArgListElements (   $which,
array &  $values,
  $classes 
)
protected

Check every element of the list if it is an instance of one of the given classes.

Throw an InvalidArgumentException if that is not the case.

Parameters
string$which
mixed[]&$values
string | string[]$classesname(s) of classes
Exceptions

InvalidArgumentException if any element is not an instance of $classes

Returns
null

Definition at line 217 of file ComponentHelper.php.

218 {
219 $classes = $this->toArray($classes);
220 $this->checkArgList($which, $values, function ($_, $value) use (&$classes) {
221 foreach ($classes as $cls) {
222 if ($cls === "string" && is_string($value)) {
223 return true;
224 }
225 if ($cls === "int" && is_int($value)) {
226 return true;
227 } elseif ($value instanceof $cls) {
228 return true;
229 }
230 }
231 return false;
232 }, function ($_, $failed) use (&$classes) {
233 return $this->wrongTypeMessage(implode(", ", $classes), $failed);
234 });
235 }
$failed
Definition: Utf8Test.php:85
checkArgList($which, array &$values, \Closure $check, \Closure $message)
Check every key and value of the list with a supplied closure.
toArray($value)
Wrap the given value in an array if it is no array.

References $failed, ILIAS\UI\Implementation\Component\checkArgList(), ILIAS\UI\Implementation\Component\toArray(), and ILIAS\UI\Implementation\Component\wrongTypeMessage().

Referenced by ILIAS\UI\Implementation\Component\Deck\Deck\__construct(), ILIAS\UI\Implementation\Component\Popover\Standard\__construct(), ILIAS\UI\Implementation\Component\Listing\Listing\__construct(), ILIAS\UI\Implementation\Component\Popover\Listing\__construct(), ILIAS\UI\Implementation\Component\Modal\Lightbox\__construct(), ILIAS\UI\Implementation\Component\Panel\Panel\__construct(), ILIAS\UI\Implementation\Component\Panel\Report\__construct(), ILIAS\UI\Implementation\Component\Modal\RoundTrip\__construct(), ILIAS\UI\Implementation\Component\Listing\Workflow\Workflow\__construct(), ILIAS\UI\Implementation\Component\Dropzone\File\Wrapper\__construct(), ILIAS\UI\Implementation\Component\Layout\Page\Standard\__construct(), ILIAS\UI\Implementation\Component\Breadcrumbs\Breadcrumbs\__construct(), ILIAS\UI\Implementation\Component\MainControls\Footer\__construct(), ILIAS\UI\Implementation\Component\Input\Field\Group\__construct(), ILIAS\UI\Implementation\Component\Input\Field\SwitchableGroup\__construct(), ILIAS\UI\Implementation\Component\Input\Container\Form\Form\__construct(), ILIAS\UI\Implementation\Component\Input\Container\Filter\Filter\__construct(), ComponentMock\_checkArgListElements(), ILIAS\UI\Implementation\Component\Menu\Menu\checkItemParameter(), ILIAS\UI\Implementation\Component\Menu\LabeledMenu\checkLabelParameter(), ILIAS\UI\Implementation\Component\Modal\RoundTrip\withActionButtons(), ILIAS\UI\Implementation\Component\MainControls\Slate\Combined\withAdditionalEntry(), ILIAS\UI\Implementation\Component\MainControls\MainBar\withAdditionalEntry(), ILIAS\UI\Implementation\Component\MainControls\MetaBar\withAdditionalEntry(), ILIAS\UI\Implementation\Component\Modal\Interruptive\withAffectedItems(), ILIAS\UI\Implementation\Component\Item\Notification\withAggregateNotifications(), ILIAS\UI\Implementation\Component\MessageBox\MessageBox\withButtons(), ILIAS\UI\Implementation\Component\Deck\Deck\withCards(), ILIAS\UI\Implementation\Component\Dropzone\File\Wrapper\withContent(), ILIAS\UI\Implementation\Component\Listing\Listing\withItems(), ILIAS\UI\Implementation\Component\MessageBox\MessageBox\withLinks(), and ILIAS\UI\Implementation\Component\Card\Card\withSections().

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

◆ checkBinder()

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

InvalidArgumentException if closure does not take one argument

Returns
null

Definition at line 58 of file JavaScriptBindable.php.

59 {
60 $refl = new \ReflectionFunction($binder);
61 $args = array_map(function ($arg) {
62 return $arg->name;
63 }, $refl->getParameters());
64 if (array("id") !== $args) {
65 throw new \InvalidArgumentException('Expected closure "$binder" to have exactly one argument "$id".');
66 }
67 }

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

+ Here is the caller graph for this function:

◆ checkBoolArg()

◆ checkFloatArg()

ILIAS\UI\Implementation\Component\checkFloatArg (   $which,
  $value 
)
protected

Throw an InvalidArgumentException if $value is not a float.

Parameters
string$which
mixed$value
Exceptions

InvalidArgumentException if $value is no float

Returns
null

Definition at line 122 of file ComponentHelper.php.

123 {
124 $this->checkArg($which, is_float($value), $this->wrongTypeMessage("float", $value));
125 }

References ILIAS\UI\Implementation\Component\checkArg(), and ILIAS\UI\Implementation\Component\wrongTypeMessage().

Referenced by ComponentMock\_checkFloatArg().

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

◆ checkIntArg()

◆ checkStringArg()

ILIAS\UI\Implementation\Component\checkStringArg (   $which,
  $value 
)
protected

Throw an InvalidArgumentException if $value is no string.

Parameters
string$which
mixed$value
Exceptions

InvalidArgumentException if $value is no string

Returns
null

Definition at line 92 of file ComponentHelper.php.

93 {
94 $this->checkArg($which, is_string($value), $this->wrongTypeMessage("string", $value));
95 }

References ILIAS\UI\Implementation\Component\checkArg(), and ILIAS\UI\Implementation\Component\wrongTypeMessage().

Referenced by ILIAS\UI\Implementation\Component\Link\Link\__construct(), ILIAS\UI\Implementation\Component\Legacy\Legacy\__construct(), ILIAS\UI\Implementation\Component\Symbol\Icon\Custom\__construct(), ILIAS\UI\Implementation\Component\Modal\InterruptiveItem\__construct(), ILIAS\UI\Implementation\Component\Button\Button\__construct(), ILIAS\UI\Implementation\Component\Link\Standard\__construct(), ILIAS\UI\Implementation\Component\Listing\Workflow\Step\__construct(), ILIAS\UI\Implementation\Component\ViewControl\Mode\__construct(), ILIAS\UI\Implementation\Component\Symbol\Icon\Standard\__construct(), ILIAS\UI\Implementation\Component\Item\Item\__construct(), ILIAS\UI\Implementation\Component\Panel\Panel\__construct(), ILIAS\UI\Implementation\Component\Modal\RoundTrip\__construct(), ILIAS\UI\Implementation\Component\Panel\Listing\Listing\__construct(), ILIAS\UI\Implementation\Component\Modal\Interruptive\__construct(), ILIAS\UI\Implementation\Component\Card\Card\__construct(), ILIAS\UI\Implementation\Component\Item\Group\__construct(), ILIAS\UI\Implementation\Component\Listing\Workflow\Workflow\__construct(), ILIAS\UI\Implementation\Component\Table\Presentation\__construct(), ILIAS\UI\Implementation\Component\Symbol\Glyph\Glyph\__construct(), ILIAS\UI\Implementation\Component\MessageBox\MessageBox\__construct(), ILIAS\UI\Implementation\Component\Image\Image\__construct(), ILIAS\UI\Implementation\Component\Dropzone\File\File\__construct(), ILIAS\UI\Implementation\Component\Input\Field\Input\__construct(), ILIAS\UI\Implementation\Component\Modal\LightboxImagePage\__construct(), ILIAS\UI\Implementation\Component\Input\Container\Form\Standard\__construct(), ILIAS\UI\Implementation\Component\Modal\LightboxTextPage\__construct(), ILIAS\UI\Implementation\Component\Panel\Secondary\Listing\__construct(), ILIAS\UI\Implementation\Component\Panel\Secondary\Legacy\__construct(), ComponentMock\_checkStringArg(), ILIAS\UI\Implementation\Component\Input\Field\Input\setError(), ILIAS\UI\Implementation\Component\Symbol\Icon\Icon\withAbbreviation(), ILIAS\UI\Implementation\Component\ViewControl\Mode\withActive(), ILIAS\UI\Implementation\Component\Image\Image\withAlt(), ILIAS\UI\Implementation\Component\Button\Button\withAriaLabel(), ILIAS\UI\Implementation\Component\Dropdown\Dropdown\withAriaLabel(), ILIAS\UI\Implementation\Component\Popover\Popover\withAsyncContentUrl(), ILIAS\UI\Implementation\Component\Modal\Modal\withAsyncRenderUrl(), ILIAS\UI\Implementation\Component\ReplaceContentSignal\withAsyncRenderUrl(), ILIAS\UI\Implementation\Component\ReplaceSignal\withAsyncRenderUrl(), ILIAS\UI\Implementation\Component\Input\Field\Input\withByline(), ILIAS\UI\Implementation\Component\Button\Tag\withClasses(), ILIAS\UI\Implementation\Component\Item\Item\withDescription(), ILIAS\UI\Implementation\Component\Modal\Interruptive\withFormAction(), ILIAS\UI\Implementation\Component\Table\PresentationRow\withFurtherFieldsHeadline(), ILIAS\UI\Implementation\Component\Table\PresentationRow\withHeadline(), ILIAS\UI\Implementation\Component\Button\Button\withLabel(), ILIAS\UI\Implementation\Component\Divider\Horizontal\withLabel(), ILIAS\UI\Implementation\Component\Dropdown\Dropdown\withLabel(), ILIAS\UI\Implementation\Component\Input\Field\Input\withLabel(), ILIAS\UI\Implementation\Component\ViewControl\Sortation\withLabel(), ILIAS\UI\Implementation\Component\Item\Standard\withLeadText(), ILIAS\UI\Implementation\Component\Chart\ProgressMeter\Standard\withMainText(), ILIAS\UI\Implementation\Component\Dropzone\File\Standard\withMessage(), ILIAS\UI\Implementation\Component\Dropzone\File\File\withParameterName(), ILIAS\UI\Implementation\Component\Button\Tag\withRelevance(), ILIAS\UI\Implementation\Component\Chart\ProgressMeter\Standard\withRequiredText(), ILIAS\UI\Implementation\Component\Image\Image\withSource(), ILIAS\UI\Implementation\Component\Table\PresentationRow\withSubheadline(), ILIAS\UI\Implementation\Component\ViewControl\Sortation\withTargetURL(), ILIAS\UI\Implementation\Component\ViewControl\Pagination\withTargetURL(), ILIAS\UI\Implementation\Component\Card\Card\withTitle(), ILIAS\UI\Implementation\Component\Dropzone\File\Wrapper\withTitle(), ILIAS\UI\Implementation\Component\Popover\Popover\withTitle(), ILIAS\UI\Implementation\Component\Table\Presentation\withTitle(), and ILIAS\UI\Implementation\Component\Dropzone\File\File\withUploadUrl().

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

◆ checkStringOrSignalArg()

ILIAS\UI\Implementation\Component\checkStringOrSignalArg (   $which,
  $value 
)
protected

Throw an InvalidArgumentException if $value is no string or Signal.

Parameters
string$which
mixed$value
Exceptions

InvalidArgumentException if $value is no string or Signal

Returns
null

Definition at line 105 of file ComponentHelper.php.

106 {
107 $this->checkArg(
108 $which,
109 is_string($value) || $value instanceof Signal,
110 $this->wrongTypeMessage("string or Signal", gettype($value))
111 );
112 }

References ILIAS\UI\Implementation\Component\checkArg(), and ILIAS\UI\Implementation\Component\wrongTypeMessage().

Referenced by ILIAS\UI\Implementation\Component\Button\Button\__construct(), ILIAS\UI\Implementation\Component\Button\Toggle\__construct(), ILIAS\UI\Implementation\Component\Image\Image\withAction(), and ILIAS\UI\Implementation\Component\Card\Card\withTitleAction().

+ Here is the call graph for this function:
+ 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.

Parameters
array$array
Returns
array

Definition at line 114 of file Triggerer.php.

115 {
116 $flatten = array();
117 array_walk_recursive($array, function ($a) use (&$flatten) {
118 $flatten[] = $a;
119 });
120 return $flatten;
121 }
$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:

◆ getCanonicalName()

ILIAS\UI\Implementation\Component\getCanonicalName ( )

Default implementation uses the namespace of the component up to and excluding "Component", reverses the order and adds spaces.

Also does caching.

Returns
string

Definition at line 25 of file ComponentHelper.php.

26 {
27 if ($this->canonical_name === null) {
28 $this->canonical_name = $this->getCanonicalNameByFullyQualifiedName();
29 }
30 return $this->canonical_name;
31 }
getCanonicalNameByFullyQualifiedName()
Does the calculation required for getCanonicalName.

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

+ Here is the call graph for this function:

◆ getCanonicalNameByFullyQualifiedName()

ILIAS\UI\Implementation\Component\getCanonicalNameByFullyQualifiedName ( )
protected

Does the calculation required for getCanonicalName.

Returns
string

Definition at line 38 of file ComponentHelper.php.

39 {
40 $cls = explode("\\", get_class($this));
41 $name = [];
42 $cur = array_pop($cls);
43 while ($cur !== "Component" && count($cls) > 0) {
44 $name[] = preg_replace("%([a-z])([A-Z])%", "$1 $2", $cur);
45 $cur = array_pop($cls);
46 }
47 return implode(" ", $name);
48 }
if($format !==null) $name
Definition: metadata.php:230

References $name.

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

+ Here is the caller graph for this function:

◆ getOnLoadCode()

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

Definition at line 48 of file JavaScriptBindable.php.

49 {
50 return $this->on_load_code_binder;
51 }

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

+ Here is the caller graph for this function:

◆ getTriggeredSignals()

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

Definition at line 74 of file Triggerer.php.

75 {
76 return $this->flattenArray($this->triggered_signals);
77 }
flattenArray(array $array)
Flatten a multidimensional array to a single dimension.
Definition: Triggerer.php:114

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

+ Here is the call graph for this function:

◆ getTriggeredSignalsFor()

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

Get signals that are triggered for a certain event.

Parameters
string
Returns
\ILIAS\UI\Component\Signal[]

Definition at line 85 of file Triggerer.php.

86 {
87 if (!isset($this->triggered_signals[$event])) {
88 return [];
89 }
90 return array_map(
91 function ($ts) {
92 return $ts->getSignal();
93 },
94 $this->triggered_signals[$event]
95 );
96 }

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 ( Component\Signal  $signal,
  $event 
)
protected

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

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

Parameters
Component\Signal$signal
string$event
Returns
void

Definition at line 65 of file Triggerer.php.

66 {
67 $this->triggered_signals[$event] = array();
68 $this->triggered_signals[$event][] = new TriggeredSignal($signal, $event);
69 }

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:

◆ toArray()

◆ withAdditionalOnLoadCode()

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

Definition at line 32 of file JavaScriptBindable.php.

33 {
34 $current_binder = $this->getOnLoadCode();
35 if ($current_binder === null) {
36 return $this->withOnLoadCode($binder);
37 }
38
39 $this->checkBinder($binder);
40 return $this->withOnLoadCode(function ($id) use ($current_binder, $binder) {
41 return $current_binder($id) . "\n" . $binder($id);
42 });
43 }

References 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 21 of file JavaScriptBindable.php.

22 {
23 $this->checkBinder($binder);
24 $clone = clone $this;
25 $clone->on_load_code_binder = $binder;
26 return $clone;
27 }

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 ( )
Returns
$this

Definition at line 101 of file Triggerer.php.

102 {
103 $clone = clone $this;
104 $clone->triggered_signals = array();
105 return $clone;
106 }

◆ withTriggeredSignal()

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

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

Parameters
Component\Signal$signal
string$event
Returns
$this

Definition at line 48 of file Triggerer.php.

49 {
50 $clone = clone $this;
51 $clone->setTriggeredSignal($signal, $event);
52 return $clone;
53 }

Referenced by Triggerermock\_withTriggeredSignal(), 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\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\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\Input\withOnUpdate().

+ Here is the caller graph for this function:

◆ wrongTypeMessage()

ILIAS\UI\Implementation\Component\wrongTypeMessage (   $expected,
  $value 
)
protected

Definition at line 251 of file ComponentHelper.php.

252 {
253 $type = gettype($value);
254 if (!is_object($value) && !is_array($value)) {
255 return "expected $expected, got $type '$value'";
256 } else {
257 if (is_object($value)) {
258 $type = get_class($value);
259 }
260 return "expected $expected, got $type";
261 }
262 }
$type

References $type.

Referenced by ILIAS\UI\Implementation\Component\Listing\Workflow\Step\__construct(), ILIAS\UI\Implementation\Component\checkArgInstanceOf(), ILIAS\UI\Implementation\Component\checkArgListElements(), ILIAS\UI\Implementation\Component\checkBoolArg(), ILIAS\UI\Implementation\Component\checkFloatArg(), ILIAS\UI\Implementation\Component\checkIntArg(), ILIAS\UI\Implementation\Component\checkStringArg(), ILIAS\UI\Implementation\Component\checkStringOrSignalArg(), and ILIAS\UI\Implementation\Component\Table\PresentationRow\withAction().

+ Here is the caller graph for this function:

Variable Documentation

◆ ComponentHelper

trait ILIAS::UI::Implementation::Component\ComponentHelper
Initial value:
{
private $canonical_name = null

Provides common functionality for component implementations.

Definition at line 12 of file ComponentHelper.php.

◆ JavaScriptBindable

Initial value:
{
private $on_load_code_binder = null

Trait for components implementing JavaScriptBindable providing standard implementation.

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

Definition at line 11 of file JavaScriptBindable.php.

◆ Triggerer

Initial value:
{
private $triggered_signals = array()

Definition at line 16 of file Triggerer.php.