ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
MetaBar.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29use ILIAS\UI\Implementation\Component\ComponentHelper;
32
37{
38 use ComponentHelper;
40
44
48 protected array $entries = [];
49
50 public function __construct(SignalGeneratorInterface $signal_generator)
51 {
52 $this->signal_generator = $signal_generator;
53 $this->initSignals();
54 }
55
59 public function getEntries(): array
60 {
61 return $this->entries;
62 }
63
67 public function withAdditionalEntry(string $id, $entry): MainControls\MetaBar
68 {
69 $classes = [Button\Bulky::class, Link\Bulky::class, Slate::class];
70 $check = [$entry];
71 $this->checkArgListElements("Bulky Button, Bulky Link or Slate", $check, $classes);
72
73 $clone = clone $this;
74 $clone->entries[$id] = $entry;
75 return $clone;
76 }
77
81 public function getEntryClickSignal(): Signal
82 {
83 return $this->entry_click_signal;
84 }
85
89 public function getDisengageAllSignal(): Signal
90 {
91 return $this->disengage_all_signal;
92 }
93
97 protected function initSignals(): void
98 {
99 $this->entry_click_signal = $this->signal_generator->create();
100 $this->disengage_all_signal = $this->signal_generator->create();
101 }
102
103 public function withClearedEntries(): MainControls\MetaBar
104 {
105 $clone = clone $this;
106 $clone->entries = [];
107 return $clone;
108 }
109}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$check
Definition: buildRTE.php:81
__construct(SignalGeneratorInterface $signal_generator)
Definition: MetaBar.php:50
initSignals()
Set the signals for this component.
Definition: MetaBar.php:97
This describes the MetaBar.
Definition: MetaBar.php:33
Prompts are notifications from the system to the user.
Definition: Prompt.php:27
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Bulky.php:21
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.