19 declare(strict_types=1);
58 $this->
ctrl = $DIC->ctrl();
61 $this->ui_factory = $DIC->ui()->factory();
62 $this->filter_service = $DIC->uiService()->filter();
64 $this->irss = $DIC->resourceStorage();
65 $this->query = $DIC->http()->wrapper()->query();
67 $this->data_source->setOffsetAndLimit(
68 $this->
determinePage() * $this->view_definition->getItemsPerPage(),
69 $this->view_definition->getItemsPerPage()
81 $filters = $this->data_source->getFilterItems($this->ui_factory, $this->
language);
82 if ($filters !== []) {
83 $embedding_gui = $this->view_definition->getEmbeddingGui();
84 $this->
components[] = $filter = $this->filter_service->standard(
86 $this->
ctrl->getLinkTargetByClass($embedding_gui, $this->view_definition->getEmbeddingCmd()),
89 fn($filter):
bool =>
true,
95 $this->data_source->applyFilterValues($this->filter_service->getData($filter));
107 $this->
components[] = $this->ui_factory->table()->presentation(
112 $this->data_source->getResourceIdentifications()
115 $this->
components = array_merge($this->
components, $this->action_generator->getCollectedModals());
124 $resource = $this->irss->manage()->getResource($resource_identification);
127 $this->action_generator
129 return $resource_to_component->getAsRowMapping()($row, $resource_identification);
143 foreach (array_keys($this->data_source->getSortationsMapping()) as $sort_id) {
144 $sortations[$sort_id] = $this->
language->txt(
'sorting_' . $sort_id);
147 $view_controls[] = $this->ui_factory->viewControl()->sortation($sortations, (
string) $this->
determineSortation())
149 $this->
ctrl->getLinkTargetByClass(
150 $this->view_definition->getEmbeddingGui(),
151 $this->view_definition->getEmbeddingCmd()
157 $count = $this->data_source->getFilteredAmountOfItems();
158 if ($count > $this->view_definition->getItemsPerPage()) {
159 $view_controls[] = $this->ui_factory->viewControl()->pagination()
161 $this->
ctrl->getLinkTargetByClass(
162 $this->view_definition->getEmbeddingGui(),
163 $this->view_definition->getEmbeddingCmd()
168 ->withPageSize($this->view_definition->getItemsPerPage())
169 ->withTotalEntries($count)
170 ->withMaxPaginationButtons(5);
173 return $view_controls;
178 if ($this->query->has(
'cmdFilter')) {
182 return $this->query->has(self::P_PAGE)
183 ? $this->query->retrieve(self::P_PAGE, $this->
refinery->kindlyTo()->int())
189 return $this->query->has(self::P_SORTATION)
190 ? $this->query->retrieve(self::P_SORTATION, $this->
refinery->kindlyTo()->int())
197 $this->
ctrl->saveParameterByClass($this->view_definition->getEmbeddingGui(), self::P_SORTATION);
198 $this->
ctrl->saveParameterByClass($this->view_definition->getEmbeddingGui(), self::P_PAGE);
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
This describes a Row used in Presentation Table.
__construct(private ViewDefinition $view_definition, private TableDataSource $data_source, private ActionGenerator $action_generator=new NullActionGenerator())
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.