ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
with_view_controls.php
Go to the documentation of this file.
1 <?php
2 
3 declare(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  $url = $DIC->http()->request()->getRequestTarget();
24 
25  $sort_options = array(
26  'internal_rating' => 'Best',
27  'date_desc' => 'Most Recent',
28  'date_asc' => 'Oldest',
29  );
30  $sortation = $factory->viewControl()->sortation($sort_options)->withTargetURL($url, "");
31 
32  $parameter_name = 'page';
33  $current_page = 0;
34  if ($request_wrapper->has($parameter_name)) {
35  $current_page = $request_wrapper->retrieve($parameter_name, $refinery->kindlyTo()->int());
36  }
37 
38  $pagination = $factory->viewControl()->pagination()
39  ->withTargetURL($url, $parameter_name)
40  ->withTotalEntries(98)
41  ->withPageSize(10)
42  ->withCurrentPage($current_page);
43 
44 
45  $panel = $factory->panel()->standard(
46  "Panel Title",
47  $factory->legacy("Some Content")
48  )
49  ->withActions($actions)
50  ->withViewControls(array($sortation, $pagination));
51 
52  return $renderer->render($panel);
53 }
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
Definition: imgupload.php:198
global $DIC
Definition: feed.php:28
$url
$factory
Definition: metadata.php:75
Refinery Factory $refinery