48 $this->
access = $DIC->access();
49 $this->
ctrl = $DIC->ctrl();
51 $this->http_request = $DIC->http()->request();
52 $this->
lng = $DIC->language();
53 $this->ui_factory = $DIC->ui()->factory();
54 $this->ui_renderer = $DIC->ui()->renderer();
62 return $this->ui_renderer->render([$this->table]);
68 return $this->ui_factory->table()->data(
69 $this->
lng->txt(
'bibl_settings_libraries'),
77 new Order(
'bibl_library_name', Order::ASC)
78 )->withRequest($this->http_request);
85 'bibl_library_name' => $this->ui_factory->table()->column()->text($this->
lng->txt(
'bibl_library_name')),
86 'bibl_library_url' => $this->ui_factory->table()->column()->text($this->
lng->txt(
'bibl_library_url')),
87 'bibl_library_img' => $this->ui_factory->table()->column()->text($this->
lng->txt(
'bibl_library_img'))
92 private function getActions(): array
97 if ($this->
access->checkAccess(
'write',
'', $this->http_request->getQueryParams()[
'ref_id'])) {
98 $uri_edit = $this->data_factory->uri(
99 ILIAS_HTTP_PATH .
'/' . $this->
ctrl->getLinkTargetByClass(
100 ilBiblLibraryGUI::class,
109 [$url_builder_edit, $action_parameter_token_edit, $row_id_token_edit] = (
111 )->acquireParameters(
117 $uri_delete = $this->data_factory->uri(
118 ILIAS_HTTP_PATH .
'/' . $this->
ctrl->getLinkTargetByClass(
119 ilBiblLibraryGUI::class,
128 [$url_builder_delete, $action_parameter_token_delete, $row_id_token_delete] = (
130 )->acquireParameters(
137 'edit' => $this->ui_factory->table()->action()->single(
138 $this->
lng->txt(
'edit'),
139 $url_builder_edit->withParameter($action_parameter_token_edit,
'edit'),
142 'delete' => $this->ui_factory->table()->action()->standard(
143 $this->
lng->txt(
'delete'),
144 $url_builder_delete->withParameter($action_parameter_token_delete,
'delete'),
156 array $visible_column_ids,
160 ?array $additional_parameters
163 foreach ($records as $record) {
164 $row_id = (string) $record[
'bibl_library_id'];
179 $libraries = $this->facade->libraryFactory()->getAll();
180 foreach ($libraries as $library) {
182 "bibl_library_id" => $library->getId(),
183 "bibl_library_name" => $library->getName(),
184 "bibl_library_url" => $library->getUrl(),
185 "bibl_library_img" => $library->getImg(),
190 [$order_field, $order_direction] = $order->join([], fn($ret, $key, $value) => [$key, $value]);
191 usort($records,
static fn(
$a,
$b) =>
$a[$order_field] <=>
$b[$order_field]);
192 if ($order_direction ===
'DESC') {
193 $records = array_reverse($records);
getRows(DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, ?array $filter_data, ?array $additional_parameters)
This is called by the table to retrieve rows; map data-records to rows using the $row_builder e...
if($err=$client->getError()) $namespace
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getRecords(Range $range=null, Order $order=null)
getTotalRowCount(?array $filter_data, ?array $additional_parameters)
Mainly for the purpose of pagination-support, it is important to know about the total number of recor...
Both the subject and the direction need to be specified when expressing an order. ...
buildDataRow(string $id, array $record)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
HttpRequest $http_request
DataFactory $data_factory
__construct(private readonly ilBiblAdminLibraryFacadeInterface $facade)
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
A simple class to express a naive range of whole positive numbers.