addthis_sharingtool - Version 2.0.0

Version Notes

* Implemented SmartLayers
* Added new section for managing Profile ID

Download this release

Release Info

Developer AddThis
Extension addthis_sharingtool
Version 2.0.0
Comparing to
See all releases


Code changes from version 1.0.1 to 2.0.0

app/code/community/AddThis/PluginsGeneral/Helper/Data.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (C) 2012 Clearspring Technologies, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ ?>
18
+ <?php
19
+
20
+ class AddThis_PluginsGeneral_Helper_Data extends Mage_Core_Helper_Abstract
21
+ {
22
+
23
+ }
app/code/community/AddThis/PluginsGeneral/etc/config.xml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <AddThis_PluginsGeneral>
5
+ <version>2.0.0</version>
6
+ </AddThis_PluginsGeneral>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <pluginsgeneral>
11
+ <class>AddThis_PluginsGeneral_Helper</class>
12
+ </pluginsgeneral>
13
+ </helpers>
14
+ <resources>
15
+ <pluginsgeneral_setup>
16
+ <setup>
17
+ <module>AddThis_PluginsGeneral</module>
18
+ </setup>
19
+ <connection>
20
+ <use>core_setup</use>
21
+ </connection>
22
+ </pluginsgeneral_setup>
23
+ <pluginsgeneral_write>
24
+ <connection>
25
+ <use>core_write</use>
26
+ </connection>
27
+ </pluginsgeneral_write>
28
+ <pluginsgeneral_read>
29
+ <connection>
30
+ <use>core_read</use>
31
+ </connection>
32
+ </pluginsgeneral_read>
33
+ </resources>
34
+ </global>
35
+ <adminhtml>
36
+ <acl>
37
+ <resources>
38
+ <all>
39
+ <title>Allow Everything</title>
40
+ </all>
41
+ <admin>
42
+ <children>
43
+ <system>
44
+ <children>
45
+ <config>
46
+ <children>
47
+ <plugins_general translate="title" module="pluginsgeneral">
48
+ <title>AddThis</title>
49
+ <sort_order>52</sort_order>
50
+ </plugins_general>
51
+ </children>
52
+ </config>
53
+ </children>
54
+ </system>
55
+ </children>
56
+ </admin>
57
+ </resources>
58
+ </acl>
59
+ </adminhtml>
60
+ </config>
app/code/community/AddThis/PluginsGeneral/etc/system.xml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <add_this translate="label" module="pluginsgeneral">
5
+ <label>AddThis</label>
6
+ <sort_order>100</sort_order>
7
+ </add_this>
8
+ </tabs>
9
+ <sections>
10
+ <plugins_general translate="label" module="pluginsgeneral">
11
+ <label>General</label>
12
+ <tab>add_this</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
+ <general translate="label" module="pluginsgeneral">
20
+ <label>General</label>
21
+ <sort_order>800</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
+ <expanded>1</expanded>
26
+ <fields>
27
+ <pubid translate="label">
28
+ <label>Profile ID</label>
29
+ <frontend_type>text</frontend_type>
30
+ <sort_order>20</sort_order>
31
+ <show_in_default>1</show_in_default>
32
+ <show_in_website>1</show_in_website>
33
+ <show_in_store>1</show_in_store>
34
+ <comment><![CDATA[<a href="http://support.addthis.com/customer/portal/articles/381263-addthis-client-api" target="_blank">More info</a>]]></comment>
35
+ </pubid>
36
+ </fields>
37
+ </general>
38
+ </groups>
39
+ </plugins_general>
40
+ </sections>
41
+ </config>
app/code/community/AddThis/SharingTool/Block/Share.php CHANGED
@@ -32,7 +32,7 @@ class AddThis_SharingTool_Block_Share extends Mage_Core_Block_Template
32
 
33
  public function getPubId(){
34
 
35
- return Mage::getStoreConfig('sharing_tool/general/pubid');
36
  }
37
 
38
  public function getMenuVersion(){
@@ -110,21 +110,6 @@ class AddThis_SharingTool_Block_Share extends Mage_Core_Block_Template
110
  return Mage::getStoreConfig('sharing_tool/api/ui_language');
111
  }
112
 
113
- public function getUiOffsetTop(){
114
-
115
- return Mage::getStoreConfig('sharing_tool/api/ui_offset_top');
116
- }
117
-
118
- public function getUiOffsetLeft(){
119
-
120
- return Mage::getStoreConfig('sharing_tool/api/ui_offset_left');
121
- }
122
-
123
- public function getUiCss(){
124
-
125
- return Mage::getStoreConfig('sharing_tool/api/ui_use_css');
126
- }
127
-
128
  public function getDataTrackClick(){
129
 
130
  return Mage::getStoreConfig('sharing_tool/api/data_track_clickback');
32
 
33
  public function getPubId(){
34
 
35
+ return Mage::getStoreConfig('plugins_general/general/pubid');
36
  }
37
 
38
  public function getMenuVersion(){
110
  return Mage::getStoreConfig('sharing_tool/api/ui_language');
111
  }
112
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  public function getDataTrackClick(){
114
 
115
  return Mage::getStoreConfig('sharing_tool/api/data_track_clickback');
app/code/community/AddThis/SharingTool/Model/Observer.php CHANGED
@@ -19,21 +19,22 @@
19
 
20
  class AddThis_SharingTool_Model_Observer
21
  {
22
- public function addButtonsHtml($observer)
23
- {
24
- $block = $observer->getBlock();
25
- $transport = $observer->getTransport();
26
-
27
- if ($block->getNameInLayout()=='product_review_list.count') {
28
-
29
- $plugin_enabled = Mage::getStoreConfig('sharing_tool/general/enabled');
30
-
31
- if($plugin_enabled!=0){
32
- $html = $transport->getHtml();
33
- $buttons = Mage::app()->getLayout()->createBlock('sharingtool/share', 'addthis', array('template'=>'addthis/sharingtool/share.phtml'));
34
- $html .= $buttons->toHtml();
35
- $transport->setHtml($html);
36
- }
37
- }
38
- }
 
39
  }
19
 
20
  class AddThis_SharingTool_Model_Observer
21
  {
22
+ public function addButtonsHtml($observer){
23
+ if(version_compare(Mage::getVersion(), "1.6") != 1){
24
+ $block = $observer->getBlock();
25
+ $transport = $observer->getTransport();
26
+
27
+ if ($block->getNameInLayout()=='product_review_list.count') {
28
+
29
+ $plugin_enabled = Mage::getStoreConfig('sharing_tool/general/enabled');
30
+
31
+ if($plugin_enabled!=0){
32
+ $html = $transport->getHtml();
33
+ $buttons = Mage::app()->getLayout()->createBlock('sharingtool/share', 'addthis', array('template'=>'addthis/sharingtool/share.phtml'));
34
+ $html .= $buttons->toHtml();
35
+ $transport->setHtml($html);
36
+ }
37
+ }
38
+ }
39
+ }
40
  }
app/code/community/AddThis/SharingTool/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <AddThis_SharingTool>
5
- <version>1.0.1</version>
6
  </AddThis_SharingTool>
7
  </modules>
8
  <global>
@@ -93,6 +93,9 @@
93
  <adminhtml>
94
  <acl>
95
  <resources>
 
 
 
96
  <admin>
97
  <children>
98
  <system>
2
  <config>
3
  <modules>
4
  <AddThis_SharingTool>
5
+ <version>2.0.0</version>
6
  </AddThis_SharingTool>
7
  </modules>
8
  <global>
93
  <adminhtml>
94
  <acl>
95
  <resources>
96
+ <all>
97
+ <title>Allow Everything</title>
98
+ </all>
99
  <admin>
100
  <children>
101
  <system>
app/code/community/AddThis/SharingTool/etc/system.xml CHANGED
@@ -11,7 +11,7 @@
11
  <label>Sharing Tool</label>
12
  <tab>add_this</tab>
13
  <frontend_type>text</frontend_type>
14
- <sort_order>40</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>
@@ -25,26 +25,16 @@
25
  <expanded>1</expanded>
26
  <fields>
27
  <enabled translate="label">
28
- <label>Display Tool</label>
29
  <frontend_type>select</frontend_type>
30
  <source_model>adminhtml/system_config_source_enabledisable</source_model>
31
  <sort_order>10</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
- </enabled>
36
- <pubid translate="label">
37
- <label>Profile ID</label>
38
- <frontend_type>text</frontend_type>
39
- <sort_order>20</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[<a href="http://support.addthis.com/customer/portal/articles/381263-addthis-client-api" target="_blank">More info</a>]]></comment>
44
- </pubid>
45
  </fields>
46
- </general>
47
-
48
  <button_style translate="label" module="sharingtool">
49
  <label>Button Style</label>
50
  <sort_order>900</sort_order>
@@ -84,8 +74,7 @@
84
  });
