Display tutorial only to new users

[MAILPOET-3206]
This commit is contained in:
Pavel Dohnal
2020-11-24 15:08:43 +01:00
committed by Veljko V
parent 2ef27608e9
commit bfaa1bbec4
4 changed files with 17 additions and 0 deletions

View File

@ -78,6 +78,7 @@ use MailPoet\Models\Segment;
use MailPoet\Router\Endpoints\FormPreview;
use MailPoet\Router\Router;
use MailPoet\Settings\Pages;
use MailPoet\Settings\SettingsController;
use MailPoet\Settings\UserFlagsController;
use MailPoet\WP\Functions as WPFunctions;
@ -112,6 +113,9 @@ class FormEditor {
/** @var UserFlagsController */
private $userFlags;
/** @var SettingsController */
private $settings;
private $activeTemplates = [
FormEntity::DISPLAY_TYPE_POPUP => [
Template1Popup::ID,
@ -195,6 +199,7 @@ class FormEditor {
FormFactory $formsFactory,
Localizer $localizer,
UserFlagsController $userFlags,
SettingsController $settings,
TemplateRepository $templateRepository
) {
$this->pageRenderer = $pageRenderer;
@ -207,6 +212,7 @@ class FormEditor {
$this->localizer = $localizer;
$this->templatesRepository = $templateRepository;
$this->userFlags = $userFlags;
$this->settings = $settings;
}
public function render() {
@ -251,6 +257,7 @@ class FormEditor {
'products' => $this->getWooCommerceProducts(),
'product_categories' => $this->getWooCommerceCategories(),
'product_tags' => $this->getWooCommerceTags(),
'installed_at' => $this->settings->get('installed_at'),
];
$this->wp->wpEnqueueMedia();
$this->pageRenderer->displayPage('form/editor.html', $data);