3if (
$_GET[
'async_ref']) {
4 $ref = (int)
$_GET[
'async_ref'];
12 $ilTree =
$DIC[
'tree'];
18 $ilTree->getNodeData(1)
22 $data = $ilTree->getChilds($ref);
23 if (count(
$data) === 0) {
28 $recursion =
new class implements \
ILIAS\
UI\Component\Tree\TreeRecursion {
29 public function getChildren($record, $environment =
null) : array
34 public function build(
39 $ref_id = $record[
'ref_id'];
40 $label = $record[
'title']
41 .
' (' . $record[
'type'] .
', ' . $ref_id .
')';
43 $icon = $environment[
'icon_factory']->standard($record[
"type"],
'');
44 $url = $this->getAsyncURL($environment, $ref_id);
46 $node =
$factory->simple($label, $icon)
50 if ((
int) $ref_id > 9 && (
int) $ref_id < 20) {
51 $label = $environment[
'modal']->getShowSignal()->getId();
54 ->withOnClick($environment[
'modal']->getShowSignal());
60 protected function getAsyncURL($environment,
string $ref_id) :
string
62 $url = $environment[
'url'];
65 parse_str(
$query, $params);
66 $params[
'async_ref'] = $ref_id;
72 $f =
$DIC->ui()->factory();
73 $renderer =
$DIC->ui()->renderer();
74 $image =
$f->image()->responsive(
"src/UI/examples/Image/mountains.jpg",
"Image source: https://stocksnap.io, Creative Commons CC0 license");
75 $page =
$f->modal()->lightboxImagePage($image,
'Mountains');
76 $modal =
$f->modal()->lightbox($page);
79 'url' =>
$DIC->http()->request()->getRequestTarget(),
81 'icon_factory' =>
$f->symbol()->icon()
84 $tree =
$f->tree()->expandable(
"Label", $recursion)
85 ->withEnvironment($environment)
89 return $renderer->render([$modal, $tree]);
91 echo $renderer->renderAsync([$modal, $tree]);
An exception for terminatinating execution or to throw for unit testing.
if( $_GET[ 'async_ref']) expandable_async_repo($ref=null)
This describes a Tree Node.
Class ChatMainBarProvider \MainMenu\Provider.