ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ViewControlBuilder.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27
32{
33 public function __construct(
34 private Request $request,
35 private TableDataProvider $data_provider,
36 private \ilCtrlInterface $ctrl,
37 private Factory $ui_factory,
38 private \ilLanguage $language,
39 ) {
40 }
41
42 public function getPagination(): Pagination
43 {
44 return $this->ui_factory->viewControl()
45 ->pagination()
46 ->withPageSize($this->request->getItemsPerPage())
47 ->withCurrentPage($this->request->getPage())
48 ->withTotalEntries($this->data_provider->getTotal())
49 ->withTargetURL(
50 $this->ctrl->getLinkTargetByClass(
51 \ilContainerResourceGUI::class,
53 ),
55 );
56 }
57
58 public function getSortation(): Sortation
59 {
60 return $this->ui_factory->viewControl()->sortation([
62 Request::BY_TITLE_DESC => $this->language->txt(Request::BY_TITLE_DESC),
65 Request::BY_SIZE_ASC => $this->language->txt(Request::BY_SIZE_ASC),
66 Request::BY_SIZE_DESC => $this->language->txt(Request::BY_SIZE_DESC),
67 ])->withTargetURL(
68 $this->ctrl->getLinkTargetByClass(
69 \ilContainerResourceGUI::class,
71 ),
73 );
74 }
75}
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
__construct(private Request $request, private TableDataProvider $data_provider, private \ilCtrlInterface $ctrl, private Factory $ui_factory, private \ilLanguage $language,)
language handling
This describes a Pagination Control.
Definition: Pagination.php:33
withPageSize(int $size)
Set the amount of entries per page.
This describes a Sortation Control.
Definition: Sortation.php:32
withTargetURL(string $url, string $parameter_name)
Get a Sortation with this target-url.
This is how the factory for UI elements looks.
Definition: Factory.php:38
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...