85
  }
86
  });</script>]]></comment>
87
- </button_set>
88
-
89
  <custom_button_url translate="label">
90
  <label>Custom Button Image URL</label>
91
  <frontend_type>text</frontend_type>
@@ -104,8 +93,7 @@
104
  <show_in_store>1</show_in_store>
105
  </custom_button_code>
106
  </fields>
107
- </button_style>
108
-
109
  <custom_share translate="label" module="sharingtool">
110
  <label>Custom URL and Title (Optional)</label>
111
  <sort_order>1100</sort_order>
@@ -138,8 +126,7 @@
138
  <show_in_store>1</show_in_store>
139
  </custom_description>
140
  </fields>
141
- </custom_share>
142
-
143
  <api translate="label" module="sharingtool">
144
  <label>API Configuration Options (Optional)</label>
145
  <sort_order>1200</sort_order>
@@ -223,33 +210,6 @@
223
  <show_in_store>1</show_in_store>
224
  <comment>Force the menu to use a particular language.</comment>
225
  </ui_language>
226
- <ui_offset_top translate="label">
227
- <label>Offset Top</label>
228
- <frontend_type>text</frontend_type>
229
- <sort_order>120</sort_order>
230
- <show_in_default>1</show_in_default>
231
- <show_in_website>1</show_in_website>
232
- <show_in_store>1</show_in_store>
233
- <comment>Number of pixels to offset the top of the compact menu from its parent element.</comment>
234
- </ui_offset_top>
235
- <ui_offset_left translate="label">
236
- <label>Offset Left</label>
237
- <frontend_type>text</frontend_type>
238
- <sort_order>130</sort_order>
239
- <show_in_default>1</show_in_default>
240
- <show_in_website>1</show_in_website>
241
- <show_in_store>1</show_in_store>
242
- <comment>Number of pixels to offset the left of the compact menu from its parent element.</comment>
243
- </ui_offset_left>
244
- <ui_use_css translate="label">
245
- <label>Load AddThis CSS</label>
246
- <frontend_type>select</frontend_type>
247
- <source_model>adminhtml/system_config_source_yesno</source_model>
248
- <sort_order>170</sort_order>
249
- <show_in_default>1</show_in_default>
250
- <show_in_website>1</show_in_website>
251
- <show_in_store>1</show_in_store>
252
- </ui_use_css>
253
  <data_track_clickback translate="label">
254
  <label>Track Clickbacks</label>
255
  <frontend_type>select</frontend_type>
@@ -280,8 +240,7 @@
280
  <comment>If set, AddThis will send tracking events to Google.</comment>
281
  </data_ga_tracker>
282
  </fields>
283
- </api>
284
-
285
  <custom_service translate="label" module="sharingtool">
286
  <label>Specify Your Own AddThis Sharing Service (Optional)</label>
287
  <sort_order>1300</sort_order>
@@ -315,8 +274,7 @@
315
  <show_in_store>1</show_in_store>
316
  </services_custom_icon>
317
  </fields>
318
- </custom_service>
319
-
320
  </groups>
321
  </sharing_tool>
322
  </sections>
11
  <label>Sharing Tool</label>
12
  <tab>add_this</tab>
13
  <frontend_type>text</frontend_type>
14
+ <sort_order>30</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>
25
  <expanded>1</expanded>
26
  <fields>
27
  <enabled translate="label">
28
+ <label>Status</label>
29
  <frontend_type>select</frontend_type>
30
  <source_model>adminhtml/system_config_source_enabledisable</source_model>
31
  <sort_order>10</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
+ </enabled>
 
 
 
 
 
 
 
 
 
36
  </fields>
37
+ </general>
 
38
  <button_style translate="label" module="sharingtool">
39
  <label>Button Style</label>
40
  <sort_order>900</sort_order>
74
  });
75
  }
76
  });</script>]]></comment>
77
+ </button_set>
 
78
  <custom_button_url translate="label">
79
  <label>Custom Button Image URL</label>
80
  <frontend_type>text</frontend_type>
93
  <show_in_store>1</show_in_store>
94
  </custom_button_code>
95
  </fields>
96
+ </button_style>
 
97
  <custom_share translate="label" module="sharingtool">
98
  <label>Custom URL and Title (Optional)</label>
99
  <sort_order>1100</sort_order>
126
  <show_in_store>1</show_in_store>
127
  </custom_description>
128
  </fields>
