2020-06-04 10:05:45 +02:00
|
|
|
<?php
|
|
|
|
echo $this->element('genericElements/IndexTable/index_table', [
|
|
|
|
'data' => [
|
|
|
|
'row_modifier' => function(App\Model\Entity\EncryptionKey $row): string {
|
|
|
|
return !empty($row['revoked']) ? 'text-light bg-secondary' : '';
|
|
|
|
},
|
|
|
|
'data' => $data,
|
|
|
|
'top_bar' => [
|
|
|
|
'children' => [
|
|
|
|
[
|
|
|
|
'type' => 'simple',
|
|
|
|
'children' => [
|
|
|
|
'data' => [
|
|
|
|
'type' => 'simple',
|
|
|
|
'text' => __('Add encryption key'),
|
|
|
|
'class' => 'btn btn-primary',
|
|
|
|
'popover_url' => '/encryptionKeys/add'
|
|
|
|
]
|
|
|
|
]
|
|
|
|
],
|
2021-01-11 16:28:07 +01:00
|
|
|
[
|
|
|
|
'type' => 'context_filters',
|
|
|
|
'context_filters' => $filteringContexts
|
|
|
|
],
|
2020-06-04 10:05:45 +02:00
|
|
|
[
|
|
|
|
'type' => 'search',
|
2021-11-10 15:31:09 +01:00
|
|
|
'button' => __('Search'),
|
2020-06-04 10:05:45 +02:00
|
|
|
'placeholder' => __('Enter value to search'),
|
|
|
|
'data' => '',
|
|
|
|
'searchKey' => 'value'
|
|
|
|
]
|
|
|
|
]
|
|
|
|
],
|
|
|
|
'fields' => [
|
|
|
|
[
|
|
|
|
'name' => '#',
|
|
|
|
'sort' => 'id',
|
|
|
|
'data_path' => 'id',
|
|
|
|
],
|
|
|
|
[
|
2020-11-06 10:25:22 +01:00
|
|
|
'name' => __('Type'),
|
|
|
|
'sort' => 'type',
|
|
|
|
'data_path' => 'type',
|
2020-06-04 10:05:45 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => __('Owner'),
|
|
|
|
'data_path' => 'owner_id',
|
2021-03-15 22:47:13 +01:00
|
|
|
'owner_model_path' => 'owner_model',
|
2020-06-04 10:05:45 +02:00
|
|
|
'element' => 'owner'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => __('Revoked'),
|
|
|
|
'sort' => 'revoked',
|
|
|
|
'data_path' => 'revoked',
|
|
|
|
'element' => 'boolean'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => __('Key'),
|
2020-11-06 10:25:22 +01:00
|
|
|
'data_path' => 'encryption_key'
|
2020-06-04 10:05:45 +02:00
|
|
|
],
|
|
|
|
],
|
|
|
|
'title' => __('Encryption key Index'),
|
|
|
|
'description' => __('A list encryption / signing keys that are bound to an individual or an organsiation.'),
|
|
|
|
'pull' => 'right',
|
|
|
|
'actions' => [
|
|
|
|
[
|
2021-01-11 16:28:07 +01:00
|
|
|
'url' => '/encryptionKeys/view',
|
|
|
|
'url_params_data_paths' => ['id'],
|
2020-06-04 10:05:45 +02:00
|
|
|
'icon' => 'eye'
|
|
|
|
],
|
2020-11-06 10:45:00 +01:00
|
|
|
[
|
2021-01-11 16:28:07 +01:00
|
|
|
'open_modal' => '/encryptionKeys/edit/[onclick_params_data_path]',
|
|
|
|
'modal_params_data_path' => 'id',
|
2020-11-06 10:45:00 +01:00
|
|
|
'icon' => 'edit'
|
|
|
|
],
|
2020-06-04 10:05:45 +02:00
|
|
|
[
|
2021-01-11 16:28:07 +01:00
|
|
|
'open_modal' => '/encryptionKeys/delete/[onclick_params_data_path]',
|
|
|
|
'modal_params_data_path' => 'id',
|
2020-06-04 10:05:45 +02:00
|
|
|
'icon' => 'trash'
|
2021-01-11 16:28:07 +01:00
|
|
|
],
|
2020-06-04 10:05:45 +02:00
|
|
|
]
|
|
|
|
]
|
|
|
|
]);
|