VS_Tweet - Version 1.0.0

Version Notes

Quickly add a Twitter tweet button to your Magento store.

Download this release

Release Info

Developer virendra kumar sharma
Extension VS_Tweet
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/VS/Tweet/Block/Tweet.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ class VS_Tweet_Block_Tweet extends Mage_Core_Block_Template {
3
+
4
+ }
app/code/community/VS/Tweet/Helper/Data.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Edition :- Community
5
+ * Developed By :- virendra Kumar Sharma
6
+ *
7
+ */
8
+ class VS_Tweet_Helper_Data extends Mage_Core_Helper_Abstract
9
+ {
10
+
11
+ }
app/code/community/VS/Tweet/Model/Button.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class VS_Tweet_Model_Button{
3
+ protected $_options;
4
+ const DATA_COUNT_VERTICAL = 'vertical';
5
+ const DATA_COUNT_HORIZONTAL = 'horizontal';
6
+ const DATA_COUNT_NO = 'none';
7
+
8
+
9
+ public function toOptionArray(){
10
+ if (!$this->_options) {
11
+ $this->_options[] = array(
12
+ 'value'=>self::DATA_COUNT_VERTICAL,
13
+ 'label'=>Mage::helper('tweet')->__('Vertical')
14
+ );
15
+ $this->_options[] = array(
16
+ 'value'=>self::DATA_COUNT_HORIZONTAL,
17
+ 'label'=>Mage::helper('tweet')->__('Horizontal')
18
+ );
19
+ $this->_options[] = array(
20
+ 'value'=>self::DATA_COUNT_NO,
21
+ 'label'=>Mage::helper('tweet')->__('No Count')
22
+ );
23
+
24
+
25
+ }
26
+ return $this->_options;
27
+ }
28
+ }
app/code/community/VS/Tweet/etc/config.xml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <VS_Tweet>
6
+ <version>2.0</version>
7
+ </VS_Tweet>
8
+ </modules>
9
+ <global>
10
+ <helpers>
11
+ <tweet>
12
+ <class>VS_Tweet_Helper</class>
13
+ </tweet>
14
+ </helpers>
15
+ <models>
16
+ <tweet>
17
+ <class>VS_Tweet_Model</class>
18
+ </tweet>
19
+ </models>
20
+ <blocks>
21
+ <tweet>
22
+ <class>VS_Tweet_Block</class>
23
+ </tweet>
24
+ </blocks>
25
+ <resources>
26
+ <tweet_setup>
27
+ <setup>
28
+ <module>VS_Tweet</module>
29
+ </setup>
30
+ <connection>
31
+ <use>core_setup</use>
32
+ </connection>
33
+ </tweet_setup>
34
+ <tweet_write>
35
+ <connection>
36
+ <use>core_write</use>
37
+ </connection>
38
+ </tweet_write>
39
+ <tweet_read>
40
+ <connection>
41
+ <use>core_read</use>
42
+ </connection>
43
+ </tweet_read>
44
+ </resources>
45
+ </global>
46
+ <default>
47
+ <tweet>
48
+ <general>
49
+ <buttonstyle>horizontal</buttonstyle>
50
+ <buttonsize>small</buttonsize>
51
+ </general>
52
+ </tweet>
53
+
54
+ </default>
55
+ <frontend>
56
+ <layout>
57
+ <updates>
58
+ <tweet>
59
+ <file>tweet.xml</file>
60
+ </tweet>
61
+ </updates>
62
+ </layout>
63
+ </frontend>
64
+ <adminhtml>
65
+ <acl>
66
+ <resources>
67
+ <admin>
68
+ <children>
69
+ <system>
70
+ <children>
71
+ <config>
72
+ <children>
73
+ <tweet>
74
+ <title>Tweet Button</title>
75
+ </tweet>
76
+ </children>
77
+ </config>
78
+ </children>
79
+ </system>
80
+ </children>
81
+ </admin>
82
+ </resources>
83
+ </acl>
84
+ </adminhtml>
85
+ </config>
app/code/community/VS/Tweet/etc/system.xml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <config>
4
+ <tabs>
5
+ <vs_extensions>
6
+ <label>VS Extensions</label>
7
+ <sort_order>195</sort_order>
8
+ </vs_extensions>
9
+ </tabs>
10
+ <sections>
11
+ <tweet translate="label" >
12
+ <label>VS Tweet Button</label>
13
+ <tab>vs_extensions</tab>
14
+ <frontend_type>text</frontend_type>
15
+ <sort_order>90</sort_order>
16
+ <show_in_default>1</show_in_default>
17
+ <show_in_website>1</show_in_website>
18
+ <show_in_store>1</show_in_store>
19
+ <groups>
20
+ <general translate="label">
21
+ <label>Tweet Button Settings</label>
22
+ <frontend_type>text</frontend_type>
23
+ <sort_order>1</sort_order>
24
+ <show_in_default>1</show_in_default>
25
+ <show_in_website>1</show_in_website>
26
+ <show_in_store>1</show_in_store>
27
+ <fields>
28
+ <enabled translate="label">
29
+ <label>Enabled</label>
30
+ <frontend_type>select</frontend_type>
31
+ <source_model>adminhtml/system_config_source_yesno</source_model>
32
+ <sort_order>1</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
+ </enabled>
37
+ <buttonstyle translate="label">
38
+ <label>Button Style</label>
39
+ <frontend_type>select</frontend_type>
40
+ <source_model>tweet/button</source_model>
41
+ <sort_order>3</sort_order>
42
+ <show_in_default>1</show_in_default>
43
+ <show_in_website>1</show_in_website>
44
+ <show_in_store>1</show_in_store>
45
+ </buttonstyle>
46
+
47
+ </fields>
48
+ </general>
49
+
50
+
51
+ </groups>
52
+
53
+ </tweet>
54
+ </sections>
55
+ </config>
app/design/frontend/default/default/layout/tweet.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <layout version="0.1.0">
4
+
5
+ <catalog_product_view>
6
+
7
+ <reference name="alert.urls">
8
+ <block type="core/template" name="tweet" after="-" >
9
+ <action method="setTemplate" ifconfig="tweet/general/enabled">
10
+ <template>tweet/tweet.phtml</template>
11
+ </action>
12
+ </block>
13
+ </reference>
14
+ </catalog_product_view>
15
+
16
+
17
+ </layout>
18
+
app/design/frontend/default/default/template/tweet/tweet.phtml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <a href="https://twitter.com/share" class="twitter-share-button" data-count="<?php echo Mage::getStoreConfig('tweet/general/buttonstyle');?>" >Tweet</a>
2
+
3
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
4
+
app/etc/modules/VS_Tweet.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <VS_Tweet>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <depends>
8
+ <Mage_Catalog />
9
+ </depends>
10
+ </VS_Tweet>
11
+ </modules>
12
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>VS_Tweet</name>
4
+ <version>1.0.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>Quickly add a Twitter tweet button to your Magento store.</summary>
10
+ <description>Quickly add a Twitter tweet button to your Magento store.</description>
11
+ <notes>Quickly add a Twitter tweet button to your Magento store.</notes>
12
+ <authors><author><name>virendra kumar sharma</name><user>virendra</user><email>bhardwajveerendra@gmail.com</email></author></authors>
13
+ <date>2011-12-30</date>
14
+ <time>12:21:02</time>
15
+ <contents><target name="magecommunity"><dir><dir name="VS"><dir name="Tweet"><dir><dir name="Block"><file name="Tweet.php" hash="469bb91024653dfb672ed9a56dcf202f"/></dir><dir name="Helper"><file name="Data.php" hash="0e940860ca9f878e16b41dd2213cee69"/></dir><dir name="Model"><file name="Button.php" hash="70685287b57691a2223862b96c31ea09"/></dir><dir name="etc"><file name="config.xml" hash="c6e42ad2fb678795518dafdcf507a4a7"/><file name="system.xml" hash="9ddc598011eef1d943626a6aa30c4496"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="VS_Tweet.xml" hash="ef7d7e6cf0ba9ae0650aab0e82c4d177"/></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="tweet"><file name="tweet.phtml" hash="e352f8591a65e106ed98e9ab3fee4269"/></dir></dir><dir name="layout"><file name="tweet.xml" hash="a8bc7e7b6f8f04f31b12f60309283877"/></dir></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>