19declare(strict_types=1);
35 private array $servers,
41 private \Psr\Http\Message\ServerRequestInterface $http_request,
43 private bool $has_write_access,
44 private bool $has_read_access
50 ] = (new \ILIAS\UI\URLBuilder($action_url))->acquireParameters(
62 $servers = $this->servers;
64 [$order_field, $order_direction] = $order->join([],
static function ($ret, $key, $value) {
65 return [$key, $value];
70 static function (array &
$server):
void {
78 strtolower($order_direction),
79 \in_array($order_field, [
'user',
'active'],
true)
82 if ($order_field ===
'active') {
83 $records = array_reverse($records);
93 array $visible_column_ids,
96 mixed $additional_viewcontrol_data,
98 mixed $additional_parameters
102 if ($this->has_read_access) {
103 $this->
ctrl->setParameter($this->parent_gui,
'ldap_server_id',
$server[
'server_id']);
104 $title = $this->ui_renderer->render(
105 $this->ui_factory->link()->standard(
107 $this->ctrl->getLinkTarget($this->parent_gui,
'editServerSettings')
117 'active' => (
bool)
$server[
'active'],
121 ->withDisabledAction(
125 ->withDisabledAction(
133 mixed $additional_viewcontrol_data,
135 mixed $additional_parameters
137 return \count($this->servers);
146 'active' => $this->ui_factory
150 $this->
lng->txt(
'status'),
151 $this->ui_factory->symbol()->icon()->custom(
152 'assets/images/standard/icon_ok.svg',
153 $this->lng->txt(
'active'),
156 $this->ui_factory->symbol()->icon()->custom(
157 'assets/images/standard/icon_not_ok.svg',
158 $this->lng->txt(
'inactive'),
162 ->withIsSortable(
true)
163 ->withOrderingLabels(
164 "{$this->lng->txt('status')}, {$this->lng->txt('active')} {$this->lng->txt('order_option_first')}",
165 "{$this->lng->txt('status')}, {$this->lng->txt('inactive')} {$this->lng->txt('order_option_first')}"
167 'name' => $this->ui_factory
170 ->text($this->
lng->txt(
'title'))
171 ->withIsSortable(
true),
172 'user' => $this->ui_factory
175 ->number($this->
lng->txt(
'user'))
176 ->withIsSortable(
true)
187 if ($this->has_read_access || $this->has_write_access) {
188 $actions[
'editServerSettings'] = $this->ui_factory->table()->action()->single(
189 $this->has_write_access ? $this->
lng->txt(
'edit') : $this->lng->txt(
'view'),
190 $this->url_builder->withParameter($this->action_parameter_token,
'editServerSettings'),
195 if ($this->has_write_access) {
196 $actions[
'activateServer'] = $this->ui_factory->table()->action()->single(
197 $this->
lng->txt(
'activate'),
198 $this->url_builder->withParameter($this->action_parameter_token,
'activateServer'),
202 $actions[
'deactivateServer'] = $this->ui_factory->table()->action()->single(
203 $this->
lng->txt(
'deactivate'),
204 $this->url_builder->withParameter($this->action_parameter_token,
'deactivateServer'),
208 $actions[
'confirmDeleteServerSettings'] = $this->ui_factory->table()->action()->single(
209 $this->
lng->txt(
'delete'),
210 $this->url_builder->withParameter($this->action_parameter_token,
'confirmDeleteServerSettings'),
220 return $this->ui_factory
224 $this->
lng->txt(
'ldap_servers'),
225 $this->getColumnDefinition(),
227 ->withId(str_replace(
'\\',
'', self::class))
229 ->withRange(
new Range(0, 100))
230 ->withActions($this->getActions())
231 ->withRequest($this->http_request);
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.
The scope of this class is split ilias-conform URI's into components.
ILIAS UI URLBuilder $url_builder
getRows(\ILIAS\UI\Component\Table\DataRowBuilder $row_builder, array $visible_column_ids, \ILIAS\Data\Range $range, \ILIAS\Data\Order $order, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
ILIAS UI URLBuilderToken $action_parameter_token
__construct(private array $servers, private \ilLDAPSettingsGUI $parent_gui, private \ILIAS\UI\Factory $ui_factory, private \ILIAS\UI\Renderer $ui_renderer, private \ilLanguage $lng, private \ilCtrlInterface $ctrl, private \Psr\Http\Message\ServerRequestInterface $http_request, private \ILIAS\Data\URI $action_url, private bool $has_write_access, private bool $has_read_access)
getRecords(\ILIAS\Data\Range $range, \ILIAS\Data\Order $order)
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...
ILIAS UI URLBuilderToken $row_id_token
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static _getExternalAccountsByAuthMode(string $a_auth_mode, bool $a_read_auth_default=false)
Get list of external account by authentication method Note: If login == ext_account for two user with...
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
An entity that renders components to a string output.
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.