description: > Example for rendering a standard panel with an all view control.
33 : string
34{
36 $f =
$DIC->ui()->factory();
40
41 $url =
$DIC->http()->request()->getRequestTarget();
42
43 $actions =
$f->dropdown()->standard([
44 $f->button()->shy(
"ILIAS",
"https://www.ilias.de"),
45 $f->button()->shy(
"GitHub",
"https://www.github.com")
46 ]);
47 $current_sortation = 'abc';
50 }
51
52 $sortation_options = [
53 'abc' => 'Sort by Alphabet',
54 'date' => 'Sort by Date',
55 'location' => 'Sort by Location'
56 ];
57 $sortation =
$f->viewControl()->sortation($sortation_options, $current_sortation)
58 ->withTargetURL(
$url,
"sort");
59
60 $current_presentation = 'list';
63 }
64 $presentation_options = [
65 'list' => 'List View',
66 'tile' => 'Tile View'
67 ];
68 $modes =
$f->viewControl()->mode(
69 array_reduce(
70 array_keys($presentation_options),
71 static function ($carry, $item) use ($presentation_options,
$url) {
72 $carry[$presentation_options[$item]] = "$url&mode=$item";
73 return $carry;
74 },
75 []
76 ),
77 'Presentation Mode'
78 )
79 ->withActive($presentation_options[$current_presentation]);
80
81 $current_page = 0;
84 }
85 $pagination =
$f->viewControl()->pagination()
86 ->withTargetURL(
$url,
"page")
87 ->withTotalEntries(98)
88 ->withPageSize(10)
89 ->withCurrentPage($current_page);
90
91 $view_controls = [
92 $sortation,
93 $modes,
94 $pagination
95 ];
96
97 if ($current_presentation === 'list') {
98 $item1 =
$f->item()->standard(
"Item Title")
99 ->withActions($actions)
100 ->withProperties([
101 "Origin" => "Course Title 1",
102 "Last Update" => "24.11.2011",
103 "Location" => "Room 123, Main Street 44, 3012 Bern"
104 ])
105 ->withDescription(
106 "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua."
107 );
108
109 $item2 =
$f->item()->standard(
"Item 2 Title")
110 ->withActions($actions)
111 ->withDescription(
112 "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua."
113 );
114
115 $item3 =
$f->item()->standard(
"Item 3 Title")
116 ->withActions($actions)
117 ->withDescription(
118 "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua."
119 );
120 } else {
121 $image =
$f->image()->responsive(
122 "./assets/images/logo/HeaderIcon.svg",
123 "Thumbnail Example"
124 );
125 $content =
$f->listing()->descriptive(
126 [
127 "Entry 1" => "Some text",
128 "Entry 2" => "Some more text",
129 ]
130 );
131 $item1 = $item2 = $item3 =
$f->card()->standard(
"Item Title", $image)
132 ->withSections([$content]);
133 }
134
135 $std_list =
$f->panel()->standard(
"List Title", [
136 $f->item()->group(
"Subtitle 1", [
137 $item1,
138 $item2
139 ]),
140 $f->item()->group(
"Subtitle 2", [
141 $item3
142 ])
143 ])
144 ->withActions($actions)
145 ->withViewControls($view_controls);
146
148}