Social_Facebook - Version 1.4.0.0

Version Notes

Facebook Open Graph 2.0 extension is compatible with Magento Enterprise Edition and Professional Edition 1.9.0.0 or later, and Magento Community Edition 1.4.0.0 or later.

Download this release

Release Info

Developer Magento Core Team
Extension Social_Facebook
Version 1.4.0.0
Comparing to
See all releases


Code changes from version 1.5.0.0 to 1.4.0.0

app/code/community/Social/Facebook/Block/Action.php CHANGED
@@ -14,8 +14,8 @@
14
  *
15
  * @category Social
16
  * @package Social_Facebook
17
- * @copyright Copyright (c) 2009 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
18
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
21
  class Social_Facebook_Block_Action extends Mage_Core_Block_Template
@@ -52,7 +52,7 @@ class Social_Facebook_Block_Action extends Mage_Core_Block_Template
52
  'facebook/index/redirect/',
53
  array(
54
  'productId' => $this->getProductId(),
55
- 'action' => $this->escapeHtml($action),
56
  ));
57
  }
58
  }
14
  *
15
  * @category Social
16
  * @package Social_Facebook
17
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
18
+ * @license http://www.magentocommerce.com/license/enterprise-edition
19
  */
20
 
21
  class Social_Facebook_Block_Action extends Mage_Core_Block_Template
52
  'facebook/index/redirect/',
53
  array(
54
  'productId' => $this->getProductId(),
55
+ 'action' => $this->htmlEscape($action),
56
  ));
57
  }
58
  }
app/code/community/Social/Facebook/Block/Adminhtml/Facebuttons.php CHANGED
@@ -12,12 +12,25 @@
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
- * @category Social
16
- * @package Social_Facebook
17
- * @copyright Copyright (c) 2009 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
 
 
 
 
 
 
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
 
 
 
 
 
 
 
21
  class Social_Facebook_Block_Adminhtml_Facebuttons extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
