From 08b28b1b24aadc6c6e676e33881fefb49ce4fca5 Mon Sep 17 00:00:00 2001 From: Nils Haagen Date: Mon, 11 Nov 2024 17:02:38 +0100 Subject: [PATCH 1/4] UI/DataTable: with additional view control --- .../ILIAS/UI/src/Component/Table/Data.php | 2 +- .../Implementation/Component/Table/Data.php | 70 +++++++++++++------ .../ILIAS/UI/src/examples/Table/Data/base.php | 12 ++++ .../Component/Table/DataViewControlsTest.php | 58 +++++++++++++++ 4 files changed, 120 insertions(+), 22 deletions(-) diff --git a/components/ILIAS/UI/src/Component/Table/Data.php b/components/ILIAS/UI/src/Component/Table/Data.php index 46c5221b6336..2fc04dd81e9c 100755 --- a/components/ILIAS/UI/src/Component/Table/Data.php +++ b/components/ILIAS/UI/src/Component/Table/Data.php @@ -54,7 +54,7 @@ public function withSelectedOptionalColumns(array $selected_optional_column_ids) public function withOrder(?Order $order): self; public function withRange(?Range $range): self; public function withFilter(?array $filter): self; - public function withAdditionalParameters(?array $additional_parameters): self; + public function withAdditionalParameters(array $additional_parameters): self; /** * The DataTable comes with a storage to keep e.g. ViewControl-settings throughout requests. diff --git a/components/ILIAS/UI/src/Implementation/Component/Table/Data.php b/components/ILIAS/UI/src/Implementation/Component/Table/Data.php index 04b49a9bf241..41bea95a0d28 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Table/Data.php +++ b/components/ILIAS/UI/src/Implementation/Component/Table/Data.php @@ -47,7 +47,8 @@ class Data extends AbstractTable implements T\Data public const VIEWCONTROL_KEY_FIELDSELECTION = 'selected_optional'; protected ?array $filter = null; - protected ?array $additional_parameters = null; + protected ?array $additional_parameters = []; + protected array $additional_view_controls = []; /** * @param array $columns @@ -93,14 +94,14 @@ public function getFilter(): ?array return $this->filter; } - public function withAdditionalParameters(?array $additional_parameters): self + public function withAdditionalParameters(array $additional_parameters): self { $clone = clone $this; $clone->additional_parameters = $additional_parameters; return $clone; } - public function getAdditionalParameters(): ?array + public function getAdditionalParameters(): array { return $this->additional_parameters; } @@ -120,26 +121,40 @@ public function applyViewControls( array $filter_data, ?array $additional_parameters = [] ): array { - $table = $this; - $total_count = $this->getDataRetrieval()->getTotalRowCount($filter_data, $additional_parameters); - $view_controls = $this->getViewControls($total_count); - - if ($request = $this->getRequest()) { - # This retrieves container data from the request - $data = $this->applyValuesToViewcontrols($view_controls, $request)->getData(); - $range = $data[self::VIEWCONTROL_KEY_PAGINATION]; - $range = ($range instanceof Range) ? $range->croppedTo($total_count ?? PHP_INT_MAX) : null; - $order = $data[self::VIEWCONTROL_KEY_ORDERING]; - $order = ($order instanceof Order) ? $order : null; - - $table = $table - ->withRange($range) - ->withOrder($order) - ->withSelectedOptionalColumns($data[self::VIEWCONTROL_KEY_FIELDSELECTION] ?? null); - # This retrieves the view controls that should be displayed - $view_controls = $table->applyValuesToViewcontrols($table->getViewControls($total_count), $request); + $request = $this->getRequest(); + if (! $request) { + $total_count = $this->getDataRetrieval()->getTotalRowCount($filter_data, $additional_parameters); + $view_controls = $this->getViewControls($total_count); + return [ + $this, + $view_controls + ]; } + $data = $this->applyValuesToViewcontrols($this->getViewControls(null), $request)->getData(); + $additional_parameters_from_viewcontrols = array_filter( + $data, + fn($key) => !in_array($key, [self::VIEWCONTROL_KEY_PAGINATION, self::VIEWCONTROL_KEY_ORDERING, self::VIEWCONTROL_KEY_FIELDSELECTION]), + ARRAY_FILTER_USE_KEY + ); + $additional_parameters = array_merge($additional_parameters, $additional_parameters_from_viewcontrols); + + $total_count = $this->getDataRetrieval()->getTotalRowCount($filter_data, $additional_parameters); + $data = $this->applyValuesToViewcontrols($this->getViewControls($total_count), $request)->getData(); + $range = $data[self::VIEWCONTROL_KEY_PAGINATION]; + $range = ($range instanceof Range) ? $range->croppedTo($total_count ?? PHP_INT_MAX) : null; + $order = $data[self::VIEWCONTROL_KEY_ORDERING]; + $order = ($order instanceof Order) ? $order : null; + + $table = $this + ->withRange($range) + ->withOrder($order) + ->withSelectedOptionalColumns($data[self::VIEWCONTROL_KEY_FIELDSELECTION] ?? null) + ->withAdditionalParameters($additional_parameters); + + # This retrieves the view controls that should be displayed + $view_controls = $table->applyValuesToViewcontrols($table->getViewControls($total_count), $request); + return [ $table, $view_controls @@ -154,6 +169,19 @@ protected function getViewControls(?int $total_count = null): ViewControlContain self::VIEWCONTROL_KEY_FIELDSELECTION => $this->getViewControlFieldSelection(), ]; $view_controls = array_filter($view_controls); + $view_controls = array_merge($view_controls, $this->additional_view_controls); + return $this->view_control_container_factory->standard($view_controls); } + + + public function withAdditionalViewControl( + string $key, + ViewControlContainer\ViewControlInput $view_control + ) { + $clone = clone $this; + $clone->additional_view_controls[$key] = $view_control; + return $clone; + } + } diff --git a/components/ILIAS/UI/src/examples/Table/Data/base.php b/components/ILIAS/UI/src/examples/Table/Data/base.php index baf3133d401b..75711ac8895e 100755 --- a/components/ILIAS/UI/src/examples/Table/Data/base.php +++ b/components/ILIAS/UI/src/examples/Table/Data/base.php @@ -171,6 +171,10 @@ public function getRows( } $record['achieve'] = $icon; + if ($additional_parameters['anon_mail'] === 'hide') { + $record['email'] = '-'; + } + yield $row_builder->buildDataRow($row_id, $record) /** Actions may be disabled for specific rows: */ ->withDisabledAction('delete', ($record['login'] === 'superuser')); @@ -239,6 +243,14 @@ protected function getRecords(Range $range = null, Order $order = null): array ->withRange(new Range(0, 2)) ->withOrder(new Order('achieve', Order::DESC)) + ->withAdditionalViewControl( + 'anon_mail', + $f->input()->viewControl()->mode([ + 'show' => 'show mails', + 'hide' => 'anon mails' + ]) + ->withValue('show') + ) ->withRequest($request); /** diff --git a/components/ILIAS/UI/tests/Component/Table/DataViewControlsTest.php b/components/ILIAS/UI/tests/Component/Table/DataViewControlsTest.php index c60859dca470..08d58595caab 100755 --- a/components/ILIAS/UI/tests/Component/Table/DataViewControlsTest.php +++ b/components/ILIAS/UI/tests/Component/Table/DataViewControlsTest.php @@ -257,4 +257,62 @@ public function testDataTableViewControlStorage(): void $this->assertEquals(new Order('f2', Order::DESC), $table->getOrder()); $this->assertEquals(1, count($table->getSelectedOptionalColumns())); } + + public function testDataTableHasNoFieldSelectionButAdditionalViewControl(): void + { + $factory = $this->getTableFactory(); + $columns = [ + 'f1' => $factory->column()->text('f1'), + 'f2' => $factory->column()->text('f2'), + ]; + $total_count = 200; + $table = $factory->data('Table', $columns, $this->getDataRetrieval($total_count)) + ->withAdditionalViewControl( + 'additional_control', + $this->getViewControlFactory()->mode([ + 'mode1' => 'a mode', + 'mode2' => 'another mode' + ]) + ) + ->withId('testing_data_table_id') + ->withRequest( + $this->getRequestMock([ + 'view_control/input_0/input_1' => 0, + 'view_control/input_0/input_2' => 10, + 'view_control/input_3/input_4' => 'f2', + 'view_control/input_3/input_5' => 'DESC', + 'view_control/input_6' => 'mode2' + ]) + ); + + $additional_parameters = ['existing' => true]; + list($table, $view_controls) = $table->applyViewControls([], $additional_parameters); + + $this->assertEquals( + [ + C\Table\Data::VIEWCONTROL_KEY_PAGINATION, + C\Table\Data::VIEWCONTROL_KEY_ORDERING, + 'additional_control' + ], + array_keys($view_controls->getInputs()) + ); + $this->assertEquals( + [ + 'additional_control' => 'mode2', + 'existing' => true, + ], + $table->getAdditionalParameters() + ); + + //applied values from session with empty request + $table = $table->withRequest($this->getRequestMock([])); + list($table, $view_controls) = $table->applyViewControls([], $additional_parameters); + $this->assertEquals( + [ + 'additional_control' => 'mode2', + 'existing' => true, + ], + $table->getAdditionalParameters() + ); + } } From 4662025af03bc59eb9a2dee8ad357aeab1d8f891 Mon Sep 17 00:00:00 2001 From: Nils Haagen Date: Thu, 21 Nov 2024 11:26:25 +0100 Subject: [PATCH 2/4] UI/DataTable: mixed params additional_viewcontrol_data, filter_data, additional for getRows/getTotalRowCount --- .../UI/src/Component/Table/DataRetrieval.php | 10 +++-- .../Implementation/Component/Table/Data.php | 38 +++++++++++++------ .../Component/Table/Renderer.php | 3 +- .../src/examples/Table/Action/Multi/base.php | 10 +++-- .../src/examples/Table/Action/Single/base.php | 10 +++-- .../examples/Table/Action/Standard/base.php | 10 +++-- .../examples/Table/Column/Boolean/base.php | 10 +++-- .../src/examples/Table/Column/Date/base.php | 10 +++-- .../src/examples/Table/Column/EMail/base.php | 10 +++-- .../src/examples/Table/Column/Link/base.php | 10 +++-- .../Table/Column/LinkListing/base.php | 10 +++-- .../src/examples/Table/Column/Number/base.php | 10 +++-- .../src/examples/Table/Column/Status/base.php | 10 +++-- .../examples/Table/Column/StatusIcon/base.php | 10 +++-- .../src/examples/Table/Column/Text/base.php | 10 +++-- .../examples/Table/Column/TimeSpan/base.php | 10 +++-- .../ILIAS/UI/src/examples/Table/Data/base.php | 12 +++--- .../Table/Data/repo_implementation.php | 10 +++-- .../src/examples/Table/Data/without_data.php | 12 ++++-- .../Component/Table/DataRendererTest.php | 37 ++++++++++-------- .../UI/tests/Component/Table/DataTest.php | 10 +++-- .../Component/Table/DataViewControlsTest.php | 10 +++-- 22 files changed, 168 insertions(+), 104 deletions(-) diff --git a/components/ILIAS/UI/src/Component/Table/DataRetrieval.php b/components/ILIAS/UI/src/Component/Table/DataRetrieval.php index 90fcb798072d..f12fec907afa 100755 --- a/components/ILIAS/UI/src/Component/Table/DataRetrieval.php +++ b/components/ILIAS/UI/src/Component/Table/DataRetrieval.php @@ -38,8 +38,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, // $DIC->uiService()->filter()->getData(); - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator; /** @@ -55,7 +56,8 @@ public function getRows( * to the count. */ public function getTotalRowCount( - ?array $filter_data, // $DIC->uiService()->filter()->getData(); - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int; } diff --git a/components/ILIAS/UI/src/Implementation/Component/Table/Data.php b/components/ILIAS/UI/src/Implementation/Component/Table/Data.php index 41bea95a0d28..f918b6581e2c 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Table/Data.php +++ b/components/ILIAS/UI/src/Implementation/Component/Table/Data.php @@ -46,8 +46,9 @@ class Data extends AbstractTable implements T\Data public const VIEWCONTROL_KEY_ORDERING = 'order'; public const VIEWCONTROL_KEY_FIELDSELECTION = 'selected_optional'; - protected ?array $filter = null; - protected ?array $additional_parameters = []; + protected mixed $filter = null; + protected mixed $additional_parameters = null; + protected mixed $additional_viewcontrol_data = null; protected array $additional_view_controls = []; /** @@ -94,18 +95,30 @@ public function getFilter(): ?array return $this->filter; } - public function withAdditionalParameters(array $additional_parameters): self + public function withAdditionalParameters(mixed $additional_parameters): self { $clone = clone $this; $clone->additional_parameters = $additional_parameters; return $clone; } - public function getAdditionalParameters(): array + public function getAdditionalParameters(): mixed { return $this->additional_parameters; } + public function withAdditionalViewControlData(mixed $additional_viewcontrol_data): self + { + $clone = clone $this; + $clone->additional_viewcontrol_data = $additional_viewcontrol_data; + return $clone; + } + + public function getAdditionalViewControlData(): mixed + { + return $this->additional_viewcontrol_data; + } + public function getRowBuilder(): DataRowBuilder { return $this->data_row_builder @@ -118,12 +131,12 @@ public function getRowBuilder(): DataRowBuilder * @return array */ public function applyViewControls( - array $filter_data, - ?array $additional_parameters = [] + mixed $filter_data, + mixed $additional_parameters ): array { $request = $this->getRequest(); if (! $request) { - $total_count = $this->getDataRetrieval()->getTotalRowCount($filter_data, $additional_parameters); + $total_count = $this->getDataRetrieval()->getTotalRowCount(null, $filter_data, $additional_parameters); $view_controls = $this->getViewControls($total_count); return [ $this, @@ -132,14 +145,17 @@ public function applyViewControls( } $data = $this->applyValuesToViewcontrols($this->getViewControls(null), $request)->getData(); - $additional_parameters_from_viewcontrols = array_filter( + $additional_viewcontrol_data = array_filter( $data, fn($key) => !in_array($key, [self::VIEWCONTROL_KEY_PAGINATION, self::VIEWCONTROL_KEY_ORDERING, self::VIEWCONTROL_KEY_FIELDSELECTION]), ARRAY_FILTER_USE_KEY ); - $additional_parameters = array_merge($additional_parameters, $additional_parameters_from_viewcontrols); - $total_count = $this->getDataRetrieval()->getTotalRowCount($filter_data, $additional_parameters); + $total_count = $this->getDataRetrieval()->getTotalRowCount( + $additional_viewcontrol_data, + $filter_data, + $additional_parameters + ); $data = $this->applyValuesToViewcontrols($this->getViewControls($total_count), $request)->getData(); $range = $data[self::VIEWCONTROL_KEY_PAGINATION]; $range = ($range instanceof Range) ? $range->croppedTo($total_count ?? PHP_INT_MAX) : null; @@ -150,7 +166,7 @@ public function applyViewControls( ->withRange($range) ->withOrder($order) ->withSelectedOptionalColumns($data[self::VIEWCONTROL_KEY_FIELDSELECTION] ?? null) - ->withAdditionalParameters($additional_parameters); + ->withAdditionalViewControlData($additional_viewcontrol_data); # This retrieves the view controls that should be displayed $view_controls = $table->applyValuesToViewcontrols($table->getViewControls($total_count), $request); diff --git a/components/ILIAS/UI/src/Implementation/Component/Table/Renderer.php b/components/ILIAS/UI/src/Implementation/Component/Table/Renderer.php index 26a31ca2f3a6..13195d72a6c6 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Table/Renderer.php +++ b/components/ILIAS/UI/src/Implementation/Component/Table/Renderer.php @@ -204,7 +204,7 @@ public function renderDataTable(Component\Table\Data $component, RendererInterfa $component = $this->registerActions($component); [$component, $view_controls] = $component->applyViewControls( - $component->getFilter() ?? [], + $component->getFilter(), $component->getAdditionalParameters() ); @@ -213,6 +213,7 @@ public function renderDataTable(Component\Table\Data $component, RendererInterfa array_keys($component->getVisibleColumns()), $component->getRange(), $component->getOrder(), + $component->getAdditionalViewControlData(), $component->getFilter(), $component->getAdditionalParameters() ); diff --git a/components/ILIAS/UI/src/examples/Table/Action/Multi/base.php b/components/ILIAS/UI/src/examples/Table/Action/Multi/base.php index a402e1da0035..4dff09a065c1 100755 --- a/components/ILIAS/UI/src/examples/Table/Action/Multi/base.php +++ b/components/ILIAS/UI/src/examples/Table/Action/Multi/base.php @@ -98,8 +98,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach (range(0, 5) as $cnt) { yield $row_builder->buildDataRow('row_id' . $cnt, ['f1' => $cnt]); @@ -107,8 +108,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return 6; } diff --git a/components/ILIAS/UI/src/examples/Table/Action/Single/base.php b/components/ILIAS/UI/src/examples/Table/Action/Single/base.php index f9b7094f0ad1..e7f75b9053f1 100755 --- a/components/ILIAS/UI/src/examples/Table/Action/Single/base.php +++ b/components/ILIAS/UI/src/examples/Table/Action/Single/base.php @@ -96,8 +96,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach (range(0, 5) as $cnt) { yield $row_builder->buildDataRow('row_id' . $cnt, ['f1' => $cnt]); @@ -105,8 +106,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return 6; } diff --git a/components/ILIAS/UI/src/examples/Table/Action/Standard/base.php b/components/ILIAS/UI/src/examples/Table/Action/Standard/base.php index e54fb65d318a..9cd0a80987d3 100755 --- a/components/ILIAS/UI/src/examples/Table/Action/Standard/base.php +++ b/components/ILIAS/UI/src/examples/Table/Action/Standard/base.php @@ -102,8 +102,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach (range(0, 5) as $cnt) { yield $row_builder->buildDataRow('row_id' . $cnt, ['f1' => $cnt]); @@ -111,8 +112,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return 6; } diff --git a/components/ILIAS/UI/src/examples/Table/Column/Boolean/base.php b/components/ILIAS/UI/src/examples/Table/Column/Boolean/base.php index 984335c29a80..b7406235fdb8 100755 --- a/components/ILIAS/UI/src/examples/Table/Column/Boolean/base.php +++ b/components/ILIAS/UI/src/examples/Table/Column/Boolean/base.php @@ -53,8 +53,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach ($this->records as $number) { $row_id = ''; @@ -67,8 +68,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->records); } diff --git a/components/ILIAS/UI/src/examples/Table/Column/Date/base.php b/components/ILIAS/UI/src/examples/Table/Column/Date/base.php index 6f8f1a5fae77..92da475ccad9 100755 --- a/components/ILIAS/UI/src/examples/Table/Column/Date/base.php +++ b/components/ILIAS/UI/src/examples/Table/Column/Date/base.php @@ -33,8 +33,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $row_id = ''; $dat = new \DateTimeImmutable(); @@ -46,8 +47,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return 1; } diff --git a/components/ILIAS/UI/src/examples/Table/Column/EMail/base.php b/components/ILIAS/UI/src/examples/Table/Column/EMail/base.php index d205b2ef888b..491463a3d825 100755 --- a/components/ILIAS/UI/src/examples/Table/Column/EMail/base.php +++ b/components/ILIAS/UI/src/examples/Table/Column/EMail/base.php @@ -36,8 +36,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach ($this->records as $idx => $record) { $row_id = ''; @@ -46,8 +47,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->records); } diff --git a/components/ILIAS/UI/src/examples/Table/Column/Link/base.php b/components/ILIAS/UI/src/examples/Table/Column/Link/base.php index 2cfbba454477..27999a66334a 100755 --- a/components/ILIAS/UI/src/examples/Table/Column/Link/base.php +++ b/components/ILIAS/UI/src/examples/Table/Column/Link/base.php @@ -44,8 +44,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach ($this->records as $idx => $record) { $row_id = ''; @@ -54,8 +55,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->records); } diff --git a/components/ILIAS/UI/src/examples/Table/Column/LinkListing/base.php b/components/ILIAS/UI/src/examples/Table/Column/LinkListing/base.php index e03c925101db..40ae7c618d1e 100755 --- a/components/ILIAS/UI/src/examples/Table/Column/LinkListing/base.php +++ b/components/ILIAS/UI/src/examples/Table/Column/LinkListing/base.php @@ -45,8 +45,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach ($this->records as $idx => $record) { $row_id = ''; @@ -55,8 +56,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->records); } diff --git a/components/ILIAS/UI/src/examples/Table/Column/Number/base.php b/components/ILIAS/UI/src/examples/Table/Column/Number/base.php index 5b66cd6b0d09..2bc339c93002 100755 --- a/components/ILIAS/UI/src/examples/Table/Column/Number/base.php +++ b/components/ILIAS/UI/src/examples/Table/Column/Number/base.php @@ -47,8 +47,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach ($this->records as $number) { $row_id = ''; @@ -60,8 +61,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->records); } diff --git a/components/ILIAS/UI/src/examples/Table/Column/Status/base.php b/components/ILIAS/UI/src/examples/Table/Column/Status/base.php index eb51a8931e79..97865053e4d2 100755 --- a/components/ILIAS/UI/src/examples/Table/Column/Status/base.php +++ b/components/ILIAS/UI/src/examples/Table/Column/Status/base.php @@ -39,8 +39,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach ($this->records as $idx => $record) { $row_id = ''; @@ -49,8 +50,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->records); } diff --git a/components/ILIAS/UI/src/examples/Table/Column/StatusIcon/base.php b/components/ILIAS/UI/src/examples/Table/Column/StatusIcon/base.php index bc18c8cc95cb..7cce47784425 100755 --- a/components/ILIAS/UI/src/examples/Table/Column/StatusIcon/base.php +++ b/components/ILIAS/UI/src/examples/Table/Column/StatusIcon/base.php @@ -41,8 +41,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach ($this->records as $number) { $row_id = ''; @@ -57,8 +58,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->records); } diff --git a/components/ILIAS/UI/src/examples/Table/Column/Text/base.php b/components/ILIAS/UI/src/examples/Table/Column/Text/base.php index 9219fb7ac652..35033bb5d20e 100755 --- a/components/ILIAS/UI/src/examples/Table/Column/Text/base.php +++ b/components/ILIAS/UI/src/examples/Table/Column/Text/base.php @@ -43,8 +43,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach ($this->records as $idx => $record) { $row_id = ''; @@ -53,8 +54,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->records); } diff --git a/components/ILIAS/UI/src/examples/Table/Column/TimeSpan/base.php b/components/ILIAS/UI/src/examples/Table/Column/TimeSpan/base.php index 4155742b9c78..75a94f59db91 100755 --- a/components/ILIAS/UI/src/examples/Table/Column/TimeSpan/base.php +++ b/components/ILIAS/UI/src/examples/Table/Column/TimeSpan/base.php @@ -33,8 +33,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $row_id = ''; $dat = new \DateTimeImmutable(); @@ -47,8 +48,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return 1; } diff --git a/components/ILIAS/UI/src/examples/Table/Data/base.php b/components/ILIAS/UI/src/examples/Table/Data/base.php index 75711ac8895e..a541fb2a7398 100755 --- a/components/ILIAS/UI/src/examples/Table/Data/base.php +++ b/components/ILIAS/UI/src/examples/Table/Data/base.php @@ -147,8 +147,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range, $order); foreach ($records as $idx => $record) { @@ -171,7 +172,7 @@ public function getRows( } $record['achieve'] = $icon; - if ($additional_parameters['anon_mail'] === 'hide') { + if ($viewcontrol_data['anon_mail'] === 'hide') { $record['email'] = '-'; } @@ -182,8 +183,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->getRecords()); } diff --git a/components/ILIAS/UI/src/examples/Table/Data/repo_implementation.php b/components/ILIAS/UI/src/examples/Table/Data/repo_implementation.php index 865a23a82d3f..9271337281d1 100755 --- a/components/ILIAS/UI/src/examples/Table/Data/repo_implementation.php +++ b/components/ILIAS/UI/src/examples/Table/Data/repo_implementation.php @@ -68,8 +68,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $icons = [ $this->ui_factory->symbol()->icon()->custom('assets/images/standard/icon_checked.svg', '', 'small'), @@ -86,8 +87,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->dummyrecords()); } diff --git a/components/ILIAS/UI/src/examples/Table/Data/without_data.php b/components/ILIAS/UI/src/examples/Table/Data/without_data.php index 112b41267319..cf1ea59b8ce5 100755 --- a/components/ILIAS/UI/src/examples/Table/Data/without_data.php +++ b/components/ILIAS/UI/src/examples/Table/Data/without_data.php @@ -34,14 +34,18 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { yield from []; } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int - { + public function getTotalRowCount( + mixed $viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters + ): ?int { return 0; } }; diff --git a/components/ILIAS/UI/tests/Component/Table/DataRendererTest.php b/components/ILIAS/UI/tests/Component/Table/DataRendererTest.php index 8caf88f38489..37a09ec13ba9 100644 --- a/components/ILIAS/UI/tests/Component/Table/DataRendererTest.php +++ b/components/ILIAS/UI/tests/Component/Table/DataRendererTest.php @@ -242,14 +242,16 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { yield $row_builder->buldDataRow('', []); } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return null; } @@ -324,14 +326,16 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { yield $row_builder->buldDataRow('', []); } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return null; } @@ -405,14 +409,16 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { yield $row_builder->buldDataRow('', []); } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return null; } @@ -531,13 +537,14 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { yield from []; } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { return 0; } diff --git a/components/ILIAS/UI/tests/Component/Table/DataTest.php b/components/ILIAS/UI/tests/Component/Table/DataTest.php index 50a015f7e305..8268c422e3b2 100755 --- a/components/ILIAS/UI/tests/Component/Table/DataTest.php +++ b/components/ILIAS/UI/tests/Component/Table/DataTest.php @@ -54,14 +54,16 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { yield $row_builder->buildStandardRow('', []); } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return null; } diff --git a/components/ILIAS/UI/tests/Component/Table/DataViewControlsTest.php b/components/ILIAS/UI/tests/Component/Table/DataViewControlsTest.php index 08d58595caab..a1339127c693 100755 --- a/components/ILIAS/UI/tests/Component/Table/DataViewControlsTest.php +++ b/components/ILIAS/UI/tests/Component/Table/DataViewControlsTest.php @@ -46,14 +46,16 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { yield $row_builder->buildStandardRow('', []); } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return $this->total_count; } From 89998ab12bdfe628523a02ed019e6936cc39d6e9 Mon Sep 17 00:00:00 2001 From: Nils Haagen Date: Thu, 21 Nov 2024 11:27:47 +0100 Subject: [PATCH 3/4] (UI/DataTable): adjust DataRetrieval according to changed interface --- .../ILIAS/AccessControl/src/Log/Table.php | 10 +++--- .../classes/DataRetrieval.php | 10 +++--- .../Pages/AuthPageLanguagesOverviewTable.php | 10 +++--- .../class.ilBadgeImageTemplateTableGUI.php | 10 +++--- .../classes/class.ilBadgePersonalTableGUI.php | 10 +++--- .../Badge/classes/class.ilBadgeTableGUI.php | 10 +++--- .../classes/class.ilBadgeTypesTableGUI.php | 10 +++--- .../classes/class.ilBadgeUserTableGUI.php | 10 +++--- .../classes/class.ilObjectBadgeTableGUI.php | 10 +++--- .../Library/class.ilBiblLibraryTableGUI.php | 13 +++---- .../classes/Field/DataRetrieval.php | 10 +++--- .../classes/FieldFilter/DataRetrieval.php | 10 +++--- .../ConsultationHours/BookingTableGUI.php | 7 ++-- .../Overview/CertificateOverviewTable.php | 7 ++-- .../classes/Bans/BannedUsersTable.php | 10 +++--- .../ConditionTriggerTableGUI.php | 7 ++-- .../MailingLists/MailingListsMembersTable.php | 10 +++--- .../MailingLists/MailingListsTable.php | 10 +++--- .../MemberSearch/MailMemberSearchTable.php | 10 +++--- .../classes/DataRetrieval/Language.php | 4 +-- ...cticTemplateSettingsTableDataRetrieval.php | 10 +++--- .../Table/DataRetrieval/Handler.php | 10 +++--- .../Forum/classes/Drafts/ForumDraftsTable.php | 7 ++-- .../Moderation/ForumModeratorsTable.php | 10 +++--- .../Statistics/ForumStatisticsTable.php | 7 ++-- .../UI/Footer/Entries/EntriesRepositoryDB.php | 2 +- .../UI/Footer/Groups/GroupsRepositoryDB.php | 2 +- .../Glossary/Table/DownloadListTable.php | 10 +++--- .../Table/class.GlossaryAutoLinkTable.php | 10 +++--- .../Table/class.GlossaryForeignTermTable.php | 12 ++++--- .../class.TermDefinitionBulkCreationTable.php | 10 +++--- .../Glossary/Table/class.TermListTable.php | 10 +++--- .../Glossary/Table/class.TermUsagesTable.php | 10 +++--- .../classes/class.ilLanguageFolderTable.php | 7 ++-- .../class.ilLanguageStatisticsTable.php | 9 ++--- .../LearningModule/Editing/TableRetrieval.php | 10 +++--- .../Attachments/MailAttachmentTableGUI.php | 7 ++-- .../Mail/classes/Folder/MailFolderTableUI.php | 7 ++-- .../class.ilMediaCastManageTableGUI.php | 10 +++--- .../Settings/Vocabularies/DataRetrieval.php | 7 ++-- ...ss.ilOrgUnitUserAssignmentDBRepository.php | 16 +++++---- .../class.ilOrgUnitPositionDBRepository.php | 12 ++++--- .../classes/Types/class.ilOrgUnitTypeGUI.php | 34 ++++++++++--------- .../Collections/View/RequestToDataTable.php | 7 ++-- .../Container/View/RequestToDataTable.php | 7 ++-- .../Saml/classes/class.ilSamlIdpTableGUI.php | 7 ++-- .../classes/class.AssignMaterialsTable.php | 10 +++--- .../classes/class.AssignedObjectsTable.php | 10 +++--- .../classes/class.LevelResourcesTable.php | 10 +++--- .../Table/classes/class.ProfileTable.php | 10 +++--- .../class.ProfileUserAssignmentTable.php | 10 +++--- .../Skill/Table/classes/class.TreeTable.php | 10 +++--- ...class.ilStudyProgrammeTypeDBRepository.php | 26 +++++++------- .../Test/classes/class.ilTestArchiver.php | 10 +++--- .../ILIAS/Test/src/Logging/LogTable.php | 10 +++--- .../src/Participants/ParticipantTable.php | 7 ++-- .../Presentation/QuestionsBrowserTable.php | 7 ++-- .../Presentation/QuestionsOfAttemptTable.php | 7 ++-- ...andomQuestionSetNonAvailablePoolsTable.php | 12 ++++--- .../src/Results/Toplist/DataRetrieval.php | 7 ++-- .../Manual/ScoringByQuestionTableBinder.php | 10 +++--- .../src/Scoring/Marks/MarkSchemaTable.php | 10 +++--- .../src/Presentation/QuestionTable.php | 10 +++--- .../ILIAS/UI/src/examples/Table/Data/base.php | 4 +-- 64 files changed, 361 insertions(+), 257 deletions(-) diff --git a/components/ILIAS/AccessControl/src/Log/Table.php b/components/ILIAS/AccessControl/src/Log/Table.php index 3ada3b10bd29..8863bf148073 100644 --- a/components/ILIAS/AccessControl/src/Log/Table.php +++ b/components/ILIAS/AccessControl/src/Log/Table.php @@ -140,8 +140,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $log_data = $this->rbac_log->getLogItems( $this->getRefId(), @@ -167,8 +168,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return $this->rbac_log->getLogItemsCount($this->getRefId(), $filter_data); } diff --git a/components/ILIAS/AdministrativeNotification/classes/DataRetrieval.php b/components/ILIAS/AdministrativeNotification/classes/DataRetrieval.php index d051d4a2a7eb..6ee19beca23b 100755 --- a/components/ILIAS/AdministrativeNotification/classes/DataRetrieval.php +++ b/components/ILIAS/AdministrativeNotification/classes/DataRetrieval.php @@ -44,8 +44,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($order); foreach ($records as $idx => $record) { @@ -86,8 +87,9 @@ protected function getRecords(Order $order): array } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count(ilADNNotification::getArray()); } diff --git a/components/ILIAS/Authentication/classes/Pages/AuthPageLanguagesOverviewTable.php b/components/ILIAS/Authentication/classes/Pages/AuthPageLanguagesOverviewTable.php index 16acae458179..bd2d77d619df 100644 --- a/components/ILIAS/Authentication/classes/Pages/AuthPageLanguagesOverviewTable.php +++ b/components/ILIAS/Authentication/classes/Pages/AuthPageLanguagesOverviewTable.php @@ -172,8 +172,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range, $order); @@ -185,8 +186,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { $this->initRecords(); diff --git a/components/ILIAS/Badge/classes/class.ilBadgeImageTemplateTableGUI.php b/components/ILIAS/Badge/classes/class.ilBadgeImageTemplateTableGUI.php index 732f4da9803c..a1cb348278df 100755 --- a/components/ILIAS/Badge/classes/class.ilBadgeImageTemplateTableGUI.php +++ b/components/ILIAS/Badge/classes/class.ilBadgeImageTemplateTableGUI.php @@ -119,8 +119,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { $records = $this->getRecords($range, $order); foreach ($records as $record) { @@ -130,8 +131,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return \count($this->getRecords()); } diff --git a/components/ILIAS/Badge/classes/class.ilBadgePersonalTableGUI.php b/components/ILIAS/Badge/classes/class.ilBadgePersonalTableGUI.php index b1634c32facd..1f5faf58e33d 100755 --- a/components/ILIAS/Badge/classes/class.ilBadgePersonalTableGUI.php +++ b/components/ILIAS/Badge/classes/class.ilBadgePersonalTableGUI.php @@ -92,8 +92,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { $records = $this->getRecords($range, $order); foreach ($records as $idx => $record) { @@ -103,8 +104,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->getRecords()); } diff --git a/components/ILIAS/Badge/classes/class.ilBadgeTableGUI.php b/components/ILIAS/Badge/classes/class.ilBadgeTableGUI.php index b4a6167e08cc..88f53abaaabe 100755 --- a/components/ILIAS/Badge/classes/class.ilBadgeTableGUI.php +++ b/components/ILIAS/Badge/classes/class.ilBadgeTableGUI.php @@ -190,8 +190,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { $records = $this->getRecords($range, $order); foreach ($records as $record) { @@ -201,8 +202,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return \count($this->getRecords()); } diff --git a/components/ILIAS/Badge/classes/class.ilBadgeTypesTableGUI.php b/components/ILIAS/Badge/classes/class.ilBadgeTypesTableGUI.php index 2c149e06c3b5..f34d7f420fbd 100755 --- a/components/ILIAS/Badge/classes/class.ilBadgeTypesTableGUI.php +++ b/components/ILIAS/Badge/classes/class.ilBadgeTypesTableGUI.php @@ -105,8 +105,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { $records = $this->getRecords($range, $order); foreach ($records as $record) { @@ -116,8 +117,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return \count($this->getRecords()); } diff --git a/components/ILIAS/Badge/classes/class.ilBadgeUserTableGUI.php b/components/ILIAS/Badge/classes/class.ilBadgeUserTableGUI.php index 0d3b924e8803..743195508897 100755 --- a/components/ILIAS/Badge/classes/class.ilBadgeUserTableGUI.php +++ b/components/ILIAS/Badge/classes/class.ilBadgeUserTableGUI.php @@ -194,8 +194,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { $records = $this->getRecords($range, $order); foreach ($records as $record) { @@ -210,8 +211,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return \count($this->getRecords()); } diff --git a/components/ILIAS/Badge/classes/class.ilObjectBadgeTableGUI.php b/components/ILIAS/Badge/classes/class.ilObjectBadgeTableGUI.php index 133e732f2644..f4fcab24a8fe 100755 --- a/components/ILIAS/Badge/classes/class.ilObjectBadgeTableGUI.php +++ b/components/ILIAS/Badge/classes/class.ilObjectBadgeTableGUI.php @@ -126,8 +126,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { $records = $this->getRecords($range, $order); foreach ($records as $record) { @@ -137,8 +138,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return \count($this->getRecords()); } diff --git a/components/ILIAS/Bibliographic/classes/Admin/Library/class.ilBiblLibraryTableGUI.php b/components/ILIAS/Bibliographic/classes/Admin/Library/class.ilBiblLibraryTableGUI.php index e8ca7ad9b82c..7b962925d1ac 100755 --- a/components/ILIAS/Bibliographic/classes/Admin/Library/class.ilBiblLibraryTableGUI.php +++ b/components/ILIAS/Bibliographic/classes/Admin/Library/class.ilBiblLibraryTableGUI.php @@ -4,12 +4,12 @@ use ILIAS\UI\Component\Table\DataRowBuilder; use ILIAS\Data\Range; use ILIAS\Data\Order; -use Psr\Http\Message\ServerRequestInterface AS HttpRequest; +use Psr\Http\Message\ServerRequestInterface as HttpRequest; use ILIAS\UI\Factory as UIFactory; -use ILIAS\UI\Renderer AS UIRenderer; +use ILIAS\UI\Renderer as UIRenderer; use ILIAS\Data\Factory as DataFactory; use ILIAS\UI\URLBuilder; -use ILIAS\UI\Component\Table\Data AS DataTable; +use ILIAS\UI\Component\Table\Data as DataTable; use ILIAS\UI\URLBuilderToken; /** @@ -156,8 +156,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { $records = $this->getRecords($range, $order); foreach ($records as $record) { @@ -167,7 +168,7 @@ public function getRows( } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { return count($this->getRecords()); } diff --git a/components/ILIAS/Bibliographic/classes/Field/DataRetrieval.php b/components/ILIAS/Bibliographic/classes/Field/DataRetrieval.php index 97cfd766262f..e5ab6a62079d 100755 --- a/components/ILIAS/Bibliographic/classes/Field/DataRetrieval.php +++ b/components/ILIAS/Bibliographic/classes/Field/DataRetrieval.php @@ -42,8 +42,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($order); foreach ($records as $idx => $record) { @@ -67,8 +68,9 @@ protected function getRecords(Order $order): array } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->facade->fieldFactory()->getAvailableFieldsForObjId($this->facade->iliasObjId())); } diff --git a/components/ILIAS/Bibliographic/classes/FieldFilter/DataRetrieval.php b/components/ILIAS/Bibliographic/classes/FieldFilter/DataRetrieval.php index 2dec9f65cf2e..a1e18a498d2e 100755 --- a/components/ILIAS/Bibliographic/classes/FieldFilter/DataRetrieval.php +++ b/components/ILIAS/Bibliographic/classes/FieldFilter/DataRetrieval.php @@ -43,8 +43,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($order); foreach ($records as $idx => $record) { @@ -70,8 +71,9 @@ protected function getRecords(Order $order): array } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->facade->filterFactory()->getAllForObjectId($this->facade->iliasObjId())); } diff --git a/components/ILIAS/Calendar/classes/ConsultationHours/BookingTableGUI.php b/components/ILIAS/Calendar/classes/ConsultationHours/BookingTableGUI.php index adfe4ca5fe56..2efc7631231f 100644 --- a/components/ILIAS/Calendar/classes/ConsultationHours/BookingTableGUI.php +++ b/components/ILIAS/Calendar/classes/ConsultationHours/BookingTableGUI.php @@ -78,8 +78,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { $records = $this->provider->limitData($range, $order); foreach ($records as $row) { @@ -95,7 +96,7 @@ public function getRows( } } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { return count($this->provider->getData()); } diff --git a/components/ILIAS/Certificate/classes/Overview/CertificateOverviewTable.php b/components/ILIAS/Certificate/classes/Overview/CertificateOverviewTable.php index 7c9da50fda7f..3092808fd4c5 100644 --- a/components/ILIAS/Certificate/classes/Overview/CertificateOverviewTable.php +++ b/components/ILIAS/Certificate/classes/Overview/CertificateOverviewTable.php @@ -97,8 +97,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { /** * @var array{certificate_id: null|string, issue_date: null|DateTime, object: null|string, owner: null|string} $filter_data @@ -130,7 +131,7 @@ public function getRows( } } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { /** * @var array{certificate_id: null|string, issue_date: null|DateTime, object: null|string, owner: null|string} $filter_data diff --git a/components/ILIAS/Chatroom/classes/Bans/BannedUsersTable.php b/components/ILIAS/Chatroom/classes/Bans/BannedUsersTable.php index 8d6d4272e669..9ab82e937f12 100644 --- a/components/ILIAS/Chatroom/classes/Bans/BannedUsersTable.php +++ b/components/ILIAS/Chatroom/classes/Bans/BannedUsersTable.php @@ -157,8 +157,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range, $order); @@ -169,8 +170,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { $this->initRecords(); diff --git a/components/ILIAS/Conditions/classes/Configuration/ConditionTriggerTableGUI.php b/components/ILIAS/Conditions/classes/Configuration/ConditionTriggerTableGUI.php index cf76a3976a9b..2db138b06e4a 100644 --- a/components/ILIAS/Conditions/classes/Configuration/ConditionTriggerTableGUI.php +++ b/components/ILIAS/Conditions/classes/Configuration/ConditionTriggerTableGUI.php @@ -78,8 +78,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { $records = $this->provider->limitData($range, $order); foreach ($records as $row) { @@ -88,7 +89,7 @@ public function getRows( } } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { return count($this->provider->getData()); } diff --git a/components/ILIAS/Contact/classes/MailingLists/MailingListsMembersTable.php b/components/ILIAS/Contact/classes/MailingLists/MailingListsMembersTable.php index dd6d4adbbd95..fc2c6252bb3f 100644 --- a/components/ILIAS/Contact/classes/MailingLists/MailingListsMembersTable.php +++ b/components/ILIAS/Contact/classes/MailingLists/MailingListsMembersTable.php @@ -142,8 +142,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range, $order); @@ -154,8 +155,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { $this->initRecords(); diff --git a/components/ILIAS/Contact/classes/MailingLists/MailingListsTable.php b/components/ILIAS/Contact/classes/MailingLists/MailingListsTable.php index 6e00678f27da..15e016aec355 100644 --- a/components/ILIAS/Contact/classes/MailingLists/MailingListsTable.php +++ b/components/ILIAS/Contact/classes/MailingLists/MailingListsTable.php @@ -182,8 +182,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range, $order); @@ -194,8 +195,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { $this->initRecords(); diff --git a/components/ILIAS/Contact/classes/MemberSearch/MailMemberSearchTable.php b/components/ILIAS/Contact/classes/MemberSearch/MailMemberSearchTable.php index 92bc08804392..28cf3f71bda8 100644 --- a/components/ILIAS/Contact/classes/MemberSearch/MailMemberSearchTable.php +++ b/components/ILIAS/Contact/classes/MemberSearch/MailMemberSearchTable.php @@ -147,8 +147,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range, $order); @@ -159,8 +160,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { $this->initRecords(); diff --git a/components/ILIAS/Dashboard/classes/DataRetrieval/Language.php b/components/ILIAS/Dashboard/classes/DataRetrieval/Language.php index 68052011ef69..2b9c05f52208 100644 --- a/components/ILIAS/Dashboard/classes/DataRetrieval/Language.php +++ b/components/ILIAS/Dashboard/classes/DataRetrieval/Language.php @@ -37,7 +37,7 @@ public function __construct() global $DIC; $this->lng = $DIC->language(); } - public function getRows(DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, ?array $filter_data, ?array $additional_parameters): Generator + public function getRows(DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): Generator { foreach ($this->lng->getInstalledLanguages() as $key) { $title = $this->lng->txt('meta_l_' . $key); @@ -51,7 +51,7 @@ public function getRows(DataRowBuilder $row_builder, array $visible_column_ids, } } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { return count($this->lng->getInstalledLanguages()); } diff --git a/components/ILIAS/DidacticTemplate/classes/Setting/class.ilDidacticTemplateSettingsTableDataRetrieval.php b/components/ILIAS/DidacticTemplate/classes/Setting/class.ilDidacticTemplateSettingsTableDataRetrieval.php index 8a6280cefca2..4d8055fe8bcb 100755 --- a/components/ILIAS/DidacticTemplate/classes/Setting/class.ilDidacticTemplateSettingsTableDataRetrieval.php +++ b/components/ILIAS/DidacticTemplate/classes/Setting/class.ilDidacticTemplateSettingsTableDataRetrieval.php @@ -58,8 +58,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { $records = $this->getRecords($order, $range); foreach ($records as $record) { @@ -72,8 +73,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->getTemplates()); } diff --git a/components/ILIAS/Export/classes/ExportHandler/Table/DataRetrieval/Handler.php b/components/ILIAS/Export/classes/ExportHandler/Table/DataRetrieval/Handler.php index c0fe41be8d08..4c061098a34e 100644 --- a/components/ILIAS/Export/classes/ExportHandler/Table/DataRetrieval/Handler.php +++ b/components/ILIAS/Export/classes/ExportHandler/Table/DataRetrieval/Handler.php @@ -79,8 +79,9 @@ public function getRows( array $visible_column_ids, ilDataRange $range, ilDataOrder $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { [$column_name, $direction] = $order->join([], fn($ret, $key, $value) => [$key, $value]); $icons = [ @@ -153,8 +154,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { $context = $this->export_handler->consumer()->context()->handler($this->export_gui, $this->export_object); $count = 0; diff --git a/components/ILIAS/Forum/classes/Drafts/ForumDraftsTable.php b/components/ILIAS/Forum/classes/Drafts/ForumDraftsTable.php index 2a17815c5456..ab4e81509884 100644 --- a/components/ILIAS/Forum/classes/Drafts/ForumDraftsTable.php +++ b/components/ILIAS/Forum/classes/Drafts/ForumDraftsTable.php @@ -62,8 +62,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters, + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters, ): Generator { $records = $this->getRecords($range, $order); foreach ($records as $record) { @@ -144,7 +145,7 @@ public function getComponent(): DataTable ); } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { $this->initRecords(); diff --git a/components/ILIAS/Forum/classes/Moderation/ForumModeratorsTable.php b/components/ILIAS/Forum/classes/Moderation/ForumModeratorsTable.php index 8df6d0323924..dba324803548 100644 --- a/components/ILIAS/Forum/classes/Moderation/ForumModeratorsTable.php +++ b/components/ILIAS/Forum/classes/Moderation/ForumModeratorsTable.php @@ -152,8 +152,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range, $order); @@ -164,8 +165,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { $this->initRecords(); diff --git a/components/ILIAS/Forum/classes/Statistics/ForumStatisticsTable.php b/components/ILIAS/Forum/classes/Statistics/ForumStatisticsTable.php index 0fb6d545f4d4..d05eb1a51b53 100644 --- a/components/ILIAS/Forum/classes/Statistics/ForumStatisticsTable.php +++ b/components/ILIAS/Forum/classes/Statistics/ForumStatisticsTable.php @@ -185,8 +185,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters, + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters, ): \Generator { $records = $this->getRecords($range, $order); foreach ($records as $record) { @@ -195,7 +196,7 @@ public function getRows( } } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { $this->initRecords(); diff --git a/components/ILIAS/GlobalScreen_/classes/UI/Footer/Entries/EntriesRepositoryDB.php b/components/ILIAS/GlobalScreen_/classes/UI/Footer/Entries/EntriesRepositoryDB.php index 9c9ed221a4af..82e0c3aa3389 100644 --- a/components/ILIAS/GlobalScreen_/classes/UI/Footer/Entries/EntriesRepositoryDB.php +++ b/components/ILIAS/GlobalScreen_/classes/UI/Footer/Entries/EntriesRepositoryDB.php @@ -221,7 +221,7 @@ public function updatePositionById(string $id, int $position): void ); } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { return null; } diff --git a/components/ILIAS/GlobalScreen_/classes/UI/Footer/Groups/GroupsRepositoryDB.php b/components/ILIAS/GlobalScreen_/classes/UI/Footer/Groups/GroupsRepositoryDB.php index 841bce63459b..7aff60614fec 100644 --- a/components/ILIAS/GlobalScreen_/classes/UI/Footer/Groups/GroupsRepositoryDB.php +++ b/components/ILIAS/GlobalScreen_/classes/UI/Footer/Groups/GroupsRepositoryDB.php @@ -217,7 +217,7 @@ public function updatePositionById(string $id, int $position): void ); } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { return null; } diff --git a/components/ILIAS/Glossary/Table/DownloadListTable.php b/components/ILIAS/Glossary/Table/DownloadListTable.php index 1b8b8caf635c..b3504a8830e9 100644 --- a/components/ILIAS/Glossary/Table/DownloadListTable.php +++ b/components/ILIAS/Glossary/Table/DownloadListTable.php @@ -134,8 +134,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range); foreach ($records as $idx => $record) { @@ -146,8 +147,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->getRecords()); } diff --git a/components/ILIAS/Glossary/Table/class.GlossaryAutoLinkTable.php b/components/ILIAS/Glossary/Table/class.GlossaryAutoLinkTable.php index 41644a15fc18..c052596f05c0 100644 --- a/components/ILIAS/Glossary/Table/class.GlossaryAutoLinkTable.php +++ b/components/ILIAS/Glossary/Table/class.GlossaryAutoLinkTable.php @@ -148,8 +148,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range, $order); foreach ($records as $idx => $record) { @@ -160,8 +161,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->getRecords()); } diff --git a/components/ILIAS/Glossary/Table/class.GlossaryForeignTermTable.php b/components/ILIAS/Glossary/Table/class.GlossaryForeignTermTable.php index f730fc7e1926..c9ee6900783c 100644 --- a/components/ILIAS/Glossary/Table/class.GlossaryForeignTermTable.php +++ b/components/ILIAS/Glossary/Table/class.GlossaryForeignTermTable.php @@ -59,7 +59,7 @@ public function getComponent(): UI\Component\Table\Data $table = $this->ui_fac->table() ->data( - $this->foreign_glossary->getTitle() . ": " .$this->lng->txt("glo_select_terms"), + $this->foreign_glossary->getTitle() . ": " . $this->lng->txt("glo_select_terms"), $columns, $data_retrieval ) @@ -143,8 +143,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range); foreach ($records as $idx => $record) { @@ -155,8 +156,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->getRecords()); } diff --git a/components/ILIAS/Glossary/Table/class.TermDefinitionBulkCreationTable.php b/components/ILIAS/Glossary/Table/class.TermDefinitionBulkCreationTable.php index ca4031728282..cc5b143e8c1f 100644 --- a/components/ILIAS/Glossary/Table/class.TermDefinitionBulkCreationTable.php +++ b/components/ILIAS/Glossary/Table/class.TermDefinitionBulkCreationTable.php @@ -100,8 +100,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range); foreach ($records as $idx => $record) { @@ -112,8 +113,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->getRecords()); } diff --git a/components/ILIAS/Glossary/Table/class.TermListTable.php b/components/ILIAS/Glossary/Table/class.TermListTable.php index 02bcd3d9f7c8..12bf5885eda0 100644 --- a/components/ILIAS/Glossary/Table/class.TermListTable.php +++ b/components/ILIAS/Glossary/Table/class.TermListTable.php @@ -355,8 +355,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range, $order, $filter_data); foreach ($records as $idx => $record) { @@ -376,8 +377,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->getRecords()); } diff --git a/components/ILIAS/Glossary/Table/class.TermUsagesTable.php b/components/ILIAS/Glossary/Table/class.TermUsagesTable.php index 797e685f7636..1ede3f545abd 100644 --- a/components/ILIAS/Glossary/Table/class.TermUsagesTable.php +++ b/components/ILIAS/Glossary/Table/class.TermUsagesTable.php @@ -107,8 +107,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range, $order); foreach ($records as $idx => $record) { @@ -119,8 +120,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->getRecords()); } diff --git a/components/ILIAS/Language/classes/class.ilLanguageFolderTable.php b/components/ILIAS/Language/classes/class.ilLanguageFolderTable.php index fd9209708b75..fcb539015d26 100644 --- a/components/ILIAS/Language/classes/class.ilLanguageFolderTable.php +++ b/components/ILIAS/Language/classes/class.ilLanguageFolderTable.php @@ -141,8 +141,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { foreach ($this->getItems($range, $order) as $idx => $record) { $obj_id = (string) $record['obj_id']; @@ -189,7 +190,7 @@ protected function getURIWithTargetClass(string $target_gui, string $command): U ); } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { return 1; } diff --git a/components/ILIAS/Language/classes/class.ilLanguageStatisticsTable.php b/components/ILIAS/Language/classes/class.ilLanguageStatisticsTable.php index 25a0139d629e..55f5f0da91a0 100644 --- a/components/ILIAS/Language/classes/class.ilLanguageStatisticsTable.php +++ b/components/ILIAS/Language/classes/class.ilLanguageStatisticsTable.php @@ -82,7 +82,7 @@ public function getItems(Range $range = null, Order $order = null): array $total["unchanged"] = $total["unchanged"]; array_unshift($data, $total); - if($order) { + if ($order) { list($order_field, $order_direction) = $order->join([], fn($ret, $key, $value) => [$key, $value]); usort( $data, @@ -128,8 +128,9 @@ public function getRows( array $visible_column_ids, \ILIAS\Data\Range $range, \ILIAS\Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { foreach ($this->getItems($range, $order) as $idx => $record) { $obj_id = (string) $idx; @@ -145,7 +146,7 @@ public function getRows( /** * @inheritDoc */ - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { return count($this->getItems()); } diff --git a/components/ILIAS/LearningModule/Editing/TableRetrieval.php b/components/ILIAS/LearningModule/Editing/TableRetrieval.php index d53ffa201a43..bf001e8b07ee 100644 --- a/components/ILIAS/LearningModule/Editing/TableRetrieval.php +++ b/components/ILIAS/LearningModule/Editing/TableRetrieval.php @@ -36,8 +36,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach ($this->retrieval->getData( $visible_column_ids, @@ -51,8 +52,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return $this->retrieval->count( $filter_data ?? [], diff --git a/components/ILIAS/Mail/classes/Attachments/MailAttachmentTableGUI.php b/components/ILIAS/Mail/classes/Attachments/MailAttachmentTableGUI.php index e238e75dc345..60c2bccb86c4 100644 --- a/components/ILIAS/Mail/classes/Attachments/MailAttachmentTableGUI.php +++ b/components/ILIAS/Mail/classes/Attachments/MailAttachmentTableGUI.php @@ -168,8 +168,9 @@ public function getRows( array $visible_column_ids, \ILIAS\Data\Range $range, \ILIAS\Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach ($this->getRecords($range, $order) as $item) { $record = [ @@ -185,7 +186,7 @@ public function getRows( } } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { return \count($this->records); } diff --git a/components/ILIAS/Mail/classes/Folder/MailFolderTableUI.php b/components/ILIAS/Mail/classes/Folder/MailFolderTableUI.php index a5cb1e22ff6e..084908240268 100644 --- a/components/ILIAS/Mail/classes/Folder/MailFolderTableUI.php +++ b/components/ILIAS/Mail/classes/Folder/MailFolderTableUI.php @@ -263,8 +263,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, // not used, because data is filtered by MailDataSearch - ?array $additional_parameters // not used + mixed $additional_viewcontrol_data, + mixed $filter_data, // not used, because data is filtered by MailDataSearch + mixed $additional_parameters // not used ): \Generator { // mapping of table columns to allowed order columns of the mailbox query $order_columns = [ @@ -325,7 +326,7 @@ public function getRows( } } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { return $this->search->getCount(); } diff --git a/components/ILIAS/MediaCast/classes/class.ilMediaCastManageTableGUI.php b/components/ILIAS/MediaCast/classes/class.ilMediaCastManageTableGUI.php index bbdcf8d9b7a8..b28e024a5938 100755 --- a/components/ILIAS/MediaCast/classes/class.ilMediaCastManageTableGUI.php +++ b/components/ILIAS/MediaCast/classes/class.ilMediaCastManageTableGUI.php @@ -119,8 +119,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $cnt = 0; foreach ($this->mediacast->getSortedItemsArray() as $item) { @@ -173,8 +174,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->mediacast->getSortedItemsArray()); } diff --git a/components/ILIAS/MetaData/classes/Settings/Vocabularies/DataRetrieval.php b/components/ILIAS/MetaData/classes/Settings/Vocabularies/DataRetrieval.php index 2a19627df457..0247c38dc779 100644 --- a/components/ILIAS/MetaData/classes/Settings/Vocabularies/DataRetrieval.php +++ b/components/ILIAS/MetaData/classes/Settings/Vocabularies/DataRetrieval.php @@ -56,8 +56,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $checked_icon = $this->ui_factory->symbol()->icon()->custom( 'assets/images/standard/icon_checked.svg', @@ -112,7 +113,7 @@ public function getRows( }; } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { return count($this->getVocabs()); } diff --git a/components/ILIAS/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentDBRepository.php b/components/ILIAS/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentDBRepository.php index 1e345c9f30d5..174034cc2f99 100755 --- a/components/ILIAS/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentDBRepository.php +++ b/components/ILIAS/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentDBRepository.php @@ -425,21 +425,22 @@ protected function getUserDataByOrgUnitsAndPosition( ; $res = $this->db->query($query); - if($count_only) { + if ($count_only) { return $this->db->numRows($res); } $users = []; while ($rec = $this->db->fetchAssoc($res)) { - $rec['active'] = (bool)$rec['active']; + $rec['active'] = (bool) $rec['active']; $users[] = $rec; } return $users; } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { $orgu_ids = $additional_parameters['orgu_ids']; $position_id = $additional_parameters['position_id']; @@ -451,15 +452,16 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $orgu_ids = $additional_parameters['orgu_ids']; $position_id = $additional_parameters['position_id']; $lp_visible = $additional_parameters['lp_visible_ref_ids']; foreach ($this->getUserDataByOrgUnitsAndPosition($orgu_ids, $position_id, false, $range, $order) as $record) { - $row_id = implode('_', [(string)$position_id, (string)$record['usr_id']]); + $row_id = implode('_', [(string) $position_id, (string) $record['usr_id']]); yield $row_builder->buildDataRow($row_id, $record) ->withDisabledAction( 'show_learning_progress', diff --git a/components/ILIAS/OrgUnit/classes/Positions/class.ilOrgUnitPositionDBRepository.php b/components/ILIAS/OrgUnit/classes/Positions/class.ilOrgUnitPositionDBRepository.php index 578832d7f4e9..27887474ec73 100755 --- a/components/ILIAS/OrgUnit/classes/Positions/class.ilOrgUnitPositionDBRepository.php +++ b/components/ILIAS/OrgUnit/classes/Positions/class.ilOrgUnitPositionDBRepository.php @@ -321,8 +321,9 @@ public function getAuthority(?int $id): ilOrgUnitAuthority } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return $this->getAllPositionsCount(); } @@ -332,11 +333,12 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach ($this->getAllPositions($range, $order) as $pos) { - $row_id = (string)$pos->getId(); + $row_id = (string) $pos->getId(); $record = [ 'title' => $pos->getTitle(), 'description' => $pos->getDescription() . 'dd', diff --git a/components/ILIAS/OrgUnit/classes/Types/class.ilOrgUnitTypeGUI.php b/components/ILIAS/OrgUnit/classes/Types/class.ilOrgUnitTypeGUI.php index 20cf0446a8ef..5f07a1ba62ae 100755 --- a/components/ILIAS/OrgUnit/classes/Types/class.ilOrgUnitTypeGUI.php +++ b/components/ILIAS/OrgUnit/classes/Types/class.ilOrgUnitTypeGUI.php @@ -209,7 +209,7 @@ protected function getIconForm( $this->lng->txt('file_allowed_suffixes') . ' .svg' ); - if($current_identifier) { + if ($current_identifier) { $input = $input->withValue([$current_identifier]); } @@ -256,10 +256,10 @@ private function updateCustomIcons(): void $data = $form->getData(); - if(!is_null($data)) { + if (!is_null($data)) { $new_icon_id = current($data) ? current($data) : ''; $identifier = $type->getIconIdentifier(); - if($identifier && $new_icon_id == '') { + if ($identifier && $new_icon_id == '') { $type->removeIconFromIrss($identifier); } $type = $type->withIconIdentifier($new_icon_id); @@ -287,10 +287,10 @@ protected function getCurrentOrgUnitType(): ilOrgUnitType protected function getRowIdFromQuery(): int { - if($this->query->has($this->row_id_token->getName())) { + if ($this->query->has($this->row_id_token->getName())) { return $this->query->retrieve( $this->row_id_token->getName(), - $this->refinery->custom()->transformation(fn($v) => (int)array_shift($v)) + $this->refinery->custom()->transformation(fn($v) => (int) array_shift($v)) ); } return 0; @@ -338,10 +338,10 @@ function (?array $record_ids) use ($type, $selected_ids) { $record_ids_removed = array_diff($selected_ids, $record_ids); $record_ids_added = array_diff($record_ids, $selected_ids); foreach ($record_ids_added as $record_id) { - $type->assignAdvancedMDRecord((int)$record_id); + $type->assignAdvancedMDRecord((int) $record_id); } foreach ($record_ids_removed as $record_id) { - $type->deassignAdvancedMdRecord((int)$record_id); + $type->deassignAdvancedMdRecord((int) $record_id); } return true; } @@ -373,7 +373,7 @@ private function updateAMD(): void ) ->withRequest($this->request); - if($form->getData()) { + if ($form->getData()) { $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true); $this->ctrl->redirect($this); } else { @@ -445,8 +445,9 @@ public function __construct( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->data); } @@ -456,8 +457,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = array_map( fn($type) => [ @@ -481,7 +483,7 @@ public function getRows( $records = array_slice($records, $range->getStart(), $range->getLength()); } foreach ($records as $record) { - $row_id = (string)$record['id']; + $row_id = (string) $record['id']; yield $row_builder->buildDataRow($row_id, $record); } } @@ -499,7 +501,7 @@ protected function getEditForm(ilOrgUnitType $type): StandardForm { $title = $this->lng->txt('orgu_type_add'); $action = $this->getSingleTypeLinkTarget('update'); - if($type->getId()) { + if ($type->getId()) { $title = $this->lng->txt('orgu_type_edit'); } @@ -550,7 +552,7 @@ function ($v) use ($type) { //: ilOrgUnitType $type->setDescription($description, $lang_code); } return $type; - } catch(ilOrgUnitTypePluginException $e) { + } catch (ilOrgUnitTypePluginException $e) { return $e->getMessage(); } } @@ -579,7 +581,7 @@ private function update(): void ->withRequest($this->request); $type = $form->getData(); - if($type && $type instanceof ilOrgUnitType) { + if ($type && $type instanceof ilOrgUnitType) { $type->save(); $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true); $this->ctrl->redirect($this); diff --git a/components/ILIAS/ResourceStorage/classes/Collections/View/RequestToDataTable.php b/components/ILIAS/ResourceStorage/classes/Collections/View/RequestToDataTable.php index aae0215f99a7..228aa155e8ce 100755 --- a/components/ILIAS/ResourceStorage/classes/Collections/View/RequestToDataTable.php +++ b/components/ILIAS/ResourceStorage/classes/Collections/View/RequestToDataTable.php @@ -110,8 +110,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $this->initSortingAndOrdering($range, $order); @@ -169,7 +170,7 @@ private function initSortingAndOrdering(Range $range, Order $order): void } } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { return $this->data_provider->getTotal(); } diff --git a/components/ILIAS/ResourceStorage/classes/Container/View/RequestToDataTable.php b/components/ILIAS/ResourceStorage/classes/Container/View/RequestToDataTable.php index 7bc63de05817..33925eeac0dc 100755 --- a/components/ILIAS/ResourceStorage/classes/Container/View/RequestToDataTable.php +++ b/components/ILIAS/ResourceStorage/classes/Container/View/RequestToDataTable.php @@ -194,8 +194,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $this->initSortingAndOrdering($range, $order); @@ -296,7 +297,7 @@ private function initSortingAndOrdering(Range $range, Order $order): void } } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { return $this->data_provider->getTotal(); } diff --git a/components/ILIAS/Saml/classes/class.ilSamlIdpTableGUI.php b/components/ILIAS/Saml/classes/class.ilSamlIdpTableGUI.php index 6e77bd828e51..92c6235250f7 100755 --- a/components/ILIAS/Saml/classes/class.ilSamlIdpTableGUI.php +++ b/components/ILIAS/Saml/classes/class.ilSamlIdpTableGUI.php @@ -155,8 +155,9 @@ public function getRows( array $visible_column_ids, \ILIAS\Data\Range $range, \ILIAS\Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { foreach ($this->getRecords($range, $order) as $item) { $record = [ @@ -180,7 +181,7 @@ public function getRows( } } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { return count($this->idps); } diff --git a/components/ILIAS/Skill/Table/classes/class.AssignMaterialsTable.php b/components/ILIAS/Skill/Table/classes/class.AssignMaterialsTable.php index cc812c95c062..c51913cf6d61 100755 --- a/components/ILIAS/Skill/Table/classes/class.AssignMaterialsTable.php +++ b/components/ILIAS/Skill/Table/classes/class.AssignMaterialsTable.php @@ -197,8 +197,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range); foreach ($records as $idx => $record) { @@ -223,8 +224,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->getRecords()); } diff --git a/components/ILIAS/Skill/Table/classes/class.AssignedObjectsTable.php b/components/ILIAS/Skill/Table/classes/class.AssignedObjectsTable.php index 4d6c402c1b64..2a440de03c82 100755 --- a/components/ILIAS/Skill/Table/classes/class.AssignedObjectsTable.php +++ b/components/ILIAS/Skill/Table/classes/class.AssignedObjectsTable.php @@ -120,8 +120,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range, $order); foreach ($records as $idx => $record) { @@ -132,8 +133,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->getRecords()); } diff --git a/components/ILIAS/Skill/Table/classes/class.LevelResourcesTable.php b/components/ILIAS/Skill/Table/classes/class.LevelResourcesTable.php index 5207e9ed8f91..0bd3ac445093 100755 --- a/components/ILIAS/Skill/Table/classes/class.LevelResourcesTable.php +++ b/components/ILIAS/Skill/Table/classes/class.LevelResourcesTable.php @@ -281,8 +281,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range, $order); foreach ($records as $idx => $record) { @@ -299,8 +300,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->getRecords()); } diff --git a/components/ILIAS/Skill/Table/classes/class.ProfileTable.php b/components/ILIAS/Skill/Table/classes/class.ProfileTable.php index a6a7a866c42c..d288395abec3 100755 --- a/components/ILIAS/Skill/Table/classes/class.ProfileTable.php +++ b/components/ILIAS/Skill/Table/classes/class.ProfileTable.php @@ -215,8 +215,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range, $order); foreach ($records as $idx => $record) { @@ -227,8 +228,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->getRecords()); } diff --git a/components/ILIAS/Skill/Table/classes/class.ProfileUserAssignmentTable.php b/components/ILIAS/Skill/Table/classes/class.ProfileUserAssignmentTable.php index 45c75911b53e..2f1d888bff97 100755 --- a/components/ILIAS/Skill/Table/classes/class.ProfileUserAssignmentTable.php +++ b/components/ILIAS/Skill/Table/classes/class.ProfileUserAssignmentTable.php @@ -175,8 +175,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range, $order); foreach ($records as $idx => $record) { @@ -187,8 +188,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->getRecords()); } diff --git a/components/ILIAS/Skill/Table/classes/class.TreeTable.php b/components/ILIAS/Skill/Table/classes/class.TreeTable.php index a2f07f1fa0d6..2e15338d4d6a 100755 --- a/components/ILIAS/Skill/Table/classes/class.TreeTable.php +++ b/components/ILIAS/Skill/Table/classes/class.TreeTable.php @@ -147,8 +147,9 @@ public function getRows( array $visible_column_ids, Data\Range $range, Data\Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $records = $this->getRecords($range, $order); foreach ($records as $idx => $record) { @@ -159,8 +160,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->getRecords()); } diff --git a/components/ILIAS/StudyProgramme/classes/model/Types/class.ilStudyProgrammeTypeDBRepository.php b/components/ILIAS/StudyProgramme/classes/model/Types/class.ilStudyProgrammeTypeDBRepository.php index b031dcd6c2ff..91ff0d15438d 100755 --- a/components/ILIAS/StudyProgramme/classes/model/Types/class.ilStudyProgrammeTypeDBRepository.php +++ b/components/ILIAS/StudyProgramme/classes/model/Types/class.ilStudyProgrammeTypeDBRepository.php @@ -220,7 +220,7 @@ public function updateType(ilStudyProgrammeType $type): void } public function removeIconFromIrss(string $identifier): void { - if($rid = $this->irss->manage()->find($identifier)) { + if ($rid = $this->irss->manage()->find($identifier)) { $this->irss->manage()->remove($rid, new ilStudyProgrammeTypeStakeholder()); } } @@ -328,7 +328,7 @@ public function deleteType(ilStudyProgrammeType $type): void } - if($rid = $this->irss->manage()->find($type->getIconIdentifier())) { + if ($rid = $this->irss->manage()->find($type->getIconIdentifier())) { $this->irss->manage()->remove($rid, new ilStudyProgrammeTypeStakeholder()); } $this->deleteAllTranslationsByTypeId($type->getId()); @@ -404,7 +404,7 @@ public function getAllTypes( $return[] = $this->createTypeByRow($row); } - if($order) { + if ($order) { list($order_field, $order_direction) = $order->join([], fn($ret, $key, $value) => [$key, $value]); usort( $return, @@ -430,7 +430,7 @@ static function ($a, $b) use ($order_field) { $return = array_reverse($return); } } - if($range) { + if ($range) { $return = array_slice($return, $range->getStart(), $range->getLength()); } @@ -727,8 +727,9 @@ protected function getColums(): array } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return $this->getAllTypesRecordCount(); } @@ -738,19 +739,20 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach ($this->getAllTypes($range, $order) as $idx => $type) { $default_language = $type->getDefaultLang(); $icon = $this->ui_factory->symbol()->icon()->standard('prg', $this->lng->txt('prg_type'), 'small'); - if($type->getIconIdentifier() && $icon_path = $this->getIconPath($type)) { + if ($type->getIconIdentifier() && $icon_path = $this->getIconPath($type)) { $icon = $this->ui_factory->symbol()->icon()->custom($icon_path, ''); } yield $row_builder->buildDataRow( - (string)$type->getId(), + (string) $type->getId(), [ 'title' => $type->getTitle($default_language), 'description' => $type->getDescription($default_language), @@ -764,7 +766,7 @@ public function getRows( public function getIconPathFS(ilStudyProgrammeType $type): ?string { $icon_id = $this->irss->manage()->find($type->getIconIdentifier()); - if($icon_id) { + if ($icon_id) { return $this->irss->consume()->stream($icon_id)->getStream()->getMetadata('uri'); } return null; @@ -773,7 +775,7 @@ public function getIconPathFS(ilStudyProgrammeType $type): ?string public function getIconPath(ilStudyProgrammeType $type): ?string { $icon_id = $this->irss->manage()->find($type->getIconIdentifier()); - if($icon_id) { + if ($icon_id) { return $this->irss->consume()->src($icon_id)->getSrc(); } return null; diff --git a/components/ILIAS/Test/classes/class.ilTestArchiver.php b/components/ILIAS/Test/classes/class.ilTestArchiver.php index 7abbd2241ca0..6b29e3c530e6 100755 --- a/components/ILIAS/Test/classes/class.ilTestArchiver.php +++ b/components/ILIAS/Test/classes/class.ilTestArchiver.php @@ -677,8 +677,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $i = 1; foreach ($this->result_data as $result) { @@ -701,8 +702,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->result_data); } diff --git a/components/ILIAS/Test/src/Logging/LogTable.php b/components/ILIAS/Test/src/Logging/LogTable.php index 08b4c36a7967..e9f5b06cd74f 100644 --- a/components/ILIAS/Test/src/Logging/LogTable.php +++ b/components/ILIAS/Test/src/Logging/LogTable.php @@ -173,8 +173,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { list( $from_filter, @@ -217,8 +218,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { list( $from_filter, diff --git a/components/ILIAS/Test/src/Participants/ParticipantTable.php b/components/ILIAS/Test/src/Participants/ParticipantTable.php index 8686228f4695..469a87251682 100644 --- a/components/ILIAS/Test/src/Participants/ParticipantTable.php +++ b/components/ILIAS/Test/src/Participants/ParticipantTable.php @@ -79,7 +79,7 @@ public function getComponents(URLBuilder $url_builder, string $filter_url): arra ]; } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { return $this->repository->countParticipants($this->test_object->getTestId(), $filter_data); } @@ -89,8 +89,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $processing_time = $this->test_object->getProcessingTimeInSeconds(); $reset_time_on_new_attempt = $this->test_object->getResetProcessingTime(); diff --git a/components/ILIAS/Test/src/Questions/Presentation/QuestionsBrowserTable.php b/components/ILIAS/Test/src/Questions/Presentation/QuestionsBrowserTable.php index 011e76980878..8b1dd56ae201 100644 --- a/components/ILIAS/Test/src/Questions/Presentation/QuestionsBrowserTable.php +++ b/components/ILIAS/Test/src/Questions/Presentation/QuestionsBrowserTable.php @@ -156,8 +156,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach ($this->getViewControlledRecords($filter_data, $range, $order) as $record) { $question_id = $record['question_id']; @@ -174,7 +175,7 @@ public function getRows( } } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): int { return count($this->loadRecords($filter_data)); } diff --git a/components/ILIAS/Test/src/Questions/Presentation/QuestionsOfAttemptTable.php b/components/ILIAS/Test/src/Questions/Presentation/QuestionsOfAttemptTable.php index 3ef3a6852450..123ba758bc92 100644 --- a/components/ILIAS/Test/src/Questions/Presentation/QuestionsOfAttemptTable.php +++ b/components/ILIAS/Test/src/Questions/Presentation/QuestionsOfAttemptTable.php @@ -51,8 +51,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach ($this->getData($range, $order) as $question) { $title = $this->ui_factory->link()->standard($question['title'], $this->createShowQuestionLink($question['sequence'])); @@ -69,7 +70,7 @@ public function getRows( } } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { //ignore filter bc table is not filterable return count($this->data); diff --git a/components/ILIAS/Test/src/Questions/RandomQuestionSetNonAvailablePoolsTable.php b/components/ILIAS/Test/src/Questions/RandomQuestionSetNonAvailablePoolsTable.php index 54578b91d466..faee793c027c 100644 --- a/components/ILIAS/Test/src/Questions/RandomQuestionSetNonAvailablePoolsTable.php +++ b/components/ILIAS/Test/src/Questions/RandomQuestionSetNonAvailablePoolsTable.php @@ -52,8 +52,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): Generator { foreach ($this->getData($range, $order) as $record) { $derive = $record['status'] === \ilTestRandomQuestionSetNonAvailablePool::UNAVAILABILITY_STATUS_LOST; @@ -65,8 +66,11 @@ public function getRows( } } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int - { + public function getTotalRowCount( + mixed $viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters + ): ?int { return count($this->pool_definition_list->getNonAvailablePools()); } diff --git a/components/ILIAS/Test/src/Results/Toplist/DataRetrieval.php b/components/ILIAS/Test/src/Results/Toplist/DataRetrieval.php index ad3d70b848fb..9a6ce7dd37fe 100755 --- a/components/ILIAS/Test/src/Results/Toplist/DataRetrieval.php +++ b/components/ILIAS/Test/src/Results/Toplist/DataRetrieval.php @@ -85,8 +85,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach ($this->loadToplistData() as $i => $row) { $item = [ @@ -117,7 +118,7 @@ public function getRows( } } - public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int + public function getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters): ?int { // return 0 here to avoid pagination in the table. This is the same behavior as in Ilias 8/9 return 0; diff --git a/components/ILIAS/Test/src/Scoring/Manual/ScoringByQuestionTableBinder.php b/components/ILIAS/Test/src/Scoring/Manual/ScoringByQuestionTableBinder.php index 13344447c519..4f5058a7919f 100644 --- a/components/ILIAS/Test/src/Scoring/Manual/ScoringByQuestionTableBinder.php +++ b/components/ILIAS/Test/src/Scoring/Manual/ScoringByQuestionTableBinder.php @@ -52,8 +52,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { if ($this->participant_data === null) { $this->participant_data = $this->getFilteredData($this->question_id); @@ -69,8 +70,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { if ($this->participant_data === null) { $this->participant_data = $this->getFilteredData($this->question_id); diff --git a/components/ILIAS/Test/src/Scoring/Marks/MarkSchemaTable.php b/components/ILIAS/Test/src/Scoring/Marks/MarkSchemaTable.php index f1d16a89dd76..a9ee82fd5fd7 100644 --- a/components/ILIAS/Test/src/Scoring/Marks/MarkSchemaTable.php +++ b/components/ILIAS/Test/src/Scoring/Marks/MarkSchemaTable.php @@ -93,8 +93,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { foreach ($this->mark_schema->getMarkSteps() as $index => $mark) { yield $row_builder->buildDataRow( @@ -111,8 +112,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { return count($this->mark_schema->getMarkSteps()); } diff --git a/components/ILIAS/TestQuestionPool/src/Presentation/QuestionTable.php b/components/ILIAS/TestQuestionPool/src/Presentation/QuestionTable.php index 66a64d51713a..b844a4ec564f 100755 --- a/components/ILIAS/TestQuestionPool/src/Presentation/QuestionTable.php +++ b/components/ILIAS/TestQuestionPool/src/Presentation/QuestionTable.php @@ -241,8 +241,9 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): \Generator { $no_write_access = !($this->rbac->checkAccess('write', $this->request_ref_id)); foreach ($this->getData($order, $range) as $idx => $record) { @@ -276,8 +277,9 @@ public function getRows( } public function getTotalRowCount( - ?array $filter_data, - ?array $additional_parameters + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters ): ?int { $this->setParentObjId($this->parent_obj_id); $this->load(); diff --git a/components/ILIAS/UI/src/examples/Table/Data/base.php b/components/ILIAS/UI/src/examples/Table/Data/base.php index a541fb2a7398..0063bbb198c3 100755 --- a/components/ILIAS/UI/src/examples/Table/Data/base.php +++ b/components/ILIAS/UI/src/examples/Table/Data/base.php @@ -147,7 +147,7 @@ public function getRows( array $visible_column_ids, Range $range, Order $order, - mixed $viewcontrol_data, + mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters ): \Generator { @@ -172,7 +172,7 @@ public function getRows( } $record['achieve'] = $icon; - if ($viewcontrol_data['anon_mail'] === 'hide') { + if ($additional_viewcontrol_data['anon_mail'] === 'hide') { $record['email'] = '-'; } From 04e3733b47f835405bfdfcb8b6ca1a0082c366b9 Mon Sep 17 00:00:00 2001 From: Nils Haagen Date: Mon, 25 Nov 2024 14:02:57 +0100 Subject: [PATCH 4/4] UI/DataTable: with additional view control --- components/ILIAS/UI/src/Component/Table/Data.php | 9 +++++++++ .../ILIAS/UI/src/Implementation/Component/Table/Data.php | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/components/ILIAS/UI/src/Component/Table/Data.php b/components/ILIAS/UI/src/Component/Table/Data.php index 2fc04dd81e9c..3c6e90174806 100755 --- a/components/ILIAS/UI/src/Component/Table/Data.php +++ b/components/ILIAS/UI/src/Component/Table/Data.php @@ -21,6 +21,7 @@ namespace ILIAS\UI\Component\Table; use ILIAS\UI\Component\Input\ViewControl\ViewControl; +use ILIAS\UI\Component\Input\Container\ViewControl\ViewControlInput; use Psr\Http\Message\ServerRequestInterface; use ILIAS\Data\Order; use ILIAS\Data\Range; @@ -61,4 +62,12 @@ public function withAdditionalParameters(array $additional_parameters): self; * Set an Id to enable the storage and identify the distinct table. */ public function withId(string $id): static; + + /** + * Consumers may add additional view controls + */ + public function withAdditionalViewControl( + string $key, + ViewControlInput $view_control + ): self; } diff --git a/components/ILIAS/UI/src/Implementation/Component/Table/Data.php b/components/ILIAS/UI/src/Implementation/Component/Table/Data.php index f918b6581e2c..a381e3163a2c 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Table/Data.php +++ b/components/ILIAS/UI/src/Implementation/Component/Table/Data.php @@ -194,7 +194,7 @@ protected function getViewControls(?int $total_count = null): ViewControlContain public function withAdditionalViewControl( string $key, ViewControlContainer\ViewControlInput $view_control - ) { + ): self { $clone = clone $this; $clone->additional_view_controls[$key] = $view_control; return $clone;