Ehavior_heatmap - Version 1.0.0

Version Notes

Initial public release

Download this release

Release Info

Developer Jan Flora
Extension Ehavior_heatmap
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/Ehavior/Heatmap/Block/Tracking.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ehavior_Heatmap_Block_Tracking extends Mage_Core_Block_Template
4
+ {
5
+ protected function _getPageTrackingCode($accountId)
6
+ {
7
+ return '(function(e,t){var n=t.location.protocol=="https:"?"https://ssl-":"http://",r=t.createElement("script");r.async=!0,r.src=n+"boot'.intval($accountId).'.tracking.ehavior.net/boot/'.intval($accountId).'.js",t.getElementsByTagName("head")[0].appendChild(r),t.readyState||(e._onload=e.onload,e.onload=function(){t.readyState="complete",e._onload&&e._onload()})})(window,document);';
8
+ }
9
+
10
+ protected function _toHtml()
11
+ {
12
+ if (!Ehavior_Heatmap_Helper_Data::isEhaviorAvailable()) return '';
13
+ return parent::_toHtml();
14
+ }
15
+ }
app/code/community/Ehavior/Heatmap/Helper/Data.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ehavior_Heatmap_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+ /**
6
+ * Config paths for using throughout the code
7
+ */
8
+ const XML_PATH_ACTIVE = 'heatmap/general/active';
9
+ const XML_PATH_ACCOUNT = 'heatmap/general/account';
10
+
11
+ /**
12
+ * Whether Ehavior is ready to use
13
+ *
14
+ * @param mixed $store
15
+ * @return bool
16
+ */
17
+ public function isEhaviorAvailable($store = null)
18
+ {
19
+ $accountId = Mage::getStoreConfig(self::XML_PATH_ACCOUNT, $store);
20
+ return $accountId && Mage::getStoreConfigFlag(self::XML_PATH_ACTIVE, $store);
21
+ }
22
+ }
app/code/community/Ehavior/Heatmap/etc/adminhtml.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <heatmap translate="title" module="heatmap">
12
+ <title>Ehavior</title>
13
+ </heatmap>
14
+ </children>
15
+ </config>
16
+ </children>
17
+ </system>
18
+ </children>
19
+ </admin>
20
+ </resources>
21
+ </acl>
22
+ </config>
app/code/community/Ehavior/Heatmap/etc/config.xml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Ehavior_Heatmap>
5
+ <version>1.0.0</version>
6
+ </Ehavior_Heatmap>
7
+ </modules>
8
+ <global>
9
+ <blocks>
10
+ <heatmap>
11
+ <class>Ehavior_Heatmap_Block</class>
12
+ </heatmap>
13
+ </blocks>
14
+ <helpers>
15
+ <heatmap>
16
+ <class>Ehavior_Heatmap_Helper</class>
17
+ </heatmap>
18
+ </helpers>
19
+ </global>
20
+ <frontend>
21
+ <layout>
22
+ <updates>
23
+ <heatmap>
24
+ <file>ehavior.xml</file>
25
+ </heatmap>
26
+ </updates>
27
+ </layout>
28
+ </frontend>
29
+ </config>
app/code/community/Ehavior/Heatmap/etc/system.xml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <heatmap translate="label" module="heatmap">
5
+ <label>Ehavior</label>
6
+ <tab>service</tab>
7
+ <frontend_type>text</frontend_type>
8
+ <sort_order>340</sort_order>
9
+ <show_in_default>1</show_in_default>
10
+ <show_in_website>1</show_in_website>
11
+ <show_in_store>1</show_in_store>
12
+ <groups>
13
+ <general translate="label">
14
+ <label>Ehavior website heatmaps</label>
15
+ <frontend_type>text</frontend_type>
16
+ <sort_order>10</sort_order>
17
+ <show_in_default>1</show_in_default>
18
+ <show_in_website>1</show_in_website>
19
+ <show_in_store>1</show_in_store>
20
+ <fields>
21
+ <active translate="label">
22
+ <label>Enable</label>
23
+ <frontend_type>select</frontend_type>
24
+ <source_model>adminhtml/system_config_source_yesno</source_model>
25
+ <sort_order>10</sort_order>
26
+ <show_in_default>1</show_in_default>
27
+ <show_in_website>1</show_in_website>
28
+ <show_in_store>1</show_in_store>
29
+ </active>
30
+ <account translate="label">
31
+ <label>Account Id</label>
32
+ <frontend_type>text</frontend_type>
33
+ <sort_order>20</sort_order>
34
+ <show_in_default>1</show_in_default>
35
+ <show_in_website>1</show_in_website>
36
+ <show_in_store>1</show_in_store>
37
+ <comment><![CDATA[To find your account id, <a href="http://heatmap.ehavior.net/" target="_blank">log in to Ehavior heatmaps</a> and click the "Tracking script" tab.<br>If you don't have an Ehavior account, <a href="http://ehavior.net/" target="_blank">sign up here</a>]]></comment>
38
+ </account>
39
+ </fields>
40
+ </general>
41
+ </groups>
42
+ </heatmap>
43
+ </sections>
44
+ </config>
app/design/frontend/base/default/layout/ehavior.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <!-- Ehavior_heatmap -->
5
+ <reference name="before_body_end">
6
+ <block type="heatmap/tracking" name="heatmap_tracking" template="ehavior/heatmap.phtml" />
7
+ </reference>
8
+ </default>
9
+ </layout>
app/design/frontend/base/default/template/ehavior/heatmap.phtml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php $accountId = Mage::getStoreConfig(Ehavior_Heatmap_Helper_Data::XML_PATH_ACCOUNT) ?>
2
+
3
+ <!-- BEGIN Ehavior tracking code -->
4
+ <script type="text/javascript">
5
+ //<![CDATA[
6
+ <?php echo $this->_getPageTrackingCode($accountId) ?>
7
+ //]]>
8
+ </script>
9
+ <!-- END Ehavior tracking code -->
app/etc/modules/Ehavior_Heatmap.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Ehavior_Heatmap>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Ehavior_Heatmap>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Ehavior_heatmap</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>GNU General Public License (GPL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>The official Ehavior heatmap extension for Magento</summary>
10
+ <description>This extension will help you install the Ehavior tracking code on your Magento site by just entering your account id. Easy and simple.&#xD;
11
+ &#xD;
12
+ For more information about Ehavior and heatmaps, visit our website at http://ehavior.net/</description>
13
+ <notes>Initial public release</notes>
14
+ <authors><author><name>Jan Flora</name><user>janflora</user><email>jf@ehavior.net</email></author></authors>
15
+ <date>2012-12-17</date>
16
+ <time>23:01:51</time>
17
+ <contents><target name="magecommunity"><dir name="Ehavior"><dir><dir name="Heatmap"><dir name="Block"><file name="Tracking.php" hash="ad6d562e714450ed85965c3d7b702177"/></dir><dir name="Helper"><file name="Data.php" hash="6484e49e726078e9ba6dc7861b08e5bb"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2f452ab1a0a404e8793bbcd03806ea76"/><file name="config.xml" hash="05d7f89f57744a7fbeb955498ecb36b1"/><file name="system.xml" hash="4299698378a3cc6f790098f62087270a"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ehavior.xml" hash="6738bafa15cca7e835d2e775d9d58022"/></dir><dir name="template"><dir name="ehavior"><file name="heatmap.phtml" hash="e37946b9330c5fd3dc344029011f4f0e"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ehavior_Heatmap.xml" hash="71d91a5a7f558ab29fe9179f56e99eda"/></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies><required><php><min>4.0.0</min><max>6.0.0</max></php></required></dependencies>
20
+ </package>