12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- /**
- *
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\SalesRule\Controller\Adminhtml\Promo\Quote;
- class NewActionHtml extends \Magento\SalesRule\Controller\Adminhtml\Promo\Quote
- {
- /**
- * New action html action
- *
- * @return void
- */
- public function execute()
- {
- $id = $this->getRequest()->getParam('id');
- $formName = $this->getRequest()->getParam('form');
- $typeArr = explode('|', str_replace('-', '/', $this->getRequest()->getParam('type')));
- $type = $typeArr[0];
- $model = $this->_objectManager->create(
- $type
- )->setId(
- $id
- )->setType(
- $type
- )->setRule(
- $this->_objectManager->create(\Magento\SalesRule\Model\Rule::class)
- )->setPrefix(
- 'actions'
- );
- if (!empty($typeArr[1])) {
- $model->setAttribute($typeArr[1]);
- }
- if ($model instanceof \Magento\Rule\Model\Condition\AbstractCondition) {
- $model->setJsFormObject($formName);
- $html = $model->asHtmlRecursive();
- } else {
- $html = '';
- }
- $this->getResponse()->setBody($html);
- }
- }
|