ILIAS  release_8 Revision v8.24
with_viewcontrollers.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
6
8{
9 global $DIC;
10
11 $factory = $DIC->ui()->factory();
12 $renderer = $DIC->ui()->renderer();
13 $refinery = $DIC->refinery();
14 $request_wrapper = $DIC->http()->wrapper()->query();
15
16 $actions = $factory->dropdown()->standard(array(
17 $factory->button()->shy("ILIAS", "https://www.ilias.de"),
18 $factory->button()->shy("GitHub", "https://www.github.com")
19 ));
20
21 $legacy = $factory->legacy("Legacy content");
22
23 $sort_options = array(
24 'internal_rating' => 'Best',
25 'date_desc' => 'Most Recent',
26 'date_asc' => 'Oldest',
27 );
28 $sortation = $factory->viewControl()->sortation($sort_options);
29
30
31 $url = $DIC->http()->request()->getRequestTarget();
32
33 $parameter_name = 'page';
34 $current_page = 0;
35 if ($request_wrapper->has($parameter_name)) {
36 $current_page = $request_wrapper->retrieve($parameter_name, $refinery->kindlyTo()->int());
37 }
38
39 $pagination = $factory->viewControl()->pagination()
40 ->withTargetURL($url, $parameter_name)
41 ->withTotalEntries(98)
42 ->withPageSize(10)
43 ->withCurrentPage($current_page);
44
45 $panel = $factory->panel()->secondary()->legacy("panel title", $legacy)->withViewControls(array($sortation, $pagination))->withActions($actions);
46
47 return $renderer->render($panel);
48}
global $DIC
Definition: feed.php:28
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
Definition: imgupload.php:198
$factory
Definition: metadata.php:75
Refinery Factory $refinery
$url