ILIAS  release_7 Revision v7.30-3-g800a261c036
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 $url = $DIC->http()->request()->getRequestTarget();
18
19 $sort_options = array(
20 'internal_rating' => 'Best',
21 'date_desc' => 'Most Recent',
22 'date_asc' => 'Oldest',
23 );
24 $sortation = $factory->viewControl()->sortation($sort_options)->withTargetURL($url, "");
25
26 $parameter_name = 'page';
27 $current_page = (int) (array_key_exists($parameter_name, $_GET) ? $_GET[$parameter_name] : 0);
28
29 $pagination = $factory->viewControl()->pagination()
30 ->withTargetURL($url, $parameter_name)
31 ->withTotalEntries(98)
32 ->withPageSize(10)
33 ->withCurrentPage($current_page);
34
35
36 $panel = $factory->panel()->standard(
37 "Panel Title",
38 $factory->legacy("Some Content")
39 )
40 ->withActions($actions)
41 ->withViewControls(array($sortation, $pagination));
42
43 return $renderer->render($panel);
44}
$_GET["client_id"]
global $DIC
Definition: goto.php:24
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
Definition: imgupload.php:138
$factory
Definition: metadata.php:58
$url

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