Gurutheme_Welcomebar - Version 0.1.0

Version Notes

First preview release

Download this release

Release Info

Developer thienphuc
Extension Gurutheme_Welcomebar
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

app/code/community/Gurutheme/Welcome/Block/Adminhtml/Config/Source/Hint.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Gurutheme_Welcome_Block_Adminhtml_Config_Source_Hint
3
+ extends Mage_Adminhtml_Block_Abstract
4
+ implements Varien_Data_Form_Element_Renderer_Interface
5
+ {
6
+ /**
7
+ * Render fieldset html
8
+ *
9
+ * @param Varien_Data_Form_Element_Abstract $element
10
+ * @return string
11
+ */
12
+ public function render(Varien_Data_Form_Element_Abstract $element)
13
+ {
14
+ //$version = Mage::getConfig()->getModuleConfig('_')->version;
15
+ $string ="<p style='font-size:14px;'>We warmly welcome all of you - inspired soul!
16
+ We are passionate designers, programmers and challenge takers providing you innovative,
17
+ distinctive magento themes and extensions. We combine innovative solutions, artist designs
18
+ with the latest technologies to implement ideas into our products. If you are looking for an
19
+ effective look and feel for your store, you have come to the right place. Let's work together to make things happen.<p>
20
+ <p style='margin-top:10px;font-size:15px; font-weight:bold'>Visit gurutheme website : <a href='http://gurutheme.com'><strong>Gurutheme</strong></a></p>";
21
+ return $string;
22
+ }
23
+ }
app/code/community/Gurutheme/Welcome/Block/Jsinit.php ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+
4
+ * This package designed for Magento COMMUNITY edition
5
+ * Gurutheme does not guarantee correct work of this extension
6
+ * on any other Magento edition except Magento COMMUNITY edition.
7
+ * Gurutheme does not provide extension support in case of
8
+ * incorrect edition usage.
9
+ * =================================================================
10
+ *
11
+ * @category Gurutheme
12
+ * @package Gurutheme_Welcome
13
+ * @version 1.0.1
14
+ * @copyright Copyright (c) 2010-2012 Gurutheme Co. (https://www.gurutheme.com)
15
+ */
16
+
17
+
18
+ class Gurutheme_Welcome_Block_Jsinit extends Mage_Adminhtml_Block_Template
19
+ {
20
+
21
+
22
+ protected $_platform = -1;
23
+ protected $_extensions_cache = array();
24
+ protected $_extensions;
25
+
26
+ protected $_section = '';
27
+ protected $_store_data = null;
28
+
29
+ /**
30
+ * Include JS in head if section is moneybookers
31
+ */
32
+ protected function _prepareLayout()
33
+ {
34
+ $this->_section = $this->getAction()->getRequest()->getParam('section', false);
35
+ if ($this->_section == 'gurustore') {
36
+
37
+ $this->getLayout()
38
+ ->getBlock('head')
39
+ ->addJs('gurutheme/gurutheme.js');
40
+ $this->setData('store_data', $this->_getStoreData());
41
+ }
42
+ parent::_prepareLayout();
43
+ }
44
+
45
+ /**
46
+ * Print init JS script into body
47
+ * @return string
48
+ */
49
+ protected function _toHtml()
50
+ {
51
+ if ($this->_section == 'gurustore') {
52
+ return parent::_toHtml();
53
+ } else {
54
+ return '';
55
+ }
56
+ }
57
+
58
+
59
+ /**
60
+ * Convert version to comparable integer
61
+ * @param $v
62
+ * @return int
63
+ */
64
+ protected function _convertVersion($v)
65
+ {
66
+ $digits = @explode(".", $v);
67
+ $version = 0;
68
+ if (is_array($digits)) {
69
+ foreach ($digits as $k => $v) {
70
+ $version += ($v * pow(10, max(0, (3 - $k))));
71
+ }
72
+ }
73
+ return $version;
74
+ }
75
+
76
+
77
+ /**
78
+ * Get extension info from cached feed
79
+ * @param $moduleName
80
+ * @return bool|Varien_Object
81
+ */
82
+ public function getExtensionInfo($moduleName)
83
+ {
84
+ if (!sizeof($this->_extensions_cache)) {
85
+ if ($displayNames = Mage::app()->loadCache('aw_all_extensions_feed')) {
86
+ $this->_extensions_cache = @unserialize($displayNames);
87
+ }
88
+ }
89
+ if (array_key_exists($moduleName, $this->_extensions_cache)) {
90
+ $data = array(
91
+ 'url' => @$this->_extensions_cache[$moduleName]['url'],
92
+ 'display_name' => @$this->_extensions_cache[$moduleName]['display_name'],
93
+ 'latest_version' => @$this->_extensions_cache[$moduleName]['version']
94
+ );
95
+ return new Varien_Object($data);
96
+ }
97
+ return new Varien_Object();
98
+ }
99
+
100
+ /**
101
+ * Return icon for installed extension
102
+ * @param $Extension
103
+ * @return Varien_Object
104
+ */
105
+ public function getIcon($Extension)
106
+ {
107
+ if ($Extension->getUpgradeAvailable()) {
108
+ $icon = 'aw_all/images/update.gif';
109
+ $title = "Update available";
110
+ } elseif (!$Extension->getIsPlatformValid()) {
111
+ $icon = 'aw_all/images/bad.gif';
112
+ $title = "Wrong Extension Platform";
113
+ } else {
114
+ $icon = 'aw_all/images/ok.gif';
115
+ $title = "Installed and up to date";
116
+ }
117
+ return new Varien_Object(array('title' => $title, 'source' => $this->getSkinUrl($icon)));
118
+ }
119
+
120
+ /**
121
+ * Fetch store data and return as Varien Object
122
+ * @return Varien_Object
123
+ */
124
+ protected function _getStoreData()
125
+ {
126
+ if (!is_null($this->_store_data))
127
+ return $this->_store_data;
128
+ $storeData = array();
129
+ $connection = $this->_getStoreConnection();
130
+ $storeResponse = $connection->read();
131
+
132
+ if ($storeResponse !== false) {
133
+ $storeResponse = preg_split('/^\r?$/m', $storeResponse, 2);
134
+ $storeResponse = trim($storeResponse[1]);
135
+ Mage::app()->saveCache($storeResponse, Gurutheme_Welcome_Helper_Config::STORE_RESPONSE_CACHE_KEY);
136
+ }
137
+ else {
138
+ $storeResponse = Mage::app()->loadCache(Gurutheme_Welcome_Helper_Config::STORE_RESPONSE_CACHE_KEY);
139
+ if (!$storeResponse) {
140
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Sorry, but Extensions Store is not available now. Please try again in a few minutes.'));
141
+ }
142
+ }
143
+
144
+ $connection->close();
145
+ $this->_store_data = new Varien_Object(array('text_response' => $storeResponse));
146
+ return $this->_store_data;
147
+ }
148
+
149
+ /**
150
+ * Returns URL to store
151
+ * @return Varien_Http_Adapter_Curl
152
+ */
153
+ protected function _getStoreConnection()
154
+ {
155
+ $params = array(
156
+
157
+ );
158
+ $url = array();
159
+ foreach ($params as $k => $v) {
160
+ $url[] = urlencode($k) . "=" . urlencode($v);
161
+ }
162
+ $url = rtrim(Gurutheme_Welcome_Helper_Config::STORE_URL) . (sizeof($url) ? ("?" . implode("&", $url)) : "");
163
+ $curl = new Varien_Http_Adapter_Curl();
164
+ $curl->setConfig(array(
165
+ 'timeout' => 5
166
+ ));
167
+ $curl->write(Zend_Http_Client::GET, $url, '1.0');
168
+
169
+ return $curl;
170
+ }
171
+
172
+
173
+ }
174
+
app/code/community/Gurutheme/Welcome/Helper/Config.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+
4
+ * This package designed for Magento COMMUNITY edition
5
+ * Gurutheme does not guarantee correct work of this extension
6
+ * on any other Magento edition except Magento COMMUNITY edition.
7
+ * Gurutheme does not provide extension support in case of
8
+ * incorrect edition usage.
9
+ * =================================================================
10
+ *
11
+ * @category Gurutheme
12
+ * @package Gurutheme_Welcome
13
+ * @version 1.0.1
14
+ * @copyright Copyright (c) 2010-2012 Gurutheme Co. (https://www.gurutheme.com)
15
+ */
16
+
17
+ class Gurutheme_Welcome_Helper_Config extends Mage_Core_Helper_Abstract
18
+ {
19
+ const STORE_URL = 'https://gurutheme.com/gurutheme-extensions';
20
+
21
+ /** EStore response cache key*/
22
+ const STORE_RESPONSE_CACHE_KEY = 'gurutheme_welcome_store_response_cache_key';
23
+
24
+
25
+ }
app/code/community/Gurutheme/Welcome/Helper/Data.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+
4
+ * This package designed for Magento COMMUNITY edition
5
+ * Gurutheme does not guarantee correct work of this extension
6
+ * on any other Magento edition except Magento COMMUNITY edition.
7
+ * Gurutheme does not provide extension support in case of
8
+ * incorrect edition usage.
9
+ * =================================================================
10
+ *
11
+ * @category Gurutheme
12
+ * @package Gurutheme_Welcome
13
+ * @version 1.0.1
14
+ * @copyright Copyright (c) 2010-2012 Gurutheme Co. (https://www.gurutheme.com)
15
+ */
16
+
17
+ class Gurutheme_Welcome_Helper_Data extends Mage_Core_Helper_Abstract
18
+ {
19
+ }
app/code/community/Gurutheme/Welcome/Helper/Versions.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+
4
+ * This package designed for Magento COMMUNITY edition
5
+ * Gurutheme does not guarantee correct work of this extension
6
+ * on any other Magento edition except Magento COMMUNITY edition.
7
+ * Gurutheme does not provide extension support in case of
8
+ * incorrect edition usage.
9
+ * =================================================================
10
+ *
11
+ * @category Gurutheme
12
+ * @package Gurutheme_Welcome
13
+ * @version 1.0.1
14
+ * @copyright Copyright (c) 2010-2012 Gurutheme Co. (http://www.magento.gurutheme.com)
15
+ */
16
+
17
+
18
+ class Gurutheme_Welcome_Helper_Versions extends Mage_Core_Helper_Abstract
19
+ {
20
+
21
+ const EE_PLATFORM = 100;
22
+ const PE_PLATFORM = 10;
23
+ const CE_PLATFORM = 0;
24
+
25
+ const ENTERPRISE_DETECT_COMPANY = 'Enterprise';
26
+ const ENTERPRISE_DETECT_EXTENSION = 'Enterprise';
27
+ const ENTERPRISE_DESIGN_NAME = "enterprise";
28
+ const PROFESSIONAL_DESIGN_NAME = "pro";
29
+
30
+ protected static $_platform = -1;
31
+
32
+ /**
33
+ * Checks which edition is used
34
+ * @return int
35
+ */
36
+ public static function getPlatform()
37
+ {
38
+ if (self::$_platform == -1) {
39
+ $pathToClaim = BP . DS . "app" . DS . "etc" . DS . "modules" . DS . self::ENTERPRISE_DETECT_COMPANY . "_" . self::ENTERPRISE_DETECT_EXTENSION . ".xml";
40
+ $pathToEEConfig = BP . DS . "app" . DS . "code" . DS . "core" . DS . self::ENTERPRISE_DETECT_COMPANY . DS . self::ENTERPRISE_DETECT_EXTENSION . DS . "etc" . DS . "config.xml";
41
+ $isCommunity = !file_exists($pathToClaim) || !file_exists($pathToEEConfig);
42
+ if ($isCommunity) {
43
+ self::$_platform = self::CE_PLATFORM;
44
+ } else {
45
+ $_xml = @simplexml_load_file($pathToEEConfig,'SimpleXMLElement', LIBXML_NOCDATA);
46
+ if(!$_xml===FALSE) {
47
+ $package = (string)$_xml->default->design->package->name;
48
+ $theme = (string)$_xml->install->design->theme->default;
49
+ $skin = (string)$_xml->stores->admin->design->theme->skin;
50
+ $isProffessional = ($package == self::PROFESSIONAL_DESIGN_NAME) && ($theme == self::PROFESSIONAL_DESIGN_NAME) && ($skin == self::PROFESSIONAL_DESIGN_NAME);
51
+ if ($isProffessional) {
52
+ self::$_platform = self::PE_PLATFORM;
53
+ return self::$_platform;
54
+ }
55
+ }
56
+ self::$_platform = self::EE_PLATFORM;
57
+ }
58
+ }
59
+ return self::$_platform;
60
+ }
61
+
62
+ /**
63
+ * Convert platform from string to int and backwards
64
+ * @static
65
+ * @param $platformCode
66
+ * @return int|string
67
+ */
68
+ public static function convertPlatform($platformCode)
69
+ {
70
+ if (is_numeric($platformCode)) {
71
+ // Convert predefined to letters code
72
+ $platform = ($platformCode == self::EE_PLATFORM ? 'ee' : ($platformCode == self::PE_PLATFORM ? 'pe'
73
+ : 'ce'));
74
+ } elseif (is_string($platformCode)) {
75
+ $platformCode = strtolower($platformCode);
76
+ $platform = ($platformCode == 'ee' ? self::EE_PLATFORM : ($platformCode == 'pe' ? self::PE_PLATFORM
77
+ : self::CE_PLATFORM));
78
+ }else{$platform = self::CE_PLATFORM;}
79
+ return $platform;
80
+ }
81
+
82
+ public static function convertVersion($v)
83
+ {
84
+ $digits = @explode(".", $v);
85
+ $version = 0;
86
+ if (is_array($digits)) {
87
+ foreach ($digits as $k => $v) {
88
+ $version += ($v * pow(10, max(0, (3 - $k))));
89
+ }
90
+
91
+ }
92
+ return $version;
93
+ }
94
+ }
app/code/community/Gurutheme/Welcome/etc/config.xml ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Gurutheme_Welcome>
5
+ <version>0.1.0</version>
6
+ </Gurutheme_Welcome>
7
+ </modules>
8
+
9
+ <global>
10
+ <helpers>
11
+ <welcome>
12
+ <class>Gurutheme_Welcome_Helper</class>
13
+ </welcome>
14
+ </helpers>
15
+ <models>
16
+ <!-- ... -->
17
+ <welcome>
18
+ <class>Gurutheme_Welcome_Model</class>
19
+ </welcome>
20
+ <!-- ... -->
21
+ </models>
22
+ <blocks>
23
+ <welcome>
24
+ <class>Gurutheme_Welcome_Block</class>
25
+ </welcome>
26
+ </blocks>
27
+ </global>
28
+
29
+ <!--<frontend>
30
+ <routers>
31
+ <welcome>
32
+ <use>standard</use>
33
+ <args>
34
+ <module>Gurutheme_Welcome</module>
35
+ <frontName>welcome</frontName>
36
+ </args>
37
+ </welcome>
38
+ </routers>
39
+ <layout>
40
+ <updates>
41
+ <welcome>
42
+ <file>welcomebar.xml</file>
43
+ </welcome>
44
+ </updates>
45
+ </layout>
46
+ </frontend>-->
47
+
48
+ <adminhtml>
49
+
50
+ <layout>
51
+ <updates>
52
+ <gurustore module="welcome">
53
+ <file>gurustore.xml</file>
54
+ </gurustore>
55
+ </updates>
56
+ </layout>
57
+
58
+ <acl>
59
+ <resources>
60
+ <admin>
61
+ <children>
62
+ <system>
63
+ <children>
64
+ <config>
65
+ <children>
66
+ <gurustore></gurustore>
67
+ </children>
68
+ </config>
69
+ </children>
70
+ </system>
71
+ </children>
72
+ </admin>
73
+ </resources>
74
+ </acl>
75
+ </adminhtml>
76
+
77
+ </config>
app/code/community/Gurutheme/Welcome/etc/system.xml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <welcomeconfig translate="label" module="welcome">
5
+ <label>Gurutheme</label>
6
+ <sort_order>99999</sort_order>
7
+ </welcomeconfig>
8
+ </tabs>
9
+ <sections>
10
+
11
+ <gurustore module="welcome">
12
+ <label>Store</label>
13
+ <tab>welcomeconfig</tab>
14
+ <!--<class>awall-section</class>-->
15
+ <frontend_type>text</frontend_type>
16
+ <sort_order>9999</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
+
21
+ <groups>
22
+ <extensions translate="label">
23
+ <label>Advanced Magento Extensions</label>
24
+ <frontend_type>text</frontend_type>
25
+ <!--<frontend_model>welcomebar/system_config_form_fieldset_gurutheme_store</frontend_model>-->
26
+ <sort_order>2</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ </extensions>
31
+ </groups>
32
+ </gurustore>
33
+ </sections>
34
+ </config>
app/code/community/Gurutheme/Welcomebar/Block/Adminhtml/Config/Source/Hint.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Gurutheme_Welcomebar_Block_Adminhtml_Config_Source_Hint
3
+ extends Mage_Adminhtml_Block_Abstract
4
+ implements Varien_Data_Form_Element_Renderer_Interface
5
+ {
6
+ /**
7
+ * Render fieldset html
8
+ *
9
+ * @param Varien_Data_Form_Element_Abstract $element
10
+ * @return string
11
+ */
12
+ public function render(Varien_Data_Form_Element_Abstract $element)
13
+ {
14
+ //$version = Mage::getConfig()->getModuleConfig('_')->version;
15
+ $string ="<p style='font-size:14px;'>We warmly welcome all of you - inspired soul!
16
+ We are passionate designers, programmers and challenge takers providing you innovative,
17
+ distinctive magento themes and extensions. We combine innovative solutions, artist designs
18
+ with the latest technologies to implement ideas into our products. If you are looking for an
19
+ effective look and feel for your store, you have come to the right place. Let's work together to make things happen.<p>
20
+ <p style='margin-top:10px;font-size:15px; font-weight:bold'>Visit gurutheme website : <a href='http://gurutheme.com'><strong>Gurutheme</strong></a></p>";
21
+ return $string;
22
+ }
23
+ }
app/code/community/Gurutheme/Welcomebar/Helper/Data.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ class Gurutheme_Welcomebar_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ }
app/code/community/Gurutheme/Welcomebar/etc/config.xml ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Gurutheme_Welcomebar>
5
+ <version>0.1.0</version>
6
+ </Gurutheme_Welcomebar>
7
+ </modules>
8
+ <default>
9
+ <welcome_options>
10
+ <guruthemebar>
11
+ <script>
12
+ <![CDATA[<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4fc6630645ab4116"></script>
13
+ <script type='text/javascript'>
14
+ addthis.bar.initialize({'default':{
15
+ "backgroundColor": "#D61E5A",
16
+ "buttonColor": "#3B5998",
17
+ "textColor": "#FFFFFF",
18
+ "buttonTextColor": "#FFFFFF"
19
+ },rules:[
20
+ {
21
+ "name": "Nothing",
22
+
23
+ "backgroundColor": "#13C1ED",
24
+
25
+ "message": "We LOVE our Customers! Use Promo Code HEART and get up to 20% OFF! Plus FREE Shipping and ZERO Sales Tax!",
26
+ "action": {
27
+ "type": "button",
28
+ "text": "Like",
29
+ "verb": "follow",
30
+ "service": "facebook",
31
+ "id" : "gurutheme"
32
+ }
33
+ }
34
+ ]});
35
+ </script>]]>
36
+ </script>
37
+
38
+ </guruthemebar>
39
+ </welcome_options>
40
+
41
+ </default>
42
+ <global>
43
+ <helpers>
44
+ <welcomebar>
45
+ <class>Gurutheme_Welcomebar_Helper</class>
46
+ </welcomebar>
47
+ </helpers>
48
+ <models>
49
+ <!-- ... -->
50
+ <welcomebar>
51
+ <class>Gurutheme_Welcomebar_Model</class>
52
+ </welcomebar>
53
+ <!-- ... -->
54
+ </models>
55
+ <blocks>
56
+ <welcomebar>
57
+ <class>Gurutheme_Welcomebar_Block</class>
58
+ </welcomebar>
59
+ </blocks>
60
+ </global>
61
+
62
+ <frontend>
63
+ <routers>
64
+ <welcomebar>
65
+ <use>standard</use>
66
+ <args>
67
+ <module>Gurutheme_Welcomebar</module>
68
+ <frontName>welcomebar</frontName>
69
+ </args>
70
+ </welcomebar>
71
+ </routers>
72
+ <layout>
73
+ <updates>
74
+ <welcomebar>
75
+ <file>welcomebar.xml</file>
76
+ </welcomebar>
77
+ </updates>
78
+ </layout>
79
+ </frontend>
80
+
81
+ <adminhtml>
82
+ <acl>
83
+ <resources>
84
+ <admin>
85
+ <children>
86
+ <system>
87
+ <children>
88
+ <config>
89
+ <children>
90
+ <welcome_options>
91
+ <title>Configuration Addthis Welcome</title>
92
+ </welcome_options>
93
+ </children>
94
+ </config>
95
+ </children>
96
+ </system>
97
+ </children>
98
+ </admin>
99
+ </resources>
100
+ </acl>
101
+ </adminhtml>
102
+
103
+ </config>
app/code/community/Gurutheme/Welcomebar/etc/system.xml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <welcomeconfig translate="label" module="welcomebar">
5
+ <label>Gurutheme</label>
6
+ <sort_order>99999</sort_order>
7
+ </welcomeconfig>
8
+ </tabs>
9
+ <sections>
10
+ <welcome_options translate="label" module="welcomebar">
11
+ <label>Welcomebar</label>
12
+ <tab>welcomeconfig</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
+ <hint>
20
+ <frontend_model>welcome/adminhtml_config_source_hint</frontend_model>
21
+ <sort_order>0</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ </hint>
26
+ <guruthemebar translate="label">
27
+ <label>Configuration</label>
28
+ <frontend_type>text</frontend_type>
29
+ <sort_order>1</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
+ <fields>
34
+ <use_script>
35
+ <label>Enable Script : </label>
36
+ <frontend_type>select</frontend_type>
37
+ <!-- adding a source model -->
38
+ <source_model>adminhtml/system_config_source_yesno</source_model>
39
+ <sort_order>1</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
+ </use_script>
44
+ <script>
45
+ <label>Addthis welcome bar script: </label>
46
+ <frontend_type>textarea</frontend_type>
47
+ <comment>You can edit your script at <![CDATA[<a href="https://www.addthis.com/get/welcome" target="_blank">Addthis welcome bar</a>]]></comment>
48
+ <sort_order>2</sort_order>
49
+ <show_in_default>1</show_in_default>
50
+ <show_in_website>1</show_in_website>
51
+ <show_in_store>1</show_in_store>
52
+ <depends><use_script>1</use_script></depends>
53
+ </script>
54
+
55
+
56
+ </fields>
57
+ </guruthemebar>
58
+ </groups>
59
+ </welcome_options>
60
+ </sections>
61
+ </config>
app/design/adminhtml/default/default/layout/gurustore.xml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addCss">
6
+ <name>gurutheme/css/window.css</name>
7
+ </action>
8
+
9
+ </reference>
10
+ </default>
11
+ <adminhtml_system_config_edit>
12
+ <reference name="content">
13
+ <block type="welcome/jsinit" name="gurutheme_jsinit" template="gurutheme/jsinit.phtml"></block>
14
+ </reference>
15
+ </adminhtml_system_config_edit>
16
+
17
+ </layout>
app/design/adminhtml/default/default/template/gurutheme/jsinit.phtml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+
4
+ * This package designed for Magento COMMUNITY edition
5
+ * Gurutheme does not guarantee correct work of this extension
6
+ * on any other Magento edition except Magento COMMUNITY edition.
7
+ * Gurutheme does not provide extension support in case of
8
+ * incorrect edition usage.
9
+ * =================================================================
10
+ *
11
+ * @category Gurutheme
12
+ * @package Gurutheme_Welcome
13
+ * @version 1.0.1
14
+ * @copyright Copyright (c) 2010-2012 Gurutheme Co. (http://www.magento.gurutheme.com)
15
+ */
16
+ ?>
17
+
18
+
19
+ <?php if ($this->_section == 'gurustore'): ?>
20
+
21
+ <div id="guru_store_response">
22
+
23
+ <?php echo $this->_getStoreData()->getTextResponse()?>
24
+ </div>
25
+
26
+
27
+ <?php endif; ?>
28
+
29
+
30
+ <script type="text/javascript">
31
+ _section = '<?php echo $this->_section?>';
32
+ </script>
app/design/frontend/base/default/layout/welcomebar.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+
5
+ <reference name="footer">
6
+ <block type="core/template" name="gurutheme.welcome.bar" template="gurutheme/welcomebar.phtml" ></block>
7
+ <action method="insert" ifconfig="welcome_options/guruthemebar/use_script"><block>gurutheme.welcome.bar</block></action>
8
+
9
+ </reference>
10
+
11
+ </default>
12
+ </layout>
app/design/frontend/base/default/template/gurutheme/welcomebar.phtml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ $script = Mage::getStoreConfig('welcome_options/guruthemebar/script');
3
+ if($script){
4
+ echo $script;
5
+ }
6
+
7
+ ?>
app/design/frontend/default/default/layout/welcomebar.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <block type="core/template" name="gurutheme.welcome.bar" template="gurutheme/welcomebar.phtml" ></block>
5
+ <reference name="footer">
6
+
7
+ <action method="insert" ifconfig="welcome_options/guruthemebar/use_script"><block>gurutheme.welcome.bar</block></action>
8
+
9
+ </reference>
10
+
11
+ </default>
12
+ </layout>
app/design/frontend/default/default/template/gurutheme/welcomebar.phtml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ $script = Mage::getStoreConfig('welcome_options/guruthemebar/script');
3
+ if($script){
4
+ echo $script;
5
+ }
6
+
7
+ ?>
app/etc/modules/Gurutheme_Welcome.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Gurutheme_Welcome>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Gurutheme_Welcome>
8
+ </modules>
9
+ </config>
app/etc/modules/Gurutheme_Welcomebar.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Gurutheme_Welcomebar>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Gurutheme_Welcomebar>
8
+ </modules>
9
+ </config>
js/gurutheme/gurutheme.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ function initGurutheme(){
2
+ if(_section == 'gurustore'){
3
+ $('gurustore_extensions').update($('guru_store_response').innerHTML)
4
+ }
5
+ }
6
+ Event.observe(window, 'load', function() {
7
+ initGurutheme();
8
+ });
package.xml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Gurutheme_Welcomebar</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Integrate Welcome Bar with your website fastly.</summary>
10
+ <description> This is a perfect extension you need to increase your sale. &#xD;
11
+ </description>
12
+ <notes>First preview release</notes>
13
+ <authors><author><name>thienphuc</name><user>phucvxt</user><email>phucvxt@goscom.vn</email></author></authors>
14
+ <date>2013-05-11</date>
15
+ <time>07:19:57</time>
16
+ <contents><target name="magecommunity"><dir name="Gurutheme"><dir name="Welcome"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Source"><file name="Hint.php" hash="bb4acd67eff7621bda50215d7254c1b2"/></dir></dir></dir><file name="Jsinit.php" hash="aa0cf5e227880f9434d9981150e932e0"/></dir><dir name="Helper"><file name="Config.php" hash="a4dcf23c2adbeafae9e226ca9ff4f8d3"/><file name="Data.php" hash="b8e151317ba526c6a6a1fd28dea0eac4"/><file name="Versions.php" hash="0de959189a6819062a6b98285117b360"/></dir><dir name="etc"><file name="config.xml" hash="d0c3745607182f928b80ba148dd0bac3"/><file name="system.xml" hash="f88c75604e5f04594de72e7312fd2559"/></dir></dir><dir name="Welcomebar"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Source"><file name="Hint.php" hash="64062de41478b1deae68e91d88895a9b"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="a441dcbb3f26a87e6e2676b2a38362df"/></dir><dir name="etc"><file name="config.xml" hash="d778298410a76bf8fa030a79a3dca343"/><file name="system.xml" hash="91ee64882eef46648dc73d8154346ada"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Gurutheme_Welcomebar.xml" hash="7e9c33fc5c03104073b3f106cab024aa"/><file name="Gurutheme_Welcome.xml" hash="9d5ad0216fd40273e929846a6213138c"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="welcomebar.xml" hash="fbb49bbff25c3d87244837c29e12f7f0"/></dir><dir name="template"><dir name="gurutheme"><file name="welcomebar.phtml" hash="b3789030b36d5d56eabdc7f4fa8117a1"/></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="layout"><file name="welcomebar.xml" hash="d50f0c759665f86735cbe07ddcb24064"/></dir><dir name="template"><dir name="gurutheme"><file name="welcomebar.phtml" hash="b3789030b36d5d56eabdc7f4fa8117a1"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="gurustore.xml" hash="7adb9929ee20909a6688a67b767ce73a"/></dir><dir name="template"><dir name="gurutheme"><file name="jsinit.phtml" hash="e51fb22cdcfbc10bf2e9c2430ba1514b"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="gurutheme"><file name="gurutheme.js" hash="57d5b1ab63f0e0b6e76e9f3d2fddff19"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="gurutheme"><dir name="css"><file name="window.css" hash="bdb9c84eaaf1b826b4ac88f0c01fc6c6"/></dir></dir></dir></dir></dir></target></contents>
17
+ <compatible/>
18
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
19
+ </package>
skin/adminhtml/default/default/gurutheme/css/window.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+
2
+ #guru_store_response {
3
+ display: none;
4
+ }