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 / DashboardController.php

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

74 lines 1.7 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;
4
5 use AcyMailing\Core\AcymController;
6 use AcyMailing\Controllers\Dashboard\Listing;
7 use AcyMailing\Controllers\Dashboard\Walkthrough;
8 use AcyMailing\Controllers\Dashboard\Migration;
9
10 class DashboardController extends AcymController
11 {
12 use Listing;
13 use Walkthrough;
14 use Migration;
15
16 public function __construct()
17 {
18 parent::__construct();
19
20 $this->loadScripts = [
21 'features' => ['vue-applications' => ['splashscreen']],
22 'step_editor' => ['editor-wysid'],
23 ];
24 }
25
26 public function upgrade(): void
27 {
28 acym_setVar('layout', 'upgrade');
29
30 $version = acym_getVar('string', 'version', 'enterprise');
31
32 $data = ['version' => $version];
33
34 parent::display($data);
35 }
36
37 public function features(): void
38 {
39 if (!file_exists(ACYM_NEW_FEATURES_SPLASHSCREEN_JSON)) {
40 $this->listing();
41
42 return;
43 }
44
45 $splashJson = acym_fileGetContent(ACYM_NEW_FEATURES_SPLASHSCREEN_JSON);
46 $version = json_decode($splashJson);
47 if (version_compare($this->config->get('previous_version', '11.1.1'), $version->max_version, '>=')) {
48 acym_deleteFile(ACYM_NEW_FEATURES_SPLASHSCREEN_JSON);
49 $this->listing();
50
51 return;
52 }
53
54 if (!acym_deleteFile(ACYM_NEW_FEATURES_SPLASHSCREEN_JSON)) {
55 $this->listing();
56
57 return;
58 }
59
60 $data['splashJson'] = $version;
61
62 acym_setVar('layout', 'features');
63
64 parent::display($data);
65 }
66
67 public function acychecker(): void
68 {
69 acym_setVar('layout', 'acychecker');
70
71 parent::display();
72 }
73 }
74