ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
with_view_controls.php File Reference

Go to the source code of this file.

Functions

 with_view_controls ()
 

Function Documentation

◆ with_view_controls()

with_view_controls ( )

Definition at line 3 of file with_view_controls.php.

4{
5 global $DIC;
6
7 $factory = $DIC->ui()->factory();
8 $renderer = $DIC->ui()->renderer();
9
10 $actions = $factory->dropdown()->standard(array(
11 $factory->button()->shy("ILIAS", "https://www.ilias.de"),
12 $factory->button()->shy("GitHub", "https://www.github.com")
13 ));
14
15 $legacy = $factory->legacy("Legacy content");
16
17 $sort_options = array(
18 'internal_rating' => 'Best',
19 'date_desc' => 'Most Recent',
20 'date_asc' => 'Oldest',
21 );
22 $sortation = $factory->viewControl()->sortation($sort_options);
23
24
25 $url = $DIC->http()->request()->getRequestTarget();
26
27 $parameter_name = 'page';
28 $current_page = (int) @$_GET[$parameter_name];
29
30 $pagination = $factory->viewControl()->pagination()
31 ->withTargetURL($url, $parameter_name)
32 ->withTotalEntries(98)
33 ->withPageSize(10)
34 ->withCurrentPage($current_page);
35
36
37 $panel = $factory->panel()->standard(
38 "Panel Title",
39 $factory->legacy("Some Content")
40 )
41 ->withActions($actions)
42 ->withViewControls(array($sortation, $pagination));
43
44 return $renderer->render($panel);
45}
$_GET["client_id"]
$factory
Definition: metadata.php:58
$url
$DIC
Definition: xapitoken.php:46

References $_GET, $DIC, $factory, and $url.