| @@ -27,12 +27,14 @@ | ||
| 27 | 27 | acym_enqueueMessage($message, 'warning', true, [$notification]); |
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | + // Get filters data | |
| 31 | 32 | $searchFilter = $this->getVarFiltersListing('string', 'cqueue_search', ''); |
| 32 | 33 | $tagFilter = $this->getVarFiltersListing('string', 'cqueue_tag', ''); |
| 33 | 34 | $status = $this->getVarFiltersListing('string', 'cqueue_status', ''); |
| 34 | 35 | |
| 36 | + // Get pagination data | |
| 35 | 37 | $pagination = new PaginationHelper(); |
| 36 | 38 | $campaignsPerPage = $pagination->getListLimit(); |
| 37 | 39 | $page = $this->getVarFiltersListing('int', 'cqueue_pagination_page', 1); |
| 38 | 40 | |
| @@ -46,8 +48,9 @@ | ||
| 46 | 48 | 'offset' => ($page - 1) * $campaignsPerPage, |
| 47 | 49 | ] |
| 48 | 50 | ); |
| 49 | 51 | |
| 52 | + // Prepare the pagination | |
| 50 | 53 | $pagination->setStatus((int)$matchingElements['total']->total, $page, $campaignsPerPage); |
| 51 | 54 | $tagClass = new TagClass(); |
| 52 | 55 | |
| 53 | 56 | $viewData = [ |
| @@ -80,21 +83,22 @@ | ||
| 80 | 83 | 'data-confirmation-message' => 'ACYM_ARE_YOU_SURE', |
| 81 | 84 | ], |
| 82 | 85 | 'close' |
| 83 | 86 | ); |
| 84 | - $otherContent = acym_modal( | |
| 85 | - '<i class="acymicon-paper-plane"></i>'.acym_translation('ACYM_SEND_MAILS_MANUALLY'), | |
| 86 | - '', | |
| 87 | - null, | |
| 88 | - ['data-reveal-larger' => true], | |
| 87 | + $toolbarHelper->addModalButton( | |
| 89 | 88 | [ |
| 90 | - 'class' => 'cell medium-6 large-shrink button', | |
| 91 | - 'data-reload' => 'true', | |
| 92 | - 'data-ajax' => 'true', | |
| 93 | - 'data-iframe' => '&ctrl=queue&task=continuesend&id=0&totalsend=0', | |
| 89 | + 'button' => '<i class="acymicon-paper-plane"></i>'.esc_html(acym_translation('ACYM_SEND_MAILS_MANUALLY')), | |
| 90 | + 'attributesModal' => [ | |
| 91 | + 'data-reveal-larger' => true, | |
| 92 | + ], | |
| 93 | + 'attributesButton' => [ | |
| 94 | + 'class' => 'cell medium-6 large-shrink button', | |
| 95 | + 'data-reload' => 'true', | |
| 96 | + 'data-ajax' => 'true', | |
| 97 | + 'data-iframe' => '&ctrl=queue&task=continuesend&id=0&totalsend=0', | |
| 98 | + ], | |
| 94 | 99 | ] |
| 95 | 100 | ); |
| 96 | - $toolbarHelper->addOtherContent($otherContent); | |
| 97 | 101 | $toolbarHelper->addFilterByTag($data, 'cqueue_tag', 'acym__queue__filter__tags acym__select'); |
| 98 | 102 | |
| 99 | 103 | $data['toolbar'] = $toolbarHelper; |
| 100 | 104 | if (!empty($data['tag'])) { |
| @@ -105,8 +109,10 @@ | ||
| 105 | 109 | } |
| 106 | 110 | |
| 107 | 111 | public function cancelSending(): void |
| 108 | 112 | { |
| 113 | + wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token'); | |
| 114 | + | |
| 109 | 115 | $mailId = acym_getVar('int', 'acym__queue__cancel__mail_id'); |
| 110 | 116 | |
| 111 | 117 | if (!empty($mailId)) { |
| 112 | 118 | $hasStat = acym_loadResult('SELECT COUNT(*) FROM #__acym_user_stat WHERE mail_id = '.intval($mailId)); |
| @@ -130,8 +136,10 @@ | ||
| 130 | 136 | } |
| 131 | 137 | |
| 132 | 138 | public function playPauseSending(): void |
| 133 | 139 | { |
| 140 | + wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token'); | |
| 141 | + | |
| 134 | 142 | $active = acym_getVar('int', 'acym__queue__play_pause__active__new_value'); |
| 135 | 143 | $campaignId = acym_getVar('int', 'acym__queue__play_pause__campaign_id'); |
| 136 | 144 | |
| 137 | 145 | if (!empty($campaignId)) { |
| @@ -149,9 +157,9 @@ | ||
| 149 | 157 | } |
| 150 | 158 | |
| 151 | 159 | public function emptyQueue(): void |
| 152 | 160 | { |
| 153 | - acym_checkToken(); | |
| 161 | + wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token'); | |
| 154 | 162 | |
| 155 | 163 | $queueClass = new QueueClass(); |
| 156 | 164 | $deleted = $queueClass->emptyQueue(); |
| 157 | 165 | acym_enqueueMessage(acym_translationSprintf('ACYM_EMAILS_REMOVED_QUEUE', $deleted)); |