19 declare(strict_types=1);
60 $this->
ctrl = $DIC->ctrl();
63 $this->ui_factory = $DIC->ui()->factory();
64 $this->filter_service = $DIC->uiService()->filter();
66 $this->irss = $DIC->resourceStorage();
67 $this->query = $DIC->http()->wrapper()->query();
69 $this->data_source->setOffsetAndLimit(
70 $this->
determinePage() * $this->view_definition->getItemsPerPage(),
71 $this->view_definition->getItemsPerPage()
83 $filters = $this->data_source->getFilterItems($this->ui_factory, $this->
language);
84 if ($filters !== []) {
85 $embedding_gui = $this->view_definition->getEmbeddingGui();
86 $this->
components[] = $filter = $this->filter_service->standard(
88 $this->
ctrl->getLinkTargetByClass($embedding_gui, $this->view_definition->getEmbeddingCmd()),
91 fn($filter):
bool =>
true,
97 $this->data_source->applyFilterValues($this->filter_service->getData($filter));
109 $this->
components[] = $this->ui_factory->table()->presentation(
114 $this->data_source->getResourceIdentifications()
117 $this->
components = array_merge($this->
components, $this->action_generator->getCollectedModals());
126 $resource = $this->irss->manage()->getResource($resource_identification);
129 $this->action_generator
131 return $resource_to_component->getAsRowMapping()($row, $resource_identification);
145 foreach (array_keys($this->data_source->getSortationsMapping()) as $sort_id) {
146 $sortations[$sort_id] = $this->
language->txt(
'sorting_' . $sort_id);
149 $view_controls[] = $this->ui_factory->viewControl()->sortation($sortations, (
string) $this->
determineSortation())
151 $this->
ctrl->getLinkTargetByClass(
152 $this->view_definition->getEmbeddingGui(),
153 $this->view_definition->getEmbeddingCmd()
159 $count = $this->data_source->getFilteredAmountOfItems();
160 if ($count > $this->view_definition->getItemsPerPage()) {
161 $view_controls[] = $this->ui_factory->viewControl()->pagination()
163 $this->
ctrl->getLinkTargetByClass(
164 $this->view_definition->getEmbeddingGui(),
165 $this->view_definition->getEmbeddingCmd()
170 ->withPageSize($this->view_definition->getItemsPerPage())
171 ->withTotalEntries($count)
172 ->withMaxPaginationButtons(5);
175 return $view_controls;
180 if ($this->query->has(
'cmdFilter')) {
184 return $this->query->has(self::P_PAGE)
185 ? $this->query->retrieve(self::P_PAGE, $this->
refinery->kindlyTo()->int())
191 return $this->query->has(self::P_SORTATION)
192 ? $this->query->retrieve(self::P_SORTATION, $this->
refinery->kindlyTo()->int())
199 $this->
ctrl->saveParameterByClass($this->view_definition->getEmbeddingGui(), self::P_SORTATION);
200 $this->
ctrl->saveParameterByClass($this->view_definition->getEmbeddingGui(), self::P_PAGE);
__construct(private ViewDefinition $view_definition, private TableDataSource $data_source, ActionGenerator $action_generator=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This is how the factory for UI elements looks.
Class ResourceIdentification.
ilUIFilterService $filter_service
ActionGenerator $action_generator
This describes a Row used in Presentation Table.
ILIAS Refinery Factory $refinery
ArrayBasedRequestWrapper $query
language()
description: > Example for rendring a language glyph.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ArrayBasedRequestWrapper.