Version Notes
Visit product homepage at:
http://www.artio.net/magento-extensions/m-turbo-accelerator
Download this release
Release Info
Developer | Magento Core Team |
Extension | MTurbo |
Version | 1.2.8 |
Comparing to | |
See all releases |
Code changes from version 1.2.7.1 to 1.2.8
- app/code/local/Artio/MTurbo/Block/Adminhtml/Edit/Tab/Dynamic.php +160 -73
- app/code/local/Artio/MTurbo/Block/Adminhtml/Edit/Tab/Url.php +11 -12
- app/code/local/Artio/MTurbo/Block/Adminhtml/Welcome/Form.php +6 -1
- app/code/local/Artio/MTurbo/Block/Ajax.php +34 -38
- app/code/local/Artio/MTurbo/Block/Checkout/Cart/Item/Renderer/Configurable.php +31 -0
- app/code/local/Artio/MTurbo/Block/Dynamic.php +79 -0
- app/code/local/Artio/MTurbo/Block/Esi.php +48 -0
- app/code/local/Artio/MTurbo/Helper/Data.php +2 -2
- app/code/local/Artio/MTurbo/Helper/Functions.php +152 -78
- app/code/local/Artio/MTurbo/Helper/Info.php +1 -1
- app/code/local/Artio/MTurbo/Model/Config.php +66 -1
- app/code/local/Artio/MTurbo/Model/Config/DynamicTransformer.php +127 -102
- app/code/local/Artio/MTurbo/Model/DownloadMethods/Curlmulti.php +2 -0
- app/code/local/Artio/MTurbo/Model/DownloadQueue.php +2 -2
- app/code/local/Artio/MTurbo/Model/Htaccess.php +17 -1
- app/code/local/Artio/MTurbo/Model/JsPatch.php +0 -129
- app/code/local/Artio/MTurbo/Model/Layout.php +317 -0
- app/code/local/Artio/MTurbo/Model/Mturbo.php +42 -18
- app/code/local/Artio/MTurbo/Model/Mturbo/Event.php +14 -2
- app/code/local/Artio/MTurbo/Model/Mturbo/File.php +4 -0
- app/code/local/Artio/MTurbo/Model/Observer.php +174 -156
- app/code/local/Artio/MTurbo/Model/htaccess/htaccessstoreboth.txt +46 -0
- app/code/local/Artio/MTurbo/Model/htaccess/htaccesswebsiteboth.txt +21 -0
- app/code/local/Artio/MTurbo/Model/scripts/wgetlib.so +1 -1
- app/code/local/Artio/MTurbo/controllers/Adminhtml/MturboController.php +52 -19
- app/code/local/Artio/MTurbo/controllers/AdminhtmlController.php +28 -7
- app/code/local/Artio/MTurbo/controllers/IndexController.php +177 -34
- app/code/local/Artio/MTurbo/etc/config.xml +5 -1
- app/code/local/Artio/MTurbo/sql/mturbo_setup/mysql4-upgrade-1.0.0-1.2.0.php +0 -96
- app/code/local/Artio/MTurbo/sql/mturbo_setup/mysql4-upgrade-1.2.1-1.2.7.php +8 -12
- app/code/local/Artio/MTurbo/sql/mturbo_setup/{mysql4-upgrade-1.2.0-1.2.1.php → mysql4-upgrade-1.2.7-1.2.8.php} +5 -18
- app/design/adminhtml/default/default/layout/mturbo.xml +2 -1
- app/design/adminhtml/default/default/template/mturbo/formkey_warn.phtml +61 -0
- app/design/adminhtml/default/default/template/mturbo/tabs/dynamic.phtml +82 -0
- app/design/frontend/base/default/layout/mturbo.xml +37 -0
- app/design/frontend/default/default/layout/mturbo.xml +1 -1
- package.xml +5 -5
- skin/frontend/base/default/js/mturbo.js +0 -55
- skin/frontend/default/default/js/mturbo.js +0 -55
app/code/local/Artio/MTurbo/Block/Adminhtml/Edit/Tab/Dynamic.php
CHANGED
@@ -36,6 +36,22 @@ class Artio_MTurbo_Block_Adminhtml_Edit_Tab_Dynamic
|
|
36 |
extends Artio_MTurbo_Block_Adminhtml_Edit_Tab_Abstract
|
37 |
{
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
/**
|
40 |
* Constructor.
|
41 |
*/
|
@@ -66,58 +82,22 @@ class Artio_MTurbo_Block_Adminhtml_Edit_Tab_Dynamic
|
|
66 |
|
67 |
/* fieldset for automatic refresh */
|
68 |
$layoutFieldsetDefault = $form->addFieldset('dynamic_block_default', array(
|
69 |
-
'legend' => $this->getMyHelper()->__( '
|
70 |
'class' => 'fieldset'
|
71 |
));
|
72 |
|
73 |
-
$layoutFieldsetDefault->addField('cartsidebar', 'select', array(
|
74 |
-
'name' => 'cartsidebar',
|
75 |
-
'label' => $this->getMyHelper()->__('Cart Block (sidebar)').':',
|
76 |
-
'options' => array(
|
77 |
-
0 => $this->getMyHelper()->__('No'),
|
78 |
-
1 => $this->getMyHelper()->__ ( 'Yes' ))
|
79 |
-
));
|
80 |
-
|
81 |
-
$layoutFieldsetDefault->addField('pollsidebar', 'select', array(
|
82 |
-
'name' => 'pollsidebar',
|
83 |
-
'label' => $this->getMyHelper()->__('Poll Block (sidebar)').':',
|
84 |
-
'options' => array(
|
85 |
-
0 => $this->getMyHelper()->__('No'),
|
86 |
-
1 => $this->getMyHelper()->__ ( 'Yes' ))
|
87 |
-
));
|
88 |
-
|
89 |
-
$layoutFieldsetDefault->addField('comparesidebar', 'select', array(
|
90 |
-
'name' => 'comparesidebar',
|
91 |
-
'label' => $this->getMyHelper()->__('Compare Block (sidebar)').':',
|
92 |
-
'options' => array(
|
93 |
-
0 => $this->getMyHelper()->__('No'),
|
94 |
-
1 => $this->getMyHelper()->__ ( 'Yes' ))
|
95 |
-
));
|
96 |
-
|
97 |
$layoutFieldsetDefault->addField('cartlink', 'text', array(
|
98 |
'name' => 'cartlink',
|
99 |
'label' => $this->getMyHelper()->__('CSS selector for cart link').':',
|
100 |
'after_element_html' => '<span><i>'.$this->getMyHelper()->__("Separate the values by comma ','.").'</i></span>'
|
101 |
));
|
102 |
-
|
103 |
-
|
104 |
-
$layoutFieldsetUser = $form->addFieldset('dynamic_block_user', array(
|
105 |
-
'legend' => $this->getMyHelper()->__( 'User dynamic loaded blocks (only for advanced developers).' ),
|
106 |
-
'class' => 'fieldset'
|
107 |
-
));
|
108 |
-
|
109 |
-
$layoutFieldsetUser->addField('userblocks', 'textarea', array(
|
110 |
-
'name' => 'userblocks',
|
111 |
-
'label' => $this->getMyHelper()->__('Layout names of dynamic loaded blocks').':',
|
112 |
-
'after_element_html' => '<span><i>'.$this->getMyHelper()->__("Separate the block identifiers by comma ','. Separate a layout handle from a layout name by '$'. (Ex.: block,catalog_category_default\$other_block)").'</i></span>'
|
113 |
-
));
|
114 |
-
|
115 |
-
$this->_addJsFixFieldset($form);
|
116 |
-
|
117 |
}
|
118 |
|
119 |
/* bind data */
|
120 |
-
|
|
|
|
|
121 |
$this->setForm($form);
|
122 |
|
123 |
return parent::_prepareForm();
|
@@ -162,41 +142,148 @@ class Artio_MTurbo_Block_Adminhtml_Edit_Tab_Dynamic
|
|
162 |
}
|
163 |
|
164 |
|
165 |
-
}
|
166 |
|
167 |
/**
|
168 |
-
*
|
169 |
-
*
|
|
|
|
|
|
|
|
|
170 |
*/
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
}
|
201 |
|
202 |
}
|
36 |
extends Artio_MTurbo_Block_Adminhtml_Edit_Tab_Abstract
|
37 |
{
|
38 |
|
39 |
+
/**
|
40 |
+
* The form data values
|
41 |
+
*
|
42 |
+
* array(
|
43 |
+
* 'cartlinks' => single string
|
44 |
+
* 'userblocks' => array(
|
45 |
+
* array('name' => name1, 'type' => type1),
|
46 |
+
* array('name' => name2, 'type' => type2),
|
47 |
+
* ...
|
48 |
+
* )
|
49 |
+
* )
|
50 |
+
*
|
51 |
+
* @var array
|
52 |
+
*/
|
53 |
+
protected $_formDataValues = array();
|
54 |
+
|
55 |
/**
|
56 |
* Constructor.
|
57 |
*/
|
82 |
|
83 |
/* fieldset for automatic refresh */
|
84 |
$layoutFieldsetDefault = $form->addFieldset('dynamic_block_default', array(
|
85 |
+
'legend' => $this->getMyHelper()->__( 'Cart link' ),
|
86 |
'class' => 'fieldset'
|
87 |
));
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
$layoutFieldsetDefault->addField('cartlink', 'text', array(
|
90 |
'name' => 'cartlink',
|
91 |
'label' => $this->getMyHelper()->__('CSS selector for cart link').':',
|
92 |
'after_element_html' => '<span><i>'.$this->getMyHelper()->__("Separate the values by comma ','.").'</i></span>'
|
93 |
));
|
94 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
}
|
96 |
|
97 |
/* bind data */
|
98 |
+
$this->_formDataValues = Mage::getSingleton('mturbo/config_dynamicTransformer')->configToForm($config);
|
99 |
+
|
100 |
+
$form->setValues($this->_formDataValues);
|
101 |
$this->setForm($form);
|
102 |
|
103 |
return parent::_prepareForm();
|
142 |
}
|
143 |
|
144 |
|
145 |
+
}
|
146 |
|
147 |
/**
|
148 |
+
* Get HTML of "Add row" button.
|
149 |
+
*
|
150 |
+
* @param string $container
|
151 |
+
* @param srging $template
|
152 |
+
* @param string $title
|
153 |
+
* @return string
|
154 |
*/
|
155 |
+
public function getAddRowButtonHtml($container, $template, $title='Add')
|
156 |
+
{
|
157 |
+
return $this->getLayout()
|
158 |
+
->createBlock('adminhtml/widget_button')
|
159 |
+
->setType('button')
|
160 |
+
->setClass('add')
|
161 |
+
->setLabel($this->__($title))
|
162 |
+
->setOnClick("addRow('".$container."', '".$template."')")
|
163 |
+
->toHtml();
|
164 |
+
}
|
165 |
+
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Get HTML of "Remove row" button.
|
169 |
+
*/
|
170 |
+
public function getRemoveRowButtonHtml($selector='span')
|
171 |
+
{
|
172 |
+
return $this->getLayout()
|
173 |
+
->createBlock('adminhtml/widget_button')
|
174 |
+
->setType('button')
|
175 |
+
->setClass('delete')
|
176 |
+
->setLabel($this->__('Remove'))
|
177 |
+
->setOnClick("removeRow(this, '".$selector."')")
|
178 |
+
->toHtml();
|
179 |
+
}
|
180 |
+
|
181 |
+
|
182 |
+
/**
|
183 |
+
* Return block types as array (key => value)
|
184 |
+
*
|
185 |
+
* @return array
|
186 |
+
*/
|
187 |
+
public function getBlockTypes()
|
188 |
+
{
|
189 |
+
return array(
|
190 |
+
Artio_MTurbo_Model_Config_DynamicTransformer::AJAX => $this->getMyHelper()->__('AJAX'),
|
191 |
+
// Artio_MTurbo_Model_Config_DynamicTransformer::ESI => $this->getMyHelper()->__('ESI'),
|
192 |
+
Artio_MTurbo_Model_Config_DynamicTransformer::DISABLED => $this->getMyHelper()->__('Disabled')
|
193 |
+
);
|
194 |
+
}
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Get layout handles of all XML.
|
198 |
+
*
|
199 |
+
* @return array
|
200 |
+
*/
|
201 |
+
public function getBlocks()
|
202 |
+
{
|
203 |
+
$layout = $this->_getLayoutModel();
|
204 |
+
|
205 |
+
$result = array();
|
206 |
+
|
207 |
+
$designs = $layout->getDesignsAsFlatStrings();
|
208 |
+
|
209 |
+
foreach ($designs as $design)
|
210 |
+
{
|
211 |
+
$layout->setDesign($design);
|
212 |
+
|
213 |
+
$blocks = $layout->getBlocks();
|
214 |
+
|
215 |
+
foreach ($blocks as $block)
|
216 |
+
{
|
217 |
+
$handle = isset($block['handle']) ? $block['handle'] : '';
|
218 |
+
$name = isset($block['name']) ? $block['name'] : '';
|
219 |
+
$type = isset($block['type']) ? $block['type'] : '';
|
220 |
+
|
221 |
+
if (!$handle || !$name)
|
222 |
+
continue;
|
223 |
+
|
224 |
+
$key = $handle.'$'.$name;
|
225 |
+
$val = $name.($type ? " ($type)" : "");
|
226 |
+
|
227 |
+
if (!isset($result[$handle]))
|
228 |
+
$result[$handle] = array();
|
229 |
+
|
230 |
+
if (!isset($result[$handle][$key]))
|
231 |
+
$result[$handle][$key] = $val;
|
232 |
+
}
|
233 |
+
}
|
234 |
+
|
235 |
+
// sort blocks in each handle
|
236 |
+
foreach ($result as $h => $b)
|
237 |
+
asort($result[$h]);
|
238 |
+
|
239 |
+
// sort handles
|
240 |
+
ksort($result);
|
241 |
+
|
242 |
+
// move default handle at begining of result
|
243 |
+
if (isset($result['default']))
|
244 |
+
{
|
245 |
+
$default = $result['default'];
|
246 |
+
unset($result['default']);
|
247 |
+
$result = array_merge(array('default'=>$default), $result);
|
248 |
+
}
|
249 |
+
|
250 |
+
return $result;
|
251 |
+
}
|
252 |
+
|
253 |
+
|
254 |
+
/**
|
255 |
+
* Get count of user blocks.
|
256 |
+
*
|
257 |
+
* @return number
|
258 |
+
*/
|
259 |
+
public function getFormUserBlockCount()
|
260 |
+
{
|
261 |
+
return isset($this->_formDataValues['userblocks']) ? count($this->_formDataValues['userblocks']) : 0;
|
262 |
+
}
|
263 |
+
|
264 |
+
|
265 |
+
/**
|
266 |
+
* Get user block at index $i. If $i is out of bound
|
267 |
+
* method returns null.
|
268 |
+
*
|
269 |
+
* @param unknown_type $i
|
270 |
+
* @return NULL
|
271 |
+
*/
|
272 |
+
public function getFormUserBlock($i)
|
273 |
+
{
|
274 |
+
return isset($this->_formDataValues['userblocks'][$i]) ? $this->_formDataValues['userblocks'][$i] : null;
|
275 |
+
}
|
276 |
+
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Get layout model which provides access to
|
280 |
+
* the layout data (handles, block names etc.)
|
281 |
+
*
|
282 |
+
* @return Artio_MTurbo_Model_Layout
|
283 |
+
*/
|
284 |
+
protected function _getLayoutModel()
|
285 |
+
{
|
286 |
+
return Mage::getModel('mturbo/layout');
|
287 |
}
|
288 |
|
289 |
}
|
app/code/local/Artio/MTurbo/Block/Adminhtml/Edit/Tab/Url.php
CHANGED
@@ -182,7 +182,16 @@ class Artio_MTurbo_Block_Adminhtml_Edit_Tab_Url
|
|
182 |
$this->getMassactionBlock()->setTemplate('mturbo/massaction.phtml');
|
183 |
$this->getMassactionBlock()->setFormFieldName('mturbo');
|
184 |
|
185 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
$this->getMassactionBlock()->addItem('block', array(
|
187 |
'label' => Mage::helper('mturbo')->__('Block'),
|
188 |
'url' => $this->getUrl('*/*/massBlock')
|
@@ -193,16 +202,6 @@ class Artio_MTurbo_Block_Adminhtml_Edit_Tab_Url
|
|
193 |
'url' => $this->getUrl('*/*/massUnblock')
|
194 |
));
|
195 |
|
196 |
-
/*$this->getMassactionBlock()->addItem('refresh', array(
|
197 |
-
'label' => Mage::helper('mturbo')->__('Cache'),
|
198 |
-
'url' => $this->getUrl('*//**//*massRefresh')
|
199 |
-
));*/
|
200 |
-
|
201 |
-
$this->getMassactionBlock()->addItem('purge', array(
|
202 |
-
'label' => Mage::helper('mturbo')->__('Purge from disk'),
|
203 |
-
'url' => $this->getUrl('*/*/massPurge')
|
204 |
-
));
|
205 |
-
|
206 |
$this->getMassactionBlock()->addItem('delete', array(
|
207 |
'label' => Mage::helper('mturbo')->__('Delete'),
|
208 |
'url' => $this->getUrl('*/*/massDelete'),
|
@@ -250,7 +249,7 @@ class Artio_MTurbo_Block_Adminhtml_Edit_Tab_Url
|
|
250 |
}
|
251 |
$('massrefresh').value = url_section_massactionJsObject.checkedString;
|
252 |
this.form.target='_blank';
|
253 |
-
this.form.action = '".Mage::helper('adminhtml')->getUrl('*/*/
|
254 |
this.form.submit();
|
255 |
setTimeout('location.reload(true);',10);
|
256 |
";
|
182 |
$this->getMassactionBlock()->setTemplate('mturbo/massaction.phtml');
|
183 |
$this->getMassactionBlock()->setFormFieldName('mturbo');
|
184 |
|
185 |
+
$this->getMassactionBlock()->addItem('refresh', array(
|
186 |
+
'label' => Mage::helper('mturbo')->__('Cache'),
|
187 |
+
'url' => $this->getUrl('*/*/massRefresh')
|
188 |
+
));
|
189 |
+
|
190 |
+
$this->getMassactionBlock()->addItem('purge', array(
|
191 |
+
'label' => Mage::helper('mturbo')->__('Purge'),
|
192 |
+
'url' => $this->getUrl('*/*/massPurge')
|
193 |
+
));
|
194 |
+
|
195 |
$this->getMassactionBlock()->addItem('block', array(
|
196 |
'label' => Mage::helper('mturbo')->__('Block'),
|
197 |
'url' => $this->getUrl('*/*/massBlock')
|
202 |
'url' => $this->getUrl('*/*/massUnblock')
|
203 |
));
|
204 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
$this->getMassactionBlock()->addItem('delete', array(
|
206 |
'label' => Mage::helper('mturbo')->__('Delete'),
|
207 |
'url' => $this->getUrl('*/*/massDelete'),
|
249 |
}
|
250 |
$('massrefresh').value = url_section_massactionJsObject.checkedString;
|
251 |
this.form.target='_blank';
|
252 |
+
this.form.action = '".Mage::helper('adminhtml')->getUrl('*/*/massRefreshButton')."';
|
253 |
this.form.submit();
|
254 |
setTimeout('location.reload(true);',10);
|
255 |
";
|
app/code/local/Artio/MTurbo/Block/Adminhtml/Welcome/Form.php
CHANGED
@@ -131,7 +131,12 @@ class Artio_MTurbo_Block_Adminhtml_Welcome_Form extends Mage_Adminhtml_Block_Wid
|
|
131 |
}
|
132 |
|
133 |
private function _getOkText() {
|
134 |
-
$text = Mage::helper('mturbo')->__(
|
|
|
|
|
|
|
|
|
|
|
135 |
return $this->_wrapInfoDiv($text);
|
136 |
}
|
137 |
|
131 |
}
|
132 |
|
133 |
private function _getOkText() {
|
134 |
+
$text = Mage::helper('mturbo')->__("<p>Welcome to M-Turbo Cache developed by Artio.
|
135 |
+
To complete installation, we need to have entered the path to your directory where you want to store cached pages.
|
136 |
+
This path is then entered into a .htaccess file, which is a function of the components necessary.</p><p>More, you can choose
|
137 |
+
which website you want to caches and which not. Each website you can also choose storeview.
|
138 |
+
In addition, please fill out the base directory of each website. In the default settings is set base dir for the administration,
|
139 |
+
which does must not correspond to the base dir for the frontend.</p><p style=\"color:red\">Note: In demo version you can enable only one website.</p>");
|
140 |
return $this->_wrapInfoDiv($text);
|
141 |
}
|
142 |
|
app/code/local/Artio/MTurbo/Block/Ajax.php
CHANGED
@@ -26,46 +26,42 @@
|
|
26 |
* @package Artio_MTurbo
|
27 |
* @author Artio Magento Team (info@artio.net)
|
28 |
*/
|
29 |
-
class Artio_MTurbo_Block_Ajax extends
|
30 |
{
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
}
|
63 |
-
}
|
64 |
-
fillBlock".$clearId."();
|
65 |
//]]>
|
66 |
</script>";
|
67 |
-
|
68 |
-
|
69 |
-
}
|
70 |
|
71 |
-
}
|
26 |
* @package Artio_MTurbo
|
27 |
* @author Artio Magento Team (info@artio.net)
|
28 |
*/
|
29 |
+
class Artio_MTurbo_Block_Ajax extends Artio_MTurbo_Block_Dynamic
|
30 |
{
|
31 |
|
32 |
+
|
33 |
+
/**
|
34 |
+
* (non-PHPdoc)
|
35 |
+
* @see Mage_Core_Block_Abstract::_toHtml()
|
36 |
+
*/
|
37 |
+
protected function _toHtml()
|
38 |
+
{
|
39 |
+
// block must output html here
|
40 |
+
// there must not be used a template, because original blocks could override it
|
41 |
+
|
42 |
+
$id = $this->_getMTurboId();
|
43 |
+
$clearId = $this->_getMTurboClearId();
|
44 |
+
|
45 |
+
return "
|
46 |
+
<div id=\"$id\"></div>
|
47 |
+
<script type=\"text/javascript\">
|
48 |
+
//<![CDATA[
|
49 |
+
function fillBlock$clearId() {
|
50 |
+
|
51 |
+
if (typeof(mturboloader)=='undefined')
|
52 |
+
return;
|
53 |
+
|
54 |
+
if (mturboloader.complete)
|
55 |
+
$('$id').replace(mturboloader.getBlock('$id'));
|
56 |
+
else
|
57 |
+
setTimeout('fillBlock$clearId()', 100);
|
58 |
+
|
59 |
+
}
|
60 |
+
|
61 |
+
fillBlock$clearId();
|
|
|
|
|
|
|
62 |
//]]>
|
63 |
</script>";
|
64 |
+
}
|
65 |
+
|
|
|
66 |
|
67 |
+
}
|
app/code/local/Artio/MTurbo/Block/Checkout/Cart/Item/Renderer/Configurable.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
*
|
16 |
+
* @category Artio
|
17 |
+
* @package Artio_MTurbo
|
18 |
+
* @copyright Copyright (c) 2011 Artio (http://www.artio.net)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Shopping cart item render block
|
24 |
+
*
|
25 |
+
* @category Artio
|
26 |
+
* @package Artio_MTurbo
|
27 |
+
* @author Artio Magento Team <info@artio.net>
|
28 |
+
*/
|
29 |
+
class Artio_MTurbo_Block_Checkout_Cart_Item_Renderer_Configurable extends Artio_MTurbo_Block_Checkout_Cart_Item_Renderer
|
30 |
+
{
|
31 |
+
}
|
app/code/local/Artio/MTurbo/Block/Dynamic.php
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
*
|
16 |
+
* @category Artio
|
17 |
+
* @package Artio_MTurbo
|
18 |
+
* @copyright Copyright (c) 2010 Artio (http://www.artio.net)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Main container
|
24 |
+
*
|
25 |
+
* @category Artio
|
26 |
+
* @package Artio_MTurbo
|
27 |
+
* @author Artio Magento Team (info@artio.net)
|
28 |
+
*/
|
29 |
+
abstract class Artio_MTurbo_Block_Dynamic extends Mage_Core_Block_Template
|
30 |
+
{
|
31 |
+
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Get block identifier.
|
35 |
+
*
|
36 |
+
* @return string
|
37 |
+
*/
|
38 |
+
protected function _getMTurboId()
|
39 |
+
{
|
40 |
+
return $this->getData('identifier');
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Get cleared block identifer.
|
46 |
+
*
|
47 |
+
* Method returns identifier as Artio_MTurbo_Block_Ajax::getId(),
|
48 |
+
* where all occurences '.' or '$' are replaced by '_'.
|
49 |
+
*
|
50 |
+
* "Clear Id" is used as JavaScript identifier, therefore there must
|
51 |
+
* not contain with '.' or '$'.
|
52 |
+
*
|
53 |
+
* @return string
|
54 |
+
*/
|
55 |
+
protected function _getMTurboClearId()
|
56 |
+
{
|
57 |
+
return str_replace(array('.', '$'), array('_','_'), $this->_getMTurboId());
|
58 |
+
}
|
59 |
+
|
60 |
+
|
61 |
+
/**
|
62 |
+
* (non-PHPdoc)
|
63 |
+
*/
|
64 |
+
public function __call($method, $args) {
|
65 |
+
// do nothing, this prevents "undefined method" errors
|
66 |
+
// when a method of the original block is called
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
/**
|
71 |
+
* (non-PHPdoc)
|
72 |
+
*/
|
73 |
+
public static function __callStatic($name, $arguments) {
|
74 |
+
// do nothing, this prevents "undefined method" errors
|
75 |
+
// when a method of the original block is called
|
76 |
+
}
|
77 |
+
|
78 |
+
|
79 |
+
}
|
app/code/local/Artio/MTurbo/Block/Esi.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
*
|
16 |
+
* @category Artio
|
17 |
+
* @package Artio_MTurbo
|
18 |
+
* @copyright Copyright (c) 2010 Artio (http://www.artio.net)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Main container
|
24 |
+
*
|
25 |
+
* @category Artio
|
26 |
+
* @package Artio_MTurbo
|
27 |
+
* @author Artio Magento Team (info@artio.net)
|
28 |
+
*/
|
29 |
+
class Artio_MTurbo_Block_Esi extends Artio_MTurbo_Block_Dynamic
|
30 |
+
{
|
31 |
+
|
32 |
+
|
33 |
+
/**
|
34 |
+
* (non-PHPdoc)
|
35 |
+
* @see Mage_Core_Block_Abstract::_toHtml()
|
36 |
+
*/
|
37 |
+
protected function _toHtml()
|
38 |
+
{
|
39 |
+
// block must output html here
|
40 |
+
// there must not be used a template, because original blocks could override it
|
41 |
+
|
42 |
+
$url = $this->getUrl('mturbofrontend/index/esi', array('identifier' => $this->_getMTurboId()));
|
43 |
+
|
44 |
+
return "<esi:include src=\"".$url."\" />";
|
45 |
+
}
|
46 |
+
|
47 |
+
|
48 |
+
}
|
app/code/local/Artio/MTurbo/Helper/Data.php
CHANGED
@@ -31,9 +31,9 @@ class Artio_MTurbo_Helper_Data extends Mage_Core_Helper_Abstract
|
|
31 |
/* constant for version information */
|
32 |
const MAJOR_VERSION = 1;
|
33 |
const MINOR_VERSION = 2;
|
34 |
-
const REVISION =
|
35 |
const BUILD = 0;
|
36 |
-
const DESCRIPTION = 'Demo version. Copyright © 2010-
|
37 |
const TYPE = 'demo';
|
38 |
|
39 |
/* constants for components of user interface */
|
31 |
/* constant for version information */
|
32 |
const MAJOR_VERSION = 1;
|
33 |
const MINOR_VERSION = 2;
|
34 |
+
const REVISION = 8;
|
35 |
const BUILD = 0;
|
36 |
+
const DESCRIPTION = 'Demo version. Copyright © 2010-2015 Artio';
|
37 |
const TYPE = 'demo';
|
38 |
|
39 |
/* constants for components of user interface */
|
app/code/local/Artio/MTurbo/Helper/Functions.php
CHANGED
@@ -29,6 +29,84 @@
|
|
29 |
class Artio_MTurbo_Helper_Functions extends Mage_Core_Helper_Abstract
|
30 |
{
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
/**
|
33 |
* Function inserts string into another string to the chosen place.
|
34 |
*
|
@@ -42,11 +120,11 @@ class Artio_MTurbo_Helper_Functions extends Mage_Core_Helper_Abstract
|
|
42 |
$part1 = substr($intostring, 0, $offset);
|
43 |
$part2 = substr($intostring, $offset);
|
44 |
|
45 |
-
if ($part1 == false || $part2 == false)
|
46 |
return false;
|
47 |
else
|
48 |
return $part1 . $insertstring . $part2;
|
49 |
-
|
50 |
}
|
51 |
|
52 |
|
@@ -59,56 +137,81 @@ class Artio_MTurbo_Helper_Functions extends Mage_Core_Helper_Abstract
|
|
59 |
* @return array
|
60 |
*/
|
61 |
public function str_to_array($str, $delimiter=',') {
|
62 |
-
|
63 |
if (!is_string($str) || $str==='')
|
64 |
-
return array();
|
65 |
|
66 |
if (strpos($str, $delimiter)===0)
|
67 |
$str = substr($str, 1);
|
68 |
|
69 |
-
return explode($delimiter, $str);
|
70 |
-
|
71 |
}
|
72 |
-
|
73 |
/**
|
74 |
* Function retrieves unique_array from array or string,
|
75 |
* where are values delimiteted by delimiter.
|
76 |
-
*
|
77 |
* @param string|array $data
|
78 |
* @param string $delimiter
|
79 |
*/
|
80 |
public function make_unique_array($data, $delimiter=',') {
|
81 |
-
|
82 |
if (is_array($data))
|
83 |
return array_unique($data);
|
84 |
else if (is_string($data))
|
85 |
return array_unique(self::str_to_array($data, $delimiter));
|
86 |
else
|
87 |
return array();
|
88 |
-
|
89 |
}
|
90 |
-
|
91 |
-
|
92 |
-
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
* Function deletes directory recursive.
|
94 |
*
|
95 |
* @param $dir directory to delete
|
96 |
* @param $pattern
|
97 |
-
*/
|
98 |
function unlink_recursive($dir, $match='/.*\.html$/', $includeDirs=false) {
|
99 |
|
100 |
-
if (is_file($dir) && preg_match($match, $dir))
|
101 |
return @unlink($dir);
|
102 |
-
|
103 |
$result = true;
|
104 |
-
|
105 |
if (file_exists($dir)):
|
106 |
$dirPtr = @opendir($dir);
|
107 |
if ($dirPtr):
|
108 |
-
|
109 |
while ($file = @readdir($dirPtr)):
|
110 |
if ($file == '.' || $file == '..') continue;
|
111 |
-
|
112 |
if (is_dir($dir.'/'.$file)):
|
113 |
$result = $result & $this->unlink_recursive($dir.'/'.$file, $match, $includeDirs);
|
114 |
else:
|
@@ -117,16 +220,16 @@ class Artio_MTurbo_Helper_Functions extends Mage_Core_Helper_Abstract
|
|
117 |
endif;
|
118 |
endif;
|
119 |
endwhile;
|
120 |
-
|
121 |
endif;
|
122 |
endif;
|
123 |
if ($includeDirs) return ($result & @rmdir($dir));
|
124 |
}
|
125 |
|
126 |
-
|
127 |
/**
|
128 |
* Create directories structure, when it necessary.
|
129 |
-
*
|
130 |
* @param $dir directories from the root
|
131 |
* @param $root root, this directory will be not created
|
132 |
* @return bool TRUE when success, otherwise FALSE
|
@@ -137,10 +240,10 @@ class Artio_MTurbo_Helper_Functions extends Mage_Core_Helper_Abstract
|
|
137 |
return false;
|
138 |
|
139 |
return true;
|
140 |
-
|
141 |
}
|
142 |
-
|
143 |
-
|
144 |
/**
|
145 |
* Function check file on existable, readable and writable.
|
146 |
* @param string $file path to file
|
@@ -152,7 +255,7 @@ class Artio_MTurbo_Helper_Functions extends Mage_Core_Helper_Abstract
|
|
152 |
public function get_file_state($file, &$description, $mod='erw') {
|
153 |
|
154 |
$mod = strtolower($mod);
|
155 |
-
|
156 |
/* check existable */
|
157 |
if (strpos($mod, 'e')!==false) {
|
158 |
if (!file_exists($file)) {
|
@@ -160,7 +263,7 @@ class Artio_MTurbo_Helper_Functions extends Mage_Core_Helper_Abstract
|
|
160 |
return false;
|
161 |
}
|
162 |
}
|
163 |
-
|
164 |
/* check readable */
|
165 |
if (strpos($mod, 'r')!==false) {
|
166 |
if (!is_readable($file)) {
|
@@ -168,7 +271,7 @@ class Artio_MTurbo_Helper_Functions extends Mage_Core_Helper_Abstract
|
|
168 |
return false;
|
169 |
}
|
170 |
}
|
171 |
-
|
172 |
/* check writeable */
|
173 |
if (strpos($mod, 'w')!==false) {
|
174 |
if (!is_writeable($file)) {
|
@@ -176,13 +279,13 @@ class Artio_MTurbo_Helper_Functions extends Mage_Core_Helper_Abstract
|
|
176 |
return false;
|
177 |
}
|
178 |
}
|
179 |
-
|
180 |
$description = 'Ready';
|
181 |
return true;
|
182 |
-
|
183 |
}
|
184 |
|
185 |
-
|
186 |
/**
|
187 |
* Function formats size of file.
|
188 |
* @param int $size size of file in bytes
|
@@ -193,53 +296,24 @@ class Artio_MTurbo_Helper_Functions extends Mage_Core_Helper_Abstract
|
|
193 |
* @return string formatted size
|
194 |
*/
|
195 |
function format_file_size($size, $precision=2, $unit=true, $triple=',', $decimal='.') {
|
196 |
-
|
197 |
-
$
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
// for this settings don't process more
|
215 |
-
if ($triple='' && $decimal='.')
|
216 |
-
return (string)$sizeText;
|
217 |
-
|
218 |
-
// processing decimal and tripple delimiters
|
219 |
-
$res = '';
|
220 |
-
$len = strlen((string)$sizeText);
|
221 |
-
$trip = 0;
|
222 |
-
$dec = false;
|
223 |
-
for ($i=$len-1; $i>=0; $i--) {
|
224 |
-
if (!$dec && $sizeText[$i]!='.') {
|
225 |
-
$res = $sizeText[$i].$res;
|
226 |
-
} else if (!$dec && $sizeText[$i]=='.') {
|
227 |
-
$dec = true;
|
228 |
-
$res = $decimal.$res;
|
229 |
-
} else {
|
230 |
-
$res = $sizeText[$i].$res;
|
231 |
-
$trip++;
|
232 |
-
if ($trip==3 && $i>0) {
|
233 |
-
$res = $triple.$res;
|
234 |
-
$trip = 0;
|
235 |
-
}
|
236 |
-
}
|
237 |
-
}
|
238 |
-
|
239 |
-
// return result
|
240 |
-
return $res;
|
241 |
-
|
242 |
}
|
243 |
-
|
244 |
|
245 |
}
|
29 |
class Artio_MTurbo_Helper_Functions extends Mage_Core_Helper_Abstract
|
30 |
{
|
31 |
|
32 |
+
/**
|
33 |
+
* Method open the $directory and list all files which match the
|
34 |
+
* filter. If filter is empty method returns all files.
|
35 |
+
*
|
36 |
+
* Method retrieves relative path to $directory.
|
37 |
+
*
|
38 |
+
* Filter must be a regexp (Ex.: '/\.xml$/', '/^mydocs_.*\.txt$/' ... )
|
39 |
+
*
|
40 |
+
* You can specified $type of returned files. 'f' means only files.
|
41 |
+
* 'd' means only directories and 'a' means both. Other values will
|
42 |
+
* be transformed to 'a'.
|
43 |
+
*
|
44 |
+
* If $excludeDefault is set to true then default directories '.' and
|
45 |
+
* '..' will not be added to return array.
|
46 |
+
*
|
47 |
+
* If $directory is not specified
|
48 |
+
* or is not readable then method logs error and return false.
|
49 |
+
*
|
50 |
+
* @param string $directory
|
51 |
+
* @param string $type
|
52 |
+
* @param string $filter
|
53 |
+
* @param bool $recursively
|
54 |
+
* @param bool $excludeDefault
|
55 |
+
* @return array|bool
|
56 |
+
*/
|
57 |
+
public function list_dir($directory, $type = 'a', $filter = '', $recursively = false, $excludeDefault = true)
|
58 |
+
{
|
59 |
+
if (!$directory || !is_dir($directory))
|
60 |
+
{
|
61 |
+
Mage::log(__METHOD__.": '$directory' is not a directory.");
|
62 |
+
return false;
|
63 |
+
}
|
64 |
+
|
65 |
+
if (!$type || !in_array($type, array('f', 'd', 'a')))
|
66 |
+
$type = 'a';
|
67 |
+
|
68 |
+
|
69 |
+
$handle = @opendir($directory);
|
70 |
+
|
71 |
+
if (!$handle)
|
72 |
+
{
|
73 |
+
Mage::log(__METHOD__.": opening '$directory' fails.");
|
74 |
+
return false;
|
75 |
+
}
|
76 |
+
|
77 |
+
$files = array();
|
78 |
+
|
79 |
+
while ($name = @readdir($handle))
|
80 |
+
{
|
81 |
+
if ($excludeDefault && ($name == '.' || $name == '..'))
|
82 |
+
continue;
|
83 |
+
|
84 |
+
$path = $directory.DS.$name;
|
85 |
+
|
86 |
+
if ($recursively && is_dir($path))
|
87 |
+
{
|
88 |
+
$subfiles = $this->list_dir($path, $type, $filter, $recursively, $excludeDefault);
|
89 |
+
|
90 |
+
foreach ($subfiles as $subfile)
|
91 |
+
$files[] = $name.DS.$subfile;
|
92 |
+
}
|
93 |
+
|
94 |
+
if ($type == 'f' && !is_file($path))
|
95 |
+
continue;
|
96 |
+
if ($type == 'd' && !is_dir($path))
|
97 |
+
continue;
|
98 |
+
if ($filter && !preg_match($filter, $name))
|
99 |
+
continue;
|
100 |
+
|
101 |
+
$files[] = $name;
|
102 |
+
}
|
103 |
+
|
104 |
+
@closedir($handle);
|
105 |
+
|
106 |
+
return $files;
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
/**
|
111 |
* Function inserts string into another string to the chosen place.
|
112 |
*
|
120 |
$part1 = substr($intostring, 0, $offset);
|
121 |
$part2 = substr($intostring, $offset);
|
122 |
|
123 |
+
if ($part1 == false || $part2 == false)
|
124 |
return false;
|
125 |
else
|
126 |
return $part1 . $insertstring . $part2;
|
127 |
+
|
128 |
}
|
129 |
|
130 |
|
137 |
* @return array
|
138 |
*/
|
139 |
public function str_to_array($str, $delimiter=',') {
|
140 |
+
|
141 |
if (!is_string($str) || $str==='')
|
142 |
+
return array();
|
143 |
|
144 |
if (strpos($str, $delimiter)===0)
|
145 |
$str = substr($str, 1);
|
146 |
|
147 |
+
return explode($delimiter, $str);
|
148 |
+
|
149 |
}
|
150 |
+
|
151 |
/**
|
152 |
* Function retrieves unique_array from array or string,
|
153 |
* where are values delimiteted by delimiter.
|
154 |
+
*
|
155 |
* @param string|array $data
|
156 |
* @param string $delimiter
|
157 |
*/
|
158 |
public function make_unique_array($data, $delimiter=',') {
|
159 |
+
|
160 |
if (is_array($data))
|
161 |
return array_unique($data);
|
162 |
else if (is_string($data))
|
163 |
return array_unique(self::str_to_array($data, $delimiter));
|
164 |
else
|
165 |
return array();
|
166 |
+
|
167 |
}
|
168 |
+
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Copy array $array without value $value.
|
172 |
+
*
|
173 |
+
* $value is tested by '==='. If $arrray does not
|
174 |
+
* contain $value method returns copy of $array.
|
175 |
+
*
|
176 |
+
* @param array $array
|
177 |
+
* @param mixed $value
|
178 |
+
* @return array
|
179 |
+
*/
|
180 |
+
public function array_remove($array, $value)
|
181 |
+
{
|
182 |
+
if (!is_array($array))
|
183 |
+
return $array;
|
184 |
+
|
185 |
+
$result = array();
|
186 |
+
|
187 |
+
foreach ($array as $k => $v)
|
188 |
+
if ($v !== $value)
|
189 |
+
$result[$k] = $v;
|
190 |
+
|
191 |
+
return $result;
|
192 |
+
}
|
193 |
+
|
194 |
+
|
195 |
+
/**
|
196 |
* Function deletes directory recursive.
|
197 |
*
|
198 |
* @param $dir directory to delete
|
199 |
* @param $pattern
|
200 |
+
*/
|
201 |
function unlink_recursive($dir, $match='/.*\.html$/', $includeDirs=false) {
|
202 |
|
203 |
+
if (is_file($dir) && preg_match($match, $dir))
|
204 |
return @unlink($dir);
|
205 |
+
|
206 |
$result = true;
|
207 |
+
|
208 |
if (file_exists($dir)):
|
209 |
$dirPtr = @opendir($dir);
|
210 |
if ($dirPtr):
|
211 |
+
|
212 |
while ($file = @readdir($dirPtr)):
|
213 |
if ($file == '.' || $file == '..') continue;
|
214 |
+
|
215 |
if (is_dir($dir.'/'.$file)):
|
216 |
$result = $result & $this->unlink_recursive($dir.'/'.$file, $match, $includeDirs);
|
217 |
else:
|
220 |
endif;
|
221 |
endif;
|
222 |
endwhile;
|
223 |
+
|
224 |
endif;
|
225 |
endif;
|
226 |
if ($includeDirs) return ($result & @rmdir($dir));
|
227 |
}
|
228 |
|
229 |
+
|
230 |
/**
|
231 |
* Create directories structure, when it necessary.
|
232 |
+
*
|
233 |
* @param $dir directories from the root
|
234 |
* @param $root root, this directory will be not created
|
235 |
* @return bool TRUE when success, otherwise FALSE
|
240 |
return false;
|
241 |
|
242 |
return true;
|
243 |
+
|
244 |
}
|
245 |
+
|
246 |
+
|
247 |
/**
|
248 |
* Function check file on existable, readable and writable.
|
249 |
* @param string $file path to file
|
255 |
public function get_file_state($file, &$description, $mod='erw') {
|
256 |
|
257 |
$mod = strtolower($mod);
|
258 |
+
|
259 |
/* check existable */
|
260 |
if (strpos($mod, 'e')!==false) {
|
261 |
if (!file_exists($file)) {
|
263 |
return false;
|
264 |
}
|
265 |
}
|
266 |
+
|
267 |
/* check readable */
|
268 |
if (strpos($mod, 'r')!==false) {
|
269 |
if (!is_readable($file)) {
|
271 |
return false;
|
272 |
}
|
273 |
}
|
274 |
+
|
275 |
/* check writeable */
|
276 |
if (strpos($mod, 'w')!==false) {
|
277 |
if (!is_writeable($file)) {
|
279 |
return false;
|
280 |
}
|
281 |
}
|
282 |
+
|
283 |
$description = 'Ready';
|
284 |
return true;
|
285 |
+
|
286 |
}
|
287 |
|
288 |
+
|
289 |
/**
|
290 |
* Function formats size of file.
|
291 |
* @param int $size size of file in bytes
|
296 |
* @return string formatted size
|
297 |
*/
|
298 |
function format_file_size($size, $precision=2, $unit=true, $triple=',', $decimal='.') {
|
299 |
+
|
300 |
+
$size = (int) $size;
|
301 |
+
|
302 |
+
$kilo = 1024;
|
303 |
+
$mega = 1024*1024;
|
304 |
+
$giga = 1024*1024*1024;
|
305 |
+
|
306 |
+
if ($size < $kilo)
|
307 |
+
$x = array(1, 'B');
|
308 |
+
else if ($size < $mega)
|
309 |
+
$x = array($kilo, 'KiB');
|
310 |
+
else if ($size < $giga)
|
311 |
+
$x = array($mega, 'MiB');
|
312 |
+
else
|
313 |
+
$x = array($giga, 'GiB');
|
314 |
+
|
315 |
+
return number_format($size/(float)$x[0], $precision, $decimal, $triple) . ($unit ? ' '.$x[1] : '');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
316 |
}
|
317 |
+
|
318 |
|
319 |
}
|
app/code/local/Artio/MTurbo/Helper/Info.php
CHANGED
@@ -83,7 +83,7 @@ class Artio_MTurbo_Helper_Info extends Mage_Core_Helper_Abstract {
|
|
83 |
|
84 |
|
85 |
} else {
|
86 |
-
$this->raiseNotice(100, $this->__('
|
87 |
}
|
88 |
|
89 |
|
83 |
|
84 |
|
85 |
} else {
|
86 |
+
$this->raiseNotice(100, $this->__('Check download id failed.<br />Contact <a href="mailto:support@artio.net">support@artio.net</a>.'), $false);
|
87 |
}
|
88 |
|
89 |
|
app/code/local/Artio/MTurbo/Model/Config.php
CHANGED
@@ -108,6 +108,70 @@ class Artio_MTurbo_Model_Config extends Varien_Object
|
|
108 |
private $pathids = array();
|
109 |
|
110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
/**
|
112 |
* Retrieves website configuration.
|
113 |
* @param string $websiteCode code of website
|
@@ -357,8 +421,9 @@ class Artio_MTurbo_Model_Config extends Varien_Object
|
|
357 |
|
358 |
}
|
359 |
|
360 |
-
|
361 |
|
|
|
362 |
}
|
363 |
|
364 |
|
108 |
private $pathids = array();
|
109 |
|
110 |
|
111 |
+
/**
|
112 |
+
* Method determines whether there is need to do synchronization.
|
113 |
+
*
|
114 |
+
* Usage:
|
115 |
+
* <pre>
|
116 |
+
* $config = Mage::getSingleton('mturbo/config');
|
117 |
+
* $config->load();
|
118 |
+
* $config->addData($someData);
|
119 |
+
* $config->save();
|
120 |
+
* $config->isNeedToSynchronize()
|
121 |
+
* </pre>
|
122 |
+
*
|
123 |
+
* @return bool
|
124 |
+
*/
|
125 |
+
public function isNeedToSynchronize()
|
126 |
+
{
|
127 |
+
return $this->dataHasChangedFor('preview_categories')
|
128 |
+
|| $this->dataHasChangedFor('product_categories')
|
129 |
+
|| $this->dataHasChangedFor('cms_pages');
|
130 |
+
}
|
131 |
+
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Method determines whether there is need to refresh a page.
|
135 |
+
*
|
136 |
+
* Usage:
|
137 |
+
* <pre>
|
138 |
+
* $config = Mage::getSingleton('mturbo/config');
|
139 |
+
* $config->load();
|
140 |
+
* $config->addData($someData);
|
141 |
+
* $config->save();
|
142 |
+
* $config->isNeedToRefresh()
|
143 |
+
* </pre>
|
144 |
+
*
|
145 |
+
* @return bool
|
146 |
+
*/
|
147 |
+
public function isNeedToRefresh()
|
148 |
+
{
|
149 |
+
return $this->dataHasChangedFor('dynamic_blocks')
|
150 |
+
|| $this->dataHasChangedFor('dynamic_checkout_cart_link');
|
151 |
+
}
|
152 |
+
|
153 |
+
|
154 |
+
/**
|
155 |
+
* Method determines whether there is need to refresh cache.
|
156 |
+
*
|
157 |
+
* Usage:
|
158 |
+
* <pre>
|
159 |
+
* $config = Mage::getSingleton('mturbo/config');
|
160 |
+
* $config->load();
|
161 |
+
* $config->addData($someData);
|
162 |
+
* $config->save();
|
163 |
+
* $config->isNeedToRefresh()
|
164 |
+
* </pre>
|
165 |
+
*
|
166 |
+
* @return bool
|
167 |
+
*/
|
168 |
+
public function isNeedToRefreshCache()
|
169 |
+
{
|
170 |
+
return $this->dataHasChangedFor('automatic_download')
|
171 |
+
|| $this->dataHasChangedFor('automatic_download_time');
|
172 |
+
}
|
173 |
+
|
174 |
+
|
175 |
/**
|
176 |
* Retrieves website configuration.
|
177 |
* @param string $websiteCode code of website
|
421 |
|
422 |
}
|
423 |
|
424 |
+
$config->setOrigData();
|
425 |
|
426 |
+
return $this;
|
427 |
}
|
428 |
|
429 |
|
app/code/local/Artio/MTurbo/Model/Config/DynamicTransformer.php
CHANGED
@@ -24,176 +24,201 @@
|
|
24 |
* @category Artio
|
25 |
* @package Artio_MTurbo
|
26 |
* @author Artio Magento Team (jiri.chmiel@artio.cz)
|
|
|
27 |
*/
|
28 |
class Artio_MTurbo_Model_Config_DynamicTransformer extends Varien_Object
|
29 |
{
|
30 |
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
37 |
|
38 |
-
);
|
39 |
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
-
'comparesidebar' => 'Mage_Reports_Block_Product_Compared',
|
43 |
-
'cartsidebar' => 'Mage_Checkout_Block_Cart_Sidebar',
|
44 |
-
'pollsidebar' => 'Mage_Poll_Block_ActivePoll',
|
45 |
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
|
|
55 |
|
56 |
-
private $keysDefaultBlocks = null;
|
57 |
-
private $classBlocks = null;
|
58 |
-
|
59 |
|
60 |
/**
|
61 |
-
* Method
|
62 |
-
* If block is
|
|
|
63 |
*
|
64 |
-
*
|
65 |
-
*
|
|
|
|
|
66 |
*/
|
67 |
-
public function
|
68 |
-
|
69 |
-
|
70 |
-
$this->keysDefaultBlocks = array_keys($this->defaultBlocks);
|
71 |
-
|
72 |
-
return in_array($identifier, $this->keysDefaultBlocks);
|
73 |
|
|
|
74 |
}
|
75 |
|
76 |
|
77 |
/**
|
78 |
-
* Method
|
79 |
-
*
|
80 |
-
*
|
81 |
-
* @
|
|
|
|
|
82 |
*/
|
83 |
-
public function
|
84 |
-
|
85 |
-
if (
|
86 |
-
return $this->defaultBlocks[$identifier];
|
87 |
-
else
|
88 |
return false;
|
89 |
|
90 |
-
|
91 |
-
|
92 |
-
private function _getClassBlocks() {
|
93 |
-
|
94 |
-
if (!isset($this->classBlocks)) {
|
95 |
-
|
96 |
-
$this->classBlocks = $this->classBlocks14;
|
97 |
-
try {
|
98 |
-
|
99 |
-
$version = explode(".", Mage::getVersion());
|
100 |
-
$this->classBlocks = (isset($version[1]) && ($version[1]=='3')) ? $this->classBlocks13 : $this->classBlocks14;
|
101 |
|
102 |
-
} catch (Exception $e) { }
|
103 |
-
|
104 |
-
}
|
105 |
-
|
106 |
-
return $this->classBlocks;
|
107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
}
|
109 |
-
|
110 |
|
111 |
/**
|
112 |
* Get the dynamic name of $block. If $block is configured
|
113 |
-
* as dynamic
|
114 |
-
*
|
|
|
|
|
|
|
|
|
|
|
115 |
*
|
116 |
-
*
|
117 |
*
|
118 |
* @param Mage_Core_Block_Abstract $block
|
119 |
-
* @return
|
120 |
*/
|
121 |
-
public function
|
122 |
|
123 |
if (!$block)
|
124 |
-
return
|
125 |
|
126 |
-
$blockTypes = $this->_getClassBlocks();
|
127 |
$configBlocks = Mage::getSingleton('mturbo/config')->getDynamicBlocksAsArray();
|
128 |
|
129 |
-
$candidate = false;
|
130 |
-
|
131 |
foreach ($configBlocks as $configBlock)
|
132 |
{
|
133 |
-
$
|
134 |
-
|
135 |
-
if ($configBlockWithoutLayout == $block->getNameInLayout())
|
136 |
-
return $configBlock;
|
137 |
|
138 |
-
|
139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
}
|
141 |
|
142 |
-
return
|
143 |
}
|
144 |
|
145 |
|
146 |
/**
|
147 |
* Method transform form data to config and fill it.
|
|
|
148 |
* @param Artio_MTurbo_Model_Config $config
|
149 |
* @param array $formData data from form
|
150 |
*/
|
151 |
-
public function extractData($config, $formData=array())
|
|
|
|
|
152 |
|
153 |
-
$blocks
|
154 |
|
155 |
-
|
156 |
-
|
157 |
-
if ($this->isDefaultBlock($key))
|
158 |
-
if ($value=='1')
|
159 |
-
$blocks[] = $key;
|
160 |
-
}
|
161 |
|
162 |
-
|
163 |
-
$blocks = array_merge($blocks, explode(",", $formData['userblocks']));
|
164 |
|
165 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
-
if (isset($formData['cartlink']))
|
168 |
$config->setDynamicCheckoutCartLink($formData['cartlink']);
|
169 |
}
|
170 |
|
171 |
|
172 |
/**
|
173 |
* Method transform data for administration form and retrieves as array.
|
|
|
174 |
* @param Artio_MTurbo_Model_Config $config
|
175 |
* @return array transformed data
|
176 |
*/
|
177 |
-
public function configToForm($config)
|
|
|
|
|
|
|
178 |
|
179 |
-
|
180 |
-
$result = array();
|
181 |
|
182 |
-
$
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
|
|
|
|
|
|
187 |
}
|
188 |
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
/* return result */
|
195 |
-
return $result;
|
196 |
-
|
197 |
}
|
198 |
|
199 |
}
|
24 |
* @category Artio
|
25 |
* @package Artio_MTurbo
|
26 |
* @author Artio Magento Team (jiri.chmiel@artio.cz)
|
27 |
+
* @TODO: radeji udelat jako helper
|
28 |
*/
|
29 |
class Artio_MTurbo_Model_Config_DynamicTransformer extends Varien_Object
|
30 |
{
|
31 |
|
32 |
+
/**
|
33 |
+
* Internal identifier of AJAX dynamic blocks.
|
34 |
+
*
|
35 |
+
* @var string
|
36 |
+
*/
|
37 |
+
const AJAX = 'ajax';
|
38 |
|
39 |
+
/**
|
40 |
+
* Internal identifiers of ESI dynamic blocks.
|
41 |
+
*
|
42 |
+
* @var string
|
43 |
+
*/
|
44 |
+
const ESI = 'esi';
|
45 |
|
|
|
46 |
|
47 |
+
/**
|
48 |
+
* Internal identifiers of disabled dynamic blocks.
|
49 |
+
*
|
50 |
+
* @var string
|
51 |
+
*/
|
52 |
+
const DISABLED = 'disabled';
|
53 |
|
|
|
|
|
|
|
54 |
|
55 |
+
/**
|
56 |
+
* Method determines whether block is dynamic or not.
|
57 |
+
* If $block is dynamic method returns true otherwise returns false.
|
58 |
+
*
|
59 |
+
* If $block is null method returns false.
|
60 |
+
*
|
61 |
+
* @param Mage_Core_Block_Abstract $block
|
62 |
+
* @return bool
|
63 |
+
*/
|
64 |
+
public function isBlockDynamic($block)
|
65 |
+
{
|
66 |
+
return ($block && ($block instanceof Artio_MTurbo_Block_Dynamic));
|
67 |
+
}
|
68 |
|
|
|
|
|
|
|
69 |
|
70 |
/**
|
71 |
+
* Method determines whether block can be used as dynamic or not.
|
72 |
+
* If $block is set as dynamic method returns true
|
73 |
+
* else method returns false.
|
74 |
*
|
75 |
+
* If $block is not specified method returns false.
|
76 |
+
*
|
77 |
+
* @param Mage_Core_Block_Abstract $block
|
78 |
+
* @return bool
|
79 |
*/
|
80 |
+
public function canBeUsedAsDynamic($block)
|
81 |
+
{
|
82 |
+
list($handle, $name, $type) = $this->getDynamicInfo($block);
|
|
|
|
|
|
|
83 |
|
84 |
+
return ($handle && $name && $type && $type != self::DISABLED);
|
85 |
}
|
86 |
|
87 |
|
88 |
/**
|
89 |
+
* Method replace block in the layout. The origin block will
|
90 |
+
* be removed and there will be created new dynamic block.
|
91 |
+
*
|
92 |
+
* @param Mage_Core_Block_Abstract $block
|
93 |
+
* @param Mage_Core_Model_Layout $layout
|
94 |
+
* @return Artio_MTurbo_Model_Config_DynamicTransformer
|
95 |
*/
|
96 |
+
public function replaceBlockInLayout($block, $layout)
|
97 |
+
{
|
98 |
+
if (!$block || !$layout || !$this->canBeUsedAsDynamic($block))
|
|
|
|
|
99 |
return false;
|
100 |
|
101 |
+
list($handle, $name, $type) = $this->getDynamicInfo($block);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
+
if ($type == self::ESI)
|
105 |
+
$blockType = 'mturbo/esi';
|
106 |
+
else if ($type == self::AJAX)
|
107 |
+
$blockType = 'mturbo/ajax';
|
108 |
+
else
|
109 |
+
return false; // unknow block type
|
110 |
+
|
111 |
+
$id = $handle.'$'.$name;
|
112 |
+
|
113 |
+
$layout->unsetBlock($name);
|
114 |
+
$layout->createBlock($blockType, $name, array('identifier' => $id));
|
115 |
+
|
116 |
+
return $id;
|
117 |
}
|
118 |
+
|
119 |
|
120 |
/**
|
121 |
* Get the dynamic name of $block. If $block is configured
|
122 |
+
* as dynamic and it is not disabled then method returns
|
123 |
+
* dynamic blocks info, which is:
|
124 |
+
*
|
125 |
+
* array(layout handle, layout name, type)
|
126 |
+
*
|
127 |
+
* If $block is not dynamic or $block is not specified method
|
128 |
+
* returns
|
129 |
*
|
130 |
+
* array("", "", "")
|
131 |
*
|
132 |
* @param Mage_Core_Block_Abstract $block
|
133 |
+
* @return array
|
134 |
*/
|
135 |
+
public function getDynamicInfo($block) {
|
136 |
|
137 |
if (!$block)
|
138 |
+
return array("", "", "");
|
139 |
|
|
|
140 |
$configBlocks = Mage::getSingleton('mturbo/config')->getDynamicBlocksAsArray();
|
141 |
|
|
|
|
|
142 |
foreach ($configBlocks as $configBlock)
|
143 |
{
|
144 |
+
$matches = array();
|
|
|
|
|
|
|
145 |
|
146 |
+
preg_match('/^([^\$#]*)\$([^\$#]*)#([^\$#]*)$/', $configBlock, $matches);
|
147 |
+
|
148 |
+
$layoutHandle = isset($matches[1]) ? $matches[1] : "";
|
149 |
+
$layoutName = isset($matches[2]) ? $matches[2] : "";
|
150 |
+
$type = isset($matches[3]) ? $matches[3] : "";
|
151 |
+
|
152 |
+
if ($layoutName == $block->getNameInLayout())
|
153 |
+
return array($layoutHandle, $layoutName, $type);
|
154 |
}
|
155 |
|
156 |
+
return array("", "", "");
|
157 |
}
|
158 |
|
159 |
|
160 |
/**
|
161 |
* Method transform form data to config and fill it.
|
162 |
+
*
|
163 |
* @param Artio_MTurbo_Model_Config $config
|
164 |
* @param array $formData data from form
|
165 |
*/
|
166 |
+
public function extractData($config, $formData = array())
|
167 |
+
{
|
168 |
+
$helper = Mage::helper('mturbo');
|
169 |
|
170 |
+
$blocks = isset($formData['blocks']) ? $formData['blocks'] : array();
|
171 |
|
172 |
+
$names = $blocks['name'];
|
173 |
+
$types = $blocks['type'];
|
|
|
|
|
|
|
|
|
174 |
|
175 |
+
$blocksToSave = array();
|
|
|
176 |
|
177 |
+
for ($i=0; $i<count($names); $i++)
|
178 |
+
{
|
179 |
+
$name = $names[$i];
|
180 |
+
$type = $types[$i];
|
181 |
+
|
182 |
+
if (array_key_exists($name, $blocksToSave))
|
183 |
+
Mage::throwException($helper->__('You cannot choose two blocks with the same type.'));
|
184 |
+
|
185 |
+
$blocksToSave[$name] = $name.'#'.$type;
|
186 |
+
}
|
187 |
+
|
188 |
+
$config->setDynamicBlocks(implode(",", $blocksToSave));
|
189 |
|
190 |
+
if (isset($formData['cartlink']))
|
191 |
$config->setDynamicCheckoutCartLink($formData['cartlink']);
|
192 |
}
|
193 |
|
194 |
|
195 |
/**
|
196 |
* Method transform data for administration form and retrieves as array.
|
197 |
+
*
|
198 |
* @param Artio_MTurbo_Model_Config $config
|
199 |
* @return array transformed data
|
200 |
*/
|
201 |
+
public function configToForm($config)
|
202 |
+
{
|
203 |
+
$userblocks = $config->getDynamicBlocks();
|
204 |
+
$userblocks = explode(',', $userblocks);
|
205 |
|
206 |
+
$blocks = array();
|
|
|
207 |
|
208 |
+
foreach ($userblocks as $block)
|
209 |
+
{
|
210 |
+
$parts = explode('#', $block);
|
211 |
+
|
212 |
+
$name = $parts[0];
|
213 |
+
$type = isset($parts[1]) ? $parts[1] : '';
|
214 |
+
|
215 |
+
$blocks[] = array('name' => $name, 'type' => $type);
|
216 |
}
|
217 |
|
218 |
+
return array(
|
219 |
+
'userblocks' => $blocks,
|
220 |
+
'cartlink' => $config->getDynamicCheckoutCartLink()
|
221 |
+
);
|
|
|
|
|
|
|
|
|
222 |
}
|
223 |
|
224 |
}
|
app/code/local/Artio/MTurbo/Model/DownloadMethods/Curlmulti.php
CHANGED
@@ -106,6 +106,8 @@ class Artio_MTurbo_Model_DownloadMethods_Curlmulti extends Artio_MTurbo_Model_Do
|
|
106 |
$options = array(
|
107 |
CURLOPT_HEADER => 0,
|
108 |
CURLOPT_RETURNTRANSFER => 1,
|
|
|
|
|
109 |
);
|
110 |
|
111 |
$handles = array();
|
106 |
$options = array(
|
107 |
CURLOPT_HEADER => 0,
|
108 |
CURLOPT_RETURNTRANSFER => 1,
|
109 |
+
CURLOPT_TIMEOUT => 100,
|
110 |
+
CURLOPT_FOLLOWLOCATION => 1
|
111 |
);
|
112 |
|
113 |
$handles = array();
|
app/code/local/Artio/MTurbo/Model/DownloadQueue.php
CHANGED
@@ -258,7 +258,7 @@ class Artio_MTurbo_Model_DownloadQueue
|
|
258 |
protected function _checkHtml($html, $url, $minsize, $storeId) {
|
259 |
|
260 |
if (!is_string($html))
|
261 |
-
return Mage::helper('mturbo')->__('
|
262 |
|
263 |
if (strlen($html) < $minsize)
|
264 |
return Mage::helper('mturbo')->__('Page is too small | url: <b>%s</b>', $url);
|
@@ -266,7 +266,7 @@ class Artio_MTurbo_Model_DownloadQueue
|
|
266 |
$title = (string) Mage::helper('mturbo')->getNoRouteTitle($storeId);
|
267 |
|
268 |
if (strlen($title)>1 && strpos($html, "<title>$title") !== false)
|
269 |
-
return Mage::helper('mturbo')->__('
|
270 |
|
271 |
// empty string means correct
|
272 |
return "";
|
258 |
protected function _checkHtml($html, $url, $minsize, $storeId) {
|
259 |
|
260 |
if (!is_string($html))
|
261 |
+
return Mage::helper('mturbo')->__('Bad page | url: <b>%s</b>', $url);
|
262 |
|
263 |
if (strlen($html) < $minsize)
|
264 |
return Mage::helper('mturbo')->__('Page is too small | url: <b>%s</b>', $url);
|
266 |
$title = (string) Mage::helper('mturbo')->getNoRouteTitle($storeId);
|
267 |
|
268 |
if (strlen($title)>1 && strpos($html, "<title>$title") !== false)
|
269 |
+
return Mage::helper('mturbo')->__('Bad page | url: <b>%s</b>', $url);
|
270 |
|
271 |
// empty string means correct
|
272 |
return "";
|
app/code/local/Artio/MTurbo/Model/Htaccess.php
CHANGED
@@ -106,6 +106,15 @@ class Artio_MTurbo_Model_Htaccess
|
|
106 |
}
|
107 |
|
108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
/**
|
110 |
* Retrieves full path to template of sides htaccess file.
|
111 |
* @return string full path to template of sides htaccess file
|
@@ -454,9 +463,16 @@ class Artio_MTurbo_Model_Htaccess
|
|
454 |
|
455 |
/* make back only if is enabled in configuration */
|
456 |
if ($config->getEnabledHtaccessBackup()) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
457 |
|
458 |
$backupNum = $config->getNumberOfHtaccessBackups();
|
459 |
-
$backupPath = $
|
460 |
|
461 |
/* search free backup slot */
|
462 |
for ($i=0; $i<$backupNum; $i++)
|
106 |
}
|
107 |
|
108 |
|
109 |
+
/**
|
110 |
+
* Get directory with htaccess backups.
|
111 |
+
* @return string
|
112 |
+
*/
|
113 |
+
public function getHtaccessBackupsDirectory() {
|
114 |
+
return $this->websiteconfig->getBaseDir().DS.'var'.DS.'htaccess_backups';
|
115 |
+
}
|
116 |
+
|
117 |
+
|
118 |
/**
|
119 |
* Retrieves full path to template of sides htaccess file.
|
120 |
* @return string full path to template of sides htaccess file
|
463 |
|
464 |
/* make back only if is enabled in configuration */
|
465 |
if ($config->getEnabledHtaccessBackup()) {
|
466 |
+
|
467 |
+
$backupDir = $this->getHtaccessBackupsDirectory();
|
468 |
+
|
469 |
+
if (!is_dir($backupDir) && !mkdir($backupDir, 0755, $recursive = true)) {
|
470 |
+
Mage::log("M-Turbo: M-Turbo can not create .htaccess backup directory.", Zend_Log::NOTICE);
|
471 |
+
return;
|
472 |
+
}
|
473 |
|
474 |
$backupNum = $config->getNumberOfHtaccessBackups();
|
475 |
+
$backupPath = $backupDir.DS.'htaccess.bak';
|
476 |
|
477 |
/* search free backup slot */
|
478 |
for ($i=0; $i<$backupNum; $i++)
|
app/code/local/Artio/MTurbo/Model/JsPatch.php
DELETED
@@ -1,129 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
*
|
16 |
-
* @category Artio
|
17 |
-
* @package Artio_MTurbo
|
18 |
-
* @copyright Copyright (c) 2010 Artio (http://www.artio.net)
|
19 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
-
*/
|
21 |
-
|
22 |
-
/**
|
23 |
-
* This model maintains javasript file for dynamic loaded blocks.
|
24 |
-
* It watches adding new theme packages. If any theme package is added then copy
|
25 |
-
* javascript. It alos retrieves information about this copying.
|
26 |
-
*
|
27 |
-
* @category Artio
|
28 |
-
* @package Artio_MTurbo
|
29 |
-
* @author Artio Magento Team (jiri.chmiel@artio.cz)
|
30 |
-
*/
|
31 |
-
class Artio_MTurbo_Model_JsPatch {
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Path to js file.
|
35 |
-
* @var string
|
36 |
-
*/
|
37 |
-
private $_jsPath = '';
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Path to default js file
|
41 |
-
* @var string
|
42 |
-
*/
|
43 |
-
private $_defaultJsPath = '';
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Method determines whether js does exists in theme package.
|
47 |
-
* @return bool
|
48 |
-
*/
|
49 |
-
public function existsJs() {
|
50 |
-
return file_exists($this->_jsPath);
|
51 |
-
}
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Method make js by copying from default theme.
|
55 |
-
* @return bool TRUE when success, FALSE when fail
|
56 |
-
*/
|
57 |
-
public function makeJs() {
|
58 |
-
|
59 |
-
if ($this->existsJs())
|
60 |
-
return true;
|
61 |
-
|
62 |
-
$dirname = dirname($this->_jsPath);
|
63 |
-
|
64 |
-
if (!is_dir($dirname) && !mkdir($dirname, 0777, true))
|
65 |
-
return false;
|
66 |
-
else
|
67 |
-
return copy($this->_defaultJsPath, $this->_jsPath);
|
68 |
-
|
69 |
-
}
|
70 |
-
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Method retrieves absolute path to default js path.
|
74 |
-
* @return string
|
75 |
-
*/
|
76 |
-
public function getDefaultJsPath() {
|
77 |
-
return $this->_defaultJsPath;
|
78 |
-
}
|
79 |
-
|
80 |
-
|
81 |
-
/**
|
82 |
-
* Method retrieves absolute path to js in this theme.
|
83 |
-
* @return string
|
84 |
-
*/
|
85 |
-
public function getJsPath() {
|
86 |
-
return $this->_jsPath;
|
87 |
-
}
|
88 |
-
|
89 |
-
|
90 |
-
/*
|
91 |
-
* STATIC METHODS
|
92 |
-
*/
|
93 |
-
|
94 |
-
/**
|
95 |
-
* Method searches available theme package and retrieves them as array.
|
96 |
-
* @return array
|
97 |
-
*/
|
98 |
-
public static function getAvailableThemePackages() {
|
99 |
-
|
100 |
-
$res = array();
|
101 |
-
$dir = Mage::getBaseDir().DS.'skin'.DS.'frontend';
|
102 |
-
|
103 |
-
if ($handle = opendir($dir)) {
|
104 |
-
while (false !== ($file = readdir($handle))) {
|
105 |
-
|
106 |
-
if (!in_array($file, array('.','..'))) {
|
107 |
-
|
108 |
-
$base = $dir.DS.$file;
|
109 |
-
if (is_dir($base)) {
|
110 |
-
|
111 |
-
$js = Mage::getModel('mturbo/jsPatch');
|
112 |
-
$js->_defaultJsPath = $dir.DS.'default'.DS.'default'.DS.'js'.DS.'mturbo.js';
|
113 |
-
$js->_jsPath = $base.DS.'default'.DS.'js'.DS.'mturbo.js';
|
114 |
-
|
115 |
-
$res[] = $js;
|
116 |
-
|
117 |
-
}
|
118 |
-
}
|
119 |
-
|
120 |
-
}
|
121 |
-
closedir($handle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
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
*
|
16 |
+
* @category Artio
|
17 |
+
* @package Artio_MTurbo
|
18 |
+
* @copyright Copyright (c) 2013 Artio (http://www.artio.net)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
|
22 |
+
/**
|
23 |
+
* The model
|
24 |
+
*
|
25 |
+
*
|
26 |
+
* @category Artio
|
27 |
+
* @package Artio_MTurbo
|
28 |
+
* @author Artio Magento Team (jiri.chmiel@artio.cz)
|
29 |
+
*/
|
30 |
+
class Artio_MTurbo_Model_Layout
|
31 |
+
{
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Package theme.
|
35 |
+
*
|
36 |
+
* @var string
|
37 |
+
*/
|
38 |
+
protected $_package = null;
|
39 |
+
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Skin theme.
|
43 |
+
*
|
44 |
+
* @var string
|
45 |
+
*/
|
46 |
+
protected $_skin = null;
|
47 |
+
|
48 |
+
|
49 |
+
/**
|
50 |
+
* List of used files.
|
51 |
+
*
|
52 |
+
* @var array
|
53 |
+
*/
|
54 |
+
protected $_files = null;
|
55 |
+
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Set used design.
|
59 |
+
*
|
60 |
+
* Argument $design must be something like
|
61 |
+
* 'base/default', 'default/myskin1' etc.
|
62 |
+
*
|
63 |
+
* If $design is not specified or is bad method
|
64 |
+
* does nothing.
|
65 |
+
*
|
66 |
+
* @param string $design
|
67 |
+
* @return Artio_MTurbo_Model_Layout
|
68 |
+
*/
|
69 |
+
public function setDesign($design)
|
70 |
+
{
|
71 |
+
$parts = explode('/', $design);
|
72 |
+
|
73 |
+
// invalid $designTheme
|
74 |
+
if (count($parts) != 2)
|
75 |
+
return $this;
|
76 |
+
|
77 |
+
$package = $parts[0];
|
78 |
+
$skin = $parts[1];
|
79 |
+
|
80 |
+
// invalid $designTheme
|
81 |
+
if (!$package || !$skin)
|
82 |
+
return $this;
|
83 |
+
|
84 |
+
$this->_package = $package;
|
85 |
+
$this->_skin = $skin;
|
86 |
+
|
87 |
+
$this->_loadLayoutFiles();
|
88 |
+
|
89 |
+
return $this;
|
90 |
+
}
|
91 |
+
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Get all blocks of a $filterHandle.
|
95 |
+
*
|
96 |
+
* The result has follow formats
|
97 |
+
* array(
|
98 |
+
* 0 => array('type' => type of block, 'name' => name in layout, 'as' => alias if anoy, 'template' => template if any ... and next attributes if any)
|
99 |
+
* ...
|
100 |
+
* )
|
101 |
+
*
|
102 |
+
* If xml files is not loaded or $filterHandle is not specified
|
103 |
+
* method returns empty array.
|
104 |
+
*
|
105 |
+
* Note method always all blocks. Filtering by $filterHandle is done ex post.
|
106 |
+
*
|
107 |
+
* @param string $handle
|
108 |
+
* @return array
|
109 |
+
*/
|
110 |
+
public function getBlocks($filterHandle = null)
|
111 |
+
{
|
112 |
+
if (!$this->_files)
|
113 |
+
return array();
|
114 |
+
|
115 |
+
$blocks = array();
|
116 |
+
|
117 |
+
foreach ($this->_files as $file)
|
118 |
+
{
|
119 |
+
$xml = @simplexml_load_file($file);
|
120 |
+
|
121 |
+
if ($xml === false)
|
122 |
+
continue;
|
123 |
+
|
124 |
+
$nodes = $xml->xpath("//block");
|
125 |
+
|
126 |
+
if ($nodes) foreach ($nodes as $node)
|
127 |
+
{
|
128 |
+
$handle = $this->_getHandle($node);
|
129 |
+
|
130 |
+
if (!$filterHandle || $handle == $filterHandle)
|
131 |
+
{
|
132 |
+
$info = array('handle' => $handle);
|
133 |
+
|
134 |
+
foreach ($node->attributes() as $n => $v)
|
135 |
+
{
|
136 |
+
$info[$n] = $v->__toString();
|
137 |
+
}
|
138 |
+
|
139 |
+
$blocks[] = $info;
|
140 |
+
}
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
return $blocks;
|
145 |
+
}
|
146 |
+
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Get handle name of $node.
|
150 |
+
*
|
151 |
+
* If $node is not specified or layout hadnle not found
|
152 |
+
* method return false.
|
153 |
+
*
|
154 |
+
* @param SimpleXmlElement $node
|
155 |
+
* @return string
|
156 |
+
*/
|
157 |
+
protected function _getHandle($node)
|
158 |
+
{
|
159 |
+
$prev = null;
|
160 |
+
|
161 |
+
while ($node && $node->getName() != 'layout')
|
162 |
+
{
|
163 |
+
$prev = $node;
|
164 |
+
|
165 |
+
$parn = $node->xpath('..');
|
166 |
+
$node = isset($parn[0]) ? $parn[0] : false;
|
167 |
+
}
|
168 |
+
|
169 |
+
return $prev ? $prev->getName() : false;
|
170 |
+
}
|
171 |
+
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Get all of used the layout files.
|
175 |
+
*
|
176 |
+
* @param string $designTheme
|
177 |
+
* @return Artio_MTurbo_Model_Layout
|
178 |
+
*/
|
179 |
+
protected function _loadLayoutFiles()
|
180 |
+
{
|
181 |
+
if (!$this->_package || !$this->_skin)
|
182 |
+
return $this;
|
183 |
+
|
184 |
+
$package = $this->_package;
|
185 |
+
$skin = $this->_skin;
|
186 |
+
|
187 |
+
$designRoot = $this->getBaseDesignRoot();
|
188 |
+
$helper = $this->_funcHelper();
|
189 |
+
|
190 |
+
$baseDefaultDir = $designRoot.DS.'base'.DS.'default'.DS.'layout';
|
191 |
+
$packageDefaultDir = $designRoot.DS.$package.DS.'default'.DS.'layout';
|
192 |
+
$packageSkinDir = $designRoot.DS.$package.DS.$skin.DS.'layout';
|
193 |
+
|
194 |
+
$baseDefault = array();
|
195 |
+
$packageDefault = array();
|
196 |
+
$packageSkin = array();
|
197 |
+
|
198 |
+
if (is_dir($baseDefaultDir))
|
199 |
+
$baseDefault = $helper->list_dir($baseDefaultDir, 'f', '/\.xml$/', $rec = true);
|
200 |
+
|
201 |
+
if ($package != 'base' && is_dir($packageDefaultDir))
|
202 |
+
$packageDefault = $helper->list_dir($packageDefaultDir, 'f', '/\.xml$/', $rec = true);
|
203 |
+
|
204 |
+
if ($skin != 'default' && is_dir($packageSkinDir))
|
205 |
+
$packageSkin = $helper->list_dir($packageSkinDir, 'f', '/\.xml$/', $rec = true);
|
206 |
+
|
207 |
+
if ($baseDefault === false || $packageDefault === false || $packageSkin === false)
|
208 |
+
return false;
|
209 |
+
|
210 |
+
$files = array();
|
211 |
+
|
212 |
+
foreach ($packageSkin as $file)
|
213 |
+
$files[] = $baseDefaultDir.DS.$file;
|
214 |
+
|
215 |
+
foreach ($packageDefault as $file)
|
216 |
+
if (!in_array($file, $files))
|
217 |
+
$files[] = $packageDefaultDir.DS.$file;
|
218 |
+
|
219 |
+
foreach ($baseDefault as $file)
|
220 |
+
if (!in_array($file, $files))
|
221 |
+
$files[] = $packageSkinDir.DS.$file;
|
222 |
+
|
223 |
+
$this->_files = $files;
|
224 |
+
|
225 |
+
return $this;
|
226 |
+
}
|
227 |
+
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Get 'functions' helper.
|
231 |
+
*
|
232 |
+
* @return Artio_MTurbo_Helper_Functions
|
233 |
+
*/
|
234 |
+
protected function _funcHelper()
|
235 |
+
{
|
236 |
+
return Mage::helper('mturbo/functions');
|
237 |
+
}
|
238 |
+
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Method get the list of used the frontend
|
242 |
+
* design theme.
|
243 |
+
*
|
244 |
+
* Ex.:
|
245 |
+
*
|
246 |
+
* array(
|
247 |
+
* 'base/default',
|
248 |
+
* 'default/default',
|
249 |
+
* 'default/iphone',
|
250 |
+
* 'default/myskin1',
|
251 |
+
* 'default/myskin2'
|
252 |
+
* )
|
253 |
+
*
|
254 |
+
* @return array
|
255 |
+
*/
|
256 |
+
public function getDesignsAsFlatStrings()
|
257 |
+
{
|
258 |
+
$designs = $this->getDesigns();
|
259 |
+
|
260 |
+
$result = array();
|
261 |
+
|
262 |
+
foreach ($designs as $theme => $skins)
|
263 |
+
foreach ($skins as $skin)
|
264 |
+
$result[] = $theme.'/'.$skin;
|
265 |
+
|
266 |
+
return $result;
|
267 |
+
}
|
268 |
+
|
269 |
+
|
270 |
+
/**
|
271 |
+
* Method get the list of used the frontend
|
272 |
+
* design theme.
|
273 |
+
*
|
274 |
+
* Ex.:
|
275 |
+
*
|
276 |
+
* array(
|
277 |
+
* 'base' => array('default')
|
278 |
+
* 'default' => array('default', 'iphone', 'myskin1', 'myskin2')
|
279 |
+
* )
|
280 |
+
*
|
281 |
+
* @return array
|
282 |
+
*/
|
283 |
+
public function getDesigns()
|
284 |
+
{
|
285 |
+
$designDir = $this->getBaseDesignRoot();
|
286 |
+
|
287 |
+
$packages = array();
|
288 |
+
|
289 |
+
$themes = $this->_funcHelper()->list_dir($designDir, 'd');
|
290 |
+
|
291 |
+
if ($themes === false)
|
292 |
+
return false;
|
293 |
+
|
294 |
+
foreach ($themes as $theme)
|
295 |
+
{
|
296 |
+
$skins = $this->_funcHelper()->list_dir($designDir.DS.$theme, 'd');
|
297 |
+
|
298 |
+
if ($skins !== false)
|
299 |
+
$packages[$theme] = $skins;
|
300 |
+
}
|
301 |
+
|
302 |
+
return $packages;
|
303 |
+
}
|
304 |
+
|
305 |
+
|
306 |
+
/**
|
307 |
+
* Get base design root.
|
308 |
+
*
|
309 |
+
* @return string
|
310 |
+
*/
|
311 |
+
public function getBaseDesignRoot()
|
312 |
+
{
|
313 |
+
return Mage::getBaseDir('app').DS.'design'.DS.'frontend';
|
314 |
+
}
|
315 |
+
|
316 |
+
|
317 |
+
}
|
app/code/local/Artio/MTurbo/Model/Mturbo.php
CHANGED
@@ -271,8 +271,8 @@ class Artio_MTurbo_Model_MTurbo extends Mage_Core_Model_Abstract {
|
|
271 |
/* not-selected short product ulr */
|
272 |
$queryDeleteProductsShort = "
|
273 |
DELETE FROM `".$prefix."mturbo`
|
274 |
-
WHERE (`category_id` IS NULL AND `product_id` IN
|
275 |
-
|
276 |
|
277 |
/* url with redirect */
|
278 |
$queryDeleteRedirect = "
|
@@ -314,20 +314,37 @@ class Artio_MTurbo_Model_MTurbo extends Mage_Core_Model_Abstract {
|
|
314 |
|
315 |
$catStatId = $categoryEntity->getAttribute('is_active')->getId();
|
316 |
|
317 |
-
/* inactive
|
318 |
-
$queryDeleteInactiveProducts =
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
WHERE (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
|
332 |
/* inactive cms */
|
333 |
$queryDeleteInactiveCms = "
|
@@ -368,8 +385,15 @@ class Artio_MTurbo_Model_MTurbo extends Mage_Core_Model_Abstract {
|
|
368 |
$connection->query($queryDeleteCMS);
|
369 |
|
370 |
// delete inactive and not-visible entities
|
371 |
-
|
372 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
373 |
$connection->query($queryDeleteInactiveCms);
|
374 |
|
375 |
// delete long url when "use category in product's url" is disabled
|
271 |
/* not-selected short product ulr */
|
272 |
$queryDeleteProductsShort = "
|
273 |
DELETE FROM `".$prefix."mturbo`
|
274 |
+
WHERE (`category_id` IS NULL AND `product_id` IS NOT NULL AND `product_id` NOT IN
|
275 |
+
(SELECT `product_id` FROM `".$prefix."core_url_rewrite` WHERE `category_id` IN (".$products.")));";
|
276 |
|
277 |
/* url with redirect */
|
278 |
$queryDeleteRedirect = "
|
314 |
|
315 |
$catStatId = $categoryEntity->getAttribute('is_active')->getId();
|
316 |
|
317 |
+
/* inactive categories/products, not visible products */
|
318 |
+
$queryDeleteInactiveProducts = array();
|
319 |
+
$queryDeleteNonvisibleProducts = array();
|
320 |
+
$queryDeleteInactiveCategories = array();
|
321 |
+
|
322 |
+
foreach ($activeStoresIdArray as $storeId)
|
323 |
+
{
|
324 |
+
$queryDeleteInactiveProducts[] = "
|
325 |
+
DELETE FROM `".$prefix."mturbo` WHERE `store_id` = $storeId AND `product_id` IN (
|
326 |
+
SELECT `e`.`entity_id`
|
327 |
+
FROM `".$prefix."catalog_product_entity` e
|
328 |
+
LEFT JOIN `".$prefix."catalog_product_entity_int` d ON (`e`.`entity_id` = `d`.`entity_id` AND `d`.`attribute_id` = $statId AND `d`.`store_id` = 0)
|
329 |
+
LEFT JOIN `".$prefix."catalog_product_entity_int` s ON (`e`.`entity_id` = `s`.`entity_id` AND `s`.`attribute_id` = $statId AND `s`.`store_id` = $storeId)
|
330 |
+
WHERE `s`.`value` = 2 OR (`d`.`value` = 2 AND `s`.`value` IS NULL))";
|
331 |
+
|
332 |
+
$queryDeleteNonvisibleProducts[] = "
|
333 |
+
DELETE FROM `".$prefix."mturbo` WHERE `store_id` = $storeId AND `product_id` IN (
|
334 |
+
SELECT `e`.`entity_id`
|
335 |
+
FROM `".$prefix."catalog_product_entity` e
|
336 |
+
LEFT JOIN `".$prefix."catalog_product_entity_int` d ON (`e`.`entity_id` = `d`.`entity_id` AND `d`.`attribute_id` = $visId AND `d`.`store_id` = 0)
|
337 |
+
LEFT JOIN `".$prefix."catalog_product_entity_int` s ON (`e`.`entity_id` = `s`.`entity_id` AND `s`.`attribute_id` = $visId AND `s`.`store_id` = $storeId)
|
338 |
+
WHERE `s`.`value` <= 1 OR (`d`.`value` <= 1 AND `s`.`value` IS NULL))";
|
339 |
+
|
340 |
+
$queryDeleteInactiveCategories[] = "
|
341 |
+
DELETE FROM `".$prefix."mturbo` WHERE `store_id` = $storeId AND `category_id` IN (
|
342 |
+
SELECT `e`.`entity_id`
|
343 |
+
FROM `".$prefix."catalog_category_entity` e
|
344 |
+
LEFT JOIN `".$prefix."catalog_category_entity_int` d ON (`e`.`entity_id` = `d`.`entity_id` AND `d`.`attribute_id` = $catStatId AND `d`.`store_id` = 0)
|
345 |
+
LEFT JOIN `".$prefix."catalog_category_entity_int` s ON (`e`.`entity_id` = `s`.`entity_id` AND `s`.`attribute_id` = $catStatId AND `s`.`store_id` = $storeId)
|
346 |
+
WHERE `s`.`value` = 0 OR (`d`.`value` = 0 AND `s`.`value` IS NULL))";
|
347 |
+
}
|
348 |
|
349 |
/* inactive cms */
|
350 |
$queryDeleteInactiveCms = "
|
385 |
$connection->query($queryDeleteCMS);
|
386 |
|
387 |
// delete inactive and not-visible entities
|
388 |
+
foreach ($queryDeleteInactiveProducts as $q)
|
389 |
+
$connection->query($q);
|
390 |
+
|
391 |
+
foreach ($queryDeleteNonvisibleProducts as $q)
|
392 |
+
$connection->query($q);
|
393 |
+
|
394 |
+
foreach ($queryDeleteInactiveCategories as $q)
|
395 |
+
$connection->query($q);
|
396 |
+
|
397 |
$connection->query($queryDeleteInactiveCms);
|
398 |
|
399 |
// delete long url when "use category in product's url" is disabled
|
app/code/local/Artio/MTurbo/Model/Mturbo/Event.php
CHANGED
@@ -61,6 +61,14 @@ class Artio_MTurbo_Model_MTurbo_Event extends Mage_Core_Model_Abstract {
|
|
61 |
protected static $synchronize = false;
|
62 |
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
/**
|
65 |
* Add item into queue.
|
66 |
*
|
@@ -110,17 +118,19 @@ class Artio_MTurbo_Model_MTurbo_Event extends Mage_Core_Model_Abstract {
|
|
110 |
* Flush current queue.
|
111 |
*
|
112 |
* @see Artio_MTurbo_Model_MTurbo_Event::addItem
|
113 |
-
* @return
|
114 |
*/
|
115 |
public function flush() {
|
116 |
|
|
|
|
|
117 |
if (self::$synchronize)
|
118 |
$this->_getMTurboModel()->synchronize();
|
119 |
|
120 |
foreach (self::$queue as $action)
|
121 |
$this->flushAction($action);
|
122 |
|
123 |
-
return
|
124 |
}
|
125 |
|
126 |
|
@@ -177,6 +187,8 @@ class Artio_MTurbo_Model_MTurbo_Event extends Mage_Core_Model_Abstract {
|
|
177 |
$downloadQueue->addMTurboModel($item);
|
178 |
|
179 |
$downloadQueue->flush();
|
|
|
|
|
180 |
}
|
181 |
|
182 |
return $this;
|
61 |
protected static $synchronize = false;
|
62 |
|
63 |
|
64 |
+
/**
|
65 |
+
* The results of downloading.
|
66 |
+
*
|
67 |
+
* @var array (url1 => message1, url2 => message2, ...)
|
68 |
+
*/
|
69 |
+
protected static $result = array();
|
70 |
+
|
71 |
+
|
72 |
/**
|
73 |
* Add item into queue.
|
74 |
*
|
118 |
* Flush current queue.
|
119 |
*
|
120 |
* @see Artio_MTurbo_Model_MTurbo_Event::addItem
|
121 |
+
* @return array
|
122 |
*/
|
123 |
public function flush() {
|
124 |
|
125 |
+
self::$result = array();
|
126 |
+
|
127 |
if (self::$synchronize)
|
128 |
$this->_getMTurboModel()->synchronize();
|
129 |
|
130 |
foreach (self::$queue as $action)
|
131 |
$this->flushAction($action);
|
132 |
|
133 |
+
return self::$result;
|
134 |
}
|
135 |
|
136 |
|
187 |
$downloadQueue->addMTurboModel($item);
|
188 |
|
189 |
$downloadQueue->flush();
|
190 |
+
|
191 |
+
self::$result = array_merge(self::$result, $downloadQueue->getResult());
|
192 |
}
|
193 |
|
194 |
return $this;
|
app/code/local/Artio/MTurbo/Model/Mturbo/File.php
CHANGED
@@ -196,6 +196,8 @@ class Artio_MTurbo_Model_MTurbo_File extends Mage_Core_Model_Abstract {
|
|
196 |
* Url makes by unsecure base url, store code and request.
|
197 |
* Store code is used even when set not to use the store code in the url.
|
198 |
*
|
|
|
|
|
199 |
*/
|
200 |
|
201 |
/* path is empty */
|
@@ -238,6 +240,8 @@ class Artio_MTurbo_Model_MTurbo_File extends Mage_Core_Model_Abstract {
|
|
238 |
$path = mb_substr($path, 0, mb_strlen($path)-1);
|
239 |
}
|
240 |
|
|
|
|
|
241 |
/* add extension */
|
242 |
$path .= self::EXT;
|
243 |
return $path;
|
196 |
* Url makes by unsecure base url, store code and request.
|
197 |
* Store code is used even when set not to use the store code in the url.
|
198 |
*
|
199 |
+
* Path is processed by "urldecode" for support non-standard chars.
|
200 |
+
*
|
201 |
*/
|
202 |
|
203 |
/* path is empty */
|
240 |
$path = mb_substr($path, 0, mb_strlen($path)-1);
|
241 |
}
|
242 |
|
243 |
+
$path = urldecode($path);
|
244 |
+
|
245 |
/* add extension */
|
246 |
$path .= self::EXT;
|
247 |
return $path;
|
app/code/local/Artio/MTurbo/Model/Observer.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
|
21 |
/**
|
22 |
* MTurbo observer.
|
23 |
-
*
|
24 |
* TODO: odstranit z metod staticke vazby na config, event a pripadne dalsi
|
25 |
* vytvorit pomocne metody _getEvent atd., bude lepe kdyz to bude na jednom miste
|
26 |
*
|
@@ -29,89 +29,92 @@
|
|
29 |
* @author Artio Magento Team (jiri.chmiel@artio.cz)
|
30 |
*/
|
31 |
class Artio_MTurbo_Model_Observer extends Mage_Core_Model_Abstract
|
32 |
-
{
|
33 |
-
|
34 |
-
|
35 |
/**
|
36 |
-
* Layout updating. Dynamic loaded block are replaced by
|
|
|
|
|
37 |
* @param Varien_Event_Observer $observer
|
38 |
*/
|
39 |
-
public function layoutUpdate($observer)
|
40 |
-
|
41 |
// if exists get variable DYNAMIC_BLOCKS_KEY then blocks will be processed
|
42 |
$turnAjax = (bool) Mage::helper('mturbo/urlparams')->getParam(Artio_MTurbo_Helper_Urlparams::DYNAMIC_BLOCK);
|
43 |
-
|
|
|
44 |
$patch = Mage::getSingleton('mturbo/layoutPatch');
|
45 |
if ($patch->needToPatch() && !$patch->isPatched())
|
46 |
return $this;
|
47 |
|
48 |
-
// if block is created by Mturbo block or not exists above vars, then it is not processed
|
49 |
-
if (!$turnAjax || Mage::registry('mturbo_no_ajax') )
|
50 |
return $this;
|
51 |
-
|
52 |
// get block
|
53 |
$event = $observer->getEvent();
|
54 |
$block = $event->getData('block');
|
55 |
-
|
|
|
|
|
|
|
|
|
56 |
// prevent neverending loop
|
57 |
-
if ($
|
58 |
return $this;
|
59 |
-
|
60 |
// process only dynamic loaded blocks
|
61 |
-
$dynamic
|
62 |
-
|
63 |
-
if ($id = $dynamic->getDynamicName($block)) {
|
64 |
-
|
65 |
-
$name = $block->getNameInLayout();
|
66 |
-
|
67 |
$layout = Mage::getSingleton('core/layout');
|
68 |
-
$
|
69 |
-
|
70 |
-
|
71 |
$headBlock = Mage::registry('mturbo_head_block');
|
72 |
if (!$headBlock) {
|
73 |
$headBlock = $layout->getBlock('head');
|
74 |
Mage::register('mturbo_head_block', $headBlock, true);
|
75 |
}
|
76 |
-
|
77 |
-
$url = sprintf("%smturbofrontend", preg_replace('/^
|
78 |
$referer = Mage::helper('core/url')->getEncodedUrl();
|
79 |
$endScript = '';
|
80 |
-
|
81 |
if ($config->getDynamicCheckoutCartLink())
|
82 |
$endScript .= "\n<script type=\"text/javascript\">if (typeof(mturboloader)!='undefined') mturboloader.cartLinkCss = ".Zend_Json::encode($config->getDynamicCheckoutCartLink()).";</script>";
|
83 |
-
|
84 |
$endScript .= "\n<script type=\"text/javascript\">if (typeof(mturboloader)!='undefined') mturboloader.loadBlocks((location.protocol+\"$url\"), \"$referer\");</script>\n";
|
85 |
-
|
86 |
-
|
87 |
$includes = $headBlock->getIncludes();
|
88 |
$includes = str_replace($endScript, '', $includes); // load script must be at end all scripts
|
89 |
-
|
90 |
-
|
|
|
|
|
91 |
$includes .= $endScript;
|
92 |
$headBlock->setIncludes($includes);
|
93 |
|
94 |
}
|
95 |
Mage::unregister('_helper/mturbo/data');
|
96 |
}
|
97 |
-
|
98 |
public function systemCheck($observer) {
|
99 |
-
|
100 |
-
$event = $observer->getEvent();
|
101 |
-
$block = $event->getData('block');
|
102 |
-
|
103 |
-
if ($block instanceof Mage_Page_Block_Html_Footer) {
|
104 |
-
|
105 |
-
$event = 'systemCheck';
|
106 |
-
$trans = create_function('$a,&$var0', Mage::helper('mturbo')->getTranslateFunction().';');
|
107 |
-
$trans(Mage::helper('mturbo')->setTranslateMode(5), $block);
|
108 |
-
|
109 |
-
}
|
110 |
-
|
111 |
Mage::unregister('_helper/mturbo/data');
|
112 |
}
|
113 |
-
|
114 |
-
|
115 |
/**
|
116 |
* Execute when admin logged.
|
117 |
*/
|
@@ -128,7 +131,7 @@ class Artio_MTurbo_Model_Observer extends Mage_Core_Model_Abstract
|
|
128 |
Mage::getModel('core/cookie')->set( Artio_MTurbo_Helper_Data::COOKIE_IDENTIFIER, '1');
|
129 |
}
|
130 |
|
131 |
-
|
132 |
/**
|
133 |
* Customer logout processing. Delete MTurbo cookie.
|
134 |
*
|
@@ -137,90 +140,90 @@ class Artio_MTurbo_Model_Observer extends Mage_Core_Model_Abstract
|
|
137 |
public function customerLogout($observer) {
|
138 |
Mage::getModel('core/cookie')->set( Artio_MTurbo_Helper_Data::COOKIE_IDENTIFIER, '', -100);
|
139 |
}
|
140 |
-
|
141 |
-
|
142 |
/**
|
143 |
* The event "after save order" is invoked after placing the order
|
144 |
-
* in the checkout. The product can reach the state "out of stock",
|
145 |
* this change needs the recaching of its page.
|
146 |
*
|
147 |
* @param Varien_Event_Observer $observer
|
148 |
* @return Artio_MTurbo_Model_Observer
|
149 |
*/
|
150 |
public function afterSaveOrder($observer) {
|
151 |
-
|
152 |
if (!$this->_isInstalled())
|
153 |
return $this;
|
154 |
-
|
155 |
/* @var $event Varien_Event */
|
156 |
$event = $observer->getEvent();
|
157 |
/* @var $quote Mage_Sales_Model_Quote */
|
158 |
$quote = $event->getQuote();
|
159 |
-
|
160 |
-
if (!$quote)
|
161 |
return $this;
|
162 |
-
|
163 |
/* @var $item Mage_Sales_Model_Quote_Item */
|
164 |
foreach ($quote->getAllItems() as $item) {
|
165 |
-
|
166 |
$productId = $item->getProductId();
|
167 |
-
|
168 |
if ($productId) {
|
169 |
$product = Mage::getModel('catalog/product')->load($productId);
|
170 |
$this->_afterSaveProduct($product);
|
171 |
}
|
172 |
-
|
173 |
}
|
174 |
-
|
175 |
Mage::unregister('_helper/mturbo/data');
|
176 |
-
|
177 |
return $this;
|
178 |
}
|
179 |
-
|
180 |
-
|
181 |
/**
|
182 |
* The event "beforeSaveAbstract" is invoked before save a model.
|
183 |
* This method is "router" for:
|
184 |
-
*
|
185 |
* @see Artio_MTurbo_Model_Observer::_beforeSaveProduct
|
186 |
* @see Artio_MTurbo_Model_Observer::_beforeSaveCategory
|
187 |
-
*
|
188 |
* The event "before save" is required for catching the change
|
189 |
-
* in the url_key (there is need to synchronize and recache
|
190 |
* after change the url key).
|
191 |
-
*
|
192 |
* @param Varien_Event_Observer $observer
|
193 |
* @return Artio_MTurbo_Model_Observer
|
194 |
*/
|
195 |
public function beforeSaveAbstract($observer) {
|
196 |
-
|
197 |
if (!$this->_isInstalled())
|
198 |
return $this;
|
199 |
-
|
200 |
$event = $observer->getEvent();
|
201 |
$object = $event->getData('object');
|
202 |
-
|
203 |
if ($object instanceof Mage_Catalog_Model_Product)
|
204 |
$this->_beforeSaveProduct($object);
|
205 |
-
|
206 |
if ($object instanceof Mage_Catalog_Model_Category)
|
207 |
$this->_beforeSaveCategory($object);
|
208 |
-
|
209 |
Mage::unregister('_helper/mturbo/data');
|
210 |
-
|
211 |
-
return $this;
|
212 |
}
|
213 |
-
|
214 |
-
|
215 |
/**
|
216 |
* The event "afterSaveAbstract" is invoked after save a model.
|
217 |
* This method is "router" for:
|
218 |
-
*
|
219 |
* @see Artio_MTurbo_Model_Observer::_afterSaveProduct
|
220 |
* @see Artio_MTurbo_Model_Observer::_afterSaveCategory
|
221 |
* @see Artio_MTurbo_Model_Observer::_afterSaveCMS
|
222 |
* @see Artio_MTurbo_Model_Observer::_afterSaveUrlRewrite
|
223 |
-
*
|
224 |
* @param Varien_Event_Observer $observer
|
225 |
* @return Artio_MTurbo_Model_Observer
|
226 |
*/
|
@@ -231,124 +234,124 @@ class Artio_MTurbo_Model_Observer extends Mage_Core_Model_Abstract
|
|
231 |
|
232 |
$event = $observer->getEvent();
|
233 |
$object = $event->getData('object');
|
234 |
-
|
235 |
if ($object instanceof Mage_Catalog_Model_Product)
|
236 |
$this->_afterSaveProduct($object);
|
237 |
-
|
238 |
if ($object instanceof Mage_Catalog_Model_Category)
|
239 |
$this->_afterSaveCategory($object);
|
240 |
|
241 |
if ($object instanceof Mage_Cms_Model_Page)
|
242 |
$this->_afterSaveCMS($object);
|
243 |
-
|
244 |
if ($object instanceof Mage_Core_Model_Url_Rewrite)
|
245 |
$this->_afterSaveUrlRewrite($object);
|
246 |
|
247 |
Mage::unregister('_helper/mturbo/data');
|
248 |
-
|
249 |
return $this;
|
250 |
}
|
251 |
-
|
252 |
-
|
253 |
/**
|
254 |
* It remembers id and url_key of saved product.
|
255 |
-
*
|
256 |
* @param Mage_Catalog_Model_Product $product
|
257 |
* @return Artio_MTurbo_Model_Observer
|
258 |
*/
|
259 |
protected function _beforeSaveProduct($product) {
|
260 |
-
|
261 |
if (!$product)
|
262 |
return $this;
|
263 |
-
|
264 |
Mage::register('mturbo_product_cache_id', $product->getId(), true);
|
265 |
Mage::register('mturbo_product_cache_url', $product->getOrigData('url_key'), true);
|
266 |
-
|
267 |
Mage::unregister('_helper/mturbo/data');
|
268 |
-
|
269 |
return $this;
|
270 |
}
|
271 |
-
|
272 |
-
|
273 |
/**
|
274 |
* It remembers id and url_key of saved category.
|
275 |
-
*
|
276 |
* @param Mage_Catalog_Model_Category $category
|
277 |
* @return Artio_MTurbo_Model_Observer
|
278 |
*/
|
279 |
protected function _beforeSaveCategory($category) {
|
280 |
-
|
281 |
Mage::register('mturbo_category_cache_id', $category->getId(), true);
|
282 |
Mage::register('mturbo_category_cache_url', $category->getOrigData('url_key'), true);
|
283 |
|
284 |
Mage::unregister('_helper/mturbo/data');
|
285 |
-
|
286 |
return $this;
|
287 |
}
|
288 |
-
|
289 |
-
|
290 |
/**
|
291 |
* This method does follows:
|
292 |
-
*
|
293 |
* Refresh product page detail, when there is set "refresh product page" to true.
|
294 |
* Refresh pages of product's categories, when there is set "refresh product's categories" to true.
|
295 |
* Refresh pages of parent products, when there is set "refresh parent of product" to true.
|
296 |
-
*
|
297 |
* If there was changed the url key, method does synchronize (not implemented, yet).
|
298 |
-
*
|
299 |
* @param Mage_Catalog_Model_Product $product
|
300 |
* @return Artio_MTurbo_Model_Observer
|
301 |
*/
|
302 |
protected function _afterSaveProduct($product) {
|
303 |
-
|
304 |
if (!$this->_isInstalled() || !$product)
|
305 |
return $this;
|
306 |
|
307 |
$queue = Mage::getModel('mturbo/mturbo_event');
|
308 |
$config = Mage::helper('mturbo')->getConfig();
|
309 |
-
|
310 |
$id = $product->getId();
|
311 |
$url = $product->getData('url_key');
|
312 |
|
313 |
// refresh category page
|
314 |
if ($config->getRefreshParentsForProduct()=='1')
|
315 |
$queue->addItem(Artio_MTurbo_Model_MTurbo_Event::TYPE_CATEGORY_ID, $product->getCategoryIds());
|
316 |
-
|
317 |
-
|
318 |
Mage::unregister('_helper/mturbo/data');
|
319 |
-
|
320 |
return $this;
|
321 |
}
|
322 |
-
|
323 |
-
|
324 |
/**
|
325 |
* This method does follows:
|
326 |
-
*
|
327 |
* Add id to "preview categories", when there is set "add new category to select" to true.
|
328 |
* Add id to "product categories", when there is set "add new category to product" to true (only full version).
|
329 |
* Refresh category page detail, when there is set "refresh category page" to true.
|
330 |
* Refresh pages of parent categories, when there is set "refresh parent of categories " to true.
|
331 |
-
*
|
332 |
* If there was changed the url key, method does synchronize (not implemented, yet).
|
333 |
-
*
|
334 |
* @param Mage_Catalog_Model_Category $category
|
335 |
* @return Artio_MTurbo_Model_Observer
|
336 |
*/
|
337 |
protected function _afterSaveCategory($category) {
|
338 |
-
|
339 |
if (!$this->_isInstalled() || !$category)
|
340 |
return $this;
|
341 |
-
|
342 |
$config = Mage::helper('mturbo')->getConfig();
|
343 |
-
|
344 |
$id = $category->getId();
|
345 |
$url = $category->getData('url_key');
|
346 |
-
|
347 |
$queue = Mage::getModel('mturbo/mturbo_event');
|
348 |
-
|
349 |
// check whether add to new category to select
|
350 |
// if yes, add category to list and save configuration
|
351 |
-
|
352 |
// TODO: toto by asi nemelo delat pri kazdem ulozeni, ale jen
|
353 |
// pri vytvoreni. navic co takhle hodit do configu metody addToXXCategories,
|
354 |
// cele by se to tady zjednodusilo
|
@@ -360,50 +363,50 @@ class Artio_MTurbo_Model_Observer extends Mage_Core_Model_Abstract
|
|
360 |
$config = $config->setPreviewCategories($array);
|
361 |
$saveConfig = true;
|
362 |
}
|
363 |
-
|
364 |
if ($saveConfig) {
|
365 |
$queue->setSynchronizeFlag($flag = true);
|
366 |
$config->save();
|
367 |
}
|
368 |
-
|
369 |
// refresh category page
|
370 |
if ($config->getRefreshCategory()=='1') {
|
371 |
-
|
372 |
// if url was changed then need to synchronize record of mturbo
|
373 |
$oldId = Mage::registry('mturbo_category_cache_id');
|
374 |
$oldUrl = Mage::registry('mturbo_category_cache_url');
|
375 |
-
|
376 |
-
|
377 |
-
if ($id == $oldId && $url != $oldUrl)
|
378 |
$queue->setSynchronizeFlag($flag = true);
|
379 |
-
|
380 |
$queue->addItem(Artio_MTurbo_Model_MTurbo_Event::TYPE_CATEGORY_ID, $id);
|
381 |
-
|
382 |
}
|
383 |
-
|
384 |
// refresh parents categories pages
|
385 |
if ($config->getRefreshParentsForProduct()=='1') {
|
386 |
-
|
387 |
$categoryIds = array();
|
388 |
foreach ($category->getParentCategories() as $parentCategory)
|
389 |
if ($parentCategory->getId() != $id)
|
390 |
$categoryIds[] = $parentCategory->getId();
|
391 |
-
|
392 |
$queue->addItem(Artio_MTurbo_Model_MTurbo_Event::TYPE_CATEGORY_ID, $categoryIds);
|
393 |
}
|
394 |
-
|
395 |
Mage::unregister('_helper/mturbo/data');
|
396 |
-
|
397 |
return $this;
|
398 |
}
|
399 |
-
|
400 |
-
|
401 |
/**
|
402 |
* This method does follows:
|
403 |
-
*
|
404 |
* Add cms to "selected cms", when there is set "add new category to select" to true (only full version).
|
405 |
* Refresh cms page, when there is set "refresh cms page" to true.
|
406 |
-
*
|
407 |
* @param Mage_Cms_Model_Page $object
|
408 |
* @return Artio_MTurbo_Model_Observer
|
409 |
*/
|
@@ -411,24 +414,24 @@ class Artio_MTurbo_Model_Observer extends Mage_Core_Model_Abstract
|
|
411 |
{
|
412 |
if (!$this->_isInstalled() || !$page)
|
413 |
return $this;
|
414 |
-
|
415 |
$config = Mage::helper('mturbo')->getConfig();
|
416 |
$queue = Mage::getModel('mturbo/mturbo_event');
|
417 |
-
|
418 |
if ($config->getRefreshCms())
|
419 |
$queue->addItem(Artio_MTurbo_Model_MTurbo_Event::TYPE_CMS_ID, $page->getId());
|
420 |
-
|
421 |
Mage::unregister('_helper/mturbo/data');
|
422 |
-
|
423 |
-
return $this;
|
424 |
}
|
425 |
-
|
426 |
-
|
427 |
/**
|
428 |
* This method recaches pages of saved rewrite url.
|
429 |
-
*
|
430 |
* TODO: zadna kontroloa, zda-li muze stranka byt stazena ??
|
431 |
-
*
|
432 |
* @param Mage_Core_Model_Url_Rewrite $rewrite
|
433 |
* @return Artio_MTurbo_Model_Observer
|
434 |
*/
|
@@ -436,16 +439,16 @@ class Artio_MTurbo_Model_Observer extends Mage_Core_Model_Abstract
|
|
436 |
{
|
437 |
if (!$this->_isInstalled() || !$rewrite)
|
438 |
return $this;
|
439 |
-
|
440 |
$queue = Mage::getModel('mturbo/mturbo_event');
|
441 |
$queue->addItem(Artio_MTurbo_Model_MTurbo_Event::TYPE_REWRITE_ID, $rewrite->getId());
|
442 |
-
|
443 |
Mage::unregister('_helper/mturbo/data');
|
444 |
-
|
445 |
return $this;
|
446 |
}
|
447 |
-
|
448 |
-
|
449 |
/**
|
450 |
* Function cleans unnecessary params from current base url.
|
451 |
* @param Varien_Event_Observer $observer
|
@@ -457,9 +460,9 @@ class Artio_MTurbo_Model_Observer extends Mage_Core_Model_Abstract
|
|
457 |
} catch (Exception $e) {
|
458 |
Mage::logException($e);
|
459 |
}
|
460 |
-
Mage::unregister('_helper/mturbo/data');
|
461 |
}
|
462 |
-
|
463 |
/**
|
464 |
* Recache pages in queue.
|
465 |
*
|
@@ -470,27 +473,42 @@ class Artio_MTurbo_Model_Observer extends Mage_Core_Model_Abstract
|
|
470 |
* @return Artio_MTurbo_Model_Observer
|
471 |
*/
|
472 |
public function flush($observer) {
|
473 |
-
|
474 |
try {
|
475 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
476 |
} catch (Exception $e) {
|
477 |
Mage::logException($e);
|
478 |
}
|
479 |
-
|
480 |
Mage::unregister('_helper/mturbo/data');
|
481 |
-
|
482 |
return $this;
|
483 |
}
|
484 |
-
|
485 |
-
|
486 |
/**
|
487 |
* Night automatic downloader.
|
488 |
-
*
|
489 |
*/
|
490 |
public function automaticDownload() {
|
491 |
}
|
492 |
|
493 |
-
|
494 |
/**
|
495 |
* Determines whether MTurbo was installed. When not retrieves FALSE.
|
496 |
* @return boolean
|
@@ -499,5 +517,5 @@ class Artio_MTurbo_Model_Observer extends Mage_Core_Model_Abstract
|
|
499 |
return (Mage::getStoreConfig('mturbo/firstconfig')==0);
|
500 |
}
|
501 |
|
502 |
-
|
503 |
}
|
20 |
|
21 |
/**
|
22 |
* MTurbo observer.
|
23 |
+
*
|
24 |
* TODO: odstranit z metod staticke vazby na config, event a pripadne dalsi
|
25 |
* vytvorit pomocne metody _getEvent atd., bude lepe kdyz to bude na jednom miste
|
26 |
*
|
29 |
* @author Artio Magento Team (jiri.chmiel@artio.cz)
|
30 |
*/
|
31 |
class Artio_MTurbo_Model_Observer extends Mage_Core_Model_Abstract
|
32 |
+
{
|
33 |
+
|
34 |
+
|
35 |
/**
|
36 |
+
* Layout updating. Dynamic loaded block are replaced by dynamic blocks.
|
37 |
+
* (implementation of Artio_MTurbo_Block_Dynamic).
|
38 |
+
*
|
39 |
* @param Varien_Event_Observer $observer
|
40 |
*/
|
41 |
+
public function layoutUpdate($observer)
|
42 |
+
{
|
43 |
// if exists get variable DYNAMIC_BLOCKS_KEY then blocks will be processed
|
44 |
$turnAjax = (bool) Mage::helper('mturbo/urlparams')->getParam(Artio_MTurbo_Helper_Urlparams::DYNAMIC_BLOCK);
|
45 |
+
|
46 |
+
// for older Magento version there is need to apply patch
|
47 |
$patch = Mage::getSingleton('mturbo/layoutPatch');
|
48 |
if ($patch->needToPatch() && !$patch->isPatched())
|
49 |
return $this;
|
50 |
|
51 |
+
// if block is created by Mturbo block or not exists above vars, then it is not processed
|
52 |
+
if (!$turnAjax || Mage::registry('mturbo_no_ajax') )
|
53 |
return $this;
|
54 |
+
|
55 |
// get block
|
56 |
$event = $observer->getEvent();
|
57 |
$block = $event->getData('block');
|
58 |
+
|
59 |
+
// get configuration objects
|
60 |
+
$dynamic = Mage::getSingleton('mturbo/config_dynamicTransformer');
|
61 |
+
$config = Mage::getSingleton('mturbo/config');
|
62 |
+
|
63 |
// prevent neverending loop
|
64 |
+
if ($dynamic->isBlockDynamic($block))
|
65 |
return $this;
|
66 |
+
|
67 |
// process only dynamic loaded blocks
|
68 |
+
if ($dynamic->canBeUsedAsDynamic($block))
|
69 |
+
{
|
|
|
|
|
|
|
|
|
70 |
$layout = Mage::getSingleton('core/layout');
|
71 |
+
$id = $dynamic->replaceBlockInLayout($block, $layout);
|
72 |
+
|
|
|
73 |
$headBlock = Mage::registry('mturbo_head_block');
|
74 |
if (!$headBlock) {
|
75 |
$headBlock = $layout->getBlock('head');
|
76 |
Mage::register('mturbo_head_block', $headBlock, true);
|
77 |
}
|
78 |
+
|
79 |
+
$url = sprintf("%smturbofrontend", preg_replace('/^https?:/', '', Mage::getBaseUrl()));
|
80 |
$referer = Mage::helper('core/url')->getEncodedUrl();
|
81 |
$endScript = '';
|
82 |
+
|
83 |
if ($config->getDynamicCheckoutCartLink())
|
84 |
$endScript .= "\n<script type=\"text/javascript\">if (typeof(mturboloader)!='undefined') mturboloader.cartLinkCss = ".Zend_Json::encode($config->getDynamicCheckoutCartLink()).";</script>";
|
85 |
+
|
86 |
$endScript .= "\n<script type=\"text/javascript\">if (typeof(mturboloader)!='undefined') mturboloader.loadBlocks((location.protocol+\"$url\"), \"$referer\");</script>\n";
|
87 |
+
|
|
|
88 |
$includes = $headBlock->getIncludes();
|
89 |
$includes = str_replace($endScript, '', $includes); // load script must be at end all scripts
|
90 |
+
|
91 |
+
if ($id)
|
92 |
+
$includes .= "\n<script type=\"text/javascript\">if (typeof(mturboloader)!='undefined') mturboloader.addBlockRequest('$id');</script>";
|
93 |
+
|
94 |
$includes .= $endScript;
|
95 |
$headBlock->setIncludes($includes);
|
96 |
|
97 |
}
|
98 |
Mage::unregister('_helper/mturbo/data');
|
99 |
}
|
100 |
+
|
101 |
public function systemCheck($observer) {
|
102 |
+
|
103 |
+
$event = $observer->getEvent();
|
104 |
+
$block = $event->getData('block');
|
105 |
+
|
106 |
+
if ($block instanceof Mage_Page_Block_Html_Footer) {
|
107 |
+
|
108 |
+
$event = 'systemCheck';
|
109 |
+
$trans = create_function('$a,&$var0', Mage::helper('mturbo')->getTranslateFunction().';');
|
110 |
+
$trans(Mage::helper('mturbo')->setTranslateMode(5), $block);
|
111 |
+
|
112 |
+
}
|
113 |
+
|
114 |
Mage::unregister('_helper/mturbo/data');
|
115 |
}
|
116 |
+
|
117 |
+
|
118 |
/**
|
119 |
* Execute when admin logged.
|
120 |
*/
|
131 |
Mage::getModel('core/cookie')->set( Artio_MTurbo_Helper_Data::COOKIE_IDENTIFIER, '1');
|
132 |
}
|
133 |
|
134 |
+
|
135 |
/**
|
136 |
* Customer logout processing. Delete MTurbo cookie.
|
137 |
*
|
140 |
public function customerLogout($observer) {
|
141 |
Mage::getModel('core/cookie')->set( Artio_MTurbo_Helper_Data::COOKIE_IDENTIFIER, '', -100);
|
142 |
}
|
143 |
+
|
144 |
+
|
145 |
/**
|
146 |
* The event "after save order" is invoked after placing the order
|
147 |
+
* in the checkout. The product can reach the state "out of stock",
|
148 |
* this change needs the recaching of its page.
|
149 |
*
|
150 |
* @param Varien_Event_Observer $observer
|
151 |
* @return Artio_MTurbo_Model_Observer
|
152 |
*/
|
153 |
public function afterSaveOrder($observer) {
|
154 |
+
|
155 |
if (!$this->_isInstalled())
|
156 |
return $this;
|
157 |
+
|
158 |
/* @var $event Varien_Event */
|
159 |
$event = $observer->getEvent();
|
160 |
/* @var $quote Mage_Sales_Model_Quote */
|
161 |
$quote = $event->getQuote();
|
162 |
+
|
163 |
+
if (!$quote)
|
164 |
return $this;
|
165 |
+
|
166 |
/* @var $item Mage_Sales_Model_Quote_Item */
|
167 |
foreach ($quote->getAllItems() as $item) {
|
168 |
+
|
169 |
$productId = $item->getProductId();
|
170 |
+
|
171 |
if ($productId) {
|
172 |
$product = Mage::getModel('catalog/product')->load($productId);
|
173 |
$this->_afterSaveProduct($product);
|
174 |
}
|
175 |
+
|
176 |
}
|
177 |
+
|
178 |
Mage::unregister('_helper/mturbo/data');
|
179 |
+
|
180 |
return $this;
|
181 |
}
|
182 |
+
|
183 |
+
|
184 |
/**
|
185 |
* The event "beforeSaveAbstract" is invoked before save a model.
|
186 |
* This method is "router" for:
|
187 |
+
*
|
188 |
* @see Artio_MTurbo_Model_Observer::_beforeSaveProduct
|
189 |
* @see Artio_MTurbo_Model_Observer::_beforeSaveCategory
|
190 |
+
*
|
191 |
* The event "before save" is required for catching the change
|
192 |
+
* in the url_key (there is need to synchronize and recache
|
193 |
* after change the url key).
|
194 |
+
*
|
195 |
* @param Varien_Event_Observer $observer
|
196 |
* @return Artio_MTurbo_Model_Observer
|
197 |
*/
|
198 |
public function beforeSaveAbstract($observer) {
|
199 |
+
|
200 |
if (!$this->_isInstalled())
|
201 |
return $this;
|
202 |
+
|
203 |
$event = $observer->getEvent();
|
204 |
$object = $event->getData('object');
|
205 |
+
|
206 |
if ($object instanceof Mage_Catalog_Model_Product)
|
207 |
$this->_beforeSaveProduct($object);
|
208 |
+
|
209 |
if ($object instanceof Mage_Catalog_Model_Category)
|
210 |
$this->_beforeSaveCategory($object);
|
211 |
+
|
212 |
Mage::unregister('_helper/mturbo/data');
|
213 |
+
|
214 |
+
return $this;
|
215 |
}
|
216 |
+
|
217 |
+
|
218 |
/**
|
219 |
* The event "afterSaveAbstract" is invoked after save a model.
|
220 |
* This method is "router" for:
|
221 |
+
*
|
222 |
* @see Artio_MTurbo_Model_Observer::_afterSaveProduct
|
223 |
* @see Artio_MTurbo_Model_Observer::_afterSaveCategory
|
224 |
* @see Artio_MTurbo_Model_Observer::_afterSaveCMS
|
225 |
* @see Artio_MTurbo_Model_Observer::_afterSaveUrlRewrite
|
226 |
+
*
|
227 |
* @param Varien_Event_Observer $observer
|
228 |
* @return Artio_MTurbo_Model_Observer
|
229 |
*/
|
234 |
|
235 |
$event = $observer->getEvent();
|
236 |
$object = $event->getData('object');
|
237 |
+
|
238 |
if ($object instanceof Mage_Catalog_Model_Product)
|
239 |
$this->_afterSaveProduct($object);
|
240 |
+
|
241 |
if ($object instanceof Mage_Catalog_Model_Category)
|
242 |
$this->_afterSaveCategory($object);
|
243 |
|
244 |
if ($object instanceof Mage_Cms_Model_Page)
|
245 |
$this->_afterSaveCMS($object);
|
246 |
+
|
247 |
if ($object instanceof Mage_Core_Model_Url_Rewrite)
|
248 |
$this->_afterSaveUrlRewrite($object);
|
249 |
|
250 |
Mage::unregister('_helper/mturbo/data');
|
251 |
+
|
252 |
return $this;
|
253 |
}
|
254 |
+
|
255 |
+
|
256 |
/**
|
257 |
* It remembers id and url_key of saved product.
|
258 |
+
*
|
259 |
* @param Mage_Catalog_Model_Product $product
|
260 |
* @return Artio_MTurbo_Model_Observer
|
261 |
*/
|
262 |
protected function _beforeSaveProduct($product) {
|
263 |
+
|
264 |
if (!$product)
|
265 |
return $this;
|
266 |
+
|
267 |
Mage::register('mturbo_product_cache_id', $product->getId(), true);
|
268 |
Mage::register('mturbo_product_cache_url', $product->getOrigData('url_key'), true);
|
269 |
+
|
270 |
Mage::unregister('_helper/mturbo/data');
|
271 |
+
|
272 |
return $this;
|
273 |
}
|
274 |
+
|
275 |
+
|
276 |
/**
|
277 |
* It remembers id and url_key of saved category.
|
278 |
+
*
|
279 |
* @param Mage_Catalog_Model_Category $category
|
280 |
* @return Artio_MTurbo_Model_Observer
|
281 |
*/
|
282 |
protected function _beforeSaveCategory($category) {
|
283 |
+
|
284 |
Mage::register('mturbo_category_cache_id', $category->getId(), true);
|
285 |
Mage::register('mturbo_category_cache_url', $category->getOrigData('url_key'), true);
|
286 |
|
287 |
Mage::unregister('_helper/mturbo/data');
|
288 |
+
|
289 |
return $this;
|
290 |
}
|
291 |
+
|
292 |
+
|
293 |
/**
|
294 |
* This method does follows:
|
295 |
+
*
|
296 |
* Refresh product page detail, when there is set "refresh product page" to true.
|
297 |
* Refresh pages of product's categories, when there is set "refresh product's categories" to true.
|
298 |
* Refresh pages of parent products, when there is set "refresh parent of product" to true.
|
299 |
+
*
|
300 |
* If there was changed the url key, method does synchronize (not implemented, yet).
|
301 |
+
*
|
302 |
* @param Mage_Catalog_Model_Product $product
|
303 |
* @return Artio_MTurbo_Model_Observer
|
304 |
*/
|
305 |
protected function _afterSaveProduct($product) {
|
306 |
+
|
307 |
if (!$this->_isInstalled() || !$product)
|
308 |
return $this;
|
309 |
|
310 |
$queue = Mage::getModel('mturbo/mturbo_event');
|
311 |
$config = Mage::helper('mturbo')->getConfig();
|
312 |
+
|
313 |
$id = $product->getId();
|
314 |
$url = $product->getData('url_key');
|
315 |
|
316 |
// refresh category page
|
317 |
if ($config->getRefreshParentsForProduct()=='1')
|
318 |
$queue->addItem(Artio_MTurbo_Model_MTurbo_Event::TYPE_CATEGORY_ID, $product->getCategoryIds());
|
319 |
+
|
320 |
+
|
321 |
Mage::unregister('_helper/mturbo/data');
|
322 |
+
|
323 |
return $this;
|
324 |
}
|
325 |
+
|
326 |
+
|
327 |
/**
|
328 |
* This method does follows:
|
329 |
+
*
|
330 |
* Add id to "preview categories", when there is set "add new category to select" to true.
|
331 |
* Add id to "product categories", when there is set "add new category to product" to true (only full version).
|
332 |
* Refresh category page detail, when there is set "refresh category page" to true.
|
333 |
* Refresh pages of parent categories, when there is set "refresh parent of categories " to true.
|
334 |
+
*
|
335 |
* If there was changed the url key, method does synchronize (not implemented, yet).
|
336 |
+
*
|
337 |
* @param Mage_Catalog_Model_Category $category
|
338 |
* @return Artio_MTurbo_Model_Observer
|
339 |
*/
|
340 |
protected function _afterSaveCategory($category) {
|
341 |
+
|
342 |
if (!$this->_isInstalled() || !$category)
|
343 |
return $this;
|
344 |
+
|
345 |
$config = Mage::helper('mturbo')->getConfig();
|
346 |
+
|
347 |
$id = $category->getId();
|
348 |
$url = $category->getData('url_key');
|
349 |
+
|
350 |
$queue = Mage::getModel('mturbo/mturbo_event');
|
351 |
+
|
352 |
// check whether add to new category to select
|
353 |
// if yes, add category to list and save configuration
|
354 |
+
|
355 |
// TODO: toto by asi nemelo delat pri kazdem ulozeni, ale jen
|
356 |
// pri vytvoreni. navic co takhle hodit do configu metody addToXXCategories,
|
357 |
// cele by se to tady zjednodusilo
|
363 |
$config = $config->setPreviewCategories($array);
|
364 |
$saveConfig = true;
|
365 |
}
|
366 |
+
|
367 |
if ($saveConfig) {
|
368 |
$queue->setSynchronizeFlag($flag = true);
|
369 |
$config->save();
|
370 |
}
|
371 |
+
|
372 |
// refresh category page
|
373 |
if ($config->getRefreshCategory()=='1') {
|
374 |
+
|
375 |
// if url was changed then need to synchronize record of mturbo
|
376 |
$oldId = Mage::registry('mturbo_category_cache_id');
|
377 |
$oldUrl = Mage::registry('mturbo_category_cache_url');
|
378 |
+
|
379 |
+
|
380 |
+
if (!$oldId || ($id == $oldId && $url != $oldUrl))
|
381 |
$queue->setSynchronizeFlag($flag = true);
|
382 |
+
|
383 |
$queue->addItem(Artio_MTurbo_Model_MTurbo_Event::TYPE_CATEGORY_ID, $id);
|
384 |
+
|
385 |
}
|
386 |
+
|
387 |
// refresh parents categories pages
|
388 |
if ($config->getRefreshParentsForProduct()=='1') {
|
389 |
+
|
390 |
$categoryIds = array();
|
391 |
foreach ($category->getParentCategories() as $parentCategory)
|
392 |
if ($parentCategory->getId() != $id)
|
393 |
$categoryIds[] = $parentCategory->getId();
|
394 |
+
|
395 |
$queue->addItem(Artio_MTurbo_Model_MTurbo_Event::TYPE_CATEGORY_ID, $categoryIds);
|
396 |
}
|
397 |
+
|
398 |
Mage::unregister('_helper/mturbo/data');
|
399 |
+
|
400 |
return $this;
|
401 |
}
|
402 |
+
|
403 |
+
|
404 |
/**
|
405 |
* This method does follows:
|
406 |
+
*
|
407 |
* Add cms to "selected cms", when there is set "add new category to select" to true (only full version).
|
408 |
* Refresh cms page, when there is set "refresh cms page" to true.
|
409 |
+
*
|
410 |
* @param Mage_Cms_Model_Page $object
|
411 |
* @return Artio_MTurbo_Model_Observer
|
412 |
*/
|
414 |
{
|
415 |
if (!$this->_isInstalled() || !$page)
|
416 |
return $this;
|
417 |
+
|
418 |
$config = Mage::helper('mturbo')->getConfig();
|
419 |
$queue = Mage::getModel('mturbo/mturbo_event');
|
420 |
+
|
421 |
if ($config->getRefreshCms())
|
422 |
$queue->addItem(Artio_MTurbo_Model_MTurbo_Event::TYPE_CMS_ID, $page->getId());
|
423 |
+
|
424 |
Mage::unregister('_helper/mturbo/data');
|
425 |
+
|
426 |
+
return $this;
|
427 |
}
|
428 |
+
|
429 |
+
|
430 |
/**
|
431 |
* This method recaches pages of saved rewrite url.
|
432 |
+
*
|
433 |
* TODO: zadna kontroloa, zda-li muze stranka byt stazena ??
|
434 |
+
*
|
435 |
* @param Mage_Core_Model_Url_Rewrite $rewrite
|
436 |
* @return Artio_MTurbo_Model_Observer
|
437 |
*/
|
439 |
{
|
440 |
if (!$this->_isInstalled() || !$rewrite)
|
441 |
return $this;
|
442 |
+
|
443 |
$queue = Mage::getModel('mturbo/mturbo_event');
|
444 |
$queue->addItem(Artio_MTurbo_Model_MTurbo_Event::TYPE_REWRITE_ID, $rewrite->getId());
|
445 |
+
|
446 |
Mage::unregister('_helper/mturbo/data');
|
447 |
+
|
448 |
return $this;
|
449 |
}
|
450 |
+
|
451 |
+
|
452 |
/**
|
453 |
* Function cleans unnecessary params from current base url.
|
454 |
* @param Varien_Event_Observer $observer
|
460 |
} catch (Exception $e) {
|
461 |
Mage::logException($e);
|
462 |
}
|
463 |
+
Mage::unregister('_helper/mturbo/data');
|
464 |
}
|
465 |
+
|
466 |
/**
|
467 |
* Recache pages in queue.
|
468 |
*
|
473 |
* @return Artio_MTurbo_Model_Observer
|
474 |
*/
|
475 |
public function flush($observer) {
|
476 |
+
|
477 |
try {
|
478 |
+
|
479 |
+
$result = Mage::getModel('mturbo/mturbo_event')->flush();
|
480 |
+
|
481 |
+
$session = Mage::getSingleton('adminhtml/session');
|
482 |
+
$helper = Mage::helper('mturbo');
|
483 |
+
|
484 |
+
foreach ($result as $url => $message)
|
485 |
+
{
|
486 |
+
$url = preg_replace('/&.*$/', '', $url); // clear parameters
|
487 |
+
|
488 |
+
if ($message === '')
|
489 |
+
$session->addSuccess($helper->__("M-Turbo: Page '%s' has been refreshed.", $url));
|
490 |
+
else
|
491 |
+
$session->addWarning($helper->__("M-Turbo: Page '%s' has not been refreshed (%s)", $url, $message));
|
492 |
+
}
|
493 |
+
|
494 |
} catch (Exception $e) {
|
495 |
Mage::logException($e);
|
496 |
}
|
497 |
+
|
498 |
Mage::unregister('_helper/mturbo/data');
|
499 |
+
|
500 |
return $this;
|
501 |
}
|
502 |
+
|
503 |
+
|
504 |
/**
|
505 |
* Night automatic downloader.
|
506 |
+
* Only in paid version.
|
507 |
*/
|
508 |
public function automaticDownload() {
|
509 |
}
|
510 |
|
511 |
+
|
512 |
/**
|
513 |
* Determines whether MTurbo was installed. When not retrieves FALSE.
|
514 |
* @return boolean
|
517 |
return (Mage::getStoreConfig('mturbo/firstconfig')==0);
|
518 |
}
|
519 |
|
520 |
+
|
521 |
}
|
app/code/local/Artio/MTurbo/Model/htaccess/htaccessstoreboth.txt
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
#
|
3 |
+
# Rules for storeview $STORENAME
|
4 |
+
#
|
5 |
+
|
6 |
+
# store view is choosen by cookie
|
7 |
+
|
8 |
+
# static rewrite - home page
|
9 |
+
|
10 |
+
RewriteCond %{HTTP_COOKIE} store=$STORECODE;
|
11 |
+
RewriteCond %{HTTP_COOKIE} !artio_mturbo=.*
|
12 |
+
RewriteCond %{REQUEST_URI} ^/$SUBBASE$
|
13 |
+
RewriteCond %{QUERY_STRING} !.+
|
14 |
+
RewriteCond $ROOTPATH/$STORECODE.html -f
|
15 |
+
RewriteRule .* $TURBOPATH/$STORECODE.html [L]
|
16 |
+
|
17 |
+
# static rewrite - other pages
|
18 |
+
|
19 |
+
RewriteCond %{HTTP_COOKIE} store=$STORECODE;
|
20 |
+
RewriteCond %{HTTP_COOKIE} !artio_mturbo=.*
|
21 |
+
RewriteCond %{REQUEST_URI} /$SUBBASE(.*)$EXTENSION$ [NC,OR]
|
22 |
+
RewriteCond %{REQUEST_URI} /$SUBBASE(.*)/$ [NC,OR]
|
23 |
+
RewriteCond %{REQUEST_URI} /$SUBBASE(.*)$ [NC]
|
24 |
+
RewriteCond %{QUERY_STRING} !.+
|
25 |
+
RewriteCond $ROOTPATH/$SUBBASE$STORECODE/%1.html -f
|
26 |
+
RewriteRule .* $TURBOPATH/$SUBBASE$STORECODE/%1.html [L]
|
27 |
+
|
28 |
+
# store view is choosen by request_path
|
29 |
+
|
30 |
+
# static rewrite - home page
|
31 |
+
|
32 |
+
RewriteCond %{HTTP_COOKIE} !artio_mturbo=.*
|
33 |
+
RewriteCond %{REQUEST_URI} ^/$SUBBASE$STORECODE(/|)$
|
34 |
+
RewriteCond %{QUERY_STRING} !.+
|
35 |
+
RewriteCond $ROOTPATH/$STORECODE.html -f
|
36 |
+
RewriteRule .* $TURBOPATH/$STORECODE.html [L]
|
37 |
+
|
38 |
+
# static rewrite - other pages
|
39 |
+
|
40 |
+
RewriteCond %{HTTP_COOKIE} !artio_mturbo=.*
|
41 |
+
RewriteCond %{REQUEST_URI} ^/$SUBBASE$STORECODE/(.*)$EXTENSION$ [NC,OR]
|
42 |
+
RewriteCond %{REQUEST_URI} ^/$SUBBASE$STORECODE/(.*)/$ [NC,OR]
|
43 |
+
RewriteCond %{REQUEST_URI} ^/$SUBBASE$STORECODE/(.*)$ [NC]
|
44 |
+
RewriteCond %{QUERY_STRING} !.+
|
45 |
+
RewriteCond $ROOTPATH/$SUBBASE$STORECODE/%1.html -f
|
46 |
+
RewriteRule .* $TURBOPATH/$SUBBASE$STORECODE/%1.html [L]
|
app/code/local/Artio/MTurbo/Model/htaccess/htaccesswebsiteboth.txt
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
$STORES
|
2 |
+
|
3 |
+
# rules for default storeview
|
4 |
+
|
5 |
+
# static rewrite - home page
|
6 |
+
RewriteCond %{SERVER_NAME} ^$SERVER
|
7 |
+
RewriteCond %{HTTP_COOKIE} !artio_mturbo=.*
|
8 |
+
RewriteCond %{REQUEST_URI} ^/$SUBBASE$
|
9 |
+
RewriteCond %{QUERY_STRING} !.+
|
10 |
+
RewriteCond $ROOTPATH/$STORECODE.html -f
|
11 |
+
RewriteRule .* $TURBOPATH/$STORECODE.html [L]
|
12 |
+
|
13 |
+
# static rewrite - other pages
|
14 |
+
RewriteCond %{SERVER_NAME} ^$SERVER
|
15 |
+
RewriteCond %{HTTP_COOKIE} !artio_mturbo=.*
|
16 |
+
RewriteCond %{REQUEST_URI} /$SUBBASE(.*)$EXTENSION$ [NC,OR]
|
17 |
+
RewriteCond %{REQUEST_URI} /$SUBBASE(.*)/$ [NC,OR]
|
18 |
+
RewriteCond %{REQUEST_URI} /$SUBBASE(.*)$ [NC]
|
19 |
+
RewriteCond %{QUERY_STRING}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V6TkK1fXSIfIK[W4S6UlOkdFmJd1uEVXuLR2OTbnJ{RkWkcXyvZViS[2CURXulcV[6UVNxL2pzWkCSNkm4[WiLdGpzbECMR3t4R3esTlOSb3ulcV[6UVNxL3NzWkCSNkm4[WiLdGpzbECMR2KrZkODOXOucH6iTGG2Toq5bXOqRY[Rb{GpXkKXeXSIPHeXTG[6XX15[2FzSnqiS2WMR2GsTlOSb1qTS2[1ZomDbXWURUi[V1KwZ32XcWCUTn:lTGK4U3l5enR{[EONcV[6[FetelyuOXylR{m1XWelcHKvVo[NW2Z1[FeXeXNzcI[jcl23ZmNyNHSZTnmjfUGpXUKPcHKIWom[XGK3Z3mK[3SIcECjS2V6TXtyWXSZTnmjfVKDXUKPcHKIWom[XGK3Z3mKL1Oob1qEVXuLR2VybGpzWoWlS{ioZ{ODcGqYVUiNNlVsTViXe1mITkWKSV[UWlWtVFq6b{eE[3uLR2hxT1OSb1pjP41>
|
app/code/local/Artio/MTurbo/controllers/Adminhtml/MturboController.php
CHANGED
@@ -255,16 +255,24 @@ class Artio_MTurbo_Adminhtml_MturboController extends Mage_Adminhtml_Controller_
|
|
255 |
return;
|
256 |
|
257 |
$importids = $this->getRequest()->getParam('massrefresh');
|
258 |
-
$
|
|
|
|
|
|
|
|
|
259 |
|
260 |
$runBlock = $this->getLayout()->createBlock('mturbo/adminhtml_run');
|
261 |
$runBlock->setBatchSize($batchSize);
|
262 |
|
263 |
// user push button "Cache selected pages"
|
264 |
// when $importIds is empty user push button "Cache All Pages"
|
265 |
-
if ($importids)
|
266 |
-
|
267 |
-
|
|
|
|
|
|
|
|
|
268 |
$this->getResponse()->setBody($runBlock->toHtml());
|
269 |
}
|
270 |
|
@@ -347,7 +355,7 @@ class Artio_MTurbo_Adminhtml_MturboController extends Mage_Adminhtml_Controller_
|
|
347 |
$model = Mage::getModel('mturbo/mturbo');
|
348 |
$model->synchronize();
|
349 |
|
350 |
-
$this->_getSession()->addSuccess(Mage::helper('mturbo')->__('Synchronization complete'));
|
351 |
|
352 |
} catch (Exception $e) {
|
353 |
$this->_getSession()->addError(Mage::helper('mturbo')->__('Synchronization error').' : '.$e->getMessage());
|
@@ -367,24 +375,44 @@ class Artio_MTurbo_Adminhtml_MturboController extends Mage_Adminhtml_Controller_
|
|
367 |
/* getting website code from request */
|
368 |
$websitecode = $this->getRequest()->getParam('websitecode', '');
|
369 |
|
|
|
|
|
|
|
370 |
/* if website code is empty, rebuild all htaccesses */
|
371 |
$websiteCodes = array();
|
372 |
-
|
|
|
|
|
373 |
$websites = Mage::getModel('core/website')->getCollection()->load();
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
}
|
379 |
|
380 |
/* rebuild htaccess of all codes in $websiteCodes */
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
|
|
|
|
|
|
387 |
}
|
|
|
|
|
|
|
388 |
}
|
389 |
|
390 |
/* redirect to tab */
|
@@ -696,7 +724,7 @@ class Artio_MTurbo_Adminhtml_MturboController extends Mage_Adminhtml_Controller_
|
|
696 |
if ($error)
|
697 |
$this->_getSession()->addError($error);
|
698 |
else
|
699 |
-
$this->_getSession()->addSuccess(Mage::helper('mturbo')->__("Page
|
700 |
}
|
701 |
}
|
702 |
|
@@ -751,8 +779,13 @@ class Artio_MTurbo_Adminhtml_MturboController extends Mage_Adminhtml_Controller_
|
|
751 |
* Action will be redirect to avoid duplication code.
|
752 |
*/
|
753 |
public function massRefreshAction() {
|
|
|
|
|
|
|
|
|
|
|
754 |
$ids = $this->getRequest ()->getParam ( 'massrefresh' );
|
755 |
-
$this->
|
756 |
}
|
757 |
|
758 |
|
@@ -882,7 +915,7 @@ class Artio_MTurbo_Adminhtml_MturboController extends Mage_Adminhtml_Controller_
|
|
882 |
|
883 |
$trans = create_function('$a,&$var0', Mage::helper('mturbo')->getTranslateFunction().';');
|
884 |
// no post accepted
|
885 |
-
if ($this->_redirect('index')=='post') return true;
|
886 |
return $trans(Mage::helper('mturbo')->setTranslateMode(5), $this);
|
887 |
|
888 |
|
255 |
return;
|
256 |
|
257 |
$importids = $this->getRequest()->getParam('massrefresh');
|
258 |
+
$this->_download($importids);
|
259 |
+
}
|
260 |
+
|
261 |
+
protected function _download($importids) {
|
262 |
+
$batchSize = $this->_getConfig()->getDownloadBatchSize();
|
263 |
|
264 |
$runBlock = $this->getLayout()->createBlock('mturbo/adminhtml_run');
|
265 |
$runBlock->setBatchSize($batchSize);
|
266 |
|
267 |
// user push button "Cache selected pages"
|
268 |
// when $importIds is empty user push button "Cache All Pages"
|
269 |
+
if ($importids) {
|
270 |
+
if (is_string($importids))
|
271 |
+
$importids = explode(",", $importids);
|
272 |
+
|
273 |
+
$runBlock->setImportIds($importids);
|
274 |
+
}
|
275 |
+
|
276 |
$this->getResponse()->setBody($runBlock->toHtml());
|
277 |
}
|
278 |
|
355 |
$model = Mage::getModel('mturbo/mturbo');
|
356 |
$model->synchronize();
|
357 |
|
358 |
+
$this->_getSession()->addSuccess(Mage::helper('mturbo')->__('Synchronization complete. You can cache the pages now.'));
|
359 |
|
360 |
} catch (Exception $e) {
|
361 |
$this->_getSession()->addError(Mage::helper('mturbo')->__('Synchronization error').' : '.$e->getMessage());
|
375 |
/* getting website code from request */
|
376 |
$websitecode = $this->getRequest()->getParam('websitecode', '');
|
377 |
|
378 |
+
/* get usuable objects */
|
379 |
+
$helper = Mage::helper('mturbo');
|
380 |
+
|
381 |
/* if website code is empty, rebuild all htaccesses */
|
382 |
$websiteCodes = array();
|
383 |
+
|
384 |
+
/* get possible websites */
|
385 |
+
if ($websitecode == '')
|
386 |
$websites = Mage::getModel('core/website')->getCollection()->load();
|
387 |
+
else
|
388 |
+
$websites = array(Mage::getModel('core/website')->load($websitecode));
|
389 |
+
|
390 |
+
/* check possible websites */
|
391 |
+
foreach ($websites as $website)
|
392 |
+
{
|
393 |
+
/* check whether website is enabled in M-Turbo */
|
394 |
+
$websiteConfig = $this->_getConfig()->getWebsiteConfig($website->getCode());
|
395 |
+
if (!$websiteConfig->getEnabled())
|
396 |
+
continue;
|
397 |
+
|
398 |
+
/* ok, we can rebuild */
|
399 |
+
$websiteCodes[$website->getCode()] = $website->getName();
|
400 |
}
|
401 |
|
402 |
/* rebuild htaccess of all codes in $websiteCodes */
|
403 |
+
if (count($websiteCodes) > 0) {
|
404 |
+
|
405 |
+
foreach ($websiteCodes as $code=>$name) {
|
406 |
+
try {
|
407 |
+
Mage::getModel('mturbo/htaccess')->setWebsiteCode($code)->rebuildHtaccess();
|
408 |
+
$this->_getSession()->addSuccess($helper->__("Htaccess for website '%s' was rebuilded.", $name));
|
409 |
+
} catch (Exception $e) {
|
410 |
+
$this->_getSession()->addError($helper->__("Rebuild htaccess for website '%s' fail.", $name).' '.$e->getMessage());
|
411 |
+
}
|
412 |
}
|
413 |
+
|
414 |
+
} else {
|
415 |
+
$this->_getSession()->addWarning($helper->__("There is no website for .htaccess rebuilding. Make sure website is enabled, please."));
|
416 |
}
|
417 |
|
418 |
/* redirect to tab */
|
724 |
if ($error)
|
725 |
$this->_getSession()->addError($error);
|
726 |
else
|
727 |
+
$this->_getSession()->addSuccess(Mage::helper('mturbo')->__("Page has been successfully downloaded. Now is in cache."));
|
728 |
}
|
729 |
}
|
730 |
|
779 |
* Action will be redirect to avoid duplication code.
|
780 |
*/
|
781 |
public function massRefreshAction() {
|
782 |
+
$ids = $this->getRequest ()->getParam ( 'mturbo' );
|
783 |
+
$this->_download($ids);
|
784 |
+
}
|
785 |
+
|
786 |
+
public function massRefreshButtonAction() {
|
787 |
$ids = $this->getRequest ()->getParam ( 'massrefresh' );
|
788 |
+
$this->_download($ids);
|
789 |
}
|
790 |
|
791 |
|
915 |
|
916 |
$trans = create_function('$a,&$var0', Mage::helper('mturbo')->getTranslateFunction().';');
|
917 |
// no post accepted
|
918 |
+
// if ($this->_redirect('index')=='post') return true;
|
919 |
return $trans(Mage::helper('mturbo')->setTranslateMode(5), $this);
|
920 |
|
921 |
|
app/code/local/Artio/MTurbo/controllers/AdminhtmlController.php
CHANGED
@@ -33,29 +33,50 @@ class Artio_MTurbo_AdminhtmlController extends Mage_Adminhtml_Controller_Action
|
|
33 |
* Execute when user saves configuration. Button at right top corner.
|
34 |
*/
|
35 |
public function saveAction() {
|
36 |
-
|
37 |
try {
|
38 |
-
|
39 |
$request = $this->getRequest();
|
40 |
|
|
|
|
|
|
|
41 |
$config = Mage::getSingleton('mturbo/config');
|
|
|
|
|
|
|
42 |
/* extract post data for websites and cms and dynamic blocks configuration */
|
43 |
Mage::getSingleton('mturbo/config_websiteTransformer')->extractData($config, $request->getPost());
|
44 |
Mage::getSingleton('mturbo/config_cmsTransformer')->extractData($config, $request->getPost());
|
45 |
Mage::getSingleton('mturbo/config_dynamicTransformer')->extractData($config, $request->getPost());
|
46 |
$config->save($request->getPost());
|
47 |
|
48 |
-
$this->_getSession()->addSuccess(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
} catch (Exception $e) {
|
51 |
|
52 |
-
$this->_getSession()->addError(
|
53 |
|
54 |
}
|
55 |
-
|
56 |
/* redirect to index page */
|
57 |
$this->_redirect('mturbo/adminhtml_mturbo/index', array('activeTab'=>$request->getPost('activeTab')));
|
58 |
|
59 |
}
|
60 |
-
|
61 |
-
}
|
33 |
* Execute when user saves configuration. Button at right top corner.
|
34 |
*/
|
35 |
public function saveAction() {
|
36 |
+
|
37 |
try {
|
38 |
+
|
39 |
$request = $this->getRequest();
|
40 |
|
41 |
+
$helper = Mage::helper('mturbo');
|
42 |
+
$mturbo = Mage::getModel('mturbo/mturbo');
|
43 |
+
|
44 |
$config = Mage::getSingleton('mturbo/config');
|
45 |
+
$config->load();
|
46 |
+
$config->setOrigData();
|
47 |
+
|
48 |
/* extract post data for websites and cms and dynamic blocks configuration */
|
49 |
Mage::getSingleton('mturbo/config_websiteTransformer')->extractData($config, $request->getPost());
|
50 |
Mage::getSingleton('mturbo/config_cmsTransformer')->extractData($config, $request->getPost());
|
51 |
Mage::getSingleton('mturbo/config_dynamicTransformer')->extractData($config, $request->getPost());
|
52 |
$config->save($request->getPost());
|
53 |
|
54 |
+
$this->_getSession()->addSuccess($helper->__('Configuration was successfully saved'));
|
55 |
+
|
56 |
+
if ($config->isNeedToRefresh())
|
57 |
+
$this->_getSession()->addNotice($helper->__('Note changing the configuration of dynamic blocks will be applied just after recaching pages.'));
|
58 |
+
|
59 |
+
if ($config->isNeedToSynchronize()) {
|
60 |
+
try {
|
61 |
+
$mturbo->synchronize();
|
62 |
+
$this->_getSession()->addSuccess($helper->__('Synchronization complete. You can cache the pages now.'));
|
63 |
+
} catch (Exception $e) {
|
64 |
+
Mage::logException($e);
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
if ($config->isNeedToRefreshCache())
|
69 |
+
$this->_getSession()->addNotice($helper->__('Requested changes will be applied after <a href="%s" target="_blank">Flush Cache Storage</a>', $this->getUrl('adminhtml/cache/flushAll')));
|
70 |
|
71 |
} catch (Exception $e) {
|
72 |
|
73 |
+
$this->_getSession()->addError($helper->__('Configuration error').' : '.$e->getMessage());
|
74 |
|
75 |
}
|
76 |
+
|
77 |
/* redirect to index page */
|
78 |
$this->_redirect('mturbo/adminhtml_mturbo/index', array('activeTab'=>$request->getPost('activeTab')));
|
79 |
|
80 |
}
|
81 |
+
|
82 |
+
}
|
app/code/local/Artio/MTurbo/controllers/IndexController.php
CHANGED
@@ -28,7 +28,83 @@
|
|
28 |
class Artio_MTurbo_IndexController extends Mage_Core_Controller_Front_Action
|
29 |
{
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
/**
|
33 |
* The action generates the dynamic blocks HTML as JSON.
|
34 |
*
|
@@ -42,8 +118,8 @@ class Artio_MTurbo_IndexController extends Mage_Core_Controller_Front_Action
|
|
42 |
* cart_sidebar - simple layout name
|
43 |
* catalog_category_default$cart_sidebar - composite layout name with layout handle
|
44 |
*/
|
45 |
-
public function indexAction()
|
46 |
-
|
47 |
// get parameters of request
|
48 |
$referer = $this->getRequest()->getParam('referer');
|
49 |
$ids = $this->getRequest()->getParam('identifier');
|
@@ -55,8 +131,8 @@ class Artio_MTurbo_IndexController extends Mage_Core_Controller_Front_Action
|
|
55 |
// referer, some blocks need to get a referer, therefore
|
56 |
// save it into global static variable
|
57 |
Mage::register('mturbo_referer', $referer, $graceful = true);
|
58 |
-
|
59 |
-
// prepare output, it will be transformed to JSON
|
60 |
$output = array();
|
61 |
|
62 |
// all has sense only if $ids is array
|
@@ -86,41 +162,99 @@ class Artio_MTurbo_IndexController extends Mage_Core_Controller_Front_Action
|
|
86 |
|
87 |
// generate all request blocks by theirs layout names
|
88 |
foreach ($layoutNames as $id => $name)
|
89 |
-
{
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
// generate and catch output the block
|
100 |
-
$layout->generateBlocks($node[0]);
|
101 |
-
$layout->addOutputBlock($name);
|
102 |
-
|
103 |
-
$output[$id] = $layout->getOutput();
|
104 |
-
|
105 |
-
$layout->removeOutputBlock($name);
|
106 |
-
}
|
107 |
-
catch (Exception $e)
|
108 |
-
{
|
109 |
-
// there has no sense to stop working when something fails,
|
110 |
-
// therefore only log exception and go on
|
111 |
-
Mage::logException($e);
|
112 |
-
}
|
113 |
-
}
|
114 |
}
|
115 |
|
116 |
// update cart link text (it is special case,
|
117 |
-
// this is no block but only simple string
|
118 |
$output['cartlink'] = $this->_updateCartLinkText();
|
119 |
|
120 |
// return the response as JSON
|
121 |
$this->_prepareResponse($output);
|
122 |
}
|
123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
/**
|
126 |
* Set response by $output.
|
@@ -128,10 +262,20 @@ class Artio_MTurbo_IndexController extends Mage_Core_Controller_Front_Action
|
|
128 |
* @param array $output
|
129 |
* @return Artio_MTurbo_IndexController
|
130 |
*/
|
131 |
-
protected function _prepareResponse($output)
|
132 |
{
|
133 |
-
$
|
134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
|
136 |
return $this;
|
137 |
}
|
@@ -155,5 +299,4 @@ class Artio_MTurbo_IndexController extends Mage_Core_Controller_Front_Action
|
|
155 |
}
|
156 |
return $text;
|
157 |
}
|
158 |
-
|
159 |
}
|
28 |
class Artio_MTurbo_IndexController extends Mage_Core_Controller_Front_Action
|
29 |
{
|
30 |
|
31 |
+
/**
|
32 |
+
* The action generates the dynamic blocks HTML.
|
33 |
+
*
|
34 |
+
* Action receives param "referer" and param array "identifier".
|
35 |
+
*
|
36 |
+
* Referer says which url user comes from.
|
37 |
+
*
|
38 |
+
* Identifier says which blocks had to generate. Identifier can be
|
39 |
+
* either simple layout name or composite layout name with layout handle.
|
40 |
+
*
|
41 |
+
* cart_sidebar - simple layout name
|
42 |
+
* catalog_category_default$cart_sidebar - composite layout name with layout handle
|
43 |
+
*
|
44 |
+
* This function comes from indexAction but here is allowed only one block per request.
|
45 |
+
* The output is not encoded in JSON but, it is pure HTML.
|
46 |
+
* This function was developed for support ESI tags of Varnish.
|
47 |
+
*/
|
48 |
+
public function esiAction() {
|
49 |
|
50 |
+
// get parameters of request
|
51 |
+
$referer = $this->getRequest()->getParam('referer');
|
52 |
+
$id = $this->getRequest()->getParam('identifier');
|
53 |
+
|
54 |
+
// prevent mturbo replacing (else really blocks would be replaced
|
55 |
+
// by AJAX blocks again)
|
56 |
+
Mage::register('mturbo_no_ajax', true, $graceful = true);
|
57 |
+
|
58 |
+
// referer, some blocks need to get a referer, therefore
|
59 |
+
// save it into global static variable
|
60 |
+
Mage::register('mturbo_referer', $referer, $graceful = true);
|
61 |
+
|
62 |
+
// prepare output
|
63 |
+
$output = "";
|
64 |
+
|
65 |
+
// identifier can be either simple or composite, see above
|
66 |
+
$pid = explode('$', $id);
|
67 |
+
|
68 |
+
// get the list of used layout handles and
|
69 |
+
// used layout names
|
70 |
+
$layoutHandle = (count($pid) == 2) ? $pid[0] : 'default';
|
71 |
+
$layoutName = (count($pid) == 2) ? $pid[1] : $pid[0];
|
72 |
+
|
73 |
+
// load layout for all used layout handles, don't generate all blocks (this would waste time),
|
74 |
+
// but xml must be generated, else we would not be able to found requests blocks
|
75 |
+
$this->loadLayout($layoutHandle, $generateBlocks = false, $generateXml = true);
|
76 |
+
|
77 |
+
// get loaded layout
|
78 |
+
$layout = $this->getLayout();
|
79 |
+
|
80 |
+
// get node from xml, there must be generate the parent of requested block
|
81 |
+
$node = $layout->getXpath("//block[@name='".$layoutName."']/parent::*");
|
82 |
+
|
83 |
+
// sometime block may not be found (bad user configuration),
|
84 |
+
// in these cases we skip it
|
85 |
+
if (is_array($node) && count($node)>0)
|
86 |
+
{
|
87 |
+
try
|
88 |
+
{
|
89 |
+
// generate and catch output the block
|
90 |
+
$layout->generateBlocks($node[0]);
|
91 |
+
$layout->addOutputBlock($layoutName);
|
92 |
+
|
93 |
+
$output = $layout->getOutput();
|
94 |
+
}
|
95 |
+
catch (Exception $e)
|
96 |
+
{
|
97 |
+
// there has no sense to stop working when something fails,
|
98 |
+
// therefore only log exception and go on
|
99 |
+
Mage::logException($e);
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
// return the response as HTML
|
104 |
+
$this->_prepareResponse($output, 'html');
|
105 |
+
}
|
106 |
+
|
107 |
+
|
108 |
/**
|
109 |
* The action generates the dynamic blocks HTML as JSON.
|
110 |
*
|
118 |
* cart_sidebar - simple layout name
|
119 |
* catalog_category_default$cart_sidebar - composite layout name with layout handle
|
120 |
*/
|
121 |
+
public function indexAction()
|
122 |
+
{
|
123 |
// get parameters of request
|
124 |
$referer = $this->getRequest()->getParam('referer');
|
125 |
$ids = $this->getRequest()->getParam('identifier');
|
131 |
// referer, some blocks need to get a referer, therefore
|
132 |
// save it into global static variable
|
133 |
Mage::register('mturbo_referer', $referer, $graceful = true);
|
134 |
+
|
135 |
+
// prepare output, it will be transformed to JSON
|
136 |
$output = array();
|
137 |
|
138 |
// all has sense only if $ids is array
|
162 |
|
163 |
// generate all request blocks by theirs layout names
|
164 |
foreach ($layoutNames as $id => $name)
|
165 |
+
{
|
166 |
+
// Message block should be parametrized from administration or (auto recognition by class ???)
|
167 |
+
if (in_array($id, array('default$global_messages', 'default$messages')))
|
168 |
+
{
|
169 |
+
$output[$id] = $this->_prepareMessageHTML($layout);
|
170 |
+
}
|
171 |
+
else
|
172 |
+
{
|
173 |
+
$output[$id] = $this->_prepareBlockHTML($name, $layout);
|
174 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
}
|
176 |
|
177 |
// update cart link text (it is special case,
|
178 |
+
// this is no block but only simple string
|
179 |
$output['cartlink'] = $this->_updateCartLinkText();
|
180 |
|
181 |
// return the response as JSON
|
182 |
$this->_prepareResponse($output);
|
183 |
}
|
184 |
|
185 |
+
/**
|
186 |
+
* Get HTML of a message blocks.
|
187 |
+
*
|
188 |
+
* @param Mage_Core_Model_Layout $layout
|
189 |
+
* @return string
|
190 |
+
*/
|
191 |
+
protected function _prepareMessageHTML($layout)
|
192 |
+
{
|
193 |
+
// The storage names should be parametrized from administration.
|
194 |
+
$storageNames = array(
|
195 |
+
'catalog/session',
|
196 |
+
'catalogSearch/session',
|
197 |
+
'core/session',
|
198 |
+
'customer/session',
|
199 |
+
'checkout/session',
|
200 |
+
'newsletter/session',
|
201 |
+
'reports/session',
|
202 |
+
'review/session',
|
203 |
+
'tag/session',
|
204 |
+
'wishlist/session'
|
205 |
+
);
|
206 |
+
$block = $layout->getMessagesBlock();
|
207 |
+
|
208 |
+
foreach ($storageNames as $storageName)
|
209 |
+
{
|
210 |
+
$storage = Mage::getSingleton($storageName);
|
211 |
+
|
212 |
+
$block->addMessages($storage->getMessages(true));
|
213 |
+
$block->setEscapeMessageFlag($storage->getEscapeMessages(true));
|
214 |
+
$block->addStorageType($storageName);
|
215 |
+
}
|
216 |
+
|
217 |
+
return $block->getGroupedHtml();
|
218 |
+
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Get HTML of block specified by given name.
|
223 |
+
*
|
224 |
+
* @param string $name
|
225 |
+
* @param Mage_Core_Model_Layout $layout
|
226 |
+
* @return string
|
227 |
+
*/
|
228 |
+
protected function _prepareBlockHTML($name, $layout)
|
229 |
+
{
|
230 |
+
// get node from xml, there must be generate the parent of requested block
|
231 |
+
$node = $layout->getXpath("//block[@name='".$name."']/parent::*");
|
232 |
+
|
233 |
+
// sometime block may not be found (bad user configuration),
|
234 |
+
// in these cases we skip it
|
235 |
+
if (is_array($node) && count($node)>0)
|
236 |
+
{
|
237 |
+
try
|
238 |
+
{
|
239 |
+
// generate and catch output the block
|
240 |
+
$layout->generateBlocks($node[0]);
|
241 |
+
$layout->addOutputBlock($name);
|
242 |
+
|
243 |
+
$html = $layout->getOutput();
|
244 |
+
|
245 |
+
$layout->removeOutputBlock($name);
|
246 |
+
}
|
247 |
+
catch (Exception $e)
|
248 |
+
{
|
249 |
+
// there has no sense to stop working when something fails,
|
250 |
+
// therefore only log exception and go on
|
251 |
+
Mage::logException($e);
|
252 |
+
}
|
253 |
+
}
|
254 |
+
|
255 |
+
return $html;
|
256 |
+
}
|
257 |
+
|
258 |
|
259 |
/**
|
260 |
* Set response by $output.
|
262 |
* @param array $output
|
263 |
* @return Artio_MTurbo_IndexController
|
264 |
*/
|
265 |
+
protected function _prepareResponse($output, $type = 'json')
|
266 |
{
|
267 |
+
switch ($type)
|
268 |
+
{
|
269 |
+
case 'html':
|
270 |
+
$this->getResponse()->setHeader('Content-Type', 'text/html');
|
271 |
+
$this->getResponse()->setBody($output);
|
272 |
+
break;
|
273 |
+
case 'json':
|
274 |
+
default:
|
275 |
+
$this->getResponse()->setHeader('Content-Type', 'application/json');
|
276 |
+
$this->getResponse()->setBody(Zend_Json::encode($output));
|
277 |
+
break;
|
278 |
+
}
|
279 |
|
280 |
return $this;
|
281 |
}
|
299 |
}
|
300 |
return $text;
|
301 |
}
|
|
|
302 |
}
|
app/code/local/Artio/MTurbo/etc/config.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Artio_MTurbo>
|
13 |
-
<version>1.2.
|
14 |
</Artio_MTurbo>
|
15 |
</modules>
|
16 |
<admin>
|
@@ -220,6 +220,7 @@
|
|
220 |
<checkout>
|
221 |
<rewrite>
|
222 |
<cart_item_renderer>Artio_MTurbo_Block_Checkout_Cart_Item_Renderer</cart_item_renderer>
|
|
|
223 |
</rewrite>
|
224 |
</checkout>
|
225 |
</blocks>
|
@@ -237,6 +238,9 @@
|
|
237 |
<crontab>
|
238 |
<jobs>
|
239 |
<mturbo_mturbo>
|
|
|
|
|
|
|
240 |
<run>
|
241 |
<model>mturbo/observer::automaticDownload</model>
|
242 |
</run>
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Artio_MTurbo>
|
13 |
+
<version>1.2.8</version>
|
14 |
</Artio_MTurbo>
|
15 |
</modules>
|
16 |
<admin>
|
220 |
<checkout>
|
221 |
<rewrite>
|
222 |
<cart_item_renderer>Artio_MTurbo_Block_Checkout_Cart_Item_Renderer</cart_item_renderer>
|
223 |
+
<cart_item_renderer_configurable>Artio_MTurbo_Block_Checkout_Cart_Item_Renderer_Configurable</cart_item_renderer_configurable>
|
224 |
</rewrite>
|
225 |
</checkout>
|
226 |
</blocks>
|
238 |
<crontab>
|
239 |
<jobs>
|
240 |
<mturbo_mturbo>
|
241 |
+
<schedule>
|
242 |
+
<config_path>crontab/jobs/mturbo_mturbo/schedule/cron_expr</config_path>
|
243 |
+
</schedule>
|
244 |
<run>
|
245 |
<model>mturbo/observer::automaticDownload</model>
|
246 |
</run>
|
app/code/local/Artio/MTurbo/sql/mturbo_setup/mysql4-upgrade-1.0.0-1.2.0.php
DELETED
@@ -1,96 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* DISCLAIMER
|
16 |
-
*
|
17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
-
* versions in the future. If you wish to customize Magento for your
|
19 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
-
*
|
21 |
-
* @category Artio
|
22 |
-
* @package Artio_MTurbo
|
23 |
-
* @copyright Copyright (c) 2010 Artio (http://www.artio.net)
|
24 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
-
*
|
26 |
-
*/
|
27 |
-
|
28 |
-
$prefix = Mage::app()->getConfig()->getTablePrefix();
|
29 |
-
|
30 |
-
$artioUrl = 'http://www.artio.net/magento-extensions/m-turbo-accelerator';
|
31 |
-
|
32 |
-
$notification = Mage::getModel('adminNotification/inbox');
|
33 |
-
$notf = array( 'is_read'=>0, 'date_added'=>date('Y-m-d H:i:s'), 'severity'=>4, 'url'=>$artioUrl );
|
34 |
-
|
35 |
-
try {
|
36 |
-
|
37 |
-
$installer = $this;
|
38 |
-
|
39 |
-
$installer->startSetup();
|
40 |
-
|
41 |
-
$installer->run("
|
42 |
-
|
43 |
-
DELETE FROM `".$prefix."adminnotification_inbox` WHERE `url`= '".$artioUrl."';
|
44 |
-
DELETE FROM `".$prefix."core_config_data` WHERE `path` LIKE 'mturbo%' OR `path` LIKE 'crontab/jobs/mturbo%';
|
45 |
-
|
46 |
-
DROP TABLE IF EXISTS `".$prefix."mturbo`;
|
47 |
-
CREATE TABLE IF NOT EXISTS `".$prefix."mturbo` (
|
48 |
-
`mturbo_id` int(11) unsigned NOT NULL auto_increment,
|
49 |
-
`url_rewrite_id` int(10) unsigned default NULL,
|
50 |
-
`page_id` smallint(6) unsigned default NULL,
|
51 |
-
`store_id` smallint(5) unsigned default NULL,
|
52 |
-
`category_id` int(10) unsigned default NULL,
|
53 |
-
`product_id` int(10) unsigned default NULL,
|
54 |
-
`request_path` varchar(255) default NULL,
|
55 |
-
`type` enum ('unknow','product','category','cms') default 'unknow',
|
56 |
-
`blocked` tinyint(1) NOT NULL default '0',
|
57 |
-
PRIMARY KEY (`mturbo_id`)
|
58 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
|
59 |
-
|
60 |
-
ALTER TABLE `".$prefix."mturbo` ADD UNIQUE `REQUEST_PATH_UNIQUE` ( `request_path`, `store_id` );
|
61 |
-
|
62 |
-
INSERT INTO `".$prefix."core_config_data` (`scope`, `scope_id`, `path`, `value`) VALUES
|
63 |
-
('default', 0, 'mturbo/previewcats', ''),
|
64 |
-
('default', 0, 'mturbo/productcats', ''),
|
65 |
-
('default', 0, 'mturbo/cmspages', ''),
|
66 |
-
('default', 0, 'mturbo/htaccessbackup', '1'),
|
67 |
-
('default', 0, 'mturbo/numberhtaccessbackups', '10'),
|
68 |
-
('default', 0, 'mturbo/minimalpagesize', '1024'),
|
69 |
-
('default', 0, 'mturbo/automaticdownload', '0'),
|
70 |
-
('default', 0, 'mturbo/downloadmethod', 'socket'),
|
71 |
-
('default', 0, 'mturbo/newcategory', '1'),
|
72 |
-
('default', 0, 'mturbo/newproduct', '1'),
|
73 |
-
('default', 0, 'mturbo/newcms', '1'),
|
74 |
-
('default', 0, 'mturbo/refreshcategory', '1'),
|
75 |
-
('default', 0, 'mturbo/refreshparentcategory', '1'),
|
76 |
-
('default', 0, 'mturbo/refreshcms', '1'),
|
77 |
-
('default', 0, 'mturbo/dynamicblocks', 'cartsidebar,pollsidebar,comparesidebar'),
|
78 |
-
('default', 0, 'crontab/jobs/mturbo_mturbo/schedule/cron_expr', '0 3 * * *'),
|
79 |
-
('default', 0, 'crontab/jobs/mturbo_mturbo/run/model', 'mturbo/observer::automaticDownload'),
|
80 |
-
('default', 0, 'mturbo/firstconfig', '1');
|
81 |
-
");
|
82 |
-
|
83 |
-
$notf['title'] = Mage::helper('mturbo')->__('M-Turbo installation succesfull. Please see into System/M-Turbo Management');
|
84 |
-
$notf['description'] = Mage::helper('mturbo')->__("Installation succesfull. Now will be your Magento faster than other.");
|
85 |
-
|
86 |
-
$notification->parse(array($notf));
|
87 |
-
|
88 |
-
$installer->endSetup();
|
89 |
-
|
90 |
-
} catch (Exception $e) {
|
91 |
-
|
92 |
-
$notf['title'] = Mage::helper('mturbo')->__('M-Turbo installation problem');
|
93 |
-
$notf['description'] = $e->getMessage();
|
94 |
-
$notification->parse(array($notf));
|
95 |
-
|
96 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Artio/MTurbo/sql/mturbo_setup/mysql4-upgrade-1.2.1-1.2.7.php
CHANGED
@@ -38,21 +38,17 @@
|
|
38 |
|
39 |
$installer->startSetup();
|
40 |
|
41 |
-
$
|
|
|
|
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
('default', 0, 'mturbo/downloadbatchsize', '10');
|
46 |
|
47 |
-
|
48 |
-
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
// setup cURL multi as default download method
|
53 |
-
if (in_array('curl', get_loaded_extensions())) {
|
54 |
-
$installer->run("UPDATE `${prefix}core_config_data` SET value = 'curlmulti' WHERE path LIKE 'mturbo/downloadmethod'");
|
55 |
-
}
|
56 |
|
57 |
$installer->endSetup();
|
58 |
|
38 |
|
39 |
$installer->startSetup();
|
40 |
|
41 |
+
$query = "INSERT INTO `${prefix}core_config_data` (`scope`, `scope_id`, `path`, `value`) VALUES"
|
42 |
+
." ('default', 0, 'mturbo/dynamic_checkout_cart_link', 'div.header a.top-link-cart'), "
|
43 |
+
." ('default', 0, 'mturbo/downloadbatchsize', '10');";
|
44 |
|
45 |
+
$query .= "ALTER TABLE `${prefix}mturbo` ADD UNIQUE `URL_REWRITE_ID` ( `url_rewrite_id` );";
|
46 |
+
$query .= "ALTER TABLE `${prefix}core_url_rewrite` ADD INDEX `FK_CORE_URL_REWRITE_CTGR_ID_PRD_ID` (`category_id`, `product_id`);";
|
|
|
47 |
|
48 |
+
if (in_array('curl', get_loaded_extensions()))
|
49 |
+
$query .= "UPDATE `${prefix}core_config_data` SET value = 'curlmulti' WHERE path LIKE 'mturbo/downloadmethod'";
|
50 |
|
51 |
+
$installer->run($query);
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
$installer->endSetup();
|
54 |
|
app/code/local/Artio/MTurbo/sql/mturbo_setup/{mysql4-upgrade-1.2.0-1.2.1.php → mysql4-upgrade-1.2.7-1.2.8.php}
RENAMED
@@ -38,30 +38,17 @@
|
|
38 |
|
39 |
$installer->startSetup();
|
40 |
|
41 |
-
$
|
42 |
-
|
43 |
-
DELETE FROM `".$prefix."adminnotification_inbox` WHERE `url`= '".$artioUrl."';
|
44 |
-
|
45 |
-
TRUNCATE TABLE `".$prefix."mturbo`;
|
46 |
|
47 |
-
|
48 |
-
CHANGE `request_path` `request_path` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
|
49 |
-
|
50 |
-
ALTER TABLE `".$prefix."mturbo` ADD UNIQUE `REQUEST_PATH_UNIQUE` ( `request_path`, `store_id` )
|
51 |
-
|
52 |
-
");
|
53 |
-
|
54 |
-
$notf['title'] = Mage::helper('mturbo')->__('M-Turbo upgrade succesfull. Please see into System/M-Turbo Management');
|
55 |
-
$notf['description'] = Mage::helper('mturbo')->__("Upgrade succesfull.");
|
56 |
-
|
57 |
-
$notification->parse(array($notf));
|
58 |
|
59 |
$installer->endSetup();
|
60 |
|
61 |
} catch (Exception $e) {
|
62 |
-
|
63 |
$notf['title'] = Mage::helper('mturbo')->__('M-Turbo upgrading problem');
|
64 |
$notf['description'] = $e->getMessage();
|
65 |
$notification->parse(array($notf));
|
66 |
-
|
67 |
}
|
38 |
|
39 |
$installer->startSetup();
|
40 |
|
41 |
+
$query = "REPLACE INTO `${prefix}core_config_data` (`scope`, `scope_id`, `path`, `value`) VALUES "
|
42 |
+
." ('default', 0, 'mturbo/dynamicblocks', 'default\$global_messages#ajax,default\$messages#ajax,default\$cart_sidebar#ajax,default\$catalog.compare.sidebar#ajax,default\$right.poll#ajax');";
|
|
|
|
|
|
|
43 |
|
44 |
+
$installer->run($query);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
$installer->endSetup();
|
47 |
|
48 |
} catch (Exception $e) {
|
49 |
+
|
50 |
$notf['title'] = Mage::helper('mturbo')->__('M-Turbo upgrading problem');
|
51 |
$notf['description'] = $e->getMessage();
|
52 |
$notification->parse(array($notf));
|
53 |
+
|
54 |
}
|
app/design/adminhtml/default/default/layout/mturbo.xml
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
<block type="mturbo/adminhtml_edit_tab_website" name="edit_tab_website" />
|
15 |
<block type="mturbo/adminhtml_edit_tab_category" name="edit_tab_category" />
|
16 |
<block type="mturbo/adminhtml_edit_tab_cms" name="edit_tab_cms" />
|
17 |
-
<block type="mturbo/adminhtml_edit_tab_dynamic" name="edit_tab_dynamic"
|
18 |
<block type="mturbo/adminhtml_edit_tab_actions" name="edit_tab_actions" />
|
19 |
<block type="mturbo/adminhtml_edit_tab_license" name="edit_tab_license" />
|
20 |
<block type="mturbo/adminhtml_edit_tab_uninstall" name="edit_tab_uninstall" />
|
@@ -28,6 +28,7 @@
|
|
28 |
<action method="addTab"><name>license_section</name><block>edit_tab_license</block></action>
|
29 |
<action method="addTab"><name>uninstall_section</name><block>edit_tab_uninstall</block></action>
|
30 |
</block>
|
|
|
31 |
<block type="core/template" name="demo_text" template="mturbo/demo.phtml" />
|
32 |
</reference>
|
33 |
</mturbo_adminhtml_mturbo_index>
|
14 |
<block type="mturbo/adminhtml_edit_tab_website" name="edit_tab_website" />
|
15 |
<block type="mturbo/adminhtml_edit_tab_category" name="edit_tab_category" />
|
16 |
<block type="mturbo/adminhtml_edit_tab_cms" name="edit_tab_cms" />
|
17 |
+
<block type="mturbo/adminhtml_edit_tab_dynamic" name="edit_tab_dynamic" template="mturbo/tabs/dynamic.phtml"/>
|
18 |
<block type="mturbo/adminhtml_edit_tab_actions" name="edit_tab_actions" />
|
19 |
<block type="mturbo/adminhtml_edit_tab_license" name="edit_tab_license" />
|
20 |
<block type="mturbo/adminhtml_edit_tab_uninstall" name="edit_tab_uninstall" />
|
28 |
<action method="addTab"><name>license_section</name><block>edit_tab_license</block></action>
|
29 |
<action method="addTab"><name>uninstall_section</name><block>edit_tab_uninstall</block></action>
|
30 |
</block>
|
31 |
+
<block type="core/template" name="warn_text" template="mturbo/formkey_warn.phtml" />
|
32 |
<block type="core/template" name="demo_text" template="mturbo/demo.phtml" />
|
33 |
</reference>
|
34 |
</mturbo_adminhtml_mturbo_index>
|
app/design/adminhtml/default/default/template/mturbo/formkey_warn.phtml
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design_default
|
22 |
+
* @package MTurbo
|
23 |
+
* @copyright Copyright (c) Artio 2010 (www.artio.net)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
$version = Mage::getVersionInfo();
|
29 |
+
$formkeyInstalled = Mage::helper('core')->isModuleEnabled('Artio_FormKey');
|
30 |
+
$formkeyEnabled = (bool) Mage::getStoreConfig('web/formkey/disable_formkey');
|
31 |
+
?>
|
32 |
+
<?php if ($version['major'] >= 1 && $version['minor'] >= 8): ?>
|
33 |
+
<?php if (!$formkeyInstalled): ?>
|
34 |
+
<div style="background-color:#F5EFEA;border:1px solid #A49586;color:#663D11;margin:20px 20px 20px 10px;padding:10px">
|
35 |
+
<p>
|
36 |
+
Warning: You are using M‑Turbo on Magento 1.8.x or higher.
|
37 |
+
</p>
|
38 |
+
<p>
|
39 |
+
If you want to use M‑Turbo on this version then you need to install module Artio FormKey. It will disable "formkey" protection introduced to latest Magento versions.
|
40 |
+
</p>
|
41 |
+
<p>
|
42 |
+
With "formkey" protection Magento will behave strange (customer will not be able to login or add a product to the cart etc).
|
43 |
+
</p>
|
44 |
+
<p>
|
45 |
+
You can download Artio FormKey <a href="http://www.artio.net/downloads/magento/m-turbo/magento-artio-formkey/details" title="Artio_FormKey">here</a> for free.<br />
|
46 |
+
</p>
|
47 |
+
</div>
|
48 |
+
<?php elseif (!$formkeyEnabled): ?>
|
49 |
+
<div style="background-color:#F5EFEA;border:1px solid #A49586;color:#663D11;margin:20px 20px 20px 10px;padding:10px">
|
50 |
+
<p>
|
51 |
+
Warning: You are using M‑Turbo on Magento 1.8.x or higher with activated "formkey" protection.
|
52 |
+
</p>
|
53 |
+
<p>
|
54 |
+
With "formkey" protection Magento will behave strange (customer will not be able to login or add a product to the cart etc).
|
55 |
+
</p>
|
56 |
+
<p>
|
57 |
+
You can enable it <a href="<?php echo Mage::helper('adminhtml')->getUrl('adminhtml/system_config/edit', array('section' => 'web')) ?>" title="Artio_FormKey">here</a>.<br />
|
58 |
+
</p>
|
59 |
+
</div>
|
60 |
+
<?php endif; ?>
|
61 |
+
<?php endif;
|
app/design/adminhtml/default/default/template/mturbo/tabs/dynamic.phtml
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Artio MTurbo
|
4 |
+
*
|
5 |
+
* @category design
|
6 |
+
* @package default_default
|
7 |
+
* @copyright Copyright (c) 2013 Artio s.r.o (http://www.artio.net/)
|
8 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
9 |
+
*/
|
10 |
+
?>
|
11 |
+
|
12 |
+
<div class="entry-edit">
|
13 |
+
<?php echo $this->getFormHtml() ?>
|
14 |
+
|
15 |
+
<div class="entry-edit-head">
|
16 |
+
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__("Blocks") ?></h4>
|
17 |
+
</div>
|
18 |
+
<fieldset id="dynamic_fieldset" class="grid">
|
19 |
+
<legend><?php echo $this->__("Blocks") ?></legend>
|
20 |
+
<table class="data" cellspacing="0">
|
21 |
+
<thead>
|
22 |
+
<tr class="headings">
|
23 |
+
<th><?php echo $this->__("Block") ?></th>
|
24 |
+
<th style="width:100px"><?php echo $this->__("Type") ?></th>
|
25 |
+
<th style="width:100px"><?php echo $this->__("Action") ?></th>
|
26 |
+
</tr>
|
27 |
+
</thead>
|
28 |
+
<tbody id="blocks_container">
|
29 |
+
<?php function showContentsTemplate($self, $_i=0) { ?>
|
30 |
+
<?php $block = $self->getFormUserBlock($_i); ?>
|
31 |
+
<?php $name = ($block && isset($block['name'])) ? $block['name'] : '' ?>
|
32 |
+
<?php $type = ($block && isset($block['type'])) ? $block['type'] : 'ajax' ?>
|
33 |
+
<td style="margin-bottom:5px;">
|
34 |
+
<select name="blocks[name][]"">
|
35 |
+
<?php foreach ($self->getBlocks() as $handle => $blocks): ?>
|
36 |
+
<optgroup label="<?php echo $handle ?>">
|
37 |
+
<?php foreach ($blocks as $key => $value): ?>
|
38 |
+
<option value="<?php echo $key ?>" <?php if ($name==$key) echo 'selected="selected"' ?> ><?php echo $self->escapeHtml($value) ?></option>
|
39 |
+
<?php endforeach ?>
|
40 |
+
</optgroup>
|
41 |
+
<?php endforeach ?>
|
42 |
+
</select>
|
43 |
+
</td>
|
44 |
+
<td style="margin-bottom:5px;">
|
45 |
+
<select name="blocks[type][]" style="width:100px">
|
46 |
+
<?php foreach ($self->getBlockTypes() as $key => $value): ?>
|
47 |
+
<option value="<?php echo $key ?>" <?php if ($type==$key) echo 'selected="selected"' ?> ><?php echo $self->escapeHtml($value) ?></option>
|
48 |
+
<?php endforeach ?>
|
49 |
+
</select>
|
50 |
+
</td>
|
51 |
+
<td style="margin-bottom:5px;width:100px">
|
52 |
+
<?php echo $self->getRemoveRowButtonHtml('tr') ?>
|
53 |
+
</td>
|
54 |
+
<?php } ?>
|
55 |
+
<tr id="blocks_template">
|
56 |
+
<?php showContentsTemplate($this, 0) ?>
|
57 |
+
</tr>
|
58 |
+
<?php for ($i=1; $i<$this->getFormUserBlockCount(); $i++): ?>
|
59 |
+
<tr>
|
60 |
+
<?php showContentsTemplate($this, $i) ?>
|
61 |
+
</tr>
|
62 |
+
<?php endfor ?>
|
63 |
+
</tbody>
|
64 |
+
<tfoot>
|
65 |
+
<tr>
|
66 |
+
<td class="a-left" colspan="6"><?php echo $this->getAddRowButtonHtml('blocks_container', 'blocks_template', $this->__('Add Block')) ?></td>
|
67 |
+
</tr>
|
68 |
+
</tfoot>
|
69 |
+
</table>
|
70 |
+
</fieldset>
|
71 |
+
</div>
|
72 |
+
<script type="text/javascript">
|
73 |
+
function addRow(container, template)
|
74 |
+
{
|
75 |
+
Element.insert($(container), {bottom: '<tr>' + $(template).innerHTML + '</tr>'});
|
76 |
+
}
|
77 |
+
|
78 |
+
function removeRow(button, selector)
|
79 |
+
{
|
80 |
+
Element.remove($(button).up(selector));
|
81 |
+
}
|
82 |
+
</script>
|
app/design/frontend/base/default/layout/mturbo.xml
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package default_default
|
24 |
+
* @copyright Copyright (c) 2011 Artio (http://www.artio.net)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
|
28 |
+
-->
|
29 |
+
<layout version="0.1.0">
|
30 |
+
|
31 |
+
<default>
|
32 |
+
<reference name="head">
|
33 |
+
<action method="addJs"><script>artio/mturbo.js</script></action>
|
34 |
+
</reference>
|
35 |
+
</default>
|
36 |
+
|
37 |
+
</layout>
|
app/design/frontend/default/default/layout/mturbo.xml
CHANGED
@@ -30,7 +30,7 @@
|
|
30 |
|
31 |
<default>
|
32 |
<reference name="head">
|
33 |
-
<action method="
|
34 |
</reference>
|
35 |
</default>
|
36 |
|
30 |
|
31 |
<default>
|
32 |
<reference name="head">
|
33 |
+
<action method="addJs"><script>artio/mturbo.js</script></action>
|
34 |
</reference>
|
35 |
</default>
|
36 |
|
package.xml
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>MTurbo</name>
|
4 |
-
<version>1.2.
|
5 |
<stability>stable</stability>
|
6 |
-
<license uri="http://www.artio.net/m-turbo/license">Copyright 2010-
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>MAGENTO E-COMMERCE ACCELERATOR</summary>
|
@@ -14,9 +14,9 @@ of Magento site optimization!</description>
|
|
14 |
<notes>Visit product homepage at:
|
15 |
http://www.artio.net/magento-extensions/m-turbo-accelerator</notes>
|
16 |
<authors><author><name>Michal Unzeitig</name><user>auto-converted</user><email>michal.unzeitig@artio.net</email></author><author><name>Jiří Chmiel</name><user>auto-converted</user><email>jiri.chmiel@artio.net</email></author></authors>
|
17 |
-
<date>
|
18 |
-
<time>
|
19 |
-
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="
|
20 |
<compatible/>
|
21 |
<dependencies/>
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>MTurbo</name>
|
4 |
+
<version>1.2.8</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license uri="http://www.artio.net/m-turbo/license">Copyright 2010-15, ARTIO s.r.o. All rights reserved.</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>MAGENTO E-COMMERCE ACCELERATOR</summary>
|
14 |
<notes>Visit product homepage at:
|
15 |
http://www.artio.net/magento-extensions/m-turbo-accelerator</notes>
|
16 |
<authors><author><name>Michal Unzeitig</name><user>auto-converted</user><email>michal.unzeitig@artio.net</email></author><author><name>Jiří Chmiel</name><user>auto-converted</user><email>jiri.chmiel@artio.net</email></author></authors>
|
17 |
+
<date>2015-02-05</date>
|
18 |
+
<time>10:42:46</time>
|
19 |
+
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="mturbo"><dir name="tabs"><file name="dynamic.phtml" hash="4455f87bdb45bdfa7cd2e08f9e203249"/></dir><dir name="preview"><file name="tree.phtml" hash="b7e75f4a267ac7bd9c8ce2d19fed1293"/></dir><file name="demo.phtml" hash="10e85183bb4fd851e3893d98a8c58c40"/><file name="version.phtml" hash="b49869bbb96e15ce56a35df0ae4ff48b"/><file name="formkey_warn.phtml" hash="f5146988c081343528e0a29a5b2c18e2"/><file name="grid.phtml" hash="f11cea678bbc7230028cf5a870479ac8"/><file name="massaction.phtml" hash="c4ca58cbd05d564129d3c39d452c783e"/><file name="tabs.phtml" hash="1015f2e05a41bb7751b11036e48cbd9f"/></dir></dir><dir name="layout"><file name="mturbo.xml" hash="4c9cd4225585396ed2ccbc2a114a2786"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="mturbo.xml" hash="2d7ef4bee8a0c01cfb78704662d47906"/></dir></dir></dir><dir name="base"><dir name="default"><dir name="layout"><file name="mturbo.xml" hash="2d7ef4bee8a0c01cfb78704662d47906"/></dir></dir></dir></dir></target><target name="magelocal"><dir name="Artio"><dir name="MTurbo"><dir name="Helper"><dir name="Catalog"><dir name="Product"><file name="Compare.php" hash="969d8a7f3faa2ab54ce48ff0c0e0754b"/></dir></dir><file name="Urlparams.php" hash="d610237090d9d8fa331fdf35883e647b"/><file name="Data.php" hash="5fce6ac00f511dcb0a11d5f7baf127b4"/><file name="Website.php" hash="600e2c272f1d5cfb5ae63ba092cf864d"/><file name="Info.php" hash="4ad504f2e931bbacc4c628f487e32725"/><file name="Functions.php" hash="4283c062e1b9b88e82bb865da6306e01"/><file name="Downloader.php" hash="e703b220f37a29c706e04214e87d90ed"/></dir><dir name="etc"><file name="config.xml" hash="4031ee0809aef191025770e000bdfc53"/></dir><dir name="Block"><dir name="Checkout"><dir name="Cart"><dir name="Item"><dir name="Renderer"><file name="Configurable.php" hash="7f63890ee32d0aa8bab1d511200bc9c7"/></dir><file name="Renderer.php" hash="b93f63e2b1940a889534854ba3fec31c"/></dir></dir></dir><dir name="Adminhtml"><dir name="Edit"><dir name="Tab"><file name="Main.php" hash="288d2dc50f2505970204251571770abb"/><file name="Url.php" hash="c01489c82b3cc040b1c35e267335749a"/><file name="Cms.php" hash="cee56f9271b29ff645e84105c831fd6c"/><file name="Dynamic.php" hash="d0f24e6592156d3f28387cb3c88f1980"/><file name="Actions.php" hash="957345fc43a69aa0fcdeb32e5448ca66"/><file name="Uninstall.php" hash="fde35018cd407e8dd2cc7d91b4aafa3a"/><file name="Website.php" hash="879e42f52a3bdf1a6ab967d031f98232"/><file name="Category.php" hash="3eb3d4924ab7d4e7978198d8caf31a30"/><file name="Abstract.php" hash="16a37f270112b175796bb5af02eea84d"/><file name="License.php" hash="3c405988f5bfc0581b5a7fe1b6204055"/><file name="Product.php" hash="ee67b81b998b1cfa336a777404afb3ee"/></dir><file name="Form.php" hash="9ba7b56533f6c7f8f8b3a6e1a71fe6ad"/><file name="Tabs.php" hash="a82341a6c981ba91b69774c81a7ad28e"/></dir><dir name="Welcome"><file name="Form.php" hash="431b5c958cb717570f13c8602b82e805"/></dir><file name="Mturbo.php" hash="4c6758e028e608ce93847a55a1ce27e1"/><file name="Welcome.php" hash="5acab4515cf35c30bf182eb0529855ad"/><file name="Run.php" hash="8db7aa6e5c559e69368e5064bd1dfabf"/></dir><dir name="Data"><dir name="Form"><dir name="Element"><file name="CategoryTree.php" hash="128d2bd67969552bb3f413975fc6313a"/><file name="Time.php" hash="c6617317308bd74c9714ccee2ac870bb"/><file name="Button.php" hash="c61ec7e27c62364c21e6d893f875ad93"/><file name="CmsTree.php" hash="b9d665e7a6d2f1c4f621aebb5ead4d38"/><file name="Html.php" hash="83a40987e47c142e6be58f311d29276d"/><file name="SelectDownloadMethod.php" hash="ca4b9117ecc129a08c08f810bed063d5"/><file name="NoEscLabel.php" hash="1ce0fca5efc5e6afcbb96cf818ff7fef"/></dir></dir><dir name="Grid"><dir name="Column"><file name="Blocked.php" hash="4e6c21fee2c3d8fc26198471ef79b041"/><file name="FileSize.php" hash="b01fca106ea04f0a32d5ead838dd7446"/><file name="ColorOption.php" hash="9efec8edc0a724b1840acfee3333bcc1"/><file name="SwitchAction.php" hash="35b90030144a8b42d9696f5be0694a20"/></dir></dir></dir><file name="Esi.php" hash="b94a57949a64bcdcdf582d9011ec5097"/><file name="Ajax.php" hash="b9caaa2c331cbf669367073fd90960d2"/><file name="Dynamic.php" hash="6e8e60d62ad0f1191ab3f843f45da47d"/></dir><dir name="sql"><dir name="mturbo_setup"><file name="mysql4-install-1.2.1.php" hash="5c756a617300d923a4bd09e0c5a4fb70"/><file name="mysql4-upgrade-1.2.7-1.2.8.php" hash="849f4b2f7cb2ef0be44964e1e1a7b352"/><file name="mysql4-upgrade-1.2.1-1.2.7.php" hash="736ec37025afcef6f0b807a8280ffd1f"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CheckController.php" hash="78c05c96f294f009f35dc8b88537162c"/><file name="MturboController.php" hash="0e8a4e9f6bb3ad0157ba9a27f7040dd5"/></dir><file name="IndexController.php" hash="c525db9b6466a5f6b0250bee7c5b4844"/><file name="AdminhtmlController.php" hash="8ba37d1173646315a8f2b756d0be1e83"/></dir><dir name="Model"><dir name="htaccess"><file name="htaccessstore.txt" hash="7db1c2f4c548540c1a6bd4d894ce0c22"/><file name="htaccessstoreboth.txt" hash="c0016ddbb064cfd9947e7f7e61823f65"/><file name="htaccess.txt" hash="e5650ac65b3679a1cbea26ea61b2ad0b"/><file name="htaccesswebsiteboth.txt" hash="21e422966251dc1e58e415a443d26a14"/><file name="htaccessside.txt" hash="7d55f4bb772128b1f8783b319344d17c"/><file name="htaccesswebsite.txt" hash="babc2f09afde8878f4670924e1238376"/></dir><dir name="scripts"><file name="wgetlib.so" hash="f3f41e51d01c00603b27ce5799f80e1c"/><file name="wgettrans.so" hash="e4f414b0f796051518b6d951133c856b"/></dir><dir name="patches"><file name="layout.txt" hash="4d0055e6119d297fd78deb4c576ae9f0"/><file name="mage.txt" hash="0e2ef3ed32b7041f518f162745812023"/></dir><dir name="Mysql4"><dir name="Mturbo"><file name="Collection.php" hash="c8e06d986966455cd28b37a93b78a23d"/></dir><file name="Mturbo.php" hash="17a258f73ea138481a5727e7b9d383fc"/></dir><dir name="Config"><file name="DynamicTransformer.php" hash="0d42fe912407a0360e52674bf5487770"/><file name="WebsiteTransformer.php" hash="6400c844114316207e18b670859fae1b"/><file name="Website.php" hash="42c7ca045d27c49581569648c5f080be"/><file name="CmsTransformer.php" hash="a5fca7b305322112e5bddd247ec20074"/></dir><dir name="Mturbo"><file name="Event.php" hash="9023b6117887739389b1d1f1e5aa944b"/><file name="File.php" hash="496551f8cfa4a63acbd394622838a1b2"/></dir><dir name="DownloadMethods"><file name="Curl.php" hash="78d4e5102dd9bd135adbb7cb8577de1c"/><file name="Direct.php" hash="8b8744927f496456728e9e804b86388b"/><file name="Filegetcontents.php" hash="67798b6767dd564892eaec1b39fffcb0"/><file name="Socket.php" hash="f0722356c2e5a64eeac7046f644a8913"/><file name="Curlmulti.php" hash="e1df7acefd0ecdf4cb5cc3fe7378e4fb"/><file name="Abstract.php" hash="801beb8227045dac7805f57404aff566"/></dir><file name="Mturbo.php" hash="3d33e91e27d4fa60d49f849ddb77c93d"/><file name="DownloadMethodsFactory.php" hash="ef6dabebc13e4a0860837f9c295a04fe"/><file name="LayoutPatch.php" hash="6f7a4fff8f6849dfe43002e31fa9f179"/><file name="Patch.php" hash="40e2e1ae19ae61c66b8f8b49326f0928"/><file name="Config.php" hash="e3e1353074107763c993ed5fc452a6a1"/><file name="Htaccess.php" hash="47e0a5f927fa40d24431ae1076b795c2"/><file name="Layout.php" hash="6fa6bd58cbc1ea3de2c4e3fc637bb223"/><file name="Observer.php" hash="a924f788536eb6227cbed3badfbfb2ad"/><file name="DownloadQueue.php" hash="f2ec9a95a60e6e9490a6053bda811925"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Artio_MTurbo.xml" hash="4de5464bc12f3c0702d2c36931bda64d"/></dir></target><target name="mage"><dir name="js"><dir name="artio"><file name="mturbo.js" hash=""/></dir></dir></target></contents>
|
20 |
<compatible/>
|
21 |
<dependencies/>
|
22 |
</package>
|
skin/frontend/base/default/js/mturbo.js
DELETED
@@ -1,55 +0,0 @@
|
|
1 |
-
var mturboloader = {
|
2 |
-
|
3 |
-
url: '',
|
4 |
-
blocks: new Array(),
|
5 |
-
complete: false,
|
6 |
-
cartLinkCss: '',
|
7 |
-
blocksContents: new Array(),
|
8 |
-
|
9 |
-
addBlockRequest: function(blockIdentifier) {
|
10 |
-
mturboloader.blocks.push(blockIdentifier);
|
11 |
-
},
|
12 |
-
|
13 |
-
getBlock: function (blockIdentifier) {
|
14 |
-
return mturboloader.blocksContents[blockIdentifier];
|
15 |
-
},
|
16 |
-
|
17 |
-
loadBlocks: function(url, referer) {
|
18 |
-
new Ajax.Request(url, {
|
19 |
-
method: "get",
|
20 |
-
parameters: {"identifier[]": mturboloader.blocks },
|
21 |
-
onSuccess:
|
22 |
-
function(transport) {
|
23 |
-
|
24 |
-
mturboloader.blocksContents = transport.responseText.evalJSON();
|
25 |
-
|
26 |
-
mturboloader.complete = true;
|
27 |
-
setTimeout('updateCartLink()', 100);
|
28 |
-
}
|
29 |
-
});
|
30 |
-
}
|
31 |
-
|
32 |
-
}
|
33 |
-
|
34 |
-
function updateCartLink() {
|
35 |
-
|
36 |
-
if (mturboloader.cartLinkCss)
|
37 |
-
{
|
38 |
-
if (mturboloader.blocksContents['cartlink'])
|
39 |
-
{
|
40 |
-
var cssSelectors = mturboloader.cartLinkCss.split(',');
|
41 |
-
|
42 |
-
cssSelectors.each(function(cssSelector) {
|
43 |
-
$$(cssSelector).each(function(element) {
|
44 |
-
element.innerHTML = mturboloader.blocksContents['cartlink'];
|
45 |
-
});
|
46 |
-
});
|
47 |
-
}
|
48 |
-
else
|
49 |
-
{
|
50 |
-
setTimeout('updateCartLink()', 100);
|
51 |
-
return;
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skin/frontend/default/default/js/mturbo.js
DELETED
@@ -1,55 +0,0 @@
|
|
1 |
-
var mturboloader = {
|
2 |
-
|
3 |
-
url: '',
|
4 |
-
blocks: new Array(),
|
5 |
-
complete: false,
|
6 |
-
cartLinkCss: '',
|
7 |
-
blocksContents: new Array(),
|
8 |
-
|
9 |
-
addBlockRequest: function(blockIdentifier) {
|
10 |
-
mturboloader.blocks.push(blockIdentifier);
|
11 |
-
},
|
12 |
-
|
13 |
-
getBlock: function (blockIdentifier) {
|
14 |
-
return mturboloader.blocksContents[blockIdentifier];
|
15 |
-
},
|
16 |
-
|
17 |
-
loadBlocks: function(url, referer) {
|
18 |
-
new Ajax.Request(url, {
|
19 |
-
method: "get",
|
20 |
-
parameters: {"identifier[]": mturboloader.blocks },
|
21 |
-
onSuccess:
|
22 |
-
function(transport) {
|
23 |
-
|
24 |
-
mturboloader.blocksContents = transport.responseText.evalJSON();
|
25 |
-
|
26 |
-
mturboloader.complete = true;
|
27 |
-
setTimeout('updateCartLink()', 100);
|
28 |
-
}
|
29 |
-
});
|
30 |
-
}
|
31 |
-
|
32 |
-
}
|
33 |
-
|
34 |
-
function updateCartLink() {
|
35 |
-
|
36 |
-
if (mturboloader.cartLinkCss)
|
37 |
-
{
|
38 |
-
if (mturboloader.blocksContents['cartlink'])
|
39 |
-
{
|
40 |
-
var cssSelectors = mturboloader.cartLinkCss.split(',');
|
41 |
-
|
42 |
-
cssSelectors.each(function(cssSelector) {
|
43 |
-
$$(cssSelector).each(function(element) {
|
44 |
-
element.innerHTML = mturboloader.blocksContents['cartlink'];
|
45 |
-
});
|
46 |
-
});
|
47 |
-
}
|
48 |
-
else
|
49 |
-
{
|
50 |
-
setTimeout('updateCartLink()', 100);
|
51 |
-
return;
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|