ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Combined.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25use ILIAS\UI\Component\Button\Bulky as IBulkyButton;
26use ILIAS\UI\Component\Link\Bulky as IBulkyLink;
28
32class Combined extends Slate implements ISlate\Combined
33{
34 public const ENTRY_ACTION_TRIGGER = 'trigger';
35
39 protected array $contents = [];
40
44 public function withAdditionalEntry($entry): ISlate\Combined
45 {
46 $classes = [
47 IBulkyButton::class,
48 IBulkyLink::class,
49 ISlate\Slate::class,
50 Horizontal::class
51 ];
52 $check = [$entry];
53 $this->checkArgListElements("Slate, Bulky -Button or -Link", $check, $classes);
54
55 $clone = clone $this;
56 $clone->contents[] = $entry;
57 return $clone;
58 }
59
63 public function getContents(): array
64 {
65 return $this->contents;
66 }
67
68 public function getTriggerSignal(string $entry_id): Signal
69 {
70 $signal = $this->signal_generator->create();
71 $signal->addOption('entry_id', $entry_id);
72 $signal->addOption('action', self::ENTRY_ACTION_TRIGGER);
73 return $signal;
74 }
75
76 public function withMappedSubNodes(callable $f): ISlate\Combined
77 {
78 $clone = clone $this;
79 $new_contents = [];
80 foreach ($clone->getContents() as $k => $v) {
81 $new_contents[$k] = $f($k, $v);
82 }
83 $clone->contents = $new_contents;
84 return $clone;
85 }
86}
$check
Definition: buildRTE.php:81
This describes a bulky button.
Definition: Bulky.php:29
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Combined.php:21