From bc1dafbbfaec6ee35f8815989c9ff03e45054f29 Mon Sep 17 00:00:00 2001 From: MarkusGaertner Date: Thu, 8 Aug 2024 14:16:25 +0200 Subject: [PATCH] Erweiterung verschieben --- .../{ShopControl.php => WidgetControl.php} | 33 ++++++------------- metadata.php | 2 +- 2 files changed, 11 insertions(+), 24 deletions(-) rename Modules/Core/{ShopControl.php => WidgetControl.php} (55%) diff --git a/Modules/Core/ShopControl.php b/Modules/Core/WidgetControl.php similarity index 55% rename from Modules/Core/ShopControl.php rename to Modules/Core/WidgetControl.php index eeb04e5..ce6940b 100644 --- a/Modules/Core/ShopControl.php +++ b/Modules/Core/WidgetControl.php @@ -4,7 +4,7 @@ namespace D3\GoogleAnalytics4\Modules\Core; use OxidEsales\EshopCommunity\Core\Registry; -class ShopControl extends ShopControl_parent{ +class WidgetControl extends WidgetControl_parent{ protected function _getStartController() // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore { /* @@ -27,33 +27,20 @@ class ShopControl extends ShopControl_parent{ ) */ + $sScriptName = $_SERVER['SCRIPT_NAME']; + if($sScriptName != '/widget.php') + { + return parent::getFrontendStartControllerKey(); + } + $aParameter = $_GET; - if( is_null($aParameter['actcontrol']) - && is_null($aParameter['actcontrol']) + if(is_null($aParameter['actcontrol']) && is_null($aParameter['actcontrol']) + && is_null($aParameter['oxwparent']) ) { return 'D3\GoogleAnalytics4\Application\Component\Widget\d3GtmStartWidget'; } - - return $this->getStartControllerKey(); - } - - protected function getStartControllerKey() - { - $controllerKey = Registry::getConfig()->getRequestControllerId(); - - // Use default route in case no controller id is given - if (!$controllerKey) { - $session = \OxidEsales\Eshop\Core\Registry::getSession(); - if ($this->isAdmin()) { - $controllerKey = $session->getVariable("auth") ? 'admin_start' : 'login'; - } else { - $controllerKey = $this->getFrontendStartControllerKey(); - } - $session->setVariable('cl', $controllerKey); - } - - return $controllerKey; + return parent::getFrontendStartControllerKey(); } } \ No newline at end of file diff --git a/metadata.php b/metadata.php index 1de6d53..4c311a9 100755 --- a/metadata.php +++ b/metadata.php @@ -60,7 +60,7 @@ $aModule = [ 'extend' => [ // Core OEViewConfig::class => ViewConfig::class, - \OxidEsales\Eshop\Core\ShopControl::class => \D3\GoogleAnalytics4\Modules\Core\ShopControl::class, + \OxidEsales\Eshop\Core\WidgetControl::class => \D3\GoogleAnalytics4\Modules\Core\WidgetControl::class, // Model OECategory::class => Category::class,