ILIAS  trunk Revision v5.2.0beta1-34132-g2d4d73d4a0
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

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

 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
 

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.

Referenced by Triggerermock\_appendTriggeredSignal(), ILIAS\UI\Implementation\Component\Input\Field\Checkbox\appendOnChange(), ILIAS\UI\Implementation\Component\Button\Minimize\appendOnClick(), ILIAS\UI\Implementation\Component\Button\Close\appendOnClick(), ILIAS\UI\Implementation\Component\Input\Container\Filter\ProxyFilterField\appendOnClick(), ILIAS\UI\Implementation\Component\Dropdown\Dropdown\appendOnClick(), ILIAS\UI\Implementation\Component\Button\Button\appendOnClick(), ILIAS\UI\Implementation\Component\Tree\Node\Node\appendOnClick(), ILIAS\UI\Implementation\Component\Image\Image\appendOnClick(), ILIAS\UI\Implementation\Component\Symbol\Glyph\Glyph\appendOnClick(), ILIAS\UI\Implementation\Component\Card\Card\appendOnClick(), ILIAS\UI\Implementation\Component\Dropdown\Dropdown\appendOnHover(), ILIAS\UI\Implementation\Component\Button\Button\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().

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

◆ checkBinder()

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

Definition at line 71 of file JavaScriptBindable.php.

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

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  }
+ 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.

References Vendor\Package\$a.

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

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

◆ getContentLanguage()

ILIAS\UI\Implementation\Component\getContentLanguage ( )

Definition at line 36 of file HasContentLanguage.php.

36  : ?LanguageTag
37  {
38  return $this->content_language;
39  }

◆ getHelpTopics()

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

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
getOnLoadCode

Definition at line 63 of file JavaScriptBindable.php.

Referenced by ILIAS\UI\Implementation\Component\Input\Container\Form\FormAdapterGUI\initJavascript(), and ILIAS\UI\Implementation\Component\withAdditionalOnLoadCode().

63  : ?Closure
64  {
65  return $this->on_load_code_binder;
66  }
+ Here is the caller graph for this function:

◆ getTriggeredSignals()

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

Definition at line 84 of file Triggerer.php.

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

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
+ 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[]

Definition at line 94 of file Triggerer.php.

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().

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  }
+ 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.

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

75  : void
76  {
77  $this->triggered_signals[$event] = array();
78  $this->triggered_signals[$event][] = new TriggeredSignal($signal, $event);
79  }
+ Here is the caller graph for this function:

◆ withAdditionalHelpTopics()

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

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  }

◆ withAdditionalOnLoadCode()

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

Definition at line 49 of file JavaScriptBindable.php.

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

Referenced by ilPersonalProfileGUI\addEmailChangeModal(), ilMyStaffGUI\addLinkWithActionData(), ilMarkSchemaGUI\buildCreateStepButton(), ilDclRecordListTableGUI\buildData(), ilTestQuestionNavigationGUI\getActionsHTML(), ILIAS\OnScreenChat\Provider\OnScreenChatProvider\getAsyncItem(), ILIAS\Object\Properties\MultiObjectPropertiesManipulator\getAvailabilityPeriodButton(), ILIAS\Notes\Export\ExportHelperGUI\getCommentIncludeModalDialog(), ilQuestionBrowserTableGUI\getCommentsHtml(), ILIAS\Search\Provider\SearchMetaBarProvider\getMetaBarItems(), ilDclBaseRecordModel\getStandardFieldHTML(), ilNoteGUI\getTriggerShyButton(), ilObjDashboardSettingsGUI\getViewSectionSorting(), ilObjTestSettingsMainGUI\populateConfirmationModal(), ilTestPlayerAbstractGUI\populateDiscardSolutionModal(), assClozeTestGUI\populateQuestionSpecificFormPart(), ILIAS\BookingManager\BookingProcess\ObjectSelectionListGUI\render(), ilTermDefinitionBulkCreationGUI\renderConfirmation(), ilBookBulkCreationGUI\renderConfirmation(), and ILIAS\UI\Implementation\Component\Input\Container\Filter\Renderer\renderExpandAndCollapse().

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
+ 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
ILIASwithHelpTopics

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  }

◆ withOnLoadCode()

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

Definition at line 38 of file JavaScriptBindable.php.

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

Referenced by ilObjForumGUI\addActivationFormModal(), ilTestResultsToolbarGUI\build(), ilTestPlayerAbstractGUI\buildNextButtonInstance(), ilTestPlayerAbstractGUI\buildPreviousButtonInstance(), ilChatroomViewGUI\chatFunctions(), ilGroupAddToGroupActionGUI\confirmAddUser(), ilGroupAddToGroupActionGUI\confirmCreateGroupAndAddUser(), ilMailFolderGUI\confirmDeleteMails(), ilTable2GUI\fillFooter(), ILIAS\UI\Component\Modal\ModalAdapterGUI\form(), ilObjStudyProgrammeAutoCategoriesGUI\getAsyncModalOutput(), ILIAS\UI\Implementation\Component\Table\Presentation\VideoViewGUI\getDropdown(), ilExerciseManagementGUI\getEvaluationModal(), ilPersonalSkillsGUI\getLatestEntriesForSkillHTML(), ilObjLinkResourceGUI\getLinkToListModal(), ilPersonalSkillsGUI\getNonLatestEntriesForSkillHTML(), ILIAS\COPage\Editor\Server\UIWrapper\getRenderedModalFailureBox(), ilObjStudyProgrammeTreeGUI\getToolbar(), ilInternalLinkGUI\getUserSearchResult(), ilCalendarBlockGUI\getViewControl(), ilObjForumGUI\initHeaderAction(), ilExerciseSubmissionTableGUI\parseColumns(), ilForumNotificationTableGUI\populateWithModal(), ilNewsTimelineItemGUI\render(), ILIAS\UI\Implementation\Component\Input\Container\Filter\Renderer\renderApplyAndReset(), ilTaggingSlateContentGUI\renderResourcesForTag(), ILIAS\UI\Implementation\Component\Table\Presentation\VideoViewGUI\renderSideColumn(), ilObjForumGUI\renderSplitButton(), ilExerciseManagementGUI\saveGradesObject(), ilHelpGUI\search(), ilGroupAddToGroupActionGUI\sendResponse(), ilGroupAddToGroupActionGUI\show(), ilMailFormGUI\showForm(), ilHelpGUI\showPage(), ilObjectCopyGUI\showTargetSelectionTree(), and ILIAS\UI\Implementation\Component\withAdditionalOnLoadCode().

39  {
40  $this->checkBinder($binder);
41  $clone = clone $this;
42  $clone->on_load_code_binder = $binder;
43  return $clone;
44  }
+ 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.

105  : C\Triggerer
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.

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

63  {
64  $clone = clone $this;
65  $clone->setTriggeredSignal($signal, $event);
66  return $clone;
67  }
+ 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 26 of file HasContentLanguage.php.

◆ HasHelpTopics

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

Definition at line 26 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.

Definition at line 32 of file JavaScriptBindable.php.

◆ Triggerer

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

Definition at line 36 of file Triggerer.php.