ILIAS  release_8 Revision v8.23
with_viewcontrollers.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
8 {
9  global $DIC;
10  $factory = $DIC->ui()->factory();
11  $renderer = $DIC->ui()->renderer();
12  $refinery = $DIC->refinery();
13  $request_wrapper = $DIC->http()->wrapper()->query();
14 
15  $actions = $factory->dropdown()->standard(array(
16  $factory->button()->shy("ILIAS", "https://www.ilias.de"),
17  $factory->button()->shy("GitHub", "https://www.github.com")
18  ));
19 
20  $list_item1 = $factory->item()->standard("Item Title")
21  ->withActions($actions)
22  ->withProperties(array(
23  "Origin" => "Course Title 1",
24  "Last Update" => "24.11.2011",
25  "Location" => "Room 123, Main Street 44, 3012 Bern"))
26  ->withDescription("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.");
27 
28  $list_item2 = $factory->item()->standard("Item 2 Title")
29  ->withActions($actions)
30  ->withDescription("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.");
31 
32  $list_item3 = $factory->item()->standard("Item 3 Title")
33  ->withActions($actions)
34  ->withDescription("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.");
35 
36  $items = array(
37  $factory->item()->group("Listing Subtitle 1", array(
38  $list_item1,
39  $list_item2
40  )),
41  $factory->item()->group("Listing Subtitle 2", array(
42  $list_item3
43  )));
44 
45  $sort_options = array(
46  'internal_rating' => 'Best',
47  'date_desc' => 'Most Recent',
48  'date_asc' => 'Oldest',
49  );
50  $sortation = $factory->viewControl()->sortation($sort_options);
51 
52  $url = $DIC->http()->request()->getRequestTarget();
53 
54  $parameter_name = 'page';
55  $current_page = 0;
56  if ($request_wrapper->has($parameter_name)) {
57  $current_page = $request_wrapper->retrieve($parameter_name, $refinery->kindlyTo()->int());
58  }
59 
60  $pagination = $factory->viewControl()->pagination()
61  ->withTargetURL($url, $parameter_name)
62  ->withTotalEntries(98)
63  ->withPageSize(10)
64  ->withCurrentPage($current_page);
65 
66  $panel = $factory->panel()->secondary()->listing("Listing panel Title", $items)->withViewControls(array($pagination,$sortation))->withActions($actions);
67 
68  return $renderer->render($panel);
69 }
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