Produced by Araxis Merge on 2024-03-04 14:38:23 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | /Users/coca/Documents/www/Porto v4.0.2/Theme Files/Magento 2.x/Porto Theme v4.0.7/app/code/Smartwave/Porto/Block/System/Config/Form/Button/Import | Cms.php | 2016-10-26 15:59:18 +0000 |
| 2 | /Users/coca/Documents/www/Porto v4.0.2/Theme Files/Magento 2.x/Porto Theme v4.0.8/app/code/Smartwave/Porto/Block/System/Config/Form/Button/Import | Cms.php | 2016-10-26 15:59:18 +0000 |
| Description | Between Files 1 and 2 | |
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 1 | 312 |
| Changed | 0 | 0 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | Consecutive whitespace is treated as a single space |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
| Active line-pairing rules |
No regular expressions were active.
| 1 | <?php | 1 | <?php | |||
| 2 | /** | 2 | /** | |||
| 3 | * Copyright © 2015 Magento. All rights reserved. | 3 | * Copyright © 2015 Magento. All rights reserved. | |||
| 4 | * See COPYING.txt for license details. | 4 | * See COPYING.txt for license details. | |||
| 5 | */ | 5 | */ | |||
| 6 | 6 | |||||
| 7 | /** | 7 | /** | |||
| 8 | * Adminhtml VAT ID validation block | 8 | * Adminhtml VAT ID validation block | |||
| 9 | * | 9 | * | |||
| 10 | * @author Magento Core Team <core@magentocommerce.com> | 10 | * @author Magento Core Team <core@magentocommerce.com> | |||
| 11 | */ | 11 | */ | |||
| 12 | namespace Smartwave\Porto\Block\System\Config\Form\Button\Import; | 12 | namespace Smartwave\Porto\Block\System\Config\Form\Button\Import; | |||
| 13 | 13 | |||||
| 14 | class Cms extends \Magento\Config\Block\System\Config\Form\Field | 14 | class Cms extends \Magento\Config\Block\System\Config\Form\Field | |||
| 15 | { | 15 | { | |||
| 16 | /** | 16 | /** | |||
| 17 | * Button Label | 17 | * Button Label | |||
| 18 | * | 18 | * | |||
| 19 | * @var string | 19 | * @var string | |||
| 20 | */ | 20 | */ | |||
| 21 | protected $_buttonLabel = 'Import'; | 21 | protected $_buttonLabel = 'Import'; | |||
| 22 | 22 | |||||
| 23 | protected $_actionUrl; | 23 | protected $_actionUrl; | |||
| 24 | 24 | |||||
| 25 | protected $_importType; | 25 | protected $_importType; | |||
| 26 | 26 | |||||
| 27 | private $_helper; | 27 | private $_helper; | |||
| 28 | 28 | |||||
| 29 | public function __construct( | 29 | public function __construct( | |||
| 30 | \Magento\Backend\Block\Template\Context $context, | 30 | \Magento\Backend\Block\Template\Context $context, | |||
| 31 | \Smartwave\Porto\Helper\Data $helper | 31 | \Smartwave\Porto\Helper\Data $helper | |||
| 32 | ) { | 32 | ) { | |||
| 33 | $this->_helper = $helper; | 33 | $this->_helper = $helper; | |||
| 34 | 34 | |||||
| 35 | parent::__construct($context); | 35 | parent::__construct($context); | |||
| 36 | } | 36 | } | |||
| 37 | 37 | |||||
| 38 | /** | 38 | /** | |||
| 39 | * Set Button Label | 39 | * Set Button Label | |||
| 40 | * | 40 | * | |||
| 41 | * @param string $buttonLabel | 41 | * @param string $buttonLabel | |||
| 42 | * @return \Smartwave\Porto\Block\System\Config\Form\Button\Import\Cms | 42 | * @return \Smartwave\Porto\Block\System\Config\Form\Button\Import\Cms | |||
| 43 | */ | 43 | */ | |||
| 44 | public function setButtonLabel($buttonLabel) | 44 | public function setButtonLabel($buttonLabel) | |||
| 45 | { | 45 | { | |||
| 46 | $this->_buttonLabel = $buttonLabel; | 46 | $this->_buttonLabel = $buttonLabel; | |||
| 47 | return $this; | 47 | return $this; | |||
| 48 | } | 48 | } | |||
| 49 | 49 | |||||
| 50 | /** | 50 | /** | |||
| 51 | * Get Action Url | 51 | * Get Action Url | |||
| 52 | * | 52 | * | |||
| 53 | * @return string | 53 | * @return string | |||
| 54 | */ | 54 | */ | |||
| 55 | public function getActionUrl() | 55 | public function getActionUrl() | |||
| 56 | { | 56 | { | |||
| 57 | return $this->_actionUrl; | 57 | return $this->_actionUrl; | |||
| 58 | } | 58 | } | |||
| 59 | 59 | |||||
| 60 | /** | 60 | /** | |||
| 61 | * Set Validate VAT Button Label | 61 | * Set Validate VAT Button Label | |||
| 62 | * | 62 | * | |||
| 63 | * @param string $vatButtonLabel | 63 | * @param string $vatButtonLabel | |||
| 64 | * @return \Smartwave\Porto\Block\System\Config\Form\Button\Import\Cms | 64 | * @return \Smartwave\Porto\Block\System\Config\Form\Button\Import\Cms | |||
| 65 | */ | 65 | */ | |||
| 66 | public function setActionUrl($actionUrl) | 66 | public function setActionUrl($actionUrl) | |||
| 67 | { | 67 | { | |||
| 68 | $this->_actionUrl = $actionUrl; | 68 | $this->_actionUrl = $actionUrl; | |||
| 69 | return $this; | 69 | return $this; | |||
| 70 | } | 70 | } | |||
| 71 | 71 | |||||
| 72 | /** | 72 | /** | |||
| 73 | * Get Import Type | 73 | * Get Import Type | |||
| 74 | * | 74 | * | |||
| 75 | * @return string | 75 | * @return string | |||
| 76 | */ | 76 | */ | |||
| 77 | public function getImportType() | 77 | public function getImportType() | |||
| 78 | { | 78 | { | |||
| 79 | return $this->_importType; | 79 | return $this->_importType; | |||
| 80 | } | 80 | } | |||
| 81 | 81 | |||||
| 82 | /** | 82 | /** | |||
| 83 | * Set Validate VAT Button Label | 83 | * Set Validate VAT Button Label | |||
| 84 | * | 84 | * | |||
| 85 | * @param string $vatButtonLabel | 85 | * @param string $vatButtonLabel | |||
| 86 | * @return \Smartwave\Porto\Block\System\Config\Form\Button\Import\Cms | 86 | * @return \Smartwave\Porto\Block\System\Config\Form\Button\Import\Cms | |||
| 87 | */ | 87 | */ | |||
| 88 | public function setImportType($importType) | 88 | public function setImportType($importType) | |||
| 89 | { | 89 | { | |||
| 90 | $this->_importType = $importType; | 90 | $this->_importType = $importType; | |||
| 91 | return $this; | 91 | return $this; | |||
| 92 | } | 92 | } | |||
| 93 | 93 | |||||
| 94 | /** | 94 | /** | |||
| 95 | * Set template to itself | 95 | * Set template to itself | |||
| 96 | * | 96 | * | |||
| 97 | * @return \Smartwave\Porto\Block\System\Config\Form\Button\Import\Cms | 97 | * @return \Smartwave\Porto\Block\System\Config\Form\Button\Import\Cms | |||
| 98 | */ | 98 | */ | |||
| 99 | protected function _prepareLayout() | 99 | protected function _prepareLayout() | |||
| 100 | { | 100 | { | |||
| 101 | parent::_prepareLayout(); | 101 | parent::_prepareLayout(); | |||
| 102 | if (!$this->getTemplate()) { | 102 | if (!$this->getTemplate()) { | |||
| 103 | $this->setTemplate('system/config/cms_button.phtml'); | 103 | $this->setTemplate('system/config/cms_button.phtml'); | |||
| 104 | } | 104 | } | |||
| 105 | return $this; | 105 | return $this; | |||
| 106 | } | 106 | } | |||
| 107 | 107 | |||||
| 108 | /** | 108 | /** | |||
| 109 | * Unset some non-related element parameters | 109 | * Unset some non-related element parameters | |||
| 110 | * | 110 | * | |||
| 111 | * @param \Magento\Framework\Data\Form\Element\AbstractElement $element | 111 | * @param \Magento\Framework\Data\Form\Element\AbstractElement $element | |||
| 112 | * @return string | 112 | * @return string | |||
| 113 | */ | 113 | */ | |||
| 114 | public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) | 114 | public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) | |||
| 115 | { | 115 | { | |||
| 116 | $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue(); | 116 | $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue(); | |||
| 117 | return parent::render($element); | 117 | return parent::render($element); | |||
| 118 | } | 118 | } | |||
| 119 | 119 | |||||
| 120 | /** | 120 | /** | |||
| 121 | * Get the button and scripts contents | 121 | * Get the button and scripts contents | |||
| 122 | * | 122 | * | |||
| 123 | * @param \Magento\Framework\Data\Form\Element\AbstractElement $element | 123 | * @param \Magento\Framework\Data\Form\Element\AbstractElement $element | |||
| 124 | * @return string | 124 | * @return string | |||
| 125 | */ | 125 | */ | |||
| 126 | protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element) | 126 | protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element) | |||
| 127 | { | 127 | { | |||
| 128 | $originalData = $element->getOriginalData(); | 128 | $originalData = $element->getOriginalData(); | |||
| 129 | $buttonLabel = !empty($originalData['button_label']) ? $originalData['button_label'] : $this->_buttonLabel; | 129 | $buttonLabel = !empty($originalData['button_label']) ? $originalData['button_label'] : $this->_buttonLabel; | |||
| 130 | $action = !empty($originalData['action_url']) ? $originalData['action_url'] : ''; | 130 | $action = !empty($originalData['action_url']) ? $originalData['action_url'] : ''; | |||
| 131 | if($action) { | 131 | if($action) { | |||
| 132 | $this->setActionUrl($action); | 132 | $this->setActionUrl($action); | |||
| 133 | } | 133 | } | |||
| 134 | $type = !empty($originalData['import_type']) ? $originalData['import_type'] : ''; | 134 | $type = !empty($originalData['import_type']) ? $originalData['import_type'] : ''; | |||
| 135 | if($type) { | 135 | if($type) { | |||
| 136 | $this->setImportType($type); | 136 | $this->setImportType($type); | |||
| 137 | } | 137 | } | |||
| 138 | $after_html = ""; | 138 | $after_html = ""; | |||
| 139 | $button_class = ""; | 139 | $button_class = ""; | |||
| 140 | if(!$this->_helper->checkPurchaseCode()) { | 140 | if(!$this->_helper->checkPurchaseCode()) { | |||
| 141 | $button_class = "disabled"; | 141 | $button_class = "disabled"; | |||
| 142 | $after_html = '<em style="color:#f00;font-size:10px;line-height:1;">Activation is required.</em>'; | 142 | $after_html = '<em style="color:#f00;font-size:10px;line-height:1;">Activation is required.</em>'; | |||
| 143 | } | 143 | } | |||
| 144 | $this->addData( | 144 | $this->addData( | |||
| 145 | [ | 145 | [ | |||
| 146 | 'button_label' => __($buttonLabel), | 146 | 'button_label' => __($buttonLabel), | |||
| 147 | 'import_type' => $type, | 147 | 'import_type' => $type, | |||
| 148 | 'button_class' => $button_class, | 148 | 'button_class' => $button_class, | |||
| 149 | 'html_id' => $element->getHtmlId(), | 149 | 'html_id' => $element->getHtmlId(), | |||
| 150 | 'ajax_url' => $this->_urlBuilder->getUrl($action), | 150 | 'ajax_url' => $this->_urlBuilder->getUrl($action), | |||
| 151 | ] | 151 | ] | |||
| 152 | ); | 152 | ); | |||
| 153 | 153 | |||||
| 154 | return $this->_toHtml().$after_html; | 154 | return $this->_toHtml().$after_html; | |||
| 155 | } | 155 | } | |||
| 156 | } | 156 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993–2019 Araxis Ltd (www.araxis.com). All rights reserved.