ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\UI\examples\Panel\Standard Namespace Reference

Functions

 base_text_block ()
 
 with_actions ()
 
 with_listings ()
 
 with_view_controls ()
 

Function Documentation

◆ base_text_block()

ILIAS\UI\examples\Panel\Standard\base_text_block ( )

description: > Example for rendering a standard panel.

expected output: >

ILIAS shows a panel with a large title "Panel Title" and a text "Some Content".

Definition at line 32 of file base_text_block.php.

33{
34 global $DIC;
35 $f = $DIC->ui()->factory();
36 $renderer = $DIC->ui()->renderer();
37
38 $panel = $f->panel()->standard(
39 "Panel Title",
40 $f->legacy()->content("Some Content")
41 );
42
43 return $renderer->render($panel);
44}
$renderer
global $DIC
Definition: shib_login.php:26

References $DIC, Vendor\Package\$f, and $renderer.

◆ with_actions()

ILIAS\UI\examples\Panel\Standard\with_actions ( )

description: > Example for rendering a standard panel with actions.

expected output: > ILIAS shows a base panel but it also includes a menu displayed by

an triangle symbol pointing down. You can open the menu which includes links to ilias.de and GitHub.

Definition at line 33 of file with_actions.php.

34{
35 global $DIC;
36 $f = $DIC->ui()->factory();
37 $renderer = $DIC->ui()->renderer();
38
39 $actions = $f->dropdown()->standard(array(
40 $f->button()->shy("ILIAS", "https://www.ilias.de"),
41 $f->button()->shy("GitHub", "https://www.github.com")
42 ));
43
44 $panel = $f->panel()->standard(
45 "Panel Title",
46 $f->legacy()->content("Some Content")
47 )->withActions($actions);
48
49 return $renderer->render($panel);
50}

References $DIC, Vendor\Package\$f, and $renderer.

◆ with_listings()

ILIAS\UI\examples\Panel\Standard\with_listings ( )

description: > Example for rendering a standard panel with listings.

expected output: >

ILIAS shows a base panel with two lists (numbered and unordered).

Definition at line 32 of file with_listings.php.

33{
34 global $DIC;
35 $f = $DIC->ui()->factory();
36 $renderer = $DIC->ui()->renderer();
37
38 $content = array(
39 $f->listing()->ordered(array("item 1","item 2","item 3")),
40 $f->listing()->unordered(array("item 1","item 2","item 3"))
41 );
42
43 $panel = $f->panel()->standard("Panel Title", $content);
44
45 return $renderer->render($panel);
46}

References $DIC, Vendor\Package\$f, and $renderer.

◆ with_view_controls()

ILIAS\UI\examples\Panel\Standard\with_view_controls ( )

description: > Example for rendering a standard panel with an all view control.

expected output: > ILIAS shows a base panel with some content like sub items, titles etc. Additionally it displayes three view controls

(Sortation, modes and pagination).

Definition at line 33 of file with_view_controls.php.

33 : string
34{
35 global $DIC;
36 $f = $DIC->ui()->factory();
37 $renderer = $DIC->ui()->renderer();
38 $refinery = $DIC->refinery();
39 $request_wrapper = $DIC->http()->wrapper()->query();
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';
48 if ($request_wrapper->has('sort')) {
49 $current_sortation = $request_wrapper->retrieve('sort', $refinery->kindlyTo()->string());
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';
61 if ($request_wrapper->has('mode')) {
62 $current_presentation = $request_wrapper->retrieve('mode', $refinery->kindlyTo()->string());
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;
82 if ($request_wrapper->has('page')) {
83 $current_page = $request_wrapper->retrieve('page', $refinery->kindlyTo()->int());
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
147 return $renderer->render($std_list);
148}
$url
Definition: shib_logout.php:68

References $DIC, Vendor\Package\$f, ILIAS\UI\examples\Layout\Page\Standard\$refinery, $renderer, ILIAS\UI\examples\Layout\Page\Standard\$request_wrapper, and $url.