22
  {
23
  /**
@@ -25,6 +38,20 @@ class Social_Facebook_Block_Adminhtml_Facebuttons extends Mage_Adminhtml_Block_S
25
  */
26
  protected $_selectRenderer;
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  /**
29
  * Retrieve checkbox column renderer
30
  *
@@ -69,6 +96,23 @@ class Social_Facebook_Block_Adminhtml_Facebuttons extends Mage_Adminhtml_Block_S
69
  $this->_addButtonLabel = Mage::helper('social_facebook')->__('Add Action Button');
70
  }
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  /**
73
  * Prepare existing row data object
74
  *
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
 
27
+ /**
28
+ * Adminhtml system config array field renderer
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
  class Social_Facebook_Block_Adminhtml_Facebuttons extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
35
  {
36
  /**
38
  */
39
  protected $_selectRenderer;
40
 
41
+ /**
42
+ * Check if columns are defined, set template
43
+ *
44
+ */
45
+ public function __construct()
46
+ {
47
+ if (!$this->_addButtonLabel) {
48
+ $this->_addButtonLabel = Mage::helper('adminhtml')->__('Add');
49
+ }
50
+ if (!$this->getTemplate()) {
51
+ $this->setTemplate('system/config/form/field/array.phtml');
52
+ }
53
+ }
54
+
55
  /**
56
  * Retrieve checkbox column renderer
57
  *
96
  $this->_addButtonLabel = Mage::helper('social_facebook')->__('Add Action Button');
97
  }
98
 
99
+ /**
100
+ * Render block HTML
101
+ *
102
+ * @return string
103
+ */
104
+ protected function _toHtml()
105
+ {
106
+ if (!$this->_isPreparedToRender) {
107
+ $this->_prepareToRender();
108
+ $this->_isPreparedToRender = true;
109
+ }
110
+ if (empty($this->_columns)) {
111
+ throw new Exception('At least one column must be defined.');
112
+ }
113
+ return parent::_toHtml();
114
+ }
115
+
116
  /**
117
  * Prepare existing row data object
118
  *
app/code/community/Social/Facebook/Block/Adminhtml/Select.php CHANGED
@@ -12,12 +12,25 @@
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
- * @category Social
16
- * @package Social_Facebook
17
- * @copyright Copyright (c) 2009 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
 
 
 
 
 
 
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
 
 
 
 
 
 
 
21
  class Social_Facebook_Block_Adminhtml_Select extends Mage_Core_Block_Html_Select
22
  {
23
  protected $_options = array();
12
  * obtain it through the world-wide-web, please send an email
13
  * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
 
27
+ /**
28
+ * Adminhtml system config array field renderer
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
  class Social_Facebook_Block_Adminhtml_Select extends Mage_Core_Block_Html_Select
35
  {
36
  protected $_options = array();
app/code/community/Social/Facebook/Block/Like.php CHANGED
@@ -14,10 +14,9 @@
14
  *
15
  * @category Social
16
  * @package Social_Facebook
17
- * @copyright Copyright (c) 2009 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
18
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
-
21
  class Social_Facebook_Block_Like extends Mage_Core_Block_Template
22
  {
23
 
14
  *
15
  * @category Social
16
  * @package Social_Facebook
17
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
18
+ * @license http://www.magentocommerce.com/license/enterprise-edition
19
  */
 
20
  class Social_Facebook_Block_Like extends Mage_Core_Block_Template
21
  {
22
 
app/code/community/Social/Facebook/etc/config.xml CHANGED
@@ -28,7 +28,7 @@
28
  <config>
29
  <modules>
30
  <Social_Facebook>
31
- <version>1.5.0.1</version>
32
  </Social_Facebook>
33
  </modules>
34
  <global>
28
  <config>
29
  <modules>
30
  <Social_Facebook>
31
+ <version>1.4.0.1</version>
32
  </Social_Facebook>
33
  </modules>
34
  <global>
app/code/community/Social/Facebook/sql/social_facebook_setup/{mysql4-install-1.5.0.php → mysql4-install-1.4.0.php} RENAMED
File without changes
app/code/community/Social/Facebook/sql/social_facebook_setup/{mysql4-upgrade-1.5.0-1.5.0.1.php → mysql4-upgrade-1.4.0-1.4.0.1.php} RENAMED
File without changes
app/design/frontend/base/default/layout/facebook.xml CHANGED
@@ -29,31 +29,39 @@
29
  <!--
30
  Product view
31
  -->
32
- <catalog_product_view translate="label">
33
  <reference name="head">
34
  <action method="addCss"><stylesheet>css/facebook.css</stylesheet></action>
35
  </reference>
36
- <reference name="product.info.extrahint">
37
- <block type="social_facebook/start" name="social_facebook_start" >
38
- <block type="social_facebook/action" name="social_facebook_action" as="social_facebook_action" template="social/facebook/action.phtml" />
39
- <block type="social_facebook/box" name="social_facebook_box" as="social_facebook_box" template="social/facebook/box.phtml" />
40
- </block>
 
 
 
 
41
  </reference>
42
  </catalog_product_view>
43
 
44
- <review_product_list translate="label">
45
  <reference name="head">
46
  <action method="addCss"><stylesheet>css/facebook.css</stylesheet></action>
47
  </reference>
48
- <reference name="product.info.extrahint">
49
- <block type="social_facebook/start" name="social_facebook_start" >
50
- <block type="social_facebook/action" name="social_facebook_action" as="social_facebook_action" template="social/facebook/action.phtml" />
51
- <block type="social_facebook/box" name="social_facebook_box" as="social_facebook_box" template="social/facebook/box.phtml" />
52
- </block>
 
 
 
 
53
  </reference>
54
  </review_product_list>
55
 
56
- <facebook_index_page translate="label">
57
  <block type="social_facebook/head" name="social_facebook_head" template="social/facebook/page.phtml" />
58
  </facebook_index_page>
59
  </layout>
29
  <!--
30
  Product view
31
  -->
32
+ <catalog_product_view>
33
  <reference name="head">
34
  <action method="addCss"><stylesheet>css/facebook.css</stylesheet></action>
35
  </reference>
36
+ <reference name="content">
37
+ <reference name="product.info">
38
+ <reference name="alert.urls">
39
+ <block type="social_facebook/start" name="social_facebook_start">
40
+ <block type="social_facebook/action" name="social_facebook_action" as="social_facebook_action" template="social/facebook/action.phtml" />
41
+ <block type="social_facebook/box" name="social_facebook_box" as="social_facebook_box" template="social/facebook/box.phtml" />
42
+ </block>
43
+ </reference>
44
+ </reference>
45
  </reference>
46
  </catalog_product_view>
47
 
48
+ <review_product_list>
49
  <reference name="head">
50
  <action method="addCss"><stylesheet>css/facebook.css</stylesheet></action>
51
  </reference>
52
+ <reference name="content">
53
+ <reference name="product.info">
54
+ <reference name="alert.urls">
55
+ <block type="social_facebook/start" name="social_facebook_start" >
56
+ <block type="social_facebook/action" name="social_facebook_action" as="social_facebook_action" template="social/facebook/action.phtml" />
57
+ <block type="social_facebook/box" name="social_facebook_box" as="social_facebook_box" template="social/facebook/box.phtml" />
58
+ </block>
59
+ </reference>
60
+ </reference>
61
  </reference>
62
  </review_product_list>
63
 
64
+ <facebook_index_page>
65
  <block type="social_facebook/head" name="social_facebook_head" template="social/facebook/page.phtml" />
66
  </facebook_index_page>
67
  </layout>
app/design/frontend/base/default/template/social/facebook/box.phtml~ ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+
27
+ /** @var $this Social_Facebook_Block_Box */
28
+ $actions = $this->getAllActions();
29
+ ?>
30
+ <?php if (!empty($actions)): ?>
31
+ <?php foreach ($actions as $action): ?>
32
+ <?php if ($action['box'] == 0): ?>
33
+ <?php continue; ?>
34
+ <?php endif; ?>
35
+ <div class="facebookFriendsBox">
36
+ <div>
37
+ <?php if ($this->getCountOfUsers($action['action']) == 1): ?>
38
+ 1 user <?php echo $this->htmlEscape($action['action']) ?>s this product
39
+ <?php else: ?>
40
+ <?php echo $this->getCountOfUsers($action['action'])?> users <?php echo $this->htmlEscape($action['action']) ?> this product
41
+ <?php endif; ?>
42
+ </div>
43
+ <div style="clear:both;"></div>
44
+ <?php foreach($this->getFriendBox($action['action']) as $user): ?>
45
+ <div class="facebookUser">
46
+ <img border="0" src="http://graph.facebook.com/<?php echo $user['facebook_id']?>/picture" alt="<?php $this->htmlEscape($user['facebook_name'])?>" title="<?php $this->htmlEscape($user['facebook_name'])?>">
47
+ <span title="<?php echo $this->escapeHtml($user['facebook_name'])?>"><?php echo $this->escapeHtml($user['facebook_name'])?></span>
48
+ </div>
49
+ <?php endforeach; ?>
50
+ <div style="clear:both;"></div>
51
+ </div>
52
+ <div class="facebookZeroBox"></div>
53
+ <?php endforeach; ?>
54
+ <div style="clear:both;"></div>
55
+ <?php endif; ?>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Social_Facebook</name>
4
- <version>1.5.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Facebook Open Graph 2.0 Extension for Magento</summary>
10
  <description>Facebook Open Graph 2.0 extension provides you with possibility to add new social buttons to your store. The extension uses the brand new Facebook Open Graph 2.0 protocol and allows adding the &#x201C;Want&#x201D; and &#x201C;I own this&#x201D; Facebook buttons on your product pages.</description>
11
- <notes>Facebook Open Graph 2.0 extension is compatible with Magento Enterprise Edition and Professional Edition 1.10.0.0 or later, and Magento Community Edition 1.5.0.0 or later.</notes>
12
- <authors><author><name>Magento Core Team</name><user>core</user><email>core@magentocommerce.com</email></author></authors>
13
  <date>2011-10-19</date>
14
- <time>13:10:51</time>
15
- <contents><target name="magecommunity"><dir name="Social"><dir name="Facebook"><dir name="Block"><file name="Action.php" hash="2a195319b750004552da18e082cb8184"/><dir name="Adminhtml"><file name="Facebuttons.php" hash="d73d32ba2b900e00e9705608b203b502"/><file name="Select.php" hash="036c43ac96033cf26c32e14884b83a6b"/></dir><file name="Box.php" hash="516adc472c9bf244cc4e1bfaa9c72969"/><file name="Head.php" hash="dbb35ead2ed9b6444e552335efd678e4"/><file name="Like.php" hash="3d1eb6c1c4f0e1dafdd1f90bdf54183e"/><file name="Start.php" hash="2e61c7814dc9c7c23d34c1e8ed74c518"/></dir><dir name="Helper"><file name="Data.php" hash="4997be7dfb07b5967ddc3d783c7c3ade"/></dir><dir name="Model"><file name="Api.php" hash="52c453a2fe92e84efbbe63a3eea63d6a"/><file name="Facebook.php" hash="788881a98c74b692b75680689c52e6a5"/><file name="Facebuttons.php" hash="f15aa66ba13f5977adf09b067f0fa3d9"/><dir name="Mysql4"><dir name="Facebook"><file name="Collection.php" hash="dc4fcda1d7c351876eeca1e439ba723d"/></dir><file name="Facebook.php" hash="f15b9ae8739da03fe6ab68cac466339f"/></dir><file name="Observer.php" hash="168c3c3a9ae234f7f491bbf654e83d91"/></dir><dir name="controllers"><file name="IndexController.php" hash="da8bfd193c2cc8087bf2db946504d2b6"/></dir><dir name="etc"><file name="config.xml" hash="8bf99f25f31981531661fc6d0671d85e"/><file name="system.xml" hash="2717316adc05041cc7c9eaa36dfc6ef5"/></dir><dir name="sql"><dir name="social_facebook_setup"><file name="mysql4-install-1.5.0.php" hash="ee195ec6e7b57830ced3f3c4a2a41233"/><file name="mysql4-upgrade-1.5.0-1.5.0.1.php" hash="63a0f7a199dd72e782d1f28dbfbbadb6"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="facebook.xml" hash="27e827abf0bfb795d5a8b6db7ec48c95"/></dir><dir name="template"><dir name="social"><dir name="facebook"><file name="action.phtml" hash="9d12c6e116652f0fc5bf5b516e07b0af"/><file name="box.phtml" hash="2ca758ee05423fad428770ca47e33384"/><file name="empty.phtml" hash="9c3bd6e1a1361c0e64cac4c78426b069"/><file name="page.phtml" hash="81bef9f0829d6b5718f8aecc3dd5a88f"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Social_Facebook.xml" hash="b15af76b10945d00b8dbad23aebc0f50"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="facebook.css" hash="732ee944e67155fc9c5aabd5282dd93f"/></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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Social_Facebook</name>
4
+ <version>1.4.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Facebook Open Graph 2.0 Extension for Magento</summary>
10
  <description>Facebook Open Graph 2.0 extension provides you with possibility to add new social buttons to your store. The extension uses the brand new Facebook Open Graph 2.0 protocol and allows adding the &#x201C;Want&#x201D; and &#x201C;I own this&#x201D; Facebook buttons on your product pages.</description>
11
+ <notes>Facebook Open Graph 2.0 extension is compatible with Magento Enterprise Edition and Professional Edition 1.9.0.0 or later, and Magento Community Edition 1.4.0.0 or later.</notes>
12
+ <authors><author><name>Magento Core Team</name><user>auto-converted</user><email>core@magentocommerce.com</email></author></authors>
13
  <date>2011-10-19</date>
14
+ <time>13:10:54</time>
15
+ <contents><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="facebook.css" hash="732ee944e67155fc9c5aabd5282dd93f"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="facebook.xml" hash="f9ddf18c9f52d3fd7e0e131865a383c2"/></dir><dir name="template"><dir name="social"><dir name="facebook"><file name="action.phtml" hash="9d12c6e116652f0fc5bf5b516e07b0af"/><file name="box.phtml" hash="2ca758ee05423fad428770ca47e33384"/><file name="box.phtml~" hash="8d341ead7d3c7e36c6e1b796423050f8"/><file name="empty.phtml" hash="9c3bd6e1a1361c0e64cac4c78426b069"/><file name="page.phtml" hash="81bef9f0829d6b5718f8aecc3dd5a88f"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Social_Facebook.xml" hash="b15af76b10945d00b8dbad23aebc0f50"/></dir></target><target name="magecommunity"><dir name="Social"><dir name="Facebook"><dir name="Block"><dir name="Adminhtml"><file name="Facebuttons.php" hash="4981f608fdc23b78e4bc847800397b66"/><file name="Select.php" hash="dd9ad7192087cb741b9f84b8c23bff9c"/></dir><file name="Action.php" hash="a929dce825d3b184b6d236f309ab298b"/><file name="Box.php" hash="516adc472c9bf244cc4e1bfaa9c72969"/><file name="Head.php" hash="dbb35ead2ed9b6444e552335efd678e4"/><file name="Like.php" hash="d7ace82dd95b99cd282ea99c16d10077"/><file name="Start.php" hash="2e61c7814dc9c7c23d34c1e8ed74c518"/></dir><dir name="controllers"><file name="IndexController.php" hash="da8bfd193c2cc8087bf2db946504d2b6"/></dir><dir name="etc"><file name="config.xml" hash="4990a8342e06a8e6a3478e458fe94801"/><file name="system.xml" hash="2717316adc05041cc7c9eaa36dfc6ef5"/></dir><dir name="Helper"><file name="Data.php" hash="4997be7dfb07b5967ddc3d783c7c3ade"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Facebook"><file name="Collection.php" hash="dc4fcda1d7c351876eeca1e439ba723d"/></dir><file name="Facebook.php" hash="f15b9ae8739da03fe6ab68cac466339f"/></dir><file name="Api.php" hash="52c453a2fe92e84efbbe63a3eea63d6a"/><file name="Facebook.php" hash="788881a98c74b692b75680689c52e6a5"/><file name="Facebuttons.php" hash="f15aa66ba13f5977adf09b067f0fa3d9"/><file name="Observer.php" hash="168c3c3a9ae234f7f491bbf654e83d91"/></dir><dir name="sql"><dir name="social_facebook_setup"><file name="mysql4-install-1.4.0.php" hash="ee195ec6e7b57830ced3f3c4a2a41233"/><file name="mysql4-upgrade-1.4.0-1.4.0.1.php" hash="63a0f7a199dd72e782d1f28dbfbbadb6"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
+ <dependencies/>
18
  </package>