| @@ -9,16 +9,18 @@ | ||
| 9 | 9 | use AcyMailing\Helpers\WorkflowHelper; |
| 10 | 10 | |
| 11 | 11 | trait Detailed |
| 12 | 12 | { |
| 13 | - public function detailed() | |
| 13 | + public function detailed(): void | |
| 14 | 14 | { |
| 15 | 15 | acym_setVar('layout', 'detailed'); |
| 16 | 16 | $pagination = new PaginationHelper(); |
| 17 | 17 | |
| 18 | + // Get filters data | |
| 18 | 19 | $searchFilter = $this->getVarFiltersListing('string', 'dqueue_search', ''); |
| 19 | 20 | $tagFilter = $this->getVarFiltersListing('string', 'dqueue_tag', ''); |
| 20 | 21 | |
| 22 | + // Get pagination data | |
| 21 | 23 | $elementsPerPage = $pagination->getListLimit(); |
| 22 | 24 | $page = $this->getVarFiltersListing('int', 'dqueue_pagination_page', 1); |
| 23 | 25 | |
| 24 | 26 | $queueClass = new QueueClass(); |
| @@ -30,9 +32,10 @@ | ||
| 30 | 32 | 'offset' => ($page - 1) * $elementsPerPage, |
| 31 | 33 | ] |
| 32 | 34 | ); |
| 33 | 35 | |
| 34 | - $pagination->setStatus($matchingElements['total'], $page, $elementsPerPage); | |
| 36 | + // Prepare the pagination | |
| 37 | + $pagination->setStatus((int)$matchingElements['total']->total, $page, $elementsPerPage); | |
| 35 | 38 | |
| 36 | 39 | $tagClass = new TagClass(); |
| 37 | 40 | $viewData = [ |
| 38 | 41 | 'allElements' => $matchingElements['elements'], |
| @@ -48,20 +51,26 @@ | ||
| 48 | 51 | $this->breadcrumb[acym_translation('ACYM_QUEUE_DETAILED')] = acym_completeLink('queue&task=detailed'); |
| 49 | 52 | parent::display($viewData); |
| 50 | 53 | } |
| 51 | 54 | |
| 52 | - public function prepareToolbarDetailed(&$data) | |
| 55 | + public function prepareToolbarDetailed(array &$data): void | |
| 53 | 56 | { |
| 54 | 57 | $toolbarHelper = new ToolbarHelper(); |
| 55 | 58 | $toolbarHelper->addSearchBar($data['search'], 'dqueue_search', 'ACYM_SEARCH'); |
| 56 | - $otherContent = acym_modal( | |
| 57 | - '<i class="acymicon-paper-plane"></i>'.acym_translation('ACYM_SEND_ALL'), | |
| 58 | - '', | |
| 59 | - null, | |
| 60 | - 'data-reveal-larger', | |
| 61 | - 'class="cell medium-shrink button" data-reload="true" data-ajax="true" data-iframe="&ctrl=queue&task=continuesend&id=0&totalsend=0"' | |
| 59 | + $toolbarHelper->addModalButton( | |
| 60 | + [ | |
| 61 | + 'button' => '<i class="acymicon-paper-plane"></i>'.esc_html(acym_translation('ACYM_SEND_ALL')), | |
| 62 | + 'attributesModal' => [ | |
| 63 | + 'data-reveal-larger' => true, | |
| 64 | + ], | |
| 65 | + 'attributesButton' => [ | |
| 66 | + 'class' => 'cell medium-shrink button', | |
| 67 | + 'data-reload' => 'true', | |
| 68 | + 'data-ajax' => 'true', | |
| 69 | + 'data-iframe' => '&ctrl=queue&task=continuesend&id=0&totalsend=0', | |
| 70 | + ], | |
| 71 | + ] | |
| 62 | 72 | ); |
| 63 | - $toolbarHelper->addOtherContent($otherContent); | |
| 64 | 73 | $toolbarHelper->addFilterByTag($data, 'dqueue_tag', 'acym__queue__filter__tags acym__select'); |
| 65 | 74 | |
| 66 | 75 | $data['toolbar'] = $toolbarHelper; |
| 67 | 76 | $data['cleartask'] = 'detailed'; |