2020-09-28 01:26:50 +02:00
|
|
|
<?php
|
|
|
|
echo $this->element('genericElements/IndexTable/index_table', [
|
|
|
|
'data' => [
|
|
|
|
'data' => $data,
|
|
|
|
'top_bar' => [
|
|
|
|
'children' => [
|
2020-12-07 16:06:01 +01:00
|
|
|
[
|
|
|
|
'type' => 'context_filters',
|
|
|
|
],
|
2020-09-28 01:26:50 +02:00
|
|
|
[
|
|
|
|
'type' => 'search',
|
|
|
|
'button' => __('Filter'),
|
|
|
|
'placeholder' => __('Enter value to search'),
|
|
|
|
'data' => '',
|
|
|
|
'searchKey' => 'value'
|
|
|
|
]
|
|
|
|
]
|
|
|
|
],
|
|
|
|
'fields' => [
|
|
|
|
[
|
|
|
|
'name' => '#',
|
|
|
|
'sort' => 'id',
|
|
|
|
'data_path' => 'id',
|
|
|
|
],
|
2020-11-20 11:09:24 +01:00
|
|
|
[
|
|
|
|
'name' => 'Enabled',
|
|
|
|
'sort' => 'enabled',
|
|
|
|
'data_path' => 'enabled',
|
2020-12-07 14:17:10 +01:00
|
|
|
'element' => 'toggle',
|
|
|
|
'url' => '/metaTemplates/toggle',
|
|
|
|
'url_params_data_paths' => ['id'],
|
2020-11-20 11:09:24 +01:00
|
|
|
],
|
2020-09-28 01:26:50 +02:00
|
|
|
[
|
|
|
|
'name' => __('Scope'),
|
|
|
|
'sort' => 'scope',
|
|
|
|
'data_path' => 'scope',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => __('Name'),
|
|
|
|
'sort' => 'name',
|
|
|
|
'data_path' => 'name',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => __('Namespace'),
|
|
|
|
'sort' => 'namespace',
|
|
|
|
'data_path' => 'namespace',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => __('UUID'),
|
|
|
|
'sort' => 'uuid',
|
|
|
|
'data_path' => 'uuid'
|
2020-11-20 11:09:24 +01:00
|
|
|
]
|
2020-09-28 01:26:50 +02:00
|
|
|
],
|
|
|
|
'title' => __('Meta Field Templates'),
|
|
|
|
'description' => __('The various templates used to enrich certain objects by a set of standardised fields.'),
|
|
|
|
'pull' => 'right',
|
|
|
|
'actions' => [
|
|
|
|
[
|
|
|
|
'url' => '/metaTemplates/view',
|
|
|
|
'url_params_data_paths' => ['id'],
|
|
|
|
'icon' => 'eye'
|
|
|
|
],
|
|
|
|
[
|
2020-11-20 11:09:24 +01:00
|
|
|
'url' => '/metaTemplates/toggle',
|
2020-09-28 01:26:50 +02:00
|
|
|
'url_params_data_paths' => ['id'],
|
|
|
|
'title' => __('Enable template'),
|
|
|
|
'icon' => 'plus',
|
|
|
|
'complex_requirement' => [
|
|
|
|
'function' => function($row, $options) {
|
|
|
|
return !(bool)$row['enabled'];
|
|
|
|
}
|
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2020-11-20 11:09:24 +01:00
|
|
|
'url' => '/metaTemplates/toggle',
|
2020-09-28 01:26:50 +02:00
|
|
|
'url_params_data_paths' => ['id'],
|
|
|
|
'title' => __('DIsable template'),
|
|
|
|
'icon' => 'minus',
|
|
|
|
'complex_requirement' => [
|
|
|
|
'function' => function($row, $options) {
|
|
|
|
return (bool)$row['enabled'];
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
]
|
|
|
|
]
|
|
|
|
]);
|
|
|
|
?>
|