PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / trunk
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress vtrunk
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / back / Controllers / Stats / LinksDetails.php

LinksDetails.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress trunk, at back/Controllers/Stats/LinksDetails.php

53 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace AcyMailing\Controllers\Stats;
4
5 use AcyMailing\Helpers\ExportHelper;
6
7 trait LinksDetails
8 {
9 public function linksDetails(): void
10 {
11 acym_setVar('layout', 'links_details');
12
13 $data = [];
14
15 if (!$this->prepareDefaultPageInfo($data, true)) {
16 return;
17 }
18
19 $data['anonymousStats'] = !empty($this->config->get('anonymous_stats', 0));
20 $this->prepareLinksDetailsListing($data);
21 if (count($this->selectedMailIds) == 1) {
22 if ($data['isAbTest']) {
23 $this->prepareAbTestMails($data);
24 } elseif (acym_isMultilingual()) {
25 $this->prepareMultilingualMails($data);
26 }
27 }
28 $this->prepareMailFilter($data);
29
30 parent::display($data);
31 }
32
33 public function exportLinksDetails(): void
34 {
35 wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token');
36
37 $data = [];
38 if (!$this->prepareDefaultPageInfo($data, true)) {
39 return;
40 }
41
42 $this->prepareLinksDetailsListing($data);
43 $exportHelper = new ExportHelper();
44
45 $columnsToExport['url.name'] = acym_translation('ACYM_URL');
46 $columnsToExport['total_click'] = acym_translation('ACYM_TOTAL_CLICKS');
47 $columnsToExport['unique_click'] = acym_translation('ACYM_UNIQUE_CLICKS');
48
49 $exportHelper->exportStatsFullCSV($data['query'], $columnsToExport, 'links_details');
50 exit;
51 }
52 }
53