From c05d5555a961a3bcc686b1687a78ec25ac5169ef Mon Sep 17 00:00:00 2001 From: Ihor Vansach Date: Tue, 21 May 2024 09:43:07 +0300 Subject: [PATCH] Moved theme checker to the community extension --- Block/Adminhtml/HyvaThemeChecker.php | 130 -------------------- view/adminhtml/layout/default.xml | 16 --- view/adminhtml/templates/themechecker.phtml | 36 ------ 3 files changed, 182 deletions(-) delete mode 100644 Block/Adminhtml/HyvaThemeChecker.php delete mode 100644 view/adminhtml/layout/default.xml delete mode 100644 view/adminhtml/templates/themechecker.phtml diff --git a/Block/Adminhtml/HyvaThemeChecker.php b/Block/Adminhtml/HyvaThemeChecker.php deleted file mode 100644 index 6ed250e6..00000000 --- a/Block/Adminhtml/HyvaThemeChecker.php +++ /dev/null @@ -1,130 +0,0 @@ -moduleManager = $moduleManager; - $this->storeManager = $storeManager; - $this->scopeConfig = $scopeConfig; - $this->themeProvider = $themeProvider; - $this->hyvaThemeDetection =$hyvaThemeDetection; - $this->config = $config; - } - - /** - * @return array - */ - public function getWitchModuleIsInstalled(): array - { - - $modules = [ - 'Magefan_Blog' => 'https://github.com/magefan/hyva-theme-blog', - 'Magefan_BlogPlus' => 'https://github.com/magefan/hyva-theme-blog-plus', - 'Magefan_BlogExtra' => 'https://github.com/magefan/hyva-theme-blog-extra', - 'Magefan_BlogAuthor' => 'https://github.com/magefan/hyva-theme-blog-author', - 'Magefan_AutoRelatedProduc' => 'https://github.com/magefan/hyva-theme-auto-related-product', - 'Magefan_AutoRelatedProductPlus' => 'https://github.com/magefan/hyva-theme-auto-related-product-plus', - 'Magefan_AutoLanguageSwitcher' => 'https://github.com/magefan/hyva-theme-auto-language-switcher' - ]; - - - $hyvaModules = []; - foreach ($modules as $module => $url){ - if ($this->moduleManager->isEnabled($module)) { - $hyvaModule = 'Hyva_' . str_replace('_', '', $module); - if (!$this->moduleManager->isEnabled($hyvaModule)) { - $hyvaModules[$hyvaModule] = $url; - } - } - } - return $hyvaModules; - } - - /** - * Produce and return block's html output - * - * This method should not be overridden. You can override _toHtml() method in descendants if needed. - * - * @return string - */ - public function toHtml() - { - if ($this->config->isEnabled()){ - if (!$this->hyvaThemeDetection->execute()) { - return ''; - } - - return parent::toHtml(); - } - } -} diff --git a/view/adminhtml/layout/default.xml b/view/adminhtml/layout/default.xml deleted file mode 100644 index 87e41d75..00000000 --- a/view/adminhtml/layout/default.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/view/adminhtml/templates/themechecker.phtml b/view/adminhtml/templates/themechecker.phtml deleted file mode 100644 index c5a69133..00000000 --- a/view/adminhtml/templates/themechecker.phtml +++ /dev/null @@ -1,36 +0,0 @@ - - -getWitchModuleIsInstalled()) { ?> -
-
-
- escapeHtml(__('It looks like you are using the Hyva theme, ' . - 'but the Hyva Magefan Blog extensions for Hyva compatibility are not installed. ' . - 'Please install these modules for the proper functioning of the blog module on the Hyva theme:')) ?> -
-
- -
-
-
-
-