Cdr_PureChat - Version 1.0.0

Version Notes

1.0.0 Release

Download this release

Release Info

Developer Cdr
Extension Cdr_PureChat
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/Cdr/PureChat/Block/Button.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Cdr_PureChat_Block_Button extends Mage_Core_Block_Template
4
+ {
5
+ protected $_configPath = null;
6
+
7
+ public function isActive() {
8
+ return
9
+ Mage::getStoreConfigFlag('purechat/widget/active') &&
10
+ Mage::getStoreConfigFlag('purechat/widget/key') &&
11
+ Mage::getStoreConfigFlag($this->_configPath);
12
+ }
13
+
14
+ public function setButton($btn) {
15
+ $this->_configPath = 'purechat/widget/'.$btn;
16
+ }
17
+ }
app/code/community/Cdr/PureChat/Block/Jsheader.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Cdr_PureChat_Block_Jsheader extends Mage_Core_Block_Template
4
+ {
5
+ protected $_widgetKey = false;
6
+
7
+
8
+ public function getWidgetKey() {
9
+ if($this->_widgetKey === false)
10
+ $this->_widgetKey = Mage::getStoreConfig('purechat/widget/key');
11
+
12
+ return $this->_widgetKey;
13
+ }
14
+
15
+ public function isActive() {
16
+ return
17
+ Mage::getStoreConfigFlag('purechat/widget/active') &&
18
+ $this->getWidgetKey();
19
+ }
20
+ }
app/code/community/Cdr/PureChat/Helper/Data.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class Cdr_PureChat_Helper_Data extends Mage_Core_Helper_Abstract
5
+ {
6
+
7
+ }
app/code/community/Cdr/PureChat/etc/adminhtml.xml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <cdr_purechat>
8
+ <children>
9
+ <purechat>
10
+ <title>PureChat</title>
11
+ <sort_order>50</sort_order>
12
+ </purechat>
13
+ </children>
14
+ </cdr_purechat>
15
+ <system>
16
+ <children>
17
+ <config>
18
+ <children>
19
+ <purechat>
20
+ <title>CDR PureChat</title>
21
+ </purechat>
22
+ </children>
23
+ </config>
24
+ </children>
25
+ </system>
26
+ </children>
27
+ </admin>
28
+ </resources>
29
+ </acl>
30
+ </config>
app/code/community/Cdr/PureChat/etc/config.xml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Cdr_PureChat>
5
+ <version>1.0.0.0</version>
6
+ </Cdr_PureChat>
7
+ </modules>
8
+ <global>
9
+ <blocks>
10
+ <purechat>
11
+ <class>Cdr_PureChat_Block</class>
12
+ </purechat>
13
+ </blocks>
14
+ <helpers>
15
+ <purechat>
16
+ <class>Cdr_PureChat_Helper</class>
17
+ </purechat>
18
+ </helpers>
19
+ </global>
20
+ <frontend>
21
+ <layout>
22
+ <updates>
23
+ <purechat>
24
+ <file>purechat.xml</file>
25
+ </purechat>
26
+ </updates>
27
+ </layout>
28
+ </frontend>
29
+ </config>
app/code/community/Cdr/PureChat/etc/system.xml ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <tabs>
4
+ <purechat_config module="purechat" translate="label">
5
+ <label>CDR</label>
6
+ <sort_order>1</sort_order>
7
+ </purechat_config>
8
+ </tabs>
9
+ <sections>
10
+ <purechat translate="label" module="purechat">
11
+ <label>PureChat</label>
12
+ <tab>purechat_config</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>10</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <widget translate="label">
20
+ <label>Settings</label>
21
+ <frontend_type>text</frontend_type>
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>Enable PureChat</label>
29
+ <frontend_type>select</frontend_type>
30
+ <source_model>adminhtml/system_config_source_yesno</source_model>
31
+ <sort_order>1</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ </active>
36
+ <key translate="label">
37
+ <label>Widget Key</label>
38
+ <frontend_type>text</frontend_type>
39
+ <sort_order>10</sort_order>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>1</show_in_website>
42
+ <show_in_store>1</show_in_store>
43
+ <comment><![CDATA[
44
+ This is the widget key found in the widget snippet<br />
45
+ e.g<br />
46
+ <span style="display:inline-block;margin-right:-100px">PCWidget({ c: '<strong style="color:red">xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</strong>', f: true })</span>
47
+ ]]>
48
+ </comment>
49
+ <depends>
50
+ <active>1</active>
51
+ </depends>
52
+ </key>
53
+ <left_button translate="label">
54
+ <label>Show chat button in the left column</label>
55
+ <frontend_type>select</frontend_type>
56
+ <source_model>adminhtml/system_config_source_yesno</source_model>
57
+ <sort_order>20</sort_order>
58
+ <show_in_default>1</show_in_default>
59
+ <show_in_website>1</show_in_website>
60
+ <show_in_store>1</show_in_store>
61
+ <depends>
62
+ <active>1</active>
63
+ </depends>
64
+ </left_button>
65
+ <right_button translate="label">
66
+ <label>Show chat button in the right column</label>
67
+ <frontend_type>select</frontend_type>
68
+ <source_model>adminhtml/system_config_source_yesno</source_model>
69
+ <sort_order>30</sort_order>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>1</show_in_store>
73
+ <depends>
74
+ <active>1</active>
75
+ </depends>
76
+ </right_button>
77
+
78
+ <online_image translate="label">
79
+ <label>Custom Button - Available Image</label>
80
+ <frontend_type>image</frontend_type>
81
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
82
+ <upload_dir config="system/filesystem/media" scope_info="1">purechat</upload_dir>
83
+ <base_url type="media" scope_info="1">purechat</base_url>
84
+ <sort_order>40</sort_order>
85
+ <show_in_default>1</show_in_default>
86
+ <show_in_website>1</show_in_website>
87
+ <show_in_store>1</show_in_store>
88
+ <comment>Allowed file types: jpeg, gif, png.</comment>
89
+ <depends>
90
+ <active>3</active>
91
+ </depends>
92
+ </online_image>
93
+
94
+ <offline_image translate="label">
95
+ <label>Custom Button - Unavailable Image</label>
96
+ <frontend_type>image</frontend_type>
97
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
98
+ <upload_dir config="system/filesystem/media" scope_info="1">purechat</upload_dir>
99
+ <base_url type="media" scope_info="1">purechat</base_url>
100
+ <sort_order>50</sort_order>
101
+ <show_in_default>1</show_in_default>
102
+ <show_in_website>1</show_in_website>
103
+ <show_in_store>1</show_in_store>
104
+ <comment>Allowed file types: jpeg, gif, png.</comment>
105
+ <depends>
106
+ <active>3</active>
107
+ </depends>
108
+ </offline_image>
109
+ </fields>
110
+ </widget>
111
+ </groups>
112
+ </purechat>
113
+ </sections>
114
+ </config>
app/design/frontend/base/default/layout/purechat.xml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ To change this license header, choose License Headers in Project Properties.
4
+ To change this template file, choose Tools | Templates
5
+ and open the template in the editor.
6
+ -->
7
+
8
+ <layout>
9
+ <default>
10
+ <reference name="head">
11
+ <block type="purechat/jsheader" name="purechat_js" template="purechat/js.phtml" />
12
+ <action method="addItem">
13
+ <type>skin_css</type>
14
+ <name>cdr/purechat/css/purechat.css</name>
15
+ <params/>
16
+ </action>
17
+ </reference>
18
+ <reference name="left">
19
+ <block type="purechat/button" name="purechat_left_btn" template="purechat/button.phtml" >
20
+ <action method="setButton">
21
+ <path>left_button</path>
22
+ </action>
23
+ </block>
24
+ </reference>
25
+ <reference name="right">
26
+ <block type="purechat/button" name="purechat_right_btn" template="purechat/button.phtml" >
27
+ <action method="setButton">
28
+ <path>right_button</path>
29
+ </action>
30
+ </block>
31
+ </reference>
32
+ </default>
33
+ </layout>
app/design/frontend/base/default/template/purechat/button.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php if ($this->isActive()) : ?>
2
+ <button class='purechat-button-expand' style="visibility: hidden;"><span class="purechat-button-text"></span></button>
3
+ <?php endif; ?>
app/design/frontend/base/default/template/purechat/js.phtml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ($this->isActive()) : ?>
2
+ <script type='text/javascript'>
3
+ (function() {
4
+ var done = false;
5
+ var script = document.createElement('script');
6
+ script.async = true;
7
+ script.type = 'text/javascript';
8
+ script.src = 'https://www.purechat.com/VisitorWidget/WidgetScript';
9
+ document.getElementsByTagName('HEAD').item(0).appendChild(script);
10
+ script.onreadystatechange = script.onload = function(e) {
11
+ if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete'))
12
+ {
13
+ var w = new PCWidget({c: '<?php echo $this->getWidgetKey(); ?>', f: true});
14
+ done = true;
15
+ }
16
+ };
17
+ })();
18
+ </script>
19
+ <?php endif; ?>
app/etc/modules/Cdr_PureChat.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Cdr_PureChat>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Cdr_PureChat>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Cdr_PureChat</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Pure Chat for Magento.&#xD;
10
+ Chat with you visitors, while they shop on your website.</summary>
11
+ <description>Pure Chat for Magento.&#xD;
12
+ &#xD;
13
+ Engage with your customers as they visit your website with Pure Chats easy to use, live chat service that's 100% free.</description>
14
+ <notes>1.0.0 Release</notes>
15
+ <authors><author><name>Cdr</name><user>PaulKetelle</user><email>paul@ketelle.co.uk</email></author></authors>
16
+ <date>2014-02-12</date>
17
+ <time>16:28:07</time>
18
+ <contents><target name="mageetc"><dir name="modules"><file name="Cdr_PureChat.xml" hash="cba13cea0d8459c6039e9e4f74e9e995"/></dir></target><target name="magecommunity"><dir name="Cdr"><dir name="PureChat"><dir><dir name="Block"><file name="Button.php" hash="89bd379a968d4b8ce7812bb3f635d510"/><file name="Jsheader.php" hash="ee7d8ed3dc7203e188084c06008cde9a"/></dir><dir name="Helper"><file name="Data.php" hash="1f32643d2b238ea73b390e3cec4c2d37"/></dir><dir name="etc"><file name="adminhtml.xml" hash="cd1b45974501bfe3382a4512ad4f2cc7"/><file name="config.xml" hash="4b2c7f15b5d399b6e20898911dd15e77"/><file name="system.xml" hash="a09ccaee77dc5d8b9c852c1608de6b10"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="purechat.xml" hash="87e39b0b2f38af2a50240b295f482822"/></dir><dir name="template"><dir name="purechat"><file name="button.phtml" hash="e38d0c09abc5abdc0d4279e26f8cc602"/><file name="js.phtml" hash="ffb482bde1510d4adb40f1c9bd460916"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="cdr"><dir name="purechat"><dir><dir name="css"><file name="purechat.css" hash="daf30f1164783333d76ace698bd5e18f"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
19
+ <compatible/>
20
+ <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
21
+ </package>
skin/frontend/base/default/cdr/purechat/css/purechat.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ button.purechat-button-expand {
2
+ width:100%;
3
+ }