19 declare(strict_types=1);
35 $f = $DIC->ui()->factory();
40 $url = $DIC->http()->request()->getRequestTarget();
42 $actions =
$f->dropdown()->standard([
43 $f->button()->shy(
"ILIAS",
"https://www.ilias.de"),
44 $f->button()->shy(
"GitHub",
"https://www.github.com")
46 $current_presentation =
'simple';
50 $presentation_options = [
52 'detailed' =>
'Detailed' 54 $modes =
$f->viewControl()->mode(
56 array_keys($presentation_options),
57 static function ($carry, $item) use ($presentation_options,
$url) {
58 $carry[$presentation_options[$item]] =
"$url&mode=$item";
64 )->withActive($presentation_options[$current_presentation]);
66 $content =
"Just some information.";
67 if ($current_presentation ===
'detailed') {
68 $content =
"This is clearly a lot more information!";
71 $sub1 =
$f->panel()->sub(
"Sub Panel Title 1",
$f->legacy()->content($content))
72 ->withFurtherInformation(
$f->card()->standard(
"Card Heading")->withSections(array(
$f->legacy()->content(
"Card Content"))));
73 $sub2 =
$f->panel()->sub(
"Sub Panel Title 2",
$f->legacy()->content($content));
75 $block =
$f->panel()->report(
"Report Title", [$sub1, $sub2])
76 ->withActions($actions)
77 ->withViewControls([$modes]);
with_view_controls()
description: > Example for rendering a report panel.