Go to the source code of this file.
◆ expandable()
Definition at line 2 of file expandable.php.
References $data, $DIC, Vendor\Package\$f, $factory, and ILIAS\UI\Component\Clickable\withOnClick().
Referenced by ilStyleTableGUI\__construct().
5 $f = $DIC->ui()->factory();
6 $renderer = $DIC->ui()->renderer();
9 [
'label' =>
'root',
'children' => [
10 [
'label' =>
'1',
'children' => [
11 [
'label' =>
'1.1',
'children' => [
12 [
'label' =>
'1.1.1',
'children' => []],
13 [
'label' =>
'1.1.2',
'children' => []]
15 [
'label' =>
'1.2',
'children' => []],
16 [
'label' =>
'1.3',
'children' => []]
18 [
'label' =>
'2',
'children' => [
19 [
'label' =>
'2.1',
'children' => []],
21 [
'label' =>
'3',
'children' => [
22 [
'label' =>
'3.1',
'children' => [
23 [
'label' =>
'3.1.1',
'children' => [
24 [
'label' =>
'3.1.1.1',
'children' => []],
33 public function getChildren($record, $environment = null) : array
35 return $record[
'children'];
38 public function build(
43 $label = $record[
'label'];
44 $node = $factory->simple($label);
46 if (count($record[
'children']) === 0) {
47 $node = $node->withOnClick($environment[
'modal']->getShowSignal());
50 if ($label ===
"root" || $label ===
"2") {
51 $node = $node->withExpanded(
true);
54 $node = $node->withHighlighted(
true);
61 $image =
$f->image()->responsive(
"src/UI/examples/Image/mountains.jpg",
"Image source: https://stocksnap.io, Creative Commons CC0 license");
62 $page =
$f->modal()->lightboxImagePage($image,
'Mountains');
63 $modal =
$f->modal()->lightbox($page);
68 $tree =
$f->tree()->expandable(
"Label", $recursion)
69 ->withEnvironment($environment)
71 ->withHighlightOnNodeClick(
true);
73 return $renderer->render([
Class ChatMainBarProvider .