87. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2021-05-13 09:08:41 +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.

87.1 Files compared

#LocationFileLast Modified
1/Applications/Ampps/www/Porto 3.2.2/Theme Files/Magento 2.x/Porto Theme/app/code/Smartwave/Porto/Block/System/Config/Form/Button/ImportDemo.php2019-12-13 07:43:52 +0000
2/Applications/Ampps/www/Porto v4.0.0/Theme Files/Magento 2.x/Porto Theme/app/code/Smartwave/Porto/Block/System/Config/Form/Button/ImportDemo.php2021-01-05 09:13:24 +0000

87.2 Comparison summary

DescriptionBetween
Files 1 and 2
Text BlocksLines
Unchanged10338
Changed963
Inserted00
Removed00

87.3 Comparison options

WhitespaceConsecutive whitespace is treated as a single space
Character caseDifferences in character case are significant
Line endingsDifferences in line endings (CR and LF characters) are ignored
CR/LF charactersNot shown in the comparison detail
Active line-pairing rules

87.4 Active regular expressions

No regular expressions were active.

87.5 Comparison detail

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')],    
152             ['demo_version' => 'demo01_old', 'label' => __('Old - Demo 1')],     
153             ['demo_version' => 'demo02_old', 'label' => __('Old - Demo 2')],     
154             ['demo_version' => 'demo03_old', 'label' => __('Old - Demo 3')],     
155             ['demo_version' => 'demo04_old', 'label' => __('Old - Demo 4')],     
156             ['demo_version' => 'demo05_old', 'label' => __('Old - Demo 5')],     
157             ['demo_version' => 'demo06_old', 'label' => __('Old - Demo 6')],     
158             ['demo_version' => 'demo07_old', 'label' => __('Old - Demo 7')],     
159             ['demo_version' => 'demo08_old', 'label' => __('Old - Demo 8')],     
160             ['demo_version' => 'demo09_old', 'label' => __('Old - Demo 9')],     
161             ['demo_version' => 'demo10_old', 'label' => __('Old - Demo 10')],     
162             ['demo_version' => 'demo11_old', 'label' => __('Old - Demo 11')],     
163             ['demo_version' => 'demo12_old', 'label' => __('Old - Demo 12')],     
164             ['demo_version' => 'demo13_old', 'label' => __('Old - Demo 13')],     
165             ['demo_version' => 'demo14_old', 'label' => __('Old - Demo 14')],    
166             ['demo_version' => 'demo15_old', 'label' => __('Old - Demo 15')],    
167             ['demo_version' => 'demo16_old', 'label' => __('Old - Demo 16')],    
168             ['demo_version' => 'demo17_old', 'label' => __('Old - Demo 17')],    
169             ['demo_version' => 'demo18_old', 'label' => __('Old - Demo 18')],    
170             ['demo_version' => 'demo19_old', 'label' => __('Old - Demo 19')],    
171             ['demo_version' => 'demo20_old', 'label' => __('Old - Demo 20')],    
172         ]; 151         ];
173     } 152     }
174  153 
175     /** 154     /**
176      * Get the button and scripts contents 155      * Get the button and scripts contents
177      * 156      *
178      * @param \Magento\Framework\Data\Form\Element\AbstractElement $element 157      * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
179      * @return string 158      * @return string
180      */ 159      */
181     protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element) 160     protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
182     { 161     {
183         $originalData = $element->getOriginalData(); 162         $originalData = $element->getOriginalData();
184         $buttonLabel = !empty($originalData['button_label']) ? $originalData['button_label'] : $this->_buttonLabel; 163         $buttonLabel = !empty($originalData['button_label']) ? $originalData['button_label'] : $this->_buttonLabel;
185         $action = !empty($originalData['action_url']) ? $originalData['action_url'] : ''; 164         $action = !empty($originalData['action_url']) ? $originalData['action_url'] : '';
186         if($action) { 165         if($action) {
187             $this->setActionUrl($action); 166             $this->setActionUrl($action);
188         } 167         }
189         // $demo_version = !empty($originalData['demo_version']) ? $originalData['demo_version'] : ''; 168         // $demo_version = !empty($originalData['demo_version']) ? $originalData['demo_version'] : '';
190         // if($demo_version) { 169         // if($demo_version) {
191         //     $this->setDemoVersion($demo_version); 170         //     $this->setDemoVersion($demo_version);
192         // } 171         // }
193          172 
194         $after_html = ""; 173         $after_html = "";
195         $button_class = ""; 174         $button_class = "";
196         if(!$this->_helper->checkPurchaseCode()) { 175         if(!$this->_helper->checkPurchaseCode()) {
197             $button_class = "disabled"; 176             $button_class = "disabled";
198             $after_html = '<em style="color:#f00;font-size:10px;line-height:1;">Activation is required.</em>'; 177             $after_html = '<em style="color:#f00;font-size:10px;line-height:1;">Activation is required.</em>';
199         } 178         }
200         $this->addData( 179         $this->addData(
201             [ 180             [
202                 'button_label' => __($buttonLabel), 181                 'button_label' => __($buttonLabel),
203                 //'demo_version' => $demo_version, 182                 //'demo_version' => $demo_version,
204                 'button_class' => $button_class, 183                 'button_class' => $button_class,
205                 'html_id' => $element->getHtmlId(), 184                 'html_id' => $element->getHtmlId(),
206                 'ajax_url' => $this->_urlBuilder->getUrl($action), 185                 'ajax_url' => $this->_urlBuilder->getUrl($action),
207             ] 186             ]
208         ); 187         );
209         return $this->_toHtml().$after_html; 188         return $this->_toHtml().$after_html;
210     } 189     }
211 } 190 }