19declare(strict_types=1);
26use ILIAS\UI\Component\Navigation\Sequence\SegmentBuilder;
29use Psr\Http\Message\ServerRequestInterface;
51 $r =
$DIC[
'ui.renderer'];
52 $df = new \ILIAS\Data\Factory();
54 $request =
$DIC->http()->request();
57 private array $seq_data;
60 protected UIFactory
$f,
61 protected UIRenderer $r
64 [
'c0',
'pos 1',
'<div style="width: 100%;
66 background-color: #b8d7ea;
69 justify-content: center;">
70 placeholder for the segment at position 1</div>'],
71 [
'c0',
'pos 2',
'<div style="width: 100%;
73 background-color: #f6d9a1;
76 justify-content: center;">
77 placeholder for the segment at position 2</div>'],
78 [
'c1',
'pos 3',
'the segment at position 3'],
79 [
'c2',
'pos 4',
'the segment at position 4'],
80 [
'c1',
'pos 5',
'the segment at position 5'],
84 public function getAllPositions(
85 ServerRequestInterface $request,
86 mixed $viewcontrol_values,
89 $chunks = $viewcontrol_values[
'chunks'] ?? [];
94 fn($posdata) => in_array($posdata[0], $chunks)
99 public function getSegment(
100 ServerRequestInterface $request,
101 mixed $position_data,
102 mixed $viewcontrol_values,
103 mixed $filter_values,
105 list($chunk, $title,
$data) = $position_data;
107 $segment = $this->f->legacy()->segment($title,
$data);
109 if ($chunk ===
'c0') {
110 $segment = $segment->withSegmentActions(
111 $this->f->button()->standard(
'a segment action for ' . $title,
'#')
118 $viewcontrols =
$f->input()->container()->viewControl()->standard([
119 $f->input()->viewControl()->fieldSelection(
127 ->withAdditionalTransformation(
$refinery->custom()->transformation(
128 fn($v) => [
'chunks' => $v]
131 ->withAdditionalTransformation(
132 $refinery->custom()->transformation(fn($v) => array_shift($v))
136 $f->button()->standard(
'a global action',
'#')
139 $sequence =
$f->navigation()->sequence($binding)
140 ->withViewControls($viewcontrols)
142 ->withActions($global_actions)
143 ->withRequest($request);
148 return $r->render(
$out);
Builds a Color from either hex- or rgb values.
__construct()
Constructor setup ILIAS global object @access public.
The SegmentRetrieval defines available stops for the sequence and builds it's segments.
A segment is the content resulting from operating a sequence.
An entity that renders components to a string output.