From 605321968785049cce5c762b021c70d6fa29043b Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Thu, 11 Apr 2024 11:33:51 +0200 Subject: [PATCH] [Changed] cleaning ViewConfig --- Modules/Core/ViewConfig.php | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/Modules/Core/ViewConfig.php b/Modules/Core/ViewConfig.php index 8571f8b..dfe5198 100644 --- a/Modules/Core/ViewConfig.php +++ b/Modules/Core/ViewConfig.php @@ -12,7 +12,6 @@ namespace D3\GoogleAnalytics4\Modules\Core; -use D3\GoogleAnalytics4\Application\Model\Constants; use D3\GoogleAnalytics4\Application\Model\ManagerHandler; use D3\GoogleAnalytics4\Application\Model\ManagerTypes; use OxidEsales\Eshop\Application\Controller\FrontendController; @@ -145,7 +144,10 @@ class ViewConfig extends ViewConfig_parent private $blGA4enabled = null; - + + /** + * @return null + */ public function isGA4enabled() { if ($this->blGA4enabled === null) @@ -156,14 +158,17 @@ class ViewConfig extends ViewConfig_parent return $this->blGA4enabled; } + /** + * @return bool + */ public function isGtmConsentModeSetActivated() :bool { - return $this->sContainerId = ContainerFactory::getInstance() - ->getContainer() - ->get(ModuleSettingBridgeInterface::class) - ->get('d3_gtm_blActivateConsentMode', Constants::OXID_MODULE_ID); + return Registry::getConfig()->getConfigParam('d3_gtm_blActivateConsentMode'); } + /** + * @return false|string + */ public function getGtmDataLayer() { if (!$this->getGtmContainerId()) return "[]"; @@ -202,11 +207,18 @@ class ViewConfig extends ViewConfig_parent return json_encode([$dataLayer], JSON_PRETTY_PRINT); } + /** + * @return bool + */ public function isDebugModeOn() :bool { return Registry::getConfig()->getConfigParam('d3_gtm_blEnableDebug'); } + /** + * @param $listId + * @return void + */ public function isPromotionList($listId) { $oConfig = Registry::getConfig(); @@ -215,8 +227,6 @@ class ViewConfig extends ViewConfig_parent /** * @return string - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface */ public function getServerSidetaggingJsDomain() :string { @@ -225,8 +235,6 @@ class ViewConfig extends ViewConfig_parent /** * @return string - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface */ public function getServerSidetaggingNoJsDomain() :string {