19declare(strict_types=1);
33 private array $servers,
39 private \Psr\Http\Message\ServerRequestInterface $http_request,
41 private bool $has_write_access
47 ] = (new \ILIAS\UI\URLBuilder($action_url))->acquireParameters(
59 $servers = $this->servers;
61 [$order_field, $order_direction] = $order->join([],
static function ($ret, $key, $value) {
62 return [$key, $value];
67 static function (array &
$server):
void {
75 strtolower($order_direction),
76 \in_array($order_field, [
'user',
'active'],
true)
79 if ($order_field ===
'active') {
80 $records = array_reverse($records);
90 array $visible_column_ids,
93 mixed $additional_viewcontrol_data,
95 mixed $additional_parameters
99 if ($this->has_write_access) {
100 $this->
ctrl->setParameter($this->parent_gui,
'ldap_server_id',
$server[
'server_id']);
101 $title = $this->ui_renderer->render(
102 $this->ui_factory->link()->standard(
104 $this->ctrl->getLinkTarget($this->parent_gui,
'editServerSettings')
114 'active' => (
bool)
$server[
'active'],
118 ->withDisabledAction(
122 ->withDisabledAction(
130 mixed $additional_viewcontrol_data,
132 mixed $additional_parameters
134 return \count($this->servers);
143 'active' => $this->ui_factory
147 $this->
lng->txt(
'status'),
148 $this->ui_factory->symbol()->icon()->custom(
149 'assets/images/standard/icon_ok.svg',
150 $this->lng->txt(
'active'),
153 $this->ui_factory->symbol()->icon()->custom(
154 'assets/images/standard/icon_not_ok.svg',
155 $this->lng->txt(
'inactive'),
159 ->withIsSortable(
true)
160 ->withOrderingLabels(
161 "{$this->lng->txt('status')}, {$this->lng->txt('active')} {$this->lng->txt('order_option_first')}",
162 "{$this->lng->txt('status')}, {$this->lng->txt('inactive')} {$this->lng->txt('order_option_first')}"
164 'name' => $this->ui_factory
167 ->text($this->
lng->txt(
'title'))
168 ->withIsSortable(
true),
169 'user' => $this->ui_factory
172 ->number($this->
lng->txt(
'user'))
173 ->withIsSortable(
true)
182 if (!$this->has_write_access) {
187 'editServerSettings' => $this->ui_factory->table()->action()->single(
188 $this->
lng->txt(
'edit'),
189 $this->url_builder->withParameter($this->action_parameter_token,
'editServerSettings'),
192 'activateServer' => $this->ui_factory->table()->action()->single(
193 $this->
lng->txt(
'activate'),
194 $this->url_builder->withParameter($this->action_parameter_token,
'activateServer'),
197 'deactivateServer' => $this->ui_factory->table()->action()->single(
198 $this->
lng->txt(
'deactivate'),
199 $this->url_builder->withParameter($this->action_parameter_token,
'deactivateServer'),
202 'confirmDeleteServerSettings' => $this->ui_factory->table()->action()->single(
203 $this->
lng->txt(
'delete'),
204 $this->url_builder->withParameter($this->action_parameter_token,
'confirmDeleteServerSettings'),
212 return $this->ui_factory
216 $this->
lng->txt(
'ldap_servers'),
217 $this->getColumnDefinition(),
219 ->withId(self::class)
221 ->withActions($this->getActions())
222 ->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
getRecords(\ILIAS\Data\Range $range, \ILIAS\Data\Order $order)
__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)
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.