Chatra_Live_Chat - Version 1.0.0

Version Notes

Stable version.

Download this release

Release Info

Developer Chatra
Extension Chatra_Live_Chat
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/local/Chatra/Chatrawidget/Block/Chatrawidget.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category MagePsycho
4
+ * @package MagePsycho_Zopimlivechat
5
+ * @author info@magepsycho.com
6
+ * @website http://www.magepsycho.com
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ class Chatra_Chatrawidget_Block_Chatrawidget extends Mage_Core_Block_Template
10
+ {
11
+ protected function _toHtml(){
12
+ $helper = Mage::helper('chatrawidget');
13
+ return $helper->getWidgetCode();
14
+ }
15
+ }
app/code/local/Chatra/Chatrawidget/Block/System/Config/Chatrawidget/Info.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Chatra_Chatrawidget_Block_System_Config_Chatrawidget_Info
4
+ extends Mage_Adminhtml_Block_Abstract
5
+ implements Varien_Data_Form_Element_Renderer_Interface
6
+ {
7
+
8
+ public function render(Varien_Data_Form_Element_Abstract $element)
9
+ {
10
+ $widget_code = Mage::getStoreConfig('chatrawidget/' . 'option' . '/' . 'widget_code');
11
+ if(!isset($widget_code) or trim($widget_code) == ''){
12
+ $html = '<p>
13
+ Signup for a free Chatra account at <a href="http://app.chatra.io/?utm_source=magento" target="_blank">app.chatra.io</a>,<br>
14
+ then copy and paste Widget code from Setup & Customize into the form below:
15
+ </p>';
16
+ }else{
17
+ $html = '<p>
18
+ Seems like everything is OK!<br>
19
+ Check your <a href="/" target="_blank">website</a> to see if the live chat widget is present.<br>
20
+ Log in to your <a href="http://app.chatra.io/?utm_source=magento" target="_blank">Chatra dashboard</a> to chat with your website visitors and manage preferences.
21
+ </p>';
22
+ }
23
+ return $html;
24
+ }
25
+ }
app/code/local/Chatra/Chatrawidget/Helper/Data.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Chatra_Chatrawidget_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+ public function getConfig($field, $section = 'option', $default = null){
6
+ $value = Mage::getStoreConfig('chatrawidget/' .$section . '/' . $field);
7
+ if(!isset($value) or trim($value) == ''){
8
+ return $default;
9
+ }else{
10
+ return $value;
11
+ }
12
+ }
13
+
14
+ public function log($data){
15
+ if(!$this->getConfig('enable_log')){
16
+ return;
17
+ }
18
+ if(is_array($data) || is_object($data)){
19
+ $data = print_r($data, true);
20
+ }
21
+ Mage::log($data, null, 'chatrawidget.log');
22
+ }
23
+
24
+ public function getWidgetCode(){
25
+ $widget_code=$this->getConfig('widget_code');
26
+ return $widget_code;
27
+ }
28
+ }
app/code/local/Chatra/Chatrawidget/controllers/IndexController.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Chatra_Chatrawidget_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/local/Chatra/Chatrawidget/etc/config.xml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" ?>
2
+ <config>
3
+ <modules>
4
+ <Chatra_Chatrawidget>
5
+ <version>0.0.1</version>
6
+ </Chatra_Chatrawidget>
7
+ </modules>
8
+ <global>
9
+ <blocks>
10
+ <chatrawidget>
11
+ <class>Chatra_Chatrawidget_Block</class>
12
+ </chatrawidget>
13
+ </blocks>
14
+ <helpers>
15
+ <chatrawidget>
16
+ <class>Chatra_Chatrawidget_Helper</class>
17
+ </chatrawidget>
18
+ </helpers>
19
+ </global>
20
+ <frontend>
21
+ <routers>
22
+ <chatrawidget>
23
+ <use>standard</use>
24
+ <args>
25
+ <module>Chatra_Chatrawidget</module>
26
+ <frontName>chatrawidget</frontName>
27
+ </args>
28
+ </chatrawidget>
29
+ </routers>
30
+ <layout>
31
+ <updates>
32
+ <chatrawidget>
33
+ <file>chatrawidget.xml</file>
34
+ </chatrawidget>
35
+ </updates>
36
+ </layout>
37
+ </frontend>
38
+ <adminhtml>
39
+ <acl>
40
+ <resources>
41
+ <admin>
42
+ <children>
43
+ <system>
44
+ <children>
45
+ <config>
46
+ <children>
47
+ <chatrawidget>
48
+ <title>Chatra Chat</title>
49
+ </chatrawidget>
50
+ </children>
51
+ </config>
52
+ </children>
53
+ </system>
54
+ </children>
55
+ </admin>
56
+ </resources>
57
+ </acl>
58
+ </adminhtml>
59
+ </config>
app/code/local/Chatra/Chatrawidget/etc/system.xml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <chatrawidgetall translate="label" module="chatrawidget">
5
+ <label>Chatra</label>
6
+ <sort_order>250</sort_order>
7
+ </chatrawidgetall>
8
+ </tabs>
9
+ <sections>
10
+ <chatrawidget module="chatrawidget">
11
+ <label>Chatra Setup</label>
12
+ <tab>chatrawidgetall</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>1000</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
+ <option translate="label">
20
+ <label>General 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
+ <info>
28
+ <frontend_model>chatrawidget/system_config_chatrawidget_info</frontend_model>
29
+ <sort_order>0</sort_order>
30
+ <show_in_default>1</show_in_default>
31
+ <show_in_website>1</show_in_website>
32
+ <show_in_store>1</show_in_store>
33
+ </info>
34
+ <widget_code>
35
+ <label>Widget code</label>
36
+ <frontend_type>textarea</frontend_type>
37
+ <sort_order>20</sort_order>
38
+ <show_in_default>1</show_in_default>
39
+ <show_in_website>1</show_in_website>
40
+ <show_in_store>1</show_in_store>
41
+ </widget_code>
42
+ </fields>
43
+ </option>
44
+ </groups>
45
+ </chatrawidget>
46
+ </sections>
47
+ </config>
app/design/frontend/base/default/layout/chatrawidget.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout>
3
+ <default>
4
+ <reference name="head">
5
+ <block type="chatrawidget/chatrawidget" name="mp_chatra_widget" />
6
+ </reference>
7
+ </default>
8
+ </layout>
app/etc/modules/Chatra_Chatrawidget.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Chatra_Chatrawidget>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Chatra_Chatrawidget>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Chatra_Live_Chat</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>GNU GPLv2</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Chat with your website visitors, increase sales and collect feedback.</summary>
10
+ <description>Chat with your website visitors, increase sales and collect feedback. Powerful plugin, free as long as you want.</description>
11
+ <notes>Stable version.</notes>
12
+ <authors><author><name>Chatra</name><user>Chatra</user><email>info@eraga.net</email></author></authors>
13
+ <date>2015-09-09</date>
14
+ <time>12:35:06</time>
15
+ <contents><target name="magelocal"><dir name="Chatra"><dir name="Chatrawidget"><dir name="Block"><file name="Chatrawidget.php" hash="9d1d1515195b434463700f81c5dcf7a2"/><dir name="System"><dir name="Config"><dir name="Chatrawidget"><file name="Info.php" hash="34f3706c35120b2588c675639e724509"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="ee87113412ccbc279e42c76914946de9"/></dir><dir name="controllers"><file name="IndexController.php" hash="4bf03b8fe79398f091d58f688949c8c4"/></dir><dir name="etc"><file name="config.xml" hash="a1a968f27684e497d42673c383ebe0a9"/><file name="system.xml" hash="56c4c3f3fa613aab7945f484b2c05d71"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="chatrawidget.xml" hash="77a624edb1d6ba6e140f2207fd0e4d68"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Chatra_Chatrawidget.xml" hash="30ec0f31355e0db7078d3386a0b634ae"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>