diff --git a/templates/Inbox/index.php b/templates/Inbox/index.php index b9d02e1..cef2ccb 100644 --- a/templates/Inbox/index.php +++ b/templates/Inbox/index.php @@ -9,6 +9,7 @@ echo $this->element('genericElements/IndexTable/index_table', [ 'top_bar' => [ 'children' => [ [ + 'type' => 'multi_select_actions', 'children' => [ [ 'text' => __('Discard requests'), @@ -16,7 +17,11 @@ echo $this->element('genericElements/IndexTable/index_table', [ 'onclick' => 'discardRequests', ] ], - 'type' => 'multi_select_actions', + 'data' => [ + 'id' => [ + 'value_path' => 'id' + ] + ] ], [ 'type' => 'context_filters', @@ -33,15 +38,6 @@ echo $this->element('genericElements/IndexTable/index_table', [ ] ], 'fields' => [ - [ - 'element' => 'selector', - 'class' => 'short', - 'data' => [ - 'id' => [ - 'value_path' => 'id' - ] - ] - ], [ 'name' => '#', 'sort' => 'id', diff --git a/templates/Outbox/index.php b/templates/Outbox/index.php index c7ac4f9..2685171 100644 --- a/templates/Outbox/index.php +++ b/templates/Outbox/index.php @@ -9,6 +9,7 @@ echo $this->element('genericElements/IndexTable/index_table', [ 'top_bar' => [ 'children' => [ [ + 'type' => 'multi_select_actions', 'children' => [ [ 'text' => __('Delete messages'), @@ -16,7 +17,11 @@ echo $this->element('genericElements/IndexTable/index_table', [ 'onclick' => 'deleteMessages', ] ], - 'type' => 'multi_select_actions', + 'data' => [ + 'id' => [ + 'value_path' => 'id' + ] + ] ], [ 'type' => 'context_filters', @@ -33,15 +38,6 @@ echo $this->element('genericElements/IndexTable/index_table', [ ] ], 'fields' => [ - [ - 'element' => 'selector', - 'class' => 'short', - 'data' => [ - 'id' => [ - 'value_path' => 'id' - ] - ] - ], [ 'name' => '#', 'sort' => 'id', diff --git a/templates/element/genericElements/IndexTable/index_table.php b/templates/element/genericElements/IndexTable/index_table.php index 9a407d4..221b70a 100644 --- a/templates/element/genericElements/IndexTable/index_table.php +++ b/templates/element/genericElements/IndexTable/index_table.php @@ -44,6 +44,15 @@ '/genericElements/IndexTable/pagination_links' ); } + $multiSelectData = getMultiSelectData($data['top_bar']); + if (!empty($multiSelectData)) { + $multiSelectField = [ + 'element' => 'selector', + 'class' => 'short', + 'data' => $multiSelectData['data'] + ]; + array_unshift($data['fields'], $multiSelectField); + } if (!empty($data['top_bar'])) { echo $this->element( '/genericElements/ListTopBar/scaffold', @@ -130,3 +139,13 @@ }); }); + +