ILIAS  release_7 Revision v7.30-3-g800a261c036
many_pages_dropdown.php File Reference

Go to the source code of this file.

Functions

 many_pages_dropdown ()
 

Function Documentation

◆ many_pages_dropdown()

many_pages_dropdown ( )

Definition at line 3 of file many_pages_dropdown.php.

4{
5 global $DIC;
6 $factory = $DIC->ui()->factory();
7 $renderer = $DIC->ui()->renderer();
8 $url = $DIC->http()->request()->getRequestTarget();
9 $lng = $DIC['lng'];
10
11 $parameter_name = 'page3';
12 $current_page = (int) (array_key_exists($parameter_name, $_GET) ? $_GET[$parameter_name] : 0);
13
14 $pagination = $factory->viewControl()->pagination()
15 ->withTargetURL($url, $parameter_name)
16 ->withTotalEntries(102)
17 ->withPageSize(10)
18 ->withDropdownAt(5)
19 ->withCurrentPage($current_page);
20
21 $custom_pagination = $pagination
22 ->withDropdownLabel('current page is %1$d (of %2$d pages in total)');
23
24 list($range_offset, $range_length) = $pagination->getRange()->unpack();
25 $result = "Show $range_length entries starting at $range_offset";
26
27 return $renderer->render([$pagination, $custom_pagination])
28 . '<hr>'
29 . $result;
30}
$result
$_GET["client_id"]
global $DIC
Definition: goto.php:24
$factory
Definition: metadata.php:58
$url
$lng

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