| 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.0.0'), $version->max_version, '>=')) { |
| 48 |
acym_deleteFile(ACYM_NEW_FEATURES_SPLASHSCREEN_JSON); |
| 49 |
$this->listing(); |
| 50 |
|
| 51 |
return; |
| 52 |
} |
| 53 |
|
| 54 |
ob_start(); |
| 55 |
include ACYM_NEW_FEATURES_SPLASHSCREEN; |
| 56 |
$data = [ |
| 57 |
'content' => ob_get_clean(), |
| 58 |
]; |
| 59 |
|
| 60 |
if (!acym_deleteFile(ACYM_NEW_FEATURES_SPLASHSCREEN_JSON)) { |
| 61 |
$this->listing(); |
| 62 |
|
| 63 |
return; |
| 64 |
} |
| 65 |
|
| 66 |
$data['splashJson'] = $version; |
| 67 |
|
| 68 |
acym_setVar('layout', 'features'); |
| 69 |
|
| 70 |
parent::display($data); |
| 71 |
} |
| 72 |
|
| 73 |
public function acychecker(): void |
| 74 |
{ |
| 75 |
acym_setVar('layout', 'acychecker'); |
| 76 |
|
| 77 |
parent::display(); |
| 78 |
} |
| 79 |
} |
| 80 |
|