47 $this->
access = $DIC->access();
48 $this->
ctrl = $DIC->ctrl();
50 $this->http_request = $DIC->http()->request();
51 $this->
lng = $DIC->language();
52 $this->ui_factory = $DIC->ui()->factory();
53 $this->ui_renderer = $DIC->ui()->renderer();
61 return $this->ui_renderer->render([$this->table]);
67 return $this->ui_factory->table()->data(
69 $this->
lng->txt(
'bibl_settings_libraries'),
76 new Order(
'bibl_library_name', Order::ASC)
77 )->withRequest($this->http_request);
84 'bibl_library_name' => $this->ui_factory->table()->column()->text($this->
lng->txt(
'bibl_library_name')),
85 'bibl_library_url' => $this->ui_factory->table()->column()->text($this->
lng->txt(
'bibl_library_url')),
86 'bibl_library_img' => $this->ui_factory->table()->column()->text($this->
lng->txt(
'bibl_library_img'))
91 private function getActions(): array
96 if ($this->
access->checkAccess(
'write',
'', $this->http_request->getQueryParams()[
'ref_id'])) {
97 $uri_edit = $this->data_factory->uri(
98 ILIAS_HTTP_PATH .
'/' . $this->
ctrl->getLinkTargetByClass(
99 ilBiblLibraryGUI::class,
108 [$url_builder_edit, $action_parameter_token_edit, $row_id_token_edit] = (
110 )->acquireParameters(
116 $uri_delete = $this->data_factory->uri(
117 ILIAS_HTTP_PATH .
'/' . $this->
ctrl->getLinkTargetByClass(
118 ilBiblLibraryGUI::class,
127 [$url_builder_delete, $action_parameter_token_delete, $row_id_token_delete] = (
129 )->acquireParameters(
136 'edit' => $this->ui_factory->table()->action()->single(
137 $this->
lng->txt(
'edit'),
138 $url_builder_edit->withParameter($action_parameter_token_edit,
'edit'),
141 'delete' => $this->ui_factory->table()->action()->standard(
142 $this->
lng->txt(
'delete'),
143 $url_builder_delete->withParameter($action_parameter_token_delete,
'delete'),
155 array $visible_column_ids,
159 ?array $additional_parameters
162 foreach ($records as $record) {
163 $row_id = (string) $record[
'bibl_library_id'];
178 $libraries = $this->facade->libraryFactory()->getAll();
179 foreach ($libraries as $library) {
181 "bibl_library_id" => $library->getId(),
182 "bibl_library_name" => $library->getName(),
183 "bibl_library_url" => $library->getUrl(),
184 "bibl_library_img" => $library->getImg(),
188 if ($order !==
null) {
189 [$order_field, $order_direction] = $order->join([], fn($ret, $key, $value): array => [$key, $value]);
190 usort($records,
static fn(
$a,
$b):
int =>
$a[$order_field] <=>
$b[$order_field]);
191 if ($order_direction ===
'DESC') {
192 $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)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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.