From efcd7d6e1d1c1be609f18e249a60548c511a5d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ja=CC=81n=20Mikla=CC=81s=CC=8C?= Date: Tue, 24 Sep 2019 11:37:42 +0200 Subject: [PATCH] Hide setting behind feature flag [MAILPOET-2284] --- lib/AdminPages/Pages/Settings.php | 11 ++++++++++- views/settings/woocommerce.html | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/AdminPages/Pages/Settings.php b/lib/AdminPages/Pages/Settings.php index dc2d9446d1..31b40d4929 100644 --- a/lib/AdminPages/Pages/Settings.php +++ b/lib/AdminPages/Pages/Settings.php @@ -6,6 +6,7 @@ use MailPoet\AdminPages\PageRenderer; use MailPoet\Config\Installer; use MailPoet\Config\ServicesChecker; use MailPoet\Cron\CronTrigger; +use MailPoet\Features\FeaturesController; use MailPoet\Models\Segment; use MailPoet\Models\Subscriber; use MailPoet\Services\Bridge; @@ -37,6 +38,9 @@ class Settings { /** @var Captcha */ private $captcha; + /** @var FeaturesController */ + private $features_controller; + /** @var Installation */ private $installation; @@ -47,7 +51,8 @@ class Settings { WPFunctions $wp, ServicesChecker $services_checker, Installation $installation, - Captcha $captcha + Captcha $captcha, + FeaturesController $features_controller ) { $this->page_renderer = $page_renderer; $this->settings = $settings; @@ -56,6 +61,7 @@ class Settings { $this->services_checker = $services_checker; $this->installation = $installation; $this->captcha = $captcha; + $this->features_controller = $features_controller; } function render() { @@ -87,6 +93,9 @@ class Settings { 'smtp' => Hosts::getSMTPHosts(), ], 'built_in_captcha_supported' => $this->captcha->isSupported(), + 'display_woocommerce_editor' => $this->features_controller->isSupported( + FeaturesController::WC_TRANSACTIONAL_EMAILS_CUSTOMIZER + ), ]; $data['is_new_user'] = $this->installation->isNewInstallation(); diff --git a/views/settings/woocommerce.html b/views/settings/woocommerce.html index 156ed880c4..6ce60d94a8 100644 --- a/views/settings/woocommerce.html +++ b/views/settings/woocommerce.html @@ -1,4 +1,5 @@ + <% if display_woocommerce_editor %> + <% endif %>