From b4cfceaac19d8b52be325a7dad7cb12cf6181725 Mon Sep 17 00:00:00 2001 From: Alex Dong Date: Fri, 25 Dec 2020 11:54:45 +0700 Subject: [PATCH] Update Data.php --- Helper/Data.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Helper/Data.php b/Helper/Data.php index 10605e0..3e6aacf 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -3,7 +3,7 @@ * @Author: nguyen * @Date: 2020-02-12 14:01:01 * @Last Modified by: Alex Dong - * @Last Modified time: 2020-08-25 14:26:07 + * @Last Modified time: 2020-12-25 10:54:35 */ namespace Magepow\Core\Helper; @@ -15,11 +15,18 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper */ protected $configModule; + /** + * @var \Magento\Framework\Module\Manager + */ + protected $moduleManager; + public function __construct( - \Magento\Framework\App\Helper\Context $context + \Magento\Framework\App\Helper\Context $context, + \Magento\Framework\Module\Manager $moduleManager ) { parent::__construct($context); + $this->moduleManager = $moduleManager; $this->configModule = $this->getConfig(strtolower($this->_getModuleName())); } @@ -48,4 +55,9 @@ public function getConfigModule($cfg='', $value=null) return $value; } + public function isEnabledModule($moduleName) + { + return $this->moduleManager->isEnabled($moduleName); + } + }