![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/aheadworks/module-csblock/Controller/Adminhtml/Csblock/ |
<?php namespace Aheadworks\Csblock\Controller\Adminhtml\Csblock; use Magento\Rule\Model\Condition\AbstractCondition; /** * Class NewConditionHtml * @package Aheadworks\Csblock\Controller\Adminhtml\Csblock */ class NewConditionHtml extends \Magento\CatalogRule\Controller\Adminhtml\Promo\Catalog { /** * @return void * phpcs:disable Magento2.Functions.DiscouragedFunction.Discouraged */ public function execute() { $id = $this->getRequest()->getParam('id'); $typeArr = explode('|', str_replace('-', '/', (string)$this->getRequest()->getParam('type'))); $type = $typeArr[0]; $prefix = 'conditions'; if ($this->getRequest()->getParam('prefix')) { $prefix = $this->getRequest()->getParam('prefix'); } $rule = \Aheadworks\Csblock\Model\Csblock::class; if ($this->getRequest()->getParam('rule')) { $rule = base64_decode($this->getRequest()->getParam('rule')); } $model = $this->_objectManager->create($type) ->setId($id) ->setType($type) ->setRule($this->_objectManager->create($rule)) ->setPrefix($prefix); if (!empty($typeArr[1])) { $model->setAttribute($typeArr[1]); } if ($model instanceof AbstractCondition) { $model->setJsFormObject($this->getRequest()->getParam('form')); $html = $model->asHtmlRecursive(); } else { $html = ''; } $this->getResponse()->setBody($html); } /** * @return bool */ protected function _isAllowed() { return $this->_authorization->isAllowed('Aheadworks_Csblock::csblock'); } }