39 protected bool $has_write_access,
42 $this->
lng = $DIC[
'lng'];
46 I\DataRowBuilder $row_builder,
47 array $visible_column_ids,
50 mixed $additional_viewcontrol_data,
52 mixed $additional_parameters
55 foreach ($records as $record) {
56 $row_id = (string) $record[
'id'];
58 yield $row_builder->buildDataRow($row_id, $record)
71 array_walk($records,
function (array &$record):
void {
72 $record[
'languages'] = $this->getLanguagesTextForNotification($record);
73 $record[
'type'] = $this->
lng->txt(
"msg_type_" . $record[
'type']);
74 $record[
'event_start'] = $this->formatDate($record[
'event_start']);
75 $record[
'event_end'] = $this->formatDate($record[
'event_end']);
76 $record[
'display_start'] = $this->formatDate($record[
'display_start']);
77 $record[
'display_end'] = $this->formatDate($record[
'display_end']);
79 $record[
'type_during_event'] = $record[
'permanent'] ?
'' : $this->
lng->txt(
"msg_type_" . $record[
'type_during_event']);
83 [$order_field, $order_direction] = $order->
join([], fn($ret, $key, $value): array => [$key, $value]);
84 usort($records, fn(
$a,
$b):
int =>
$a[$order_field] <=>
$b[$order_field]);
85 if ($order_direction ===
'DESC') {
86 return array_reverse($records);
93 mixed $additional_viewcontrol_data,
95 mixed $additional_parameters
107 $has_language_limitation = $record[
'has_language_limitation'];
108 $limited_to_languages = $record[
'limited_to_languages'];
110 $languages_text = $this->
lng->txt(
"all");
111 if ($has_language_limitation) {
113 $languages_text = $this->
lng->txt(
"none");
114 if (!empty($limited_to_languages)) {
115 $this->
lng->loadLanguageModule(
"meta");
118 $languages_text = implode(
121 fn(
string $lng_code):
string => $this->
lng->txt(
"meta_l_" . $lng_code),
122 $limited_to_languages
127 return $languages_text;
foreach($mandatory_scripts as $file) $timestamp
static getArray(?string $key=null, string|array|null $values=null)
getRows(I\DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
getTotalRowCount(mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
Mainly for the purpose of pagination-support, it is important to know about the total number of recor...
getLanguagesTextForNotification(array $record)
__construct(protected bool $has_write_access,)
formatDate(DateTimeImmutable $timestamp)
Both the subject and the direction need to be specified when expressing an order.
join($init, callable $fn)
A simple class to express a naive range of whole positive numbers.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class for date presentation.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
return['delivery_method'=> 'php',]
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...
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples