chg: [genericElement:index_table] Conditional inclusion of header in column visibility selector

pull/93/head
Sami Mokaddem 2021-11-11 08:24:07 +01:00
parent fc0f12e38e
commit 0dfa87be6f
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 1 additions and 1 deletions

View File

@ -17,6 +17,7 @@ $availableColumnsHtml = $this->element('/genericElements/ListTopBar/group_table_
$metaTemplateColumnMenu = [];
if (!empty($meta_templates)) {
$metaTemplateColumnMenu[] = ['header' => true, 'text' => __('Meta Templates'), 'icon' => 'object-group',];
foreach ($meta_templates as $meta_template) {
$numberActiveMetaField = !empty($tableSettings['visible_meta_column'][$meta_template->id]) ? count($tableSettings['visible_meta_column'][$meta_template->id]) : 0;
$metaTemplateColumnMenu[] = [
@ -42,7 +43,6 @@ if (!empty($meta_templates)) {
$indexColumnMenu = array_merge(
[['header' => true, 'text' => sprintf('%s\'s fields', $this->request->getParam('controller'))]],
[['html' => $availableColumnsHtml]],
[['header' => true, 'text' => __('Meta Templates'), 'icon' => 'object-group',]],
$metaTemplateColumnMenu
);