Produced by Araxis Merge on 2023-07-12 04:42:43 +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 | Porto v4.0.5/Theme Files/Porto Theme/app/code/Smartwave/Porto/Block/System/Config/Form/Button/Import | Demo.php | 2023-02-15 08:54:42 +0000 |
| 2 | Porto v4.0.6/Theme Files/Porto Theme/app/code/Smartwave/Porto/Block/System/Config/Form/Button/Import | Demo.php | 2023-06-16 07:50:46 +0000 |
| Description | Between Files 1 and 2 | |
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 398 |
| Changed | 0 | 0 |
| Inserted | 1 | 2 |
| 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 Demo extends \Magento\Config\Block\System\Config\Form\Field | 14 | class Demo 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 $_demoVersion; | 25 | protected $_demoVersion; | |||
| 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 | * Set Button Label | 38 | * Set Button Label | |||
| 39 | * | 39 | * | |||
| 40 | * @param string $buttonLabel | 40 | * @param string $buttonLabel | |||
| 41 | * @return \Smartwave\Porto\Block\System\Config\Form\Button\Import\Cms | 41 | * @return \Smartwave\Porto\Block\System\Config\Form\Button\Import\Cms | |||
| 42 | */ | 42 | */ | |||
| 43 | public function setButtonLabel($buttonLabel) | 43 | public function setButtonLabel($buttonLabel) | |||
| 44 | { | 44 | { | |||
| 45 | $this->_buttonLabel = $buttonLabel; | 45 | $this->_buttonLabel = $buttonLabel; | |||
| 46 | return $this; | 46 | return $this; | |||
| 47 | } | 47 | } | |||
| 48 | 48 | |||||
| 49 | /** | 49 | /** | |||
| 50 | * Get Action Url | 50 | * Get Action Url | |||
| 51 | * | 51 | * | |||
| 52 | * @return string | 52 | * @return string | |||
| 53 | */ | 53 | */ | |||
| 54 | public function getActionUrl() | 54 | public function getActionUrl() | |||
| 55 | { | 55 | { | |||
| 56 | return $this->_actionUrl; | 56 | return $this->_actionUrl; | |||
| 57 | } | 57 | } | |||
| 58 | 58 | |||||
| 59 | /** | 59 | /** | |||
| 60 | * Set Validate VAT Button Label | 60 | * Set Validate VAT Button Label | |||
| 61 | * | 61 | * | |||
| 62 | * @param string $vatButtonLabel | 62 | * @param string $vatButtonLabel | |||
| 63 | * @return \Smartwave\Porto\Block\System\Config\Form\Button\Import\Cms | 63 | * @return \Smartwave\Porto\Block\System\Config\Form\Button\Import\Cms | |||
| 64 | */ | 64 | */ | |||
| 65 | public function setActionUrl($actionUrl) | 65 | public function setActionUrl($actionUrl) | |||
| 66 | { | 66 | { | |||
| 67 | $this->_actionUrl = $actionUrl; | 67 | $this->_actionUrl = $actionUrl; | |||
| 68 | return $this; | 68 | return $this; | |||
| 69 | } | 69 | } | |||
| 70 | 70 | |||||
| 71 | /** | 71 | /** | |||
| 72 | * Get Import Type | 72 | * Get Import Type | |||
| 73 | * | 73 | * | |||
| 74 | * @return string | 74 | * @return string | |||
| 75 | */ | 75 | */ | |||
| 76 | public function getDemoVersion() | 76 | public function getDemoVersion() | |||
| 77 | { | 77 | { | |||
| 78 | return $this->_demoVersion; | 78 | return $this->_demoVersion; | |||
| 79 | } | 79 | } | |||
| 80 | 80 | |||||
| 81 | /** | 81 | /** | |||
| 82 | * Set Validate VAT Button Label | 82 | * Set Validate VAT Button Label | |||
| 83 | * | 83 | * | |||
| 84 | * @param string $vatButtonLabel | 84 | * @param string $vatButtonLabel | |||
| 85 | * @return \Smartwave\Porto\Block\System\Config\Form\Button\Import\Cms | 85 | * @return \Smartwave\Porto\Block\System\Config\Form\Button\Import\Cms | |||
| 86 | */ | 86 | */ | |||
| 87 | public function setDemoVersion($demoVersion) | 87 | public function setDemoVersion($demoVersion) | |||
| 88 | { | 88 | { | |||
| 89 | $this->_demoVersion = $demoVersion; | 89 | $this->_demoVersion = $demoVersion; | |||
| 90 | return $this; | 90 | return $this; | |||
| 91 | } | 91 | } | |||
| 92 | 92 | |||||
| 93 | /** | 93 | /** | |||
| 94 | * Set template to itself | 94 | * Set template to itself | |||
| 95 | * | 95 | * | |||
| 96 | * @return \Smartwave\Porto\Block\System\Config\Form\Button\Import\Cms | 96 | * @return \Smartwave\Porto\Block\System\Config\Form\Button\Import\Cms | |||
| 97 | */ | 97 | */ | |||
| 98 | protected function _prepareLayout() | 98 | protected function _prepareLayout() | |||
| 99 | { | 99 | { | |||
| 100 | parent::_prepareLayout(); | 100 | parent::_prepareLayout(); | |||
| 101 | if (!$this->getTemplate()) { | 101 | if (!$this->getTemplate()) { | |||
| 102 | $this->setTemplate('system/config/demo_button.phtml'); | 102 | $this->setTemplate('system/config/demo_button.phtml'); | |||
| 103 | } | 103 | } | |||
| 104 | return $this; | 104 | return $this; | |||
| 105 | } | 105 | } | |||
| 106 | 106 | |||||
| 107 | /** | 107 | /** | |||
| 108 | * Unset some non-related element parameters | 108 | * Unset some non-related element parameters | |||
| 109 | * | 109 | * | |||
| 110 | * @param \Magento\Framework\Data\Form\Element\AbstractElement $element | 110 | * @param \Magento\Framework\Data\Form\Element\AbstractElement $element | |||
| 111 | * @return string | 111 | * @return string | |||
| 112 | */ | 112 | */ | |||
| 113 | public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) | 113 | public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) | |||
| 114 | { | 114 | { | |||
| 115 | $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue(); | 115 | $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue(); | |||
| 116 | return parent::render($element); | 116 | return parent::render($element); | |||
| 117 | } | 117 | } | |||
| 118 | 118 | |||||
| 119 | public function getDemos() | 119 | public function getDemos() | |||
| 120 | { | 120 | { | |||
| 121 | return [ | 121 | return [ | |||
| 122 | ['demo_version' => 'demo01', 'label' => __('Demo 1')], | 122 | ['demo_version' => 'demo01', 'label' => __('Demo 1')], | |||
| 123 | ['demo_version' => 'demo02', 'label' => __('Demo 2')], | 123 | ['demo_version' => 'demo02', 'label' => __('Demo 2')], | |||
| 124 | ['demo_version' => 'demo03', 'label' => __('Demo 3')], | 124 | ['demo_version' => 'demo03', 'label' => __('Demo 3')], | |||
| 125 | ['demo_version' => 'demo04', 'label' => __('Demo 4')], | 125 | ['demo_version' => 'demo04', 'label' => __('Demo 4')], | |||
| 126 | ['demo_version' => 'demo05', 'label' => __('Demo 5')], | 126 | ['demo_version' => 'demo05', 'label' => __('Demo 5')], | |||
| 127 | ['demo_version' => 'demo06', 'label' => __('Demo 6')], | 127 | ['demo_version' => 'demo06', 'label' => __('Demo 6')], | |||
| 128 | ['demo_version' => 'demo07', 'label' => __('Demo 7')], | 128 | ['demo_version' => 'demo07', 'label' => __('Demo 7')], | |||
| 129 | ['demo_version' => 'demo08', 'label' => __('Demo 8')], | 129 | ['demo_version' => 'demo08', 'label' => __('Demo 8')], | |||
| 130 | ['demo_version' => 'demo09', 'label' => __('Demo 9')], | 130 | ['demo_version' => 'demo09', 'label' => __('Demo 9')], | |||
| 131 | ['demo_version' => 'demo10', 'label' => __('Demo 10')], | 131 | ['demo_version' => 'demo10', 'label' => __('Demo 10')], | |||
| 132 | ['demo_version' => 'demo11', 'label' => __('Demo 11')], | 132 | ['demo_version' => 'demo11', 'label' => __('Demo 11')], | |||
| 133 | ['demo_version' => 'demo12', 'label' => __('Demo 12')], | 133 | ['demo_version' => 'demo12', 'label' => __('Demo 12')], | |||
| 134 | ['demo_version' => 'demo13', 'label' => __('Demo 13')], | 134 | ['demo_version' => 'demo13', 'label' => __('Demo 13')], | |||
| 135 | ['demo_version' => 'demo14', 'label' => __('Demo 14')], | 135 | ['demo_version' => 'demo14', 'label' => __('Demo 14')], | |||
| 136 | ['demo_version' => 'demo15', 'label' => __('Demo 15')], | 136 | ['demo_version' => 'demo15', 'label' => __('Demo 15')], | |||
| 137 | ['demo_version' => 'demo16', 'label' => __('Demo 16')], | 137 | ['demo_version' => 'demo16', 'label' => __('Demo 16')], | |||
| 138 | ['demo_version' => 'demo17', 'label' => __('Demo 17')], | 138 | ['demo_version' => 'demo17', 'label' => __('Demo 17')], | |||
| 139 | ['demo_version' => 'demo18', 'label' => __('Demo 18')], | 139 | ['demo_version' => 'demo18', 'label' => __('Demo 18')], | |||
| 140 | ['demo_version' => 'demo19', 'label' => __('Demo 19')], | 140 | ['demo_version' => 'demo19', 'label' => __('Demo 19')], | |||
| 141 | ['demo_version' => 'demo20', 'label' => __('Demo 20')], | 141 | ['demo_version' => 'demo20', 'label' => __('Demo 20')], | |||
| 142 | ['demo_version' => 'demo21', 'label' => __('Demo 21')], | 142 | ['demo_version' => 'demo21', 'label' => __('Demo 21')], | |||
| 143 | ['demo_version' => 'demo22', 'label' => __('Demo 22')], | 143 | ['demo_version' => 'demo22', 'label' => __('Demo 22')], | |||
| 144 | ['demo_version' => 'demo23', 'label' => __('Demo 23')], | 144 | ['demo_version' => 'demo23', 'label' => __('Demo 23')], | |||
| 145 | ['demo_version' => 'demo24', 'label' => __('Demo 24')], | 145 | ['demo_version' => 'demo24', 'label' => __('Demo 24')], | |||
| 146 | ['demo_version' => 'demo25', 'label' => __('Demo 25')], | 146 | ['demo_version' => 'demo25', 'label' => __('Demo 25')], | |||
| 147 | ['demo_version' => 'demo26', 'label' => __('Demo 26')], | 147 | ['demo_version' => 'demo26', 'label' => __('Demo 26')], | |||
| 148 | ['demo_version' => 'demo27', 'label' => __('Demo 27')], | 148 | ['demo_version' => 'demo27', 'label' => __('Demo 27')], | |||
| 149 | ['demo_version' => 'demo28', 'label' => __('Demo 28')], | 149 | ['demo_version' => 'demo28', 'label' => __('Demo 28')], | |||
| 150 | ['demo_version' => 'demo29', 'label' => __('Demo 29')], | 150 | ['demo_version' => 'demo29', 'label' => __('Demo 29')], | |||
| 151 | ['demo_version' => 'demo30', 'label' => __('Demo 30')], | 151 | ['demo_version' => 'demo30', 'label' => __('Demo 30')], | |||
| 152 | ['demo_version' => 'demo31', 'label' => __('Demo 31')], | 152 | ['demo_version' => 'demo31', 'label' => __('Demo 31')], | |||
| 153 | ['demo_version' => 'demo32', 'label' => __('Demo 32')], | 153 | ['demo_version' => 'demo32', 'label' => __('Demo 32')], | |||
| 154 | ['demo_version' => 'demo33', 'label' => __('Demo 33')], | 154 | ['demo_version' => 'demo33', 'label' => __('Demo 33')], | |||
| 155 | ['demo_version' => 'demo34', 'label' => __('Demo 34')], | 155 | ['demo_version' => 'demo34', 'label' => __('Demo 34')], | |||
| 156 | ['demo_version' => 'demo35', 'label' => __('Demo 35')], | 156 | ['demo_version' => 'demo35', 'label' => __('Demo 35')], | |||
| 157 | ['demo_version' => 'demo36', 'label' => __('Demo 36')], | 157 | ['demo_version' => 'demo36', 'label' => __('Demo 36')], | |||
| 158 | ['demo_version' => 'demo37', 'label' => __('Demo 37')], | 158 | ['demo_version' => 'demo37', 'label' => __('Demo 37')], | |||
| 159 | ['demo_version' => 'demo38', 'label' => __('Demo 38')], | 159 | ['demo_version' => 'demo38', 'label' => __('Demo 38')], | |||
| 160 | ['demo_version' => 'demo39', 'label' => __('Demo 39')], | |||||
| 161 | ['demo_version' => 'demo40', 'label' => __('Demo 40')], | |||||
| 160 | ]; | 162 | ]; | |||
| 161 | } | 163 | } | |||
| 162 | 164 | |||||
| 163 | /** | 165 | /** | |||
| 164 | * Get the button and scripts contents | 166 | * Get the button and scripts contents | |||
| 165 | * | 167 | * | |||
| 166 | * @param \Magento\Framework\Data\Form\Element\AbstractElement $element | 168 | * @param \Magento\Framework\Data\Form\Element\AbstractElement $element | |||
| 167 | * @return string | 169 | * @return string | |||
| 168 | */ | 170 | */ | |||
| 169 | protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element) | 171 | protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element) | |||
| 170 | { | 172 | { | |||
| 171 | $originalData = $element->getOriginalData(); | 173 | $originalData = $element->getOriginalData(); | |||
| 172 | $buttonLabel = !empty($originalData['button_label']) ? $originalData['button_label'] : $this->_buttonLabel; | 174 | $buttonLabel = !empty($originalData['button_label']) ? $originalData['button_label'] : $this->_buttonLabel; | |||
| 173 | $action = !empty($originalData['action_url']) ? $originalData['action_url'] : ''; | 175 | $action = !empty($originalData['action_url']) ? $originalData['action_url'] : ''; | |||
| 174 | if($action) { | 176 | if($action) { | |||
| 175 | $this->setActionUrl($action); | 177 | $this->setActionUrl($action); | |||
| 176 | } | 178 | } | |||
| 177 | // $demo_version = !empty($originalData['demo_version']) ? $originalData['demo_version'] : ''; | 179 | // $demo_version = !empty($originalData['demo_version']) ? $originalData['demo_version'] : ''; | |||
| 178 | // if($demo_version) { | 180 | // if($demo_version) { | |||
| 179 | // $this->setDemoVersion($demo_version); | 181 | // $this->setDemoVersion($demo_version); | |||
| 180 | // } | 182 | // } | |||
| 181 | 183 | |||||
| 182 | $after_html = ""; | 184 | $after_html = ""; | |||
| 183 | $button_class = ""; | 185 | $button_class = ""; | |||
| 184 | if(!$this->_helper->checkPurchaseCode()) { | 186 | if(!$this->_helper->checkPurchaseCode()) { | |||
| 185 | $button_class = "disabled"; | 187 | $button_class = "disabled"; | |||
| 186 | $after_html = '<em style="color:#f00;font-size:10px;line-height:1;">Activation is required.</em>'; | 188 | $after_html = '<em style="color:#f00;font-size:10px;line-height:1;">Activation is required.</em>'; | |||
| 187 | } | 189 | } | |||
| 188 | $this->addData( | 190 | $this->addData( | |||
| 189 | [ | 191 | [ | |||
| 190 | 'button_label' => __($buttonLabel), | 192 | 'button_label' => __($buttonLabel), | |||
| 191 | //'demo_version' => $demo_version, | 193 | //'demo_version' => $demo_version, | |||
| 192 | 'button_class' => $button_class, | 194 | 'button_class' => $button_class, | |||
| 193 | 'html_id' => $element->getHtmlId(), | 195 | 'html_id' => $element->getHtmlId(), | |||
| 194 | 'ajax_url' => $this->_urlBuilder->getUrl($action), | 196 | 'ajax_url' => $this->_urlBuilder->getUrl($action), | |||
| 195 | ] | 197 | ] | |||
| 196 | ); | 198 | ); | |||
| 197 | return $this->_toHtml().$after_html; | 199 | return $this->_toHtml().$after_html; | |||
| 198 | } | 200 | } | |||
| 199 | } | 201 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993–2019 Araxis Ltd (www.araxis.com). All rights reserved.