19declare(strict_types=1);
25use Psr\Http\Message\ServerRequestInterface;
35 private readonly ServerRequestInterface
$request;
48 $this->request =
$http->request();
49 $this->data_factory =
new Data\Factory();
67 return $this->ui_factory
71 $this->
lng->txt(
'mail_mailing_lists'),
75 ->withRange(
new Range(0, 50))
76 ->withId(str_replace(
'\\',
'', self::class))
77 ->withActions($actions)
78 ->withRequest($this->request);
87 'title' => $this->ui_factory
90 ->text($this->
lng->txt(
'title'))
91 ->withIsSortable(
true),
92 'description' => $this->ui_factory
95 ->text($this->
lng->txt(
'description'))
96 ->withIsSortable(
true),
97 'members' => $this->ui_factory
100 ->number($this->
lng->txt(
'members'))
101 ->withIsSortable(
true),
110 $query_params_namespace = [
'contact',
'mailinglist',
'list'];
112 $uri = $this->data_factory->uri(
113 ILIAS_HTTP_PATH .
'/' . $this->
ctrl->getLinkTargetByClass(
114 ilMailingListsGUI::class,
115 'handleMailingListActions'
119 $url_builder =
new UI\URLBuilder($uri);
122 $action_parameter_token_copy,
124 ] = $url_builder->acquireParameters(
125 $query_params_namespace,
131 'confirmDelete' => $this->ui_factory->table()->action()->standard(
132 $this->
lng->txt(
'delete'),
133 $url_builder->withParameter($action_parameter_token_copy,
'confirmDelete'),
136 'showForm' => $this->ui_factory->table()->action()->single(
137 $this->
lng->txt(
'edit'),
138 $url_builder->withParameter($action_parameter_token_copy,
'showForm'),
141 'showMembersList' => $this->ui_factory->table()->action()->single(
142 $this->
lng->txt(
'members'),
143 $url_builder->withParameter($action_parameter_token_copy,
'showMembersList'),
149 $actions[
'mailToList'] = $this->ui_factory->table()->action()->standard(
150 $this->
lng->txt(
'send_mail_to'),
151 $url_builder->withParameter($action_parameter_token_copy,
'mailToList'),
161 if ($this->records ===
null) {
164 $entries = $this->mailing_lists->getAll();
166 foreach ($entries as $entry) {
171 $this->records[
$counter][
'ml_id'] = $entry->getId();
172 $this->records[
$counter][
'title'] = $entry->getTitle() .
' [#il_ml_' . $entry->getId() .
']';
173 $this->records[
$counter][
'description'] = $entry->getDescription() ??
'';
174 $this->records[
$counter][
'members'] = \count($entry->getAssignedEntries());
183 array $visible_column_ids,
186 mixed $additional_viewcontrol_data,
188 mixed $additional_parameters
193 $row_id = (string) $record[
'ml_id'];
194 yield $row_builder->buildDataRow($row_id, $record);
199 mixed $additional_viewcontrol_data,
201 mixed $additional_parameters
203 $this->initRecords();
205 return \count($this->records);
213 $records = $this->records;
214 [$order_field, $order_direction] = $order->join([], fn($ret, $key, $value) => [$key, $value]);
219 strtolower($order_direction),
220 $order_field ===
'members'
229 $this->initRecords();
230 $records = $this->sortedRecords($order);
232 return $this->limitRecords($records,
$range);
Builds a Color from either hex- or rgb values.
Both the subject and the direction need to be specified when expressing an order.
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...
static stableSortArray(array $array, string $a_array_sortby, string $a_array_sortorder="asc", bool $a_numeric=false)
Sort an aray using a stable sort algorithm, which preveserves the sequence of array elements which ha...
final const int MODE_TEMPORARY
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...
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.