title protected array $steps = []; // Step to display protected string $step = ''; public array $tabs = []; public function __construct() { parent::__construct(); $classname = get_class($this); $classname = substr($classname, strrpos($classname, '\\') + 1); $this->name = strtolower(substr($classname, 0, -4)); $this->step = acym_getVar('string', 'nextstep', ''); if (empty($this->step)) { $this->step = acym_getVar('string', 'step', ''); } } public function getName(): string { return $this->name; } public function getLayout(): string { return acym_getVar('cmd', 'layout', acym_getVar('cmd', 'task', 'listing')); } public function display(object $controller, array $data = []): void { $name = $this->getName(); $view = $this->getLayout(); if (method_exists($this, $view)) $this->$view(); $viewFolder = acym_isAdmin() ? ACYM_VIEW : ACYM_VIEW_FRONT; if (!file_exists($viewFolder.ucfirst($name).DS.'tmpl'.DS.$view.'.php')) { $view = 'listing'; } $getCleanView = ($name !== 'archive' && $view !== 'listing') && ($name !== 'frontusers' || $view !== 'profile'); if (ACYM_CMS === 'wordpress' && $getCleanView) { // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- WordPress generated content temporary held to allow redirections (headers sent). echo ob_get_clean(); } // Load the needed scripts and styles if ( ACYM_CMS !== 'wordpress' || ($name === 'frontusers' && ($view === 'unsubscribe' || $view === 'unsubscribepage')) || !defined('DOING_AJAX') || !DOING_AJAX || ($name === 'archive' && $view === 'view') ) { acym_loadAssets($name, $view); $controller->loadScripts($view); } // Display enqueued messages $notifications = acym_getVar('array', 'acynotif', [], 'SESSION'); if (!empty($notifications)) { echo implode('', $notifications); acym_setSession('acynotif', []); } // On pages with the editor, we need to put the wrapper inside the form $outsideForm = (strpos($name, 'mails') !== false && $view === 'edit') || (strpos($name, 'campaigns') !== false && $view === 'edit_email'); if ($outsideForm) { echo '
'; } // Open wrapper and display the header if (acym_getVar('cmd', 'task') !== 'ajaxEncoding') { echo '
'; } //if joomla we add the left menu and a div for the content if (acym_isLeftMenuNecessary()) { acym_displayLeftMenu($name); echo '
'; } if (!empty($data['breadcrumb'])) { $headerHelper = new HeaderHelper(); $headerHelper->display($data['breadcrumb']); } $remindme = json_decode($this->config->get('remindme', '[]'), true); if ($this->config->get('walk_through', 0) == 0) { if (acym_isAdmin()) { if (!in_array('multilingual', $remindme) && acym_level(ACYM_ESSENTIAL) && $this->config->get('multilingual', '0') === '0') { if (count(acym_getLanguages(false, true)) > 1) { $message = acym_translation('ACYM_MULTILINGUAL_OPTIONS_PROMPT'); $message .= ' '.acym_translation('ACYM_YES').''; $message .= ' / '.acym_translation('ACYM_NO').''; acym_display($message, 'info', false); } else { $remindme[] = 'multilingual'; $this->config->saveConfig(['remindme' => json_encode($remindme)]); } } $maliciousScan = $this->config->get('malicious_scan', 0); if (!empty($maliciousScan)) { $this->config->saveConfig(['malicious_scan' => 0]); acym_display(acym_translation('ACYM_NEW_SECURITY_TOOL'), 'info'); } } } acym_trigger('acym_displayTrackingMessage', [&$message], 'plgAcymWoocommerce'); if (acym_isAdmin()) { acym_trigger('onAcymDisplayPage'); acym_displayMessages(); } include acym_getView($name, $view); // Close the wrapper and the content if CMS = Joomla if (acym_isLeftMenuNecessary()) { echo '
'; } if (acym_getVar('cmd', 'task') !== 'ajaxEncoding') { echo '
'; } if ($outsideForm) { echo '
'; } if (ACYM_CMS !== 'wordpress' || !acym_isAdmin() || in_array($controller->name, ['dashboard', 'language', 'campaigns']) || acym_isAjax()) { return; } $remind = json_decode($this->config->get('remindme', '[]')); $installationDate = $this->config->get('install_date', time()); $sevenDaysAgo = time() - 7 * 86400; if (!in_array('reviews', $remind) && $installationDate < $sevenDaysAgo) { echo ''; } } }