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,
94 ?array $additional_parameters
98 if ($this->has_write_access) {
99 $this->
ctrl->setParameter($this->parent_gui,
'ldap_server_id',
$server[
'server_id']);
100 $title = $this->ui_renderer->render(
101 $this->ui_factory->link()->standard(
103 $this->ctrl->getLinkTarget($this->parent_gui,
'editServerSettings')
113 'active' => (
bool)
$server[
'active'],
117 ->withDisabledAction(
121 ->withDisabledAction(
130 return \count($this->servers);
139 'active' => $this->ui_factory
143 $this->
lng->txt(
'status'),
144 $this->ui_factory->symbol()->icon()->custom(
145 'assets/images/standard/icon_ok.svg',
146 $this->lng->txt(
'active'),
149 $this->ui_factory->symbol()->icon()->custom(
150 'assets/images/standard/icon_not_ok.svg',
151 $this->lng->txt(
'inactive'),
155 ->withIsSortable(
true)
156 ->withOrderingLabels(
157 "{$this->lng->txt('status')}, {$this->lng->txt('active')} {$this->lng->txt('order_option_first')}",
158 "{$this->lng->txt('status')}, {$this->lng->txt('inactive')} {$this->lng->txt('order_option_first')}"
160 'name' => $this->ui_factory
163 ->text($this->
lng->txt(
'title'))
164 ->withIsSortable(
true),
165 'user' => $this->ui_factory
168 ->number($this->
lng->txt(
'user'))
169 ->withIsSortable(
true)
178 if (!$this->has_write_access) {
183 'editServerSettings' => $this->ui_factory->table()->action()->single(
184 $this->
lng->txt(
'edit'),
185 $this->url_builder->withParameter($this->action_parameter_token,
'editServerSettings'),
188 'activateServer' => $this->ui_factory->table()->action()->single(
189 $this->
lng->txt(
'activate'),
190 $this->url_builder->withParameter($this->action_parameter_token,
'activateServer'),
193 'deactivateServer' => $this->ui_factory->table()->action()->single(
194 $this->
lng->txt(
'deactivate'),
195 $this->url_builder->withParameter($this->action_parameter_token,
'deactivateServer'),
198 'confirmDeleteServerSettings' => $this->ui_factory->table()->action()->single(
199 $this->
lng->txt(
'delete'),
200 $this->url_builder->withParameter($this->action_parameter_token,
'confirmDeleteServerSettings'),
208 return $this->ui_factory
212 $this->
lng->txt(
'ldap_servers'),
213 $this->getColumnDefinition(),
215 ->withId(self::class)
217 ->withActions($this->getActions())
218 ->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.
getRows(\ILIAS\UI\Component\Table\DataRowBuilder $row_builder, array $visible_column_ids, \ILIAS\Data\Range $range, \ILIAS\Data\Order $order, ?array $filter_data, ?array $additional_parameters)
ILIAS UI URLBuilder $url_builder
ILIAS UI URLBuilderToken $action_parameter_token
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...
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)
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...
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.