129
+ </custom_share>
 
130
  <api translate="label" module="sharingtool">
131
  <label>API Configuration Options (Optional)</label>
132
  <sort_order>1200</sort_order>
210
  <show_in_store>1</show_in_store>
211
  <comment>Force the menu to use a particular language.</comment>
212
  </ui_language>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  <data_track_clickback translate="label">
214
  <label>Track Clickbacks</label>
215
  <frontend_type>select</frontend_type>
240
  <comment>If set, AddThis will send tracking events to Google.</comment>
241
  </data_ga_tracker>
242
  </fields>
243
+ </api>
 
244
  <custom_service translate="label" module="sharingtool">
245
  <label>Specify Your Own AddThis Sharing Service (Optional)</label>
246
  <sort_order>1300</sort_order>
274
  <show_in_store>1</show_in_store>
275
  </services_custom_icon>
276
  </fields>
277
+ </custom_service>
 
278
  </groups>
279
  </sharing_tool>
280
  </sections>
app/code/community/AddThis/SmartLayers/Block/Layer.php ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (C) 2012 Clearspring Technologies, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ ?>
18
+ <?php
19
+
20
+ class AddThis_SmartLayers_Block_Layer extends Mage_Core_Block_Template
21
+ {
22
+ protected function _construct()
23
+ {
24
+ parent::_construct();
25
+ $this->setTemplate('addthis/smartlayers/smartlayers.phtml');
26
+ }
27
+
28
+ /* General */
29
+ public function getPluginEnabledStatus(){
30
+
31
+ return Mage::getStoreConfig('smart_layers/general/enabled');
32
+ }
33
+
34
+ public function getPubId(){
35
+
36
+ return Mage::getStoreConfig('plugins_general/general/pubid');
37
+ }
38
+
39
+ public function getTheme(){
40
+
41
+ return Mage::getStoreConfig('smart_layers/general/theme');
42
+ }
43
+
44
+ /* Follow */
45
+ public function getFollow(){
46
+
47
+ $follow_services = array();
48
+
49
+ $follow_services['facebook'] = Mage::getStoreConfig('smart_layers/follow/facebook');
50
+ $follow_services['twitter'] = Mage::getStoreConfig('smart_layers/follow/twitter');
51
+ $follow_services['linkedin'] = Mage::getStoreConfig('smart_layers/follow/linkedin');
52
+ $follow_services['linkedin_comp'] = Mage::getStoreConfig('smart_layers/follow/linkedin_comp');
53
+ $follow_services['google'] = Mage::getStoreConfig('smart_layers/follow/google');
54
+ $follow_services['youtube'] = Mage::getStoreConfig('smart_layers/follow/youtube');
55
+ $follow_services['flickr'] = Mage::getStoreConfig('smart_layers/follow/flickr');
56
+ $follow_services['vimeo'] = Mage::getStoreConfig('smart_layers/follow/vimeo');
57
+ $follow_services['pinterest'] = Mage::getStoreConfig('smart_layers/follow/pinterest');
58
+ $follow_services['instagram'] = Mage::getStoreConfig('smart_layers/follow/instagram');
59
+ $follow_services['foursquare'] = Mage::getStoreConfig('smart_layers/follow/foursquare');
60
+ $follow_services['tumblr'] = Mage::getStoreConfig('smart_layers/follow/tumblr');
61
+ $follow_services['rss'] = Mage::getStoreConfig('smart_layers/follow/rss');
62
+
63
+ return $follow_services;
64
+ }
65
+
66
+ /* Share */
67
+ public function getShareEnabled(){
68
+
69
+ return Mage::getStoreConfig('smart_layers/share/enabled');
70
+ }
71
+
72
+ public function getShareButtonPosition(){
73
+
74
+ return Mage::getStoreConfig('smart_layers/share/share_button_position');
75
+ }
76
+
77
+ public function getShareButtonCount(){
78
+
79
+ return Mage::getStoreConfig('smart_layers/share/share_button_count');
80
+ }
81
+
82
+ /* What's Next */
83
+ public function getWhatsNextEnabled(){
84
+
85
+ return Mage::getStoreConfig('smart_layers/whatsnext/enabled');
86
+ }
87
+
88
+ /* Recomended Content */
89
+ public function getRecomendedEnabled(){
90
+
91
+ return Mage::getStoreConfig('smart_layers/recommended/enabled');
92
+ }
93
+
94
+ public function getRecomendedHeader(){
95
+
96
+ return Mage::getStoreConfig('smart_layers/recommended/recommended_header');
97
+ }
98
+
99
+ /*Custom Code*/
100
+ public function getCustomCodeEnabled(){
101
+
102
+ return Mage::getStoreConfig('smart_layers/custom_code/enabled');
103
+ }
104
+
105
+ public function getCustomCode(){
106
+
107
+ return Mage::getStoreConfig('smart_layers/custom_code/content');
108
+ }
109
+ }
app/code/community/AddThis/SmartLayers/Helper/Data.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (C) 2012 Clearspring Technologies, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ ?>
18
+ <?php
19
+
20
+ class AddThis_SmartLayers_Helper_Data extends Mage_Core_Helper_Abstract
21
+ {
22
+
23
+ }
app/code/community/AddThis/SmartLayers/Model/Observer.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (C) 2012 Clearspring Technologies, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ ?>
18
+ <?php
19
+
20
+ class AddThis_SmartLayers_Model_Observer
21
+ {
22
+ public function addButtonsHtml($observer)
23
+ {
24
+ $block = $observer->getBlock();
25
+ $transport = $observer->getTransport();
26
+
27
+ if ($block->getNameInLayout()=='product_review_list.count') {
28
+
29
+ $plugin_enabled = Mage::getStoreConfig('sharing_tool/general/enabled');
30
+
31
+ if($plugin_enabled!=0){
32
+ $html = $transport->getHtml();
33
+ $buttons = Mage::app()->getLayout()->createBlock('sharingtool/share', 'addthis', array('template'=>'addthis/sharingtool/share.phtml'));
34
+ $html .= $buttons->toHtml();
35
+ $transport->setHtml($html);
36
+ }
37
+ }
38
+ }
39
+ }
app/code/community/AddThis/SmartLayers/Model/Source/Sharebuttoncount.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (C) 2012 Clearspring Technologies, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ ?>
18
+ <?php
19
+ class AddThis_SmartLayers_Model_Source_Sharebuttoncount
20
+ {
21
+
22
+ public function toOptionArray()
23
+ {
24
+ return array(
25
+ array('value' => 1, 'label'=>'1'),
26
+ array('value' => 2, 'label'=>'2'),
27
+ array('value' => 3, 'label'=>'3'),
28
+ array('value' => 4, 'label'=>'4'),
29
+ array('value' => 5, 'label'=>'5'),
30
+ array('value' => 6, 'label'=>'6'),
31
+ );
32
+ }
33
+
34
+ }
app/code/community/AddThis/SmartLayers/Model/Source/Shareposition.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (C) 2012 Clearspring Technologies, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ ?>
18
+ <?php
19
+ class AddThis_SmartLayers_Model_Source_Shareposition
20
+ {
21
+
22
+ public function toOptionArray()
23
+ {
24
+ return array(
25
+ array('value' => 'left', 'label'=>'Left'),
26
+ array('value' => 'right', 'label'=>'Right'),
27
+ );
28
+ }
29
+
30
+ }
app/code/community/AddThis/SmartLayers/Model/Source/Theme.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (C) 2012 Clearspring Technologies, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ ?>
18
+ <?php
19
+ class AddThis_SmartLayers_Model_Source_Theme
20
+ {
21
+
22
+ public function toOptionArray()
23
+ {
24
+ return array(
25
+ array('value' => 'transparent', 'label'=>'Transparent'),
26
+ array('value' => 'light', 'label'=>'Light'),
27
+ array('value' => 'gray', 'label'=>'Gray'),
28
+ array('value' => 'dark', 'label'=>'Dark'),
29
+ );
30
+ }
31
+
32
+ }
app/code/community/AddThis/SmartLayers/etc/config.xml ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <AddThis_SmartLayers>
5
+ <version>2.0.0</version>
6
+ </AddThis_SmartLayers>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <smartlayers>
11
+ <class>AddThis_SmartLayers_Helper</class>
12
+ </smartlayers>
13
+ </helpers>
14
+ <blocks>
15
+ <smartlayers>
16
+ <class>AddThis_SmartLayers_Block</class>
17
+ </smartlayers>
18
+ </blocks>
19
+ <models>
20
+ <smartlayers>
21
+ <class>AddThis_SmartLayers_Model</class>
22
+ </smartlayers>
23
+ </models>
24
+ <resources>
25
+ <smartlayers_setup>
26
+ <setup>
27
+ <module>AddThis_SmartLayers</module>
28
+ </setup>
29
+ <connection>
30
+ <use>core_setup</use>
31
+ </connection>
32
+ </smartlayers_setup>
33
+ <smartlayers_write>
34
+ <connection>
35
+ <use>core_write</use>
36
+ </connection>
37
+ </smartlayers_write>
38
+ <smartlayers_read>
39
+ <connection>
40
+ <use>core_read</use>
41
+ </connection>
42
+ </smartlayers_read>
43
+ </resources>
44
+ </global>
45
+ <default>
46
+ <smart_layers>
47
+ <general>
48
+ <enabled>1</enabled>
49
+ </general>
50
+ <follow>
51
+ <facebook>YOUR-PROFILE-ID</facebook>
52
+ <twitter>YOUR-PROFILE-ID</twitter>
53
+ </follow>
54
+ <share>
55
+ <enabled>1</enabled>
56
+ <share_button_count>5</share_button_count>
57
+ </share>
58
+ <whatsnext>
59
+ <enabled>1</enabled>
60
+ </whatsnext>
61
+ <recommended>
62
+ <enabled>1</enabled>
63
+ <recommended_header>Recommended for you:</recommended_header>
64
+ </recommended>
65
+ <custom_code>
66
+ <enabled>0</enabled>
67
+ <content>addthis.layers({
68
+ 'theme' : 'transparent',
69
+ 'share' : {
70
+ 'position' : 'left',
71
+ 'numPreferredServices' : 5
72
+ },
73
+ 'whatsnext' : {},
74
+ 'recommended' : {}
75
+ });</content>
76
+ </custom_code>
77
+ </smart_layers>
78
+ </default>
79
+ <frontend>
80
+ <layout>
81
+ <updates>
82
+ <smartlayers>
83
+ <file>smartlayers.xml</file>
84
+ </smartlayers>
85
+ </updates>
86
+ </layout>
87
+ <events>
88
+ <core_block_abstract_to_html_after>
89
+ <observers>
90
+ <smartlayers>
91
+ <type>singleton</type>
92
+ <class>smartlayers/observer</class>
93
+ <method>addButtonsHtml</method>
94
+ </smartlayers>
95
+ </observers>
96
+ </core_block_abstract_to_html_after>
97
+ </events>
98
+ </frontend>
99
+ <adminhtml>
100
+ <acl>
101
+ <resources>
102
+ <all>
103
+ <title>Allow Everything</title>
104
+ </all>
105
+ <admin>
106
+ <children>
107
+ <system>
108
+ <children>
109
+ <config>
110
+ <children>
111
+ <smart_layers translate="title" module="smartlayers">
112
+ <title>AddThis</title>
113
+ <sort_order>52</sort_order>
114
+ </smart_layers>
115
+ </children>
116
+ </config>
117
+ </children>
118
+ </system>
119
+ </children>
120
+ </admin>
121
+ </resources>
122
+ </acl>
123
+ </adminhtml>
124
+ </config>
app/code/community/AddThis/SmartLayers/etc/system.xml ADDED
@@ -0,0 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <add_this translate="label" module="smartlayers">
5
+ <label>AddThis</label>
6
+ <sort_order>100</sort_order>
7
+ </add_this>
8
+ </tabs>
9
+ <sections>
10
+ <smart_layers translate="label" module="smartlayers">
11
+ <label>Smart Layers</label>
12
+ <tab>add_this</tab>
13
+ <sort_order>20</sort_order>
14
+ <show_in_default>1</show_in_default>
15
+ <show_in_website>1</show_in_website>
16
+ <show_in_store>1</show_in_store>
17
+ <groups>
18
+ <general translate="label" module="smartlayers">
19
+ <label>General</label>
20
+ <sort_order>100</sort_order>
21
+ <show_in_default>1</show_in_default>
22
+ <show_in_website>1</show_in_website>
23
+ <show_in_store>1</show_in_store>
24
+ <expanded>1</expanded>
25
+ <fields>
26
+ <enabled translate="label">
27
+ <label>Status</label>
28
+ <frontend_type>select</frontend_type>
29
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
30
+ <sort_order>10</sort_order>
31
+ <show_in_default>1</show_in_default>
32
+ <show_in_website>1</show_in_website>
33
+ <show_in_store>1</show_in_store>
34
+ </enabled>
35
+ <theme translate="label">
36
+ <label>Theme</label>
37
+ <frontend_type>select</frontend_type>
38
+ <source_model>smartlayers/source_theme</source_model>
39
+ <sort_order>20</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
+ </theme>
44
+ </fields>
45
+ </general>
46
+ <follow>
47
+ <label>Follow</label>
48
+ <comment><![CDATA[<small>Get more fans and followers for your social media profiles on Facebook, Twitter, and other popular social networks. Complete your profile URLs below to enable Follow buttons for those services. You must complete at least one URL for the Follow Layer to appear.</small>]]></comment>
49
+ <sort_order>200</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>1</show_in_website>
52
+ <show_in_store>1</show_in_store>
53
+ <fields>
54
+ <facebook translate="label">
55
+ <label>facebook.com/</label>
56
+ <frontend_type>text</frontend_type>
57
+ <sort_order>10</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
+ <!-- <comment><![CDATA[Go to http://facebook.com. Click your profile icon. Then copy the string of letters and/or numbers after 'facebook.com/' in the URL. It will look like: 'https://facebook.com/greg.franko.10']]></comment> -->
62
+ </facebook>
63
+ <twitter translate="label">
64
+ <label>twitter.com/</label>
65
+ <frontend_type>text</frontend_type>
66
+ <sort_order>20</sort_order>
67
+ <show_in_default>1</show_in_default>
68
+ <show_in_website>1</show_in_website>
69
+ <show_in_store>1</show_in_store>
70
+ <!-- <comment><![CDATA[Go to http://twitter.com. Click the 'Me' tab. Then copy the string of letters and/or numbers after 'twitter.com/' in the URL. It will look like: 'https://twitter.com/GregFranko']]></comment> -->
71
+ </twitter>
72
+ <linkedin translate="label">
73
+ <label>linkedin.com/in/</label>
74
+ <frontend_type>text</frontend_type>
75
+ <sort_order>30</sort_order>
76
+ <show_in_default>1</show_in_default>
77
+ <show_in_website>1</show_in_website>
78
+ <show_in_store>1</show_in_store>
79
+ </linkedin>
80
+ <linkedin_comp translate="label">
81
+ <label>linkedin.com/company/</label>
82
+ <frontend_type>text</frontend_type>
83
+ <sort_order>40</sort_order>
84
+ <show_in_default>1</show_in_default>
85
+ <show_in_website>1</show_in_website>
86
+ <show_in_store>1</show_in_store>
87
+ </linkedin_comp>
88
+ <google translate="label">
89
+ <label>plus.google.com/</label>
90
+ <frontend_type>text</frontend_type>
91
+ <sort_order>50</sort_order>
92
+ <show_in_default>1</show_in_default>
93
+ <show_in_website>1</show_in_website>
94
+ <show_in_store>1</show_in_store>
95
+ </google>
96
+ <youtube translate="label">
97
+ <label>youtube.com/user/</label>
98
+ <frontend_type>text</frontend_type>
99
+ <sort_order>60</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <show_in_website>1</show_in_website>
102
+ <show_in_store>1</show_in_store>
103
+ </youtube>
104
+ <flickr translate="label">
105
+ <label>flickr.com/photos/</label>
106
+ <frontend_type>text</frontend_type>
107
+ <sort_order>70</sort_order>
108
+ <show_in_default>1</show_in_default>
109
+ <show_in_website>1</show_in_website>
110
+ <show_in_store>1</show_in_store>
111
+ </flickr>
112
+ <vimeo translate="label">
113
+ <label>vimeo.com/</label>
114
+ <frontend_type>text</frontend_type>
115
+ <sort_order>80</sort_order>
116
+ <show_in_default>1</show_in_default>
117
+ <show_in_website>1</show_in_website>
118
+ <show_in_store>1</show_in_store>
119
+ </vimeo>
120
+ <pinterest translate="label">
121
+ <label>pinterest.com/</label>
122
+ <frontend_type>text</frontend_type>
123
+ <sort_order>90</sort_order>
124
+ <show_in_default>1</show_in_default>
125
+ <show_in_website>1</show_in_website>
126
+ <show_in_store>1</show_in_store>
127
+ </pinterest>
128
+ <instagram translate="label">
129
+ <label>instagram.com/</label>
130
+ <frontend_type>text</frontend_type>
131
+ <sort_order>100</sort_order>
132
+ <show_in_default>1</show_in_default>
133
+ <show_in_website>1</show_in_website>
134
+ <show_in_store>1</show_in_store>
135
+ </instagram>
136
+ <foursquare translate="label">
137
+ <label>foursquare.com/</label>
138
+ <frontend_type>text</frontend_type>
139
+ <sort_order>110</sort_order>
140
+ <show_in_default>1</show_in_default>
141
+ <show_in_website>1</show_in_website>
142
+ <show_in_store>1</show_in_store>
143
+ </foursquare>
144
+ <tumblr translate="label">
145
+ <label>?.tumblr.com</label>
146
+ <frontend_type>text</frontend_type>
147
+ <sort_order>120</sort_order>
148
+ <show_in_default>1</show_in_default>
149
+ <show_in_website>1</show_in_website>
150
+ <show_in_store>1</show_in_store>
151
+ </tumblr>
152
+ <rss translate="label">
153
+ <label>RSS feed URL http://</label>
154
+ <frontend_type>text</frontend_type>
155
+ <sort_order>130</sort_order>
156
+ <show_in_default>1</show_in_default>
157
+ <show_in_website>1</show_in_website>
158
+ <show_in_store>1</show_in_store>
159
+ </rss>
160
+ </fields>
161
+ </follow>
162
+ <share>
163
+ <label>Share</label>
164
+ <comment><![CDATA[<small>Increase traffic and engagement with automatically personalized sharing buttons for Facebook, Twitter, Google + and more.</small>]]></comment>
165
+ <sort_order>300</sort_order>
166
+ <show_in_default>1</show_in_default>
167
+ <show_in_website>1</show_in_website>
168
+ <show_in_store>1</show_in_store>
169
+ <fields>
170
+ <enabled translate="label">
171
+ <label>Status</label>
172
+ <frontend_type>select</frontend_type>
173
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
174
+ <sort_order>10</sort_order>
175
+ <show_in_default>1</show_in_default>
176
+ <show_in_website>1</show_in_website>
177
+ <show_in_store>1</show_in_store>
178
+ </enabled>
179
+ <share_button_position translate="label">
180
+ <label>Share Button Position</label>
181
+ <frontend_type>select</frontend_type>
182
+ <source_model>smartlayers/source_shareposition</source_model>
183
+ <sort_order>20</sort_order>
184
+ <show_in_default>1</show_in_default>
185
+ <show_in_website>1</show_in_website>
186
+ <show_in_store>1</show_in_store>
187
+ </share_button_position>
188
+ <share_button_count translate="label">
189
+ <label>Button Count</label>
190
+ <frontend_type>select</frontend_type>
191
+ <source_model>smartlayers/source_sharebuttoncount</source_model>
192
+ <sort_order>30</sort_order>
193
+ <show_in_default>1</show_in_default>
194
+ <show_in_website>1</show_in_website>
195
+ <show_in_store>1</show_in_store>
196
+ </share_button_count>
197
+ </fields>
198
+ </share>
199
+ <whatsnext>
200
+ <label>What's Next</label>
201
+ <comment><![CDATA[<small>When a desktop visitor scrolls down the page, a box will appear and suggest new content, sharing, or following your brand.</small>]]></comment>
202
+
203
+ <sort_order>400</sort_order>
204
+ <show_in_default>1</show_in_default>
205
+ <show_in_website>1</show_in_website>
206
+ <show_in_store>1</show_in_store>
207
+ <fields>
208
+ <enabled translate="label">
209
+ <label>Status</label>
210
+ <frontend_type>select</frontend_type>
211
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
212
+ <sort_order>10</sort_order>
213
+ <show_in_default>1</show_in_default>
214
+ <show_in_website>1</show_in_website>
215
+ <show_in_store>1</show_in_store>
216
+ </enabled>
217
+ </fields>
218
+ </whatsnext>
219
+ <recommended>
220
+ <label>Recommended Content</label>
221
+ <comment><![CDATA[<small>Boost traffic recirculation by promoting your site's more popular trending content.</small>]]></comment>
222
+ <sort_order>500</sort_order>
223
+ <show_in_default>1</show_in_default>
224
+ <show_in_website>1</show_in_website>
225
+ <show_in_store>1</show_in_store>
226
+ <fields>
227
+ <enabled translate="label">
228
+ <label>Status</label>
229
+ <frontend_type>select</frontend_type>
230
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
231
+ <sort_order>10</sort_order>
232
+ <show_in_default>1</show_in_default>
233
+ <show_in_website>1</show_in_website>
234
+ <show_in_store>1</show_in_store>
235
+ </enabled>
236
+ <recommended_header translate="label">
237
+ <label>Header</label>
238
+ <frontend_type>text</frontend_type>
239
+ <sort_order>20</sort_order>
240
+ <show_in_default>1</show_in_default>
241
+ <show_in_website>1</show_in_website>
242
+ <show_in_store>1</show_in_store>
243
+ </recommended_header>
244
+ </fields>
245
+ </recommended>
246
+ <custom_code>
247
+ <label>Custom Code</label>
248
+ <comment><![CDATA[<small>IMPORTANT: If you enable Custom Code all of the options above will be ignored.</small>]]></comment>
249
+ <sort_order>600</sort_order>
250
+ <show_in_default>1</show_in_default>
251
+ <show_in_website>1</show_in_website>
252
+ <show_in_store>1</show_in_store>
253
+ <fields>
254
+ <enabled translate="label">
255
+ <label>Status</label>
256
+ <frontend_type>select</frontend_type>
257
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
258
+ <sort_order>10</sort_order>
259
+ <show_in_default>1</show_in_default>
260
+ <show_in_website>1</show_in_website>
261
+ <show_in_store>1</show_in_store>
262
+ </enabled>
263
+ <content translate="label">
264
+ <label>Custom Code</label>
265
+ <frontend_type>textarea</frontend_type>
266
+ <sort_order>20</sort_order>
267
+ <show_in_default>1</show_in_default>
268
+ <show_in_website>1</show_in_website>
269
+ <show_in_store>1</show_in_store>
270
+ <comment><![CDATA[Want to customize? Use our <a href="http://support.addthis.com/customer/portal/articles/1200473-smart-layers-api" target="_blank">API</a>]]></comment>
271
+ </content>
272
+ </fields>
273
+ </custom_code>
274
+ </groups>
275
+ </smart_layers>
276
+ </sections>
277
+ </config>
app/design/frontend/default/default/layout/smartlayers.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <block type="smartlayers/layer" name="addthis_smartlayers">
6
+ <action method="setTemplate"><template>addthis/smartlayers/smartlayers.phtml</template></action>
7
+ </block>
8
+ </reference>
9
+ </default>
10
+ </layout>
app/design/frontend/default/default/template/addthis/sharingtool/share.phtml CHANGED
@@ -19,7 +19,8 @@
19
  /**General Options*/
20
  $plugin_enabled = $this->getPluginEnabledStatus();
21
  $pubid = $this->getPubId();
22
- $menu_version = 300;
 
23
 
24
  /**Custom Share*/
25
  $custom_url = $this->getCustomUrl();
@@ -63,15 +64,14 @@
63
  <!-- AddThis Button BEGIN -->
64
 
65
  <!-- AddThis API Config -->
66
-
67
  <script type='text/javascript'>
68
- var addthis_product = 'mag-1.0.1';
69
  var addthis_config = {
70
  <?php
71
  if($pubid):
72
  echo "pubid : '".$pubid."'\n";
73
  else:
74
- echo "pubid : 'unknown'\n";
75
  endif;
76
  if($services_exclude):
77
  echo ", services_exclude : '".$services_exclude."'\n";
@@ -100,15 +100,6 @@ var addthis_config = {
100
  if($ui_language != 'auto'):
101
  echo ", ui_language : '".$ui_language."'\n";
102
  endif;
103
- if($ui_offset_top):
104
- echo ", ui_offset_top : ".$ui_offset_top."\n";
105
- endif;
106
- if($ui_offset_left):
107
- echo ", ui_offset_left : ".$ui_offset_left."\n";
108
- endif;
109
- if($ui_use_css == 0):
110
- echo ", ui_use_css : false \n";
111
- endif;
112
  if($data_track_clickback == 0):
113
  echo ", data_track_clickback : false \n";
114
  endif;
@@ -119,7 +110,6 @@ var addthis_config = {
119
  echo ", data_ga_tracker : '".$data_ga_tracker."'\n";
120
  endif;
121
  ?>
122
-
123
  }
124
  </script>
125
  <!-- AddThis API Config END -->
@@ -209,11 +199,25 @@ var addthis_config = {
209
  <a class="addthis_button_preferred_4"></a>
210
  <a class="addthis_button_compact"></a>
211
  <a class="addthis_counter addthis_bubble_style"></a>
212
- </div>
213
  <?php
214
  }//switch ends
215
  ?>
216
- <script type="text/javascript" src="https://s7.addthis.com/js/<?php echo $menu_version;?>/addthis_widget.js"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  <!-- AddThis Button END -->
218
  <?php
219
  endif; //if plugin not enabled
19
  /**General Options*/
20
  $plugin_enabled = $this->getPluginEnabledStatus();
21
  $pubid = $this->getPubId();
22
+ if(!$pubid)
23
+ $pubid = "xa-525fbbd6215b4f1a";
24
 
25
  /**Custom Share*/
26
  $custom_url = $this->getCustomUrl();
64
  <!-- AddThis Button BEGIN -->
65
 
66
  <!-- AddThis API Config -->
 
67
  <script type='text/javascript'>
68
+ var addthis_product = 'mag-sp-2.0.0';
69
  var addthis_config = {
70
  <?php
71
  if($pubid):
72
  echo "pubid : '".$pubid."'\n";
73
  else:
74
+ echo "pubid : 'xa-525fbbd6215b4f1a'\n";
75
  endif;
76
  if($services_exclude):
77
  echo ", services_exclude : '".$services_exclude."'\n";
100
  if($ui_language != 'auto'):
101
  echo ", ui_language : '".$ui_language."'\n";
102
  endif;
 
 
 
 
 
 
 
 
 
103
  if($data_track_clickback == 0):
104
  echo ", data_track_clickback : false \n";
105
  endif;
110
  echo ", data_ga_tracker : '".$data_ga_tracker."'\n";
111
  endif;
112
  ?>
 
113
  }
114
  </script>
115
  <!-- AddThis API Config END -->
199
  <a class="addthis_button_preferred_4"></a>
200
  <a class="addthis_button_compact"></a>
201
  <a class="addthis_counter addthis_bubble_style"></a>
202
+ </div>
203
  <?php
204
  }//switch ends
205
  ?>
206
+
207
+ <script>
208
+ var ats_widget = function(){
209
+ if(typeof addthis_conf == 'undefined'){
210
+ var at_script = document.createElement('script');
211
+ at_script.src = '//s7.addthis.com/js/300/addthis_widget.js#pubid=<?php echo urlencode($pubid) ?>';
212
+ document.getElementsByTagName('head')[0].appendChild(at_script);
213
+ var addthis_product = 'mag-sp-2.0.0';
214
+ }
215
+ };
216
+ if(window.addEventListener)
217
+ window.addEventListener('load',ats_widget);
218
+ else
219
+ window.attachEvent('onload',ats_widget);
220
+ </script>
221
  <!-- AddThis Button END -->
222
  <?php
223
  endif; //if plugin not enabled
app/design/frontend/default/default/template/addthis/smartlayers/smartlayers.phtml ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (C) 2012 Clearspring Technologies, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ ?>
18
+ <?php
19
+
20
+ /**General Options*/
21
+ $plugin_enabled = $this->getPluginEnabledStatus();
22
+
23
+ $pubid = $this->getPubId();
24
+ if(!$pubid)
25
+ $pubid = "xa-525fbbd6215b4f1a";
26
+
27
+ $theme = $this->getTheme();
28
+
29
+ /**Follow*/
30
+ $follow_services = $this->getFollow();
31
+
32
+ /**Share*/
33
+ $share_enabled = $this->getShareEnabled();
34
+ $share_position = $this->getShareButtonPosition();
35
+ $share_count = $this->getShareButtonCount();
36
+
37
+ /**What's Next*/
38
+ $whatsnext_enabled = $this->getWhatsNextEnabled();
39
+
40
+ /**Recomended Content*/
41
+ $recomended_enabled = $this->getRecomendedEnabled();
42
+ $recomended_header = $this->getRecomendedHeader();
43
+
44
+ /**Custom Code*/
45
+ $custom_code_enabled = $this->getCustomCodeEnabled();
46
+ $custom_code_content = $this->getCustomCode();
47
+
48
+ if($plugin_enabled !=0 ){
49
+ $atslScript = "<!-- AddThis Smart Layers BEGIN -->" . PHP_EOL;
50
+ $atslScript .= "<script type='text/javascript' src='https://s7.addthis.com/js/300/addthis_widget.js#pubid=".urlencode($pubid)."'></script>". PHP_EOL;
51
+
52
+ $atslScript .= "<script type='text/javascript'>". PHP_EOL;
53
+ $atslScript .= "\tvar addthis_product='mag-sp-2.0.0';". PHP_EOL;
54
+ if($custom_code_enabled == 1 && $custom_code_content != ""){
55
+ $atslScript .= $custom_code_content;
56
+ } else {
57
+ $atslScript .= "\taddthis.layers({". PHP_EOL;
58
+ $atslScript .= "\t\t'theme' : '".$theme."'". PHP_EOL;
59
+ if($share_enabled != 0){
60
+ $atslScript .= "\t\t,'share' : {\n\t\t\t'position' : '".$share_position."',\n\t\t\t'numPreferredServices' : ".$share_count."\n\t\t}". PHP_EOL;
61
+ }
62
+ if(strlen(implode($follow_services)) != 0) {
63
+
64
+ $atslScript .= "\t\t,'follow' : {";
65
+ $atslScript .= "\n\t\t\t'services' : [";
66
+
67
+ foreach($follow_services as $services => $service) {
68
+
69
+ if($follow_services[$services] != "" && $follow_services[$services] != "YOUR-PROFILE-ID") {
70
+ if($services == "linkedin_comp")
71
+ $atslScript .= "\n\t\t\t\t{'service': 'linkedin', 'id': '".$follow_services[$services]."', 'usertype':'company'},";
72
+ else
73
+ $atslScript .= "\n\t\t\t\t{'service': '".$services."', 'id': '".$follow_services[$services]."'},";
74
+ }
75
+ }
76
+ $atslScript .= "\n\t\t\t]";
77
+ $atslScript .= "\n\t\t}". PHP_EOL;
78
+ }
79
+ if($whatsnext_enabled != 0) {
80
+ $atslScript .= "\t\t,'whatsnext' : {}". PHP_EOL;
81
+ }
82
+
83
+ if($recomended_enabled != 0) {
84
+ $atslScript .= "\t\t,'recommended' : {\n\t\t\t'title': '".$recomended_header."'\n\t\t}". PHP_EOL;
85
+ }
86
+ $atslScript .= "\t});". PHP_EOL;
87
+ }
88
+ $atslScript .= "</script>". PHP_EOL;
89
+ $atslScript .= "<!-- AddThis Smart Layers ENDS -->" . PHP_EOL;
90
+ $atslScript .= "<style>.at-share-close-control .at4-arrow {float: right !important;}</style>" . PHP_EOL;
91
+
92
+ echo $atslScript;
93
+
94
+ }//if plugin is enabled
95
+ ?>
app/etc/modules/AddThis_SharingTool.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <config>
3
- <modules>
4
- <AddThis_SharingTool>
5
- <active>true</active>
6
- <codePool>community</codePool>
7
- </AddThis_SharingTool>
8
- </modules>
9
- </config>
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,19 +1,20 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>addthis_sharingtool</name>
4
- <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.apache.org/licenses/LICENSE-2.0">Apache</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>AddThis Sharing Tool</summary>
10
- <description>AddThis helps users to share your product and drive viral traffic.</description>
11
- <notes>Fixed SSL compatibility errors&#xD;
12
- Fixed issue with Bundle products</notes>
13
- <authors><author><name>AddThis</name><user>AddThisTeam</user><email>plugins@addthis.com</email></author></authors>
14
- <date>2013-04-16</date>
15
- <time>07:20:06</time>
16
- <contents><target name="magecommunity"><dir name="AddThis"><dir name="SharingTool"><dir name="Block"><file name="Share.php" hash="826c73cf37d6b60cc973fc0e3f9f1625"/></dir><dir name="Helper"><file name="Data.php" hash="d78c69dd706b97e39ef4c856c3c9d938"/></dir><dir name="Model"><file name="Observer.php" hash="5c9b5d0935bfbe2bddda81be9bfbee77"/><dir name="Source"><file name="Buttons.php" hash="36747ed838586886dd8d7c5412db6183"/><file name="Languages.php" hash="c2527e95cfc81de57230fc41413da30e"/><file name="Menuhover.php" hash="403712eca479672709c8d400c3e8fb71"/><file name="Menuversions.php" hash="7c68a011a001b44f202f5774c32880ba"/><file name="Uihover.php" hash="619d9e5d96f15da367af4096ab448f5a"/></dir></dir><dir name="etc"><file name="config.xml" hash="eb698194f5a047a2fbbf38a382640a79"/><file name="system.xml" hash="bdad69dd1ecf5e79b480a74f44064778"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="addthis"><dir name="sharingtool"><file name="share.phtml" hash="05f831833fe7ae703cb40268cf20430e"/></dir></dir></dir><dir name="layout"><file name="sharingtool.xml" hash="c3408376e653249f8c26c64a65190877"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="AddThis_SharingTool.xml" hash="40c4518a253bec346ad54824bdfef229"/></dir></target></contents>
 
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>addthis_sharingtool</name>
4
+ <version>2.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.apache.org/licenses/LICENSE-2.0">Apache</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>AddThis makes it easy for any visitor to share your content to over 350 services. Developed by AddThis.</summary>
10
+ <description>Get more traffic back to your site by installing the AddThis Magento Extension! With AddThis, your users can promote your content by sharing to 350 of the most popular social networking and bookmarking sites (like Facebook, Twitter, Google +1, Pinterest and LinkedIn). AddThis is used on over 12 million domains, seen by over 1.2 billion users a month, quick to load and recognized all over the web. Optionally, sign up for a free AddThis.com account to see how your visitors are sharing your content: which services they're using for sharing (including their browser address bar), which content is shared the most, what text of interest they're copying from your site, and more. Analytics are available in real time. Developed in-house by AddThis.com.&#xD;
11
+ Now we have also incorporated SmartLayers in this extension to make your site smarter. Increase traffic, engagement and revenue by instantly showing the right social tools and content to every visitor. It's one piece of code, mobile-ready and free! </description>
12
+ <notes>* Implemented SmartLayers&#xD;
13
+ * Added new section for managing Profile ID</notes>
14
+ <authors><author><name>AddThis</name><user>plugins_addthis</user><email>plugins@addthis.com</email></author></authors>
15
+ <date>2013-11-11</date>
16
+ <time>13:28:46</time>
17
+ <contents><target name="mageetc"><dir name="modules"><file name="AddThis.xml" hash=""/></dir></target><target name="magecommunity"><dir name="AddThis"><dir name="PluginsGeneral"><dir name="Helper"><file name="Data.php" hash="c2229d706cafec9f49fd9c88f1b73759"/></dir><dir name="etc"><file name="config.xml" hash="ca1d70a29a38afaf09b9bc8641fad6c5"/><file name="system.xml" hash="1912ba67e3b0847ff479aa0006dd0a68"/></dir></dir><dir name="SharingTool"><dir name="Block"><file name="Share.php" hash="010ceb12934ef3ae39b348495f29c966"/></dir><dir name="Helper"><file name="Data.php" hash="d78c69dd706b97e39ef4c856c3c9d938"/></dir><dir name="Model"><file name="Observer.php" hash="9a322fef544361af90a8cf5d944f67ac"/><dir name="Source"><file name="Buttons.php" hash="36747ed838586886dd8d7c5412db6183"/><file name="Languages.php" hash="c2527e95cfc81de57230fc41413da30e"/><file name="Menuhover.php" hash="403712eca479672709c8d400c3e8fb71"/><file name="Menuversions.php" hash="7c68a011a001b44f202f5774c32880ba"/><file name="Uihover.php" hash="619d9e5d96f15da367af4096ab448f5a"/></dir></dir><dir name="etc"><file name="config.xml" hash="80f2ff34d6ebf3c405cc4a2940a4f4d5"/><file name="system.xml" hash="4a91cc8f41a1fca85269f9aad31c77de"/></dir></dir><dir name="SmartLayers"><dir name="Block"><file name="Layer.php" hash="ff9c97fee5c9d729da2a251a776f1cc6"/></dir><dir name="Helper"><file name="Data.php" hash="5e7c2293a8b4211614284c73bd67b982"/></dir><dir name="Model"><file name="Observer.php" hash="77a1a1a8b90401f70b0a7f3cd7b44c3a"/><dir name="Source"><file name="Sharebuttoncount.php" hash="bc069484c899b8a6d7ce7aa2ac190825"/><file name="Shareposition.php" hash="5423eb0a41d7ffa37ddc7731527f1787"/><file name="Theme.php" hash="7dbedb75131d4f2166a5f967c607b877"/></dir></dir><dir name="etc"><file name="config.xml" hash="17e5a548f23efced439da3707cd7a578"/><file name="system.xml" hash="84ea3c15dfccedb192688dd8936d2fab"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="smartlayers.xml" hash="d7446606b33be1dc05f26ee960615044"/><file name="sharingtool.xml" hash="c3408376e653249f8c26c64a65190877"/></dir><dir name="template"><dir name="addthis"><dir name="sharingtool"><file name="share.phtml" hash="9bb3dda42fae0b71b366d0eaa33fb1c7"/></dir><dir name="smartlayers"><file name="smartlayers.phtml" hash="b743cd2866a700b6c4ec6e96969389eb"/></dir></dir></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>