19declare(strict_types=1);
28use Psr\Http\Message\ServerRequestInterface;
46 private readonly ServerRequestInterface $http_request,
48 private readonly UIFactory $ui_factory,
49 private readonly
int $server_id,
52 private readonly \
ILIAS\Data\URI $action_url
58 array $visible_column_ids,
62 ?array $additional_parameters,
66 yield $row_builder->buildDataRow((
string) $record[
'id'], $record);
72 if ($this->records ===
null) {
75 $mappings = $mapping_instance->getMappings();
76 foreach ($mappings as $item) {
77 $title = $this->object_data_cache->lookupTitle($this->rbac_review->getObjectOfRole((
int) $item[
'role']));
79 'id' => $item[
'mapping_id'],
81 'role' => $item[
'role_name'],
83 'url' => $item[
'url'],
84 'member_attribute' => $item[
'member_attribute'],
93 $query_params_namespace = [
'ldap',
'role',
'mapping'];
94 $url_builder =
new URLBuilder($this->action_url);
95 [$url_builder, $action_parameter_token, $row_id_token] = $url_builder->acquireParameters(
96 $query_params_namespace,
101 return $this->ui_factory->table()
104 $this->
lng->txt(
'mail_templates'),
107 ->withTitle($this->
lng->txt(
'ldap_role_group_assignments'))
108 ->withActions($this->getActions($url_builder, $action_parameter_token, $row_id_token))
110 'ldap_role_mapping_table'
112 ->withOrder(
new Order(
'title', Order::DESC))
113 ->withRequest($this->http_request);
118 $this->initRecords();
120 return count((array) $this->records);
136 $this->initRecords();
137 $records = $this->records;
140 $records = $this->orderRecords($records, $order);
144 $records = $this->limitRecords($records,
$range);
156 $actions[
'delete'] = $this->ui_factory->table()->action()->multi(
157 $this->
lng->txt(
'delete'),
158 $url_builder->
withParameter($action_parameter_token,
'confirmDeleteRoleMapping'),
162 $actions[
'copy'] = $this->ui_factory->table()->action()->single(
163 $this->
lng->txt(
'copy'),
164 $url_builder->
withParameter($action_parameter_token,
'addRoleMapping'),
168 $actions[
'edit'] = $this->ui_factory->table()->action()->single(
169 $this->
lng->txt(
'edit'),
170 $url_builder->
withParameter($action_parameter_token,
'editRoleMapping'),
224 [$order_field, $order_direction] = $order->
join(
226 fn($ret, $key, $value) => [$key, $value]
228 usort($records,
static fn(array $left, array $right):
int =>
ilStr::strCmp(
229 $left[$order_field] ??
'',
230 $right[$order_field] ??
''
233 if ($order_direction === Order::DESC) {
234 $records = array_reverse($records);
246 'title' => $this->ui_factory->table()->column()->text($this->
lng->txt(
'title')),
247 'role' => $this->ui_factory->table()->column()->text($this->
lng->txt(
'obj_role')),
248 'dn' => $this->ui_factory->table()->column()->text($this->
lng->txt(
'ldap_group_dn')),
249 'url' => $this->ui_factory->table()->column()->text($this->
lng->txt(
'ldap_server')),
250 'member_attribute' => $this->ui_factory->table()->column()->text($this->
lng->txt(
'ldap_group_member')),
251 'info' => $this->ui_factory->table()->column()->text($this->
lng->txt(
'ldap_info_text')),
Builds a Color from either hex- or rgb values.
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.
withParameter(URLBuilderToken $token, string|array $value)
Change an acquired parameter's value if the supplied token is valid.
orderRecords(array $records, Order $order)
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...
limitRecords(array $records, Range $range)
getRecords(Range $range, Order $order)
getActions(URLBuilder $url_builder, URLBuilderToken $action_parameter_token, URLBuilderToken $row_id_token)
__construct(private readonly ServerRequestInterface $http_request, private readonly ilLanguage $lng, private readonly UIFactory $ui_factory, private readonly int $server_id, private readonly ilObjectDataCache $object_data_cache, private readonly ilRbacReview $rbac_review, private readonly \ILIAS\Data\URI $action_url)
getRows(ILIAS\UI\Component\Table\DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, ?array $filter_data, ?array $additional_parameters,)
This is called by the table to retrieve rows; map data-records to rows using the $row_builder e....
static _getInstanceByServerId(int $a_server_id)
Get instance of class.
class ilRbacReview Contains Review functions of core Rbac.
static strCmp(string $a, string $b)
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
A Column describes the form of presentation for a certain aspect of data, i.e.
This describes a Data Table.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.