Facebook_Connect_Like_Share_Wishlist_And_Post_Comment - Version 1.0.0

Version Notes

Facebook Connect, Like, Share Wishlist and Post Comment preview release

Download this release

Release Info

Developer Bytes Technolab
Extension Facebook_Connect_Like_Share_Wishlist_And_Post_Comment
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (38) hide show
  1. app/code/community/Bytes/Facebook/Block/Channel.php +12 -0
  2. app/code/community/Bytes/Facebook/Block/Customer/Wishlist.php +35 -0
  3. app/code/community/Bytes/Facebook/Block/Template.php +74 -0
  4. app/code/community/Bytes/Facebook/Helper/Data.php +19 -0
  5. app/code/community/Bytes/Facebook/Model/Adminhtml/System/Config/Source/Color.php +14 -0
  6. app/code/community/Bytes/Facebook/Model/Adminhtml/System/Config/Source/Font.php +19 -0
  7. app/code/community/Bytes/Facebook/Model/Adminhtml/System/Config/Source/Language.php +13 -0
  8. app/code/community/Bytes/Facebook/Model/Adminhtml/System/Config/Source/Layout.php +15 -0
  9. app/code/community/Bytes/Facebook/Model/Adminhtml/System/Config/Source/Verb.php +14 -0
  10. app/code/community/Bytes/Facebook/Model/Client.php +265 -0
  11. app/code/community/Bytes/Facebook/Model/Config.php +51 -0
  12. app/code/community/Bytes/Facebook/Model/Language.php +33 -0
  13. app/code/community/Bytes/Facebook/Model/Session.php +47 -0
  14. app/code/community/Bytes/Facebook/Model/Wishlist.php +16 -0
  15. app/code/community/Bytes/Facebook/controllers/ChannelController.php +35 -0
  16. app/code/community/Bytes/Facebook/controllers/Customer/AccountController.php +217 -0
  17. app/code/community/Bytes/Facebook/etc/FacebookLanguages.xml +1191 -0
  18. app/code/community/Bytes/Facebook/etc/config.xml +121 -0
  19. app/code/community/Bytes/Facebook/etc/system.xml +318 -0
  20. app/code/community/Bytes/Facebook/sql/facebook_setup/mysql4-install-0.9.0.php +14 -0
  21. app/code/community/Bytes/Facebook/sql/facebook_setup/mysql4-upgrade-0.9.0-0.9.1.php +16 -0
  22. app/design/frontend/default/default/layout/facebook.xml +26 -0
  23. app/design/frontend/default/default/template/facebook/category.like.phtml +3 -0
  24. app/design/frontend/default/default/template/facebook/cms.like.phtml +3 -0
  25. app/design/frontend/default/default/template/facebook/fbcomment.phtml +8 -0
  26. app/design/frontend/default/default/template/facebook/fblogin.phtml +5 -0
  27. app/design/frontend/default/default/template/facebook/fbwishlist.phtml +6 -0
  28. app/design/frontend/default/default/template/facebook/init.phtml +37 -0
  29. app/design/frontend/default/default/template/facebook/login.phtml +3 -0
  30. app/design/frontend/default/default/template/facebook/loginviafb.phtml +5 -0
  31. app/design/frontend/default/default/template/facebook/product.like.phtml +3 -0
  32. app/etc/modules/Bytes_Facebook.xml +9 -0
  33. package.xml +34 -0
  34. skin/frontend/default/default/css/facebook/fb.css +12 -0
  35. skin/frontend/default/default/images/facebook/Thumbs.db +0 -0
  36. skin/frontend/default/default/images/facebook/fb-login.jpg +0 -0
  37. skin/frontend/default/default/images/facebook/fblogin.gif +0 -0
  38. user-guide/Bytes_Facebook_UG_V1.0.pdf +0 -0
app/code/community/Bytes/Facebook/Block/Channel.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Bytes
4
+ * @package bytes_Facebook
5
+ * @author Bhavesh Surani <info@bytestechnolab.com>
6
+ */
7
+ class Bytes_Facebook_Block_Channel extends Bytes_Facebook_Block_Template{
8
+
9
+ protected function _toHtml(){
10
+ return '<script src="'.($this->isSecure() ? 'https://' : 'http://').'connect.facebook.net/'.($this->getData('language') ? $this->getData('language') : $this->getLanguage()).'/all.js"></script>';
11
+ }
12
+ }
app/code/community/Bytes/Facebook/Block/Customer/Wishlist.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Bytes
4
+ * @package Bytes_Facebook
5
+ * @author Bhavesh Surani <info@bytestechnolab.com>
6
+ */
7
+
8
+ class Bytes_Facebook_Block_Customer_Wishlist extends Mage_Wishlist_Block_Customer_Wishlist{
9
+
10
+ public function getWishlist(){
11
+
12
+ if(!$this->_wishlistLoaded) {
13
+ Mage::registry('wishlist')
14
+ ->loadByCustomer(Mage::getSingleton('customer/session')->getCustomer());
15
+
16
+ $collection = Mage::registry('wishlist')->getProductCollection()
17
+ ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
18
+ ->addStoreFilter();
19
+
20
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
21
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInSiteFilterToCollection($collection);
22
+
23
+ $this->_wishlistLoaded = true;
24
+ }
25
+ return Mage::registry('wishlist')->getProductCollection();
26
+ }
27
+
28
+ public function getShareWishlistURL(){
29
+
30
+ Mage::getModel('facebook/wishlist')->updateWishlistShare();
31
+
32
+ $arrWishlist = Mage::registry('wishlist')->getData();
33
+ return Mage::getUrl('*/shared/index',array('code'=>$arrWishlist['sharing_code']));
34
+ }
35
+ }
app/code/community/Bytes/Facebook/Block/Template.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Facebook connect template block
4
+ *
5
+ * @category Bytes
6
+ * @package bytes_Facebook
7
+ * @author Bhavesh Surani <info@bytestechnolab.com>
8
+ */
9
+ class Bytes_Facebook_Block_Template extends Mage_Core_Block_Template
10
+ {
11
+
12
+ public function isSecure()
13
+ {
14
+ return Mage::app()->getStore()->isCurrentlySecure();
15
+ }
16
+
17
+ public function getConnectUrl()
18
+ {
19
+ return $this->getUrl('facebook/customer_account/connect', array('_secure'=>true));
20
+ }
21
+
22
+ public function getLogoutUrl()
23
+ {
24
+ return $this->getUrl('customer_account/logout');
25
+ }
26
+
27
+ public function getChannelUrl()
28
+ {
29
+ return $this->getUrl('facebook/channel', array('_secure'=>$this->isSecure(),'language'=>$this->getLanguage()));
30
+ }
31
+
32
+ public function getRequiredPermissions()
33
+ {
34
+ return json_encode('email');
35
+ }
36
+
37
+ public function isEnabled()
38
+ {
39
+ return Mage::getSingleton('facebook/config')->isEnabled();
40
+ }
41
+
42
+ public function getApiKey()
43
+ {
44
+ return Mage::getSingleton('facebook/config')->getApiKey();
45
+ }
46
+
47
+ public function getLanguage()
48
+ {
49
+ return Mage::getSingleton('facebook/config')->getLanguage();
50
+ }
51
+
52
+ public function addFacebookLink(){
53
+
54
+ $parentBlock = $this->getParentBlock();
55
+
56
+ if ($parentBlock) {
57
+
58
+ $text = '<img rel="facebook-connect" src="'.$this->getSkinUrl('images/facebook/fblogin.gif').'">';
59
+
60
+ if (!$this->helper('customer')->isLoggedIn() ) {
61
+ $parentBlock->addLink($text, 'javascript:void(0);', 'Facebook Login', false, array(), 150, null, '"rel"="facebook-connect"');
62
+ }
63
+ }
64
+ return $this;
65
+ }
66
+
67
+ protected function _toHtml(){
68
+ if (!$this->isEnabled()) {
69
+ return '';
70
+ }
71
+ return parent::_toHtml();
72
+ }
73
+
74
+ }
app/code/community/Bytes/Facebook/Helper/Data.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Bytes
4
+ * @package bytes_Facebook
5
+ * @author Bhavesh Surani <info@bytestechnolab.com>
6
+ */
7
+ class Bytes_Facebook_Helper_Data extends Mage_Core_Helper_Abstract{
8
+
9
+ public function getConnectUrl(){
10
+ return $this->_getUrl('facebook/customer_account/connect', array('_secure'=>true));
11
+ }
12
+
13
+ public function isFacebookCustomer($customer){
14
+ if($customer->getFacebookUid()) {
15
+ return true;
16
+ }
17
+ return false;
18
+ }
19
+ }
app/code/community/Bytes/Facebook/Model/Adminhtml/System/Config/Source/Color.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Bytes
4
+ * @package bytes_Facebook
5
+ * @author Bhavesh Surani <info@bytestechnolab.com>
6
+ */
7
+ class Bytes_Facebook_Model_Adminhtml_System_Config_Source_Color{
8
+ public function toOptionArray(){
9
+ return array(
10
+ array('value'=>'light', 'label'=>'Light'),
11
+ array('value'=>'dark', 'label'=>'Dark')
12
+ );
13
+ }
14
+ }
app/code/community/Bytes/Facebook/Model/Adminhtml/System/Config/Source/Font.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Bytes
4
+ * @package bytes_Facebook
5
+ * @author Bhavesh Surani <info@bytestechnolab.com>
6
+ */
7
+ class Bytes_Facebook_Model_Adminhtml_System_Config_Source_Font{
8
+
9
+ public function toOptionArray(){
10
+ return array(
11
+ array('value'=>'arial', 'label'=>'Arial'),
12
+ array('value'=>'lucida grande', 'label'=>'Lucida Grande'),
13
+ array('value'=>'segoe ui', 'label'=>'Segoe Ui'),
14
+ array('value'=>'tahoma', 'label'=> 'Tahoma'),
15
+ array('value'=>'trebuchet ms', 'label'=>'Trebuchet Ms'),
16
+ array('value'=>'verdana', 'label'=>'Verdana')
17
+ );
18
+ }
19
+ }
app/code/community/Bytes/Facebook/Model/Adminhtml/System/Config/Source/Language.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Bytes
4
+ * @package bytes_Facebook
5
+ * @author Bhavesh Surani <info@bytestechnolab.com>
6
+ */
7
+ class Bytes_Facebook_Model_Adminhtml_System_Config_Source_Language{
8
+
9
+ public function toOptionArray(){
10
+ return Mage::getModel('facebook/language')->getOptionLanguages();
11
+ }
12
+
13
+ }
app/code/community/Bytes/Facebook/Model/Adminhtml/System/Config/Source/Layout.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Bytes
4
+ * @package bytes_Facebook
5
+ * @author Bhavesh Surani <info@bytestechnolab.com>
6
+ */
7
+ class Bytes_Facebook_Model_Adminhtml_System_Config_Source_Layout{
8
+
9
+ public function toOptionArray(){
10
+ return array(
11
+ array('value'=>'button_count', 'label'=>'Button Count'),
12
+ array('value'=>'standard', 'label'=>'Standard')
13
+ );
14
+ }
15
+ }
app/code/community/Bytes/Facebook/Model/Adminhtml/System/Config/Source/Verb.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Bytes
4
+ * @package bytes_Facebook
5
+ * @author Bhavesh Surani <info@bytestechnolab.com>
6
+ */
7
+ class Bytes_Facebook_Model_Adminhtml_System_Config_Source_Verb{
8
+ public function toOptionArray(){
9
+ return array(
10
+ array('value'=>'like', 'label'=>'Like'),
11
+ array('value'=>'recommend', 'label'=>'Recommend')
12
+ );
13
+ }
14
+ }
app/code/community/Bytes/Facebook/Model/Client.php ADDED
@@ -0,0 +1,265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Bytes
4
+ * @package bytes_Facebook
5
+ * @author Bhavesh Surani <info@bytestechnolab.com>
6
+ */
7
+ class Bytes_Facebook_Model_Client
8
+ {
9
+ const FACEBOOK_REST_URI = 'https://api.facebook.com/restserver.php';
10
+ const FACEBOOK_REST_READ_ONLY_URI = 'https://api-read.facebook.com/restserver.php';
11
+ const FACEBOOK_GRAPH_URI = 'https://graph.facebook.com';
12
+
13
+ protected $_apiKey;
14
+ protected $_secret;
15
+ protected $_session;
16
+
17
+ protected static $_httpClient;
18
+
19
+ public function __construct()
20
+ {
21
+ $args = func_get_args();
22
+
23
+ if(isset($args[0]) && is_array($args[0])) {
24
+ $args = $args[0];
25
+ }
26
+
27
+ if(count($args)<2) {
28
+ trigger_error('Missing arguments for Bytes_Facebook_Model_Client::__construct()',E_USER_ERROR);
29
+ }
30
+
31
+ $this->_apiKey = $args[0];
32
+ $this->_secret = $args[1];
33
+
34
+ $session = isset($args[2]) ? $args[2] : null;
35
+
36
+ if(is_array($session)) {
37
+ $this->_session = new Varien_Object($session);
38
+ } elseif($session instanceof Varien_Object) {
39
+ $this->_session = $session;
40
+ } else {
41
+ $this->_session = new Varien_Object();
42
+ }
43
+ }
44
+
45
+ public function setSession($session)
46
+ {
47
+ $this->_session = $session;
48
+ return $this;
49
+ }
50
+
51
+ public function call(/* polymorphic */)
52
+ {
53
+ $args = func_get_args();
54
+ if (is_array($args[0]) || substr($args[0],0,1)!='/' ) {
55
+ return call_user_func_array(array($this, 'rest'), $args);
56
+ } else {
57
+ return call_user_func_array(array($this, 'graph'), $args);
58
+ }
59
+ }
60
+
61
+ public function graph($path, $params=array())
62
+ {
63
+ if ($path[0] != '/') {
64
+ $path = '/'.$path;
65
+ }
66
+ $url = self::FACEBOOK_GRAPH_URI.$path;
67
+
68
+ $params['method'] = 'GET'; //??
69
+
70
+ $result = $this->_oauthRequest($url, $params);
71
+
72
+ if(is_array($result) && isset($result['error'])) {
73
+ throw new Mage_Core_Exception($result['error']['message'], 0);
74
+ }
75
+
76
+ return $result;
77
+ }
78
+
79
+ public function rest(/* polymorphic */)
80
+ {
81
+ $args = func_get_args();
82
+ if (is_array($args[0])) {
83
+ $params = $args[0];
84
+ } else {
85
+ $params = isset($args[1]) ? $args[1] : array();
86
+ $params['method'] = $args[0];
87
+ }
88
+
89
+ $defaultParams = array(
90
+ 'api_key' => $this->_apiKey,
91
+ 'format' => 'json-strings',
92
+ );
93
+
94
+ $params = array_merge($defaultParams, $params);
95
+
96
+ if($this->_isReadOnlyMethod($params['method'])) {
97
+ $url = self::FACEBOOK_REST_READ_ONLY_URI;
98
+ } else {
99
+ $url = self::FACEBOOK_REST_URI;
100
+ }
101
+
102
+ $result = $this->_oauthRequest($url, $params);
103
+
104
+ if(is_array($result) && isset($result['error_code'])) {
105
+ throw new Mage_Core_Exception($result['error_msg'], $result['error_code']);
106
+ }
107
+
108
+ return $result;
109
+ }
110
+
111
+ public function restBatch($batch_queue)
112
+ {
113
+ $method_feed = array();
114
+
115
+ foreach($batch_queue as $call)
116
+ {
117
+ $p = $this->_prepareParams($call);
118
+ $method_feed[] = http_build_query($p,'','&');
119
+ }
120
+
121
+ $params = array(
122
+ 'method_feed' => json_encode($method_feed),
123
+ 'serial_only' => true
124
+ );
125
+
126
+ return $this->rest('batch.run', $params);
127
+ }
128
+
129
+ public function generateSig($params)
130
+ {
131
+ $str = '';
132
+ ksort($params);
133
+ foreach ($params as $k=>$v) {
134
+ $str .= "$k=$v";
135
+ }
136
+ $str .= $this->_secret;
137
+ return md5($str);
138
+ }
139
+
140
+ protected function _prepareParams($params)
141
+ {
142
+ //new OAuth thingy
143
+ if (!isset($params['access_token'])) {
144
+ if ($this->_session->hasData('access_token')) {
145
+ $params['access_token'] = $this->_session->getData('access_token');
146
+ } else {
147
+ //@todo: check this in newer fb sdk ?!
148
+ $params['access_token'] = $this->_apiKey .'|'. $this->_secret;
149
+ }
150
+ }
151
+
152
+ foreach ($params as $key => &$val) {
153
+ if (!is_array($val)) continue;
154
+ $val = Zend_Json::encode($val);
155
+ }
156
+
157
+ if(isset($params['sig'])) {
158
+ unset($params['sig']);
159
+ }
160
+ $params['sig'] = $this->generateSig($params);
161
+
162
+ return $params;
163
+ }
164
+
165
+ protected function _oauthRequest($url, $params)
166
+ {
167
+ $params = $this->_prepareParams($params);
168
+
169
+ $client = self::_getHttpClient()
170
+ ->setUri($url)
171
+ ->setMethod(Zend_Http_Client::POST)
172
+ ->resetParameters()
173
+ ->setParameterPost($params);
174
+
175
+ try {
176
+ $response = $client->request();
177
+ } catch(Exception $e) {
178
+ throw new Mage_Core_Exception('Service temporarily unavailable.');
179
+ }
180
+
181
+ if(!$response->isSuccessful()) {
182
+ throw new Mage_Core_Exception('Service temporarily unavailable.');
183
+ }
184
+
185
+ $result = Zend_Json::decode($response->getBody());
186
+
187
+ return $result;
188
+ }
189
+
190
+ private static function _getHttpClient()
191
+ {
192
+ if (!self::$_httpClient instanceof Varien_Http_Client) {
193
+ self::$_httpClient = new Varien_Http_Client();
194
+ }
195
+
196
+ return self::$_httpClient;
197
+ }
198
+
199
+ private function _isReadOnlyMethod($method)
200
+ {
201
+ return in_array(strtolower($method), array(
202
+ 'admin.getallocation',
203
+ 'admin.getappproperties',
204
+ 'admin.getbannedusers',
205
+ 'admin.getlivestreamvialink',
206
+ 'admin.getmetrics',
207
+ 'admin.getrestrictioninfo',
208
+ 'application.getpublicinfo',
209
+ 'auth.getapppublickey',
210
+ 'auth.getsession',
211
+ 'auth.getsignedpublicsessiondata',
212
+ 'comments.get',
213
+ 'connect.getunconnectedfriendscount',
214
+ 'dashboard.getactivity',
215
+ 'dashboard.getcount',
216
+ 'dashboard.getglobalnews',
217
+ 'dashboard.getnews',
218
+ 'dashboard.multigetcount',
219
+ 'dashboard.multigetnews',
220
+ 'data.getcookies',
221
+ 'events.get',
222
+ 'events.getmembers',
223
+ 'fbml.getcustomtags',
224
+ 'feed.getappfriendstories',
225
+ 'feed.getregisteredtemplatebundlebyid',
226
+ 'feed.getregisteredtemplatebundles',
227
+ 'fql.multiquery',
228
+ 'fql.query',
229
+ 'friends.arefriends',
230
+ 'friends.get',
231
+ 'friends.getappusers',
232
+ 'friends.getlists',
233
+ 'friends.getmutualfriends',
234
+ 'gifts.get',
235
+ 'groups.get',
236
+ 'groups.getmembers',
237
+ 'intl.gettranslations',
238
+ 'links.get',
239
+ 'notes.get',
240
+ 'notifications.get',
241
+ 'pages.getinfo',
242
+ 'pages.isadmin',
243
+ 'pages.isappadded',
244
+ 'pages.isfan',
245
+ 'permissions.checkavailableapiaccess',
246
+ 'permissions.checkgrantedapiaccess',
247
+ 'photos.get',
248
+ 'photos.getalbums',
249
+ 'photos.gettags',
250
+ 'profile.getinfo',
251
+ 'profile.getinfooptions',
252
+ 'stream.get',
253
+ 'stream.getcomments',
254
+ 'stream.getfilters',
255
+ 'users.getinfo',
256
+ 'users.getloggedinuser',
257
+ 'users.getstandardinfo',
258
+ 'users.hasapppermission',
259
+ 'users.isappuser',
260
+ 'users.isverified',
261
+ 'video.getuploadlimits'
262
+ ));
263
+ }
264
+
265
+ }
app/code/community/Bytes/Facebook/Model/Config.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Bytes
4
+ * @package bytes_Facebook
5
+ * @author Bhavesh Surani <info@bytestechnolab.com>
6
+ */
7
+ class Bytes_Facebook_Model_Config{
8
+ const XML_PATH_ENABLED = 'bytes_facebook/general/enabled';
9
+ const XML_PATH_API_KEY = 'bytes_facebook/general/api_key';
10
+ const XML_PATH_SECRET = 'bytes_facebook/general/secret';
11
+ const XML_PATH_LANGUAGE = 'bytes_facebook/general/language';
12
+
13
+ public function isEnabled($storeId=null)
14
+ {
15
+
16
+ if( Mage::getStoreConfigFlag(self::XML_PATH_ENABLED, $storeId) &&
17
+ $this->getApiKey($storeId) &&
18
+ $this->getSecret($storeId))
19
+ {
20
+ return true;
21
+ }
22
+
23
+ return false;
24
+ }
25
+
26
+ public function getApiKey($storeId=null)
27
+ {
28
+ return trim(Mage::getStoreConfig(self::XML_PATH_API_KEY, $storeId));
29
+ }
30
+
31
+ public function getSecret($storeId=null)
32
+ {
33
+ return trim(Mage::getStoreConfig(self::XML_PATH_SECRET, $storeId));
34
+ }
35
+
36
+ public function getRequiredPermissions()
37
+ {
38
+ return array('email');
39
+ }
40
+
41
+ public function getLanguage($storeId=null)
42
+ {
43
+ return Mage::getStoreConfig(self::XML_PATH_LANGUAGE, $storeId);
44
+ }
45
+
46
+ public function getXid($storeId=null){
47
+
48
+ return Mage::getStoreConfig(self::XML_PATH_XID, $storeId);
49
+ }
50
+ }
51
+
app/code/community/Bytes/Facebook/Model/Language.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Bytes
4
+ * @package bytes_Facebook
5
+ * @author Bhavesh Surani <info@bytestechnolab.com>
6
+ */
7
+ class Bytes_Facebook_Model_Language{
8
+
9
+ public function getLanguage(){
10
+ $arrLanguages = array();
11
+ $langFile = Mage::app()->getConfig()->getModuleDir('etc', 'Bytes_Facebook').DS.'FacebookLanguages.xml';
12
+
13
+ $xml = simplexml_load_file($langFile, null, LIBXML_NOERROR);
14
+ if($xml && is_object($xml->language)) {
15
+ foreach($xml->language as $item) {
16
+ $arrLanguages[(string)$item->codes->code->standard->representation] = (string)$item->englishName;
17
+ }
18
+ }
19
+ asort($arrLanguages);
20
+ return $arrLanguages;
21
+ }
22
+
23
+ public function getOptionLanguages(){
24
+ $arrLanguages = array();
25
+ foreach($this->getLanguage() as $value => $label) {
26
+ $arrLanguages[] = array(
27
+ 'value' => $value,
28
+ 'label' => $label
29
+ );
30
+ }
31
+ return $arrLanguages;
32
+ }
33
+ }
app/code/community/Bytes/Facebook/Model/Session.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Bytes
4
+ * @package bytes_Facebook
5
+ * @author Bhavesh Surani <info@bytestechnolab.com>
6
+ */
7
+ class Bytes_Facebook_Model_Session extends Varien_Object{
8
+ private $_client;
9
+
10
+ public function __construct(){
11
+ if($this->getCookie()){
12
+ $data = array();
13
+ parse_str(trim($this->getCookie(),'"'), $data);
14
+ $this->setData($data);
15
+ }
16
+ }
17
+
18
+ public function isConnected(){
19
+ if(!$this->validate()) {
20
+ return false;
21
+ }
22
+ return true;
23
+ }
24
+
25
+ public function validate(){
26
+ $params = $this->getData();
27
+ unset($params['sig']);
28
+
29
+ return ($this->getClient()->generateSig($params)==$this->getSig());
30
+ }
31
+
32
+ public function getCookie(){
33
+ return Mage::app()->getRequest()->getCookie('fbs_'.Mage::getSingleton('facebook/config')->getApiKey(), false);
34
+ }
35
+
36
+ public function getClient()
37
+ {
38
+ if(is_null($this->_client)) {
39
+ $this->_client = Mage::getModel('facebook/client',array(
40
+ Mage::getSingleton('facebook/config')->getApiKey(),
41
+ Mage::getSingleton('facebook/config')->getSecret(),
42
+ $this
43
+ ));
44
+ }
45
+ return $this->_client;
46
+ }
47
+ }
app/code/community/Bytes/Facebook/Model/Wishlist.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Bytes
4
+ * @package bytes_Facebook
5
+ * @author Bhavesh Surani <info@bytestechnolab.com>
6
+ */
7
+ class Bytes_Facebook_Model_Wishlist extends Mage_Wishlist_Model_Wishlist{
8
+
9
+ public function updateWishlistShare(){
10
+
11
+ $customer = Mage::getModel('customer/customer')->load(Mage::getSingleton('customer/session')->getCustomerId());
12
+ $wishlist = Mage::getModel('wishlist/wishlist')->loadByCustomer($customer);
13
+ $wishlist->setShared(1);
14
+ $wishlist->save();
15
+ }
16
+ }
app/code/community/Bytes/Facebook/controllers/ChannelController.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Bytes
4
+ * @package bytes_Facebook
5
+ * @author Bhavesh Surani <info@bytestechnolab.com>
6
+ */
7
+ class Bytes_Facebook_ChannelController extends Mage_Core_Controller_Front_Action{
8
+
9
+ public function indexAction(){
10
+
11
+ $expires = 365*24*60*60; //1 year
12
+ $this->getResponse()
13
+ ->setHeader('Pragma', '', true)
14
+ ->setHeader('Cache-Control', 'maxage='.$expires, true)
15
+ ->setHeader('Expires', gmdate('D, d M Y H:i:s', time()+$expires), true)
16
+ ->setHeader('Last-Modified', gmdate('D, d M Y H:i:s', time()))
17
+ ;
18
+
19
+ if($this->getRequest()->getHeader('If-Modified-Since')) {
20
+ $this->getResponse()->setHttpResponseCode(304);
21
+ }
22
+
23
+ $language = $this->getRequest()->getParam('language', false);
24
+
25
+ if(!$language) {
26
+ $language = Mage::getSingleton('facebook/config')->getLanguage();
27
+ }
28
+ $this->getResponse()->setBody(
29
+ $this->getLayout()->createBlock('facebook/channel')
30
+ ->setLanguage($language)
31
+ ->toHtml()
32
+ );
33
+ }
34
+
35
+ }
app/code/community/Bytes/Facebook/controllers/Customer/AccountController.php ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Bytes
4
+ * @package bytes_Facebook
5
+ * @author Bhavesh Surani <info@bytestechnolab.com>
6
+ */
7
+ class Bytes_Facebook_Customer_AccountController extends Mage_Core_Controller_Front_Action{
8
+
9
+ public function preDispatch(){
10
+ parent::preDispatch();
11
+
12
+ if (!Mage::getSingleton('facebook/config')->isEnabled()) {
13
+ $this->norouteAction();
14
+ return;
15
+ }
16
+ }
17
+
18
+ public function connectAction(){
19
+ if(!$this->_getSession()->validate()) {
20
+ $this->_getCustomerSession()->addError($this->__('Facebook connection failed.'));
21
+ $this->_redirect('customer/account');
22
+ return;
23
+ }
24
+
25
+ //login or connect
26
+ $customer = Mage::getModel('customer/customer');
27
+
28
+ $collection = $customer->getCollection()
29
+ ->addAttributeToFilter('facebook_uid', (string)$this->_getSession()->getUid())
30
+ ->setPageSize(1);
31
+
32
+ if($customer->getSharingConfig()->isWebsiteScope()) {
33
+ $collection->addAttributeToFilter('website_id', Mage::app()->getWebsite()->getId());
34
+ }
35
+
36
+
37
+
38
+ if($this->_getCustomerSession()->isLoggedIn()) {
39
+ $collection->addFieldToFilter('entity_id', array('neq' => $this->_getCustomerSession()->getCustomerId()));
40
+ }
41
+ #var_dump((string) $collection->getSelect());
42
+ #exit;
43
+
44
+ $uidExist = (bool)$collection->count();
45
+
46
+
47
+ if($this->_getCustomerSession()->isLoggedIn() && $uidExist) {
48
+ $existingCustomer = $collection->getFirstItem();
49
+ $existingCustomer->setFacebookUid('');
50
+ $existingCustomer->getResource()->saveAttribute($existingCustomer, 'facebook_uid');
51
+ }
52
+
53
+ if($this->_getCustomerSession()->isLoggedIn()) {
54
+ $currentCustomer = $this->_getCustomerSession()->getCustomer();
55
+ $currentCustomer->setFacebookUid($this->_getSession()->getUid());
56
+ $currentCustomer->getResource()->saveAttribute($currentCustomer, 'facebook_uid');
57
+
58
+ $this->_getCustomerSession()->addSuccess(
59
+ $this->__('Your Facebook account has been successfully connected. Now you can fast login using Facebook Connect anytime.')
60
+ );
61
+ $this->_redirect('customer/account');
62
+ return;
63
+ }
64
+
65
+ if($uidExist) {
66
+ $uidCustomer = $collection->getFirstItem();
67
+ #var_dump((string) $collection->getSelect());
68
+ #exit;
69
+ //additional fix:
70
+ if($uidCustomer->getConfirmation()){
71
+ $uidCustomer->setConfirmation(null);
72
+ Mage::getResourceModel('customer/customer')->saveAttribute($uidCustomer, 'confirmation');
73
+ }
74
+ //
75
+ $this->_getCustomerSession()->setCustomerAsLoggedIn($uidCustomer);
76
+ $this->_redirectReferer();
77
+ return;
78
+ }
79
+
80
+
81
+ //let's go with e-mail
82
+
83
+ try{
84
+ $standardInfo = $this->_getSession()->getClient()->call("/me");
85
+
86
+ }catch(Mage_Core_Exception $e){
87
+ $this->_getCustomerSession()->addError(
88
+ $this->__('Facebook connection failed.') .
89
+ ' ' .
90
+ $this->__('Service temporarily unavailable.')
91
+ );
92
+ $this->_redirect('customer/account/login');
93
+ return;
94
+ }
95
+
96
+ //@todo: check are first_name and last_name always there
97
+ if(!isset($standardInfo['email'])) {
98
+ $this->_getCustomerSession()->addError(
99
+ $this->__('Facebook connection failed.') .
100
+ ' ' .
101
+ $this->__('Email address is required.')
102
+ );
103
+ $this->_redirect('customer/account/login');
104
+ return;
105
+ }
106
+
107
+ $customer
108
+ ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
109
+ ->loadByEmail($standardInfo['email']);
110
+
111
+ if($customer->getId()){
112
+ $customer->setFacebookUid($this->_getSession()->getUid());
113
+ Mage::getResourceModel('customer/customer')->saveAttribute($customer, 'facebook_uid');
114
+
115
+ if($customer->getConfirmation()){
116
+ $customer->setConfirmation(null);
117
+ Mage::getResourceModel('customer/customer')->saveAttribute($customer, 'confirmation');
118
+ }
119
+
120
+ $this->_getCustomerSession()->setCustomerAsLoggedIn($customer);
121
+ $this->_getCustomerSession()->addSuccess(
122
+ $this->__('Your Facebook account has been successfully connected. Now you can fast login using Facebook Connect anytime.')
123
+ );
124
+ $this->_redirect('customer/account');
125
+ return;
126
+ }
127
+
128
+ //registration needed
129
+
130
+ $randomPassword = $customer->generatePassword(8);
131
+
132
+ $customer ->setId(null)
133
+ ->setSkipConfirmationIfEmail($standardInfo['email'])
134
+ ->setFirstname($standardInfo['first_name'])
135
+ ->setLastname($standardInfo['last_name'])
136
+ ->setEmail($standardInfo['email'])
137
+ ->setPassword($randomPassword)
138
+ ->setConfirmation($randomPassword)
139
+ ->setFacebookUid($this->_getSession()->getUid());
140
+
141
+ //FB: Show my sex in my profile.
142
+ if(isset($standardInfo['gender']) && $gender=Mage::getResourceSingleton('customer/customer')->getAttribute('gender')){
143
+ $genderOptions = $gender->getSource()->getAllOptions();
144
+ foreach($genderOptions as $option){
145
+ if($option['label']==ucfirst($standardInfo['gender'])){
146
+ $customer->setGender($option['value']);
147
+ break;
148
+ }
149
+ }
150
+ }
151
+
152
+ //FB: Show my full birthday in my profile.
153
+ if(isset($standardInfo['birthday']) && count(explode('/',$standardInfo['birthday']))==3){
154
+
155
+ $dob = $standardInfo['birthday'];
156
+
157
+ if(method_exists($this,'_filterDates')){
158
+ $filtered = $this->_filterDates(array('dob'=>$dob), array('dob'));
159
+ $dob = current($filtered);
160
+ }
161
+
162
+ $customer->setDob($dob);
163
+ }
164
+
165
+ //$customer->getGroupId(); // needed in 1.3.x.x ?
166
+
167
+ //for future versions and easy mods ;)
168
+ if ($this->getRequest()->getParam('is_subscribed', false)) {
169
+ $customer->setIsSubscribed(1);
170
+ }
171
+
172
+ //registration will fail if tax required, also if dob, gender aren't allowed in profile
173
+ $errors = array();
174
+ $validationCustomer = $customer->validate();
175
+ if (is_array($validationCustomer)) {
176
+ $errors = array_merge($validationCustomer, $errors);
177
+ }
178
+ $validationResult = count($errors) == 0;
179
+
180
+ if (true === $validationResult) {
181
+ $customer->save();
182
+
183
+ $this->_getCustomerSession()->addSuccess(
184
+ $this->__('Thank you for registering with %s', Mage::app()->getStore()->getFrontendName()) .
185
+ '. ' .
186
+ $this->__('You will receive welcome email with registration info in a moment.')
187
+ );
188
+
189
+ $customer->sendNewAccountEmail();
190
+
191
+ $this->_getCustomerSession()->setCustomerAsLoggedIn($customer);
192
+ $this->_redirect('customer/account');
193
+ return;
194
+
195
+ //else set form data and redirect to registration
196
+ } else {
197
+ $this->_getCustomerSession()->setCustomerFormData($customer->getData());
198
+ $this->_getCustomerSession()->addError($this->__('Facebook profile can\'t provide all required info, please register and then connect with Facebook for fast login.'));
199
+ if (is_array($errors)) {
200
+ foreach ($errors as $errorMessage) {
201
+ $this->_getCustomerSession()->addError($errorMessage);
202
+ }
203
+ }
204
+
205
+ $this->_redirect('customer/account/create');
206
+ }
207
+ }
208
+
209
+ private function _getCustomerSession(){
210
+ return Mage::getSingleton('customer/session');
211
+ }
212
+
213
+ private function _getSession(){
214
+ return Mage::getSingleton('facebook/session');
215
+ }
216
+
217
+ }
app/code/community/Bytes/Facebook/etc/FacebookLanguages.xml ADDED
@@ -0,0 +1,1191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version='1.0'?>
2
+ <languages>
3
+ <language>
4
+ <englishName>Catalan</englishName>
5
+ <codes>
6
+ <code>
7
+ <standard>
8
+ <name>FB</name>
9
+ <representation>ca_ES</representation>
10
+ </standard>
11
+ </code>
12
+ </codes>
13
+ </language>
14
+ <language>
15
+ <englishName>Czech</englishName>
16
+ <codes>
17
+ <code>
18
+ <standard>
19
+ <name>FB</name>
20
+ <representation>cs_CZ</representation>
21
+ </standard>
22
+ </code>
23
+ </codes>
24
+ </language>
25
+ <language>
26
+ <englishName>Welsh</englishName>
27
+ <codes>
28
+ <code>
29
+ <standard>
30
+ <name>FB</name>
31
+ <representation>cy_GB</representation>
32
+ </standard>
33
+ </code>
34
+ </codes>
35
+ </language>
36
+ <language>
37
+ <englishName>Danish</englishName>
38
+ <codes>
39
+ <code>
40
+ <standard>
41
+ <name>FB</name>
42
+ <representation>da_DK</representation>
43
+ </standard>
44
+ </code>
45
+ </codes>
46
+ </language>
47
+ <language>
48
+ <englishName>German</englishName>
49
+ <codes>
50
+ <code>
51
+ <standard>
52
+ <name>FB</name>
53
+ <representation>de_DE</representation>
54
+ </standard>
55
+ </code>
56
+ </codes>
57
+ </language>
58
+ <language>
59
+ <englishName>Basque</englishName>
60
+ <codes>
61
+ <code>
62
+ <standard>
63
+ <name>FB</name>
64
+ <representation>eu_ES</representation>
65
+ </standard>
66
+ </code>
67
+ </codes>
68
+ </language>
69
+ <language>
70
+ <englishName>English (Pirate)</englishName>
71
+ <codes>
72
+ <code>
73
+ <standard>
74
+ <name>FB</name>
75
+ <representation>en_PI</representation>
76
+ </standard>
77
+ </code>
78
+ </codes>
79
+ </language>
80
+ <language>
81
+ <englishName>English (Upside Down)</englishName>
82
+ <codes>
83
+ <code>
84
+ <standard>
85
+ <name>FB</name>
86
+ <representation>en_UD</representation>
87
+ </standard>
88
+ </code>
89
+ </codes>
90
+ </language>
91
+ <language>
92
+ <englishName>Cherokee</englishName>
93
+ <codes>
94
+ <code>
95
+ <standard>
96
+ <name>FB</name>
97
+ <representation>ck_US</representation>
98
+ </standard>
99
+ </code>
100
+ </codes>
101
+ </language>
102
+ <language>
103
+ <englishName>English (US)</englishName>
104
+ <codes>
105
+ <code>
106
+ <standard>
107
+ <name>FB</name>
108
+ <representation>en_US</representation>
109
+ </standard>
110
+ </code>
111
+ </codes>
112
+ </language>
113
+ <language>
114
+ <englishName>Spanish</englishName>
115
+ <codes>
116
+ <code>
117
+ <standard>
118
+ <name>FB</name>
119
+ <representation>es_LA</representation>
120
+ </standard>
121
+ </code>
122
+ </codes>
123
+ </language>
124
+ <language>
125
+ <englishName>Spanish (Chile)</englishName>
126
+ <codes>
127
+ <code>
128
+ <standard>
129
+ <name>FB</name>
130
+ <representation>es_CL</representation>
131
+ </standard>
132
+ </code>
133
+ </codes>
134
+ </language>
135
+ <language>
136
+ <englishName>Spanish (Colombia)</englishName>
137
+ <codes>
138
+ <code>
139
+ <standard>
140
+ <name>FB</name>
141
+ <representation>es_CO</representation>
142
+ </standard>
143
+ </code>
144
+ </codes>
145
+ </language>
146
+ <language>
147
+ <englishName>Spanish (Spain)</englishName>
148
+ <codes>
149
+ <code>
150
+ <standard>
151
+ <name>FB</name>
152
+ <representation>es_ES</representation>
153
+ </standard>
154
+ </code>
155
+ </codes>
156
+ </language>
157
+ <language>
158
+ <englishName>Spanish (Mexico)</englishName>
159
+ <codes>
160
+ <code>
161
+ <standard>
162
+ <name>FB</name>
163
+ <representation>es_MX</representation>
164
+ </standard>
165
+ </code>
166
+ </codes>
167
+ </language>
168
+ <language>
169
+ <englishName>Spanish (Venezuela)</englishName>
170
+ <codes>
171
+ <code>
172
+ <standard>
173
+ <name>FB</name>
174
+ <representation>es_VE</representation>
175
+ </standard>
176
+ </code>
177
+ </codes>
178
+ </language>
179
+ <language>
180
+ <englishName>Finnish (test)</englishName>
181
+ <codes>
182
+ <code>
183
+ <standard>
184
+ <name>FB</name>
185
+ <representation>fb_FI</representation>
186
+ </standard>
187
+ </code>
188
+ </codes>
189
+ </language>
190
+ <language>
191
+ <englishName>Finnish</englishName>
192
+ <codes>
193
+ <code>
194
+ <standard>
195
+ <name>FB</name>
196
+ <representation>fi_FI</representation>
197
+ </standard>
198
+ </code>
199
+ </codes>
200
+ </language>
201
+ <language>
202
+ <englishName>French (France)</englishName>
203
+ <codes>
204
+ <code>
205
+ <standard>
206
+ <name>FB</name>
207
+ <representation>fr_FR</representation>
208
+ </standard>
209
+ </code>
210
+ </codes>
211
+ </language>
212
+ <language>
213
+ <englishName>Galician</englishName>
214
+ <codes>
215
+ <code>
216
+ <standard>
217
+ <name>FB</name>
218
+ <representation>gl_ES</representation>
219
+ </standard>
220
+ </code>
221
+ </codes>
222
+ </language>
223
+ <language>
224
+ <englishName>Hungarian</englishName>
225
+ <codes>
226
+ <code>
227
+ <standard>
228
+ <name>FB</name>
229
+ <representation>hu_HU</representation>
230
+ </standard>
231
+ </code>
232
+ </codes>
233
+ </language>
234
+ <language>
235
+ <englishName>Italian</englishName>
236
+ <codes>
237
+ <code>
238
+ <standard>
239
+ <name>FB</name>
240
+ <representation>it_IT</representation>
241
+ </standard>
242
+ </code>
243
+ </codes>
244
+ </language>
245
+ <language>
246
+ <englishName>Japanese</englishName>
247
+ <codes>
248
+ <code>
249
+ <standard>
250
+ <name>FB</name>
251
+ <representation>ja_JP</representation>
252
+ </standard>
253
+ </code>
254
+ </codes>
255
+ </language>
256
+ <language>
257
+ <englishName>Korean</englishName>
258
+ <codes>
259
+ <code>
260
+ <standard>
261
+ <name>FB</name>
262
+ <representation>ko_KR</representation>
263
+ </standard>
264
+ </code>
265
+ </codes>
266
+ </language>
267
+ <language>
268
+ <englishName>Norwegian (bokmal)</englishName>
269
+ <codes>
270
+ <code>
271
+ <standard>
272
+ <name>FB</name>
273
+ <representation>nb_NO</representation>
274
+ </standard>
275
+ </code>
276
+ </codes>
277
+ </language>
278
+ <language>
279
+ <englishName>Norwegian (nynorsk)</englishName>
280
+ <codes>
281
+ <code>
282
+ <standard>
283
+ <name>FB</name>
284
+ <representation>nn_NO</representation>
285
+ </standard>
286
+ </code>
287
+ </codes>
288
+ </language>
289
+ <language>
290
+ <englishName>Dutch</englishName>
291
+ <codes>
292
+ <code>
293
+ <standard>
294
+ <name>FB</name>
295
+ <representation>nl_NL</representation>
296
+ </standard>
297
+ </code>
298
+ </codes>
299
+ </language>
300
+ <language>
301
+ <englishName>Polish</englishName>
302
+ <codes>
303
+ <code>
304
+ <standard>
305
+ <name>FB</name>
306
+ <representation>pl_PL</representation>
307
+ </standard>
308
+ </code>
309
+ </codes>
310
+ </language>
311
+ <language>
312
+ <englishName>Portuguese (Brazil)</englishName>
313
+ <codes>
314
+ <code>
315
+ <standard>
316
+ <name>FB</name>
317
+ <representation>pt_BR</representation>
318
+ </standard>
319
+ </code>
320
+ </codes>
321
+ </language>
322
+ <language>
323
+ <englishName>Portuguese (Portugal)</englishName>
324
+ <codes>
325
+ <code>
326
+ <standard>
327
+ <name>FB</name>
328
+ <representation>pt_PT</representation>
329
+ </standard>
330
+ </code>
331
+ </codes>
332
+ </language>
333
+ <language>
334
+ <englishName>Romanian</englishName>
335
+ <codes>
336
+ <code>
337
+ <standard>
338
+ <name>FB</name>
339
+ <representation>ro_RO</representation>
340
+ </standard>
341
+ </code>
342
+ </codes>
343
+ </language>
344
+ <language>
345
+ <englishName>Russian</englishName>
346
+ <codes>
347
+ <code>
348
+ <standard>
349
+ <name>FB</name>
350
+ <representation>ru_RU</representation>
351
+ </standard>
352
+ </code>
353
+ </codes>
354
+ </language>
355
+ <language>
356
+ <englishName>Slovak</englishName>
357
+ <codes>
358
+ <code>
359
+ <standard>
360
+ <name>FB</name>
361
+ <representation>sk_SK</representation>
362
+ </standard>
363
+ </code>
364
+ </codes>
365
+ </language>
366
+ <language>
367
+ <englishName>Slovenian</englishName>
368
+ <codes>
369
+ <code>
370
+ <standard>
371
+ <name>FB</name>
372
+ <representation>sl_SI</representation>
373
+ </standard>
374
+ </code>
375
+ </codes>
376
+ </language>
377
+ <language>
378
+ <englishName>Swedish</englishName>
379
+ <codes>
380
+ <code>
381
+ <standard>
382
+ <name>FB</name>
383
+ <representation>sv_SE</representation>
384
+ </standard>
385
+ </code>
386
+ </codes>
387
+ </language>
388
+ <language>
389
+ <englishName>Thai</englishName>
390
+ <codes>
391
+ <code>
392
+ <standard>
393
+ <name>FB</name>
394
+ <representation>th_TH</representation>
395
+ </standard>
396
+ </code>
397
+ </codes>
398
+ </language>
399
+ <language>
400
+ <englishName>Turkish</englishName>
401
+ <codes>
402
+ <code>
403
+ <standard>
404
+ <name>FB</name>
405
+ <representation>tr_TR</representation>
406
+ </standard>
407
+ </code>
408
+ </codes>
409
+ </language>
410
+ <language>
411
+ <englishName>Kurdish</englishName>
412
+ <codes>
413
+ <code>
414
+ <standard>
415
+ <name>FB</name>
416
+ <representation>ku_TR</representation>
417
+ </standard>
418
+ </code>
419
+ </codes>
420
+ </language>
421
+ <language>
422
+ <englishName>Simplified Chinese (China)</englishName>
423
+ <codes>
424
+ <code>
425
+ <standard>
426
+ <name>FB</name>
427
+ <representation>zh_CN</representation>
428
+ </standard>
429
+ </code>
430
+ </codes>
431
+ </language>
432
+ <language>
433
+ <englishName>Traditional Chinese (Hong Kong)</englishName>
434
+ <codes>
435
+ <code>
436
+ <standard>
437
+ <name>FB</name>
438
+ <representation>zh_HK</representation>
439
+ </standard>
440
+ </code>
441
+ </codes>
442
+ </language>
443
+ <language>
444
+ <englishName>Traditional Chinese (Taiwan)</englishName>
445
+ <codes>
446
+ <code>
447
+ <standard>
448
+ <name>FB</name>
449
+ <representation>zh_TW</representation>
450
+ </standard>
451
+ </code>
452
+ </codes>
453
+ </language>
454
+ <language>
455
+ <englishName>Leet Speak</englishName>
456
+ <codes>
457
+ <code>
458
+ <standard>
459
+ <name>FB</name>
460
+ <representation>fb_LT</representation>
461
+ </standard>
462
+ </code>
463
+ </codes>
464
+ </language>
465
+ <language>
466
+ <englishName>Afrikaans</englishName>
467
+ <codes>
468
+ <code>
469
+ <standard>
470
+ <name>FB</name>
471
+ <representation>af_ZA</representation>
472
+ </standard>
473
+ </code>
474
+ </codes>
475
+ </language>
476
+ <language>
477
+ <englishName>Albanian</englishName>
478
+ <codes>
479
+ <code>
480
+ <standard>
481
+ <name>FB</name>
482
+ <representation>sq_AL</representation>
483
+ </standard>
484
+ </code>
485
+ </codes>
486
+ </language>
487
+ <language>
488
+ <englishName>Armenian</englishName>
489
+ <codes>
490
+ <code>
491
+ <standard>
492
+ <name>FB</name>
493
+ <representation>hy_AM</representation>
494
+ </standard>
495
+ </code>
496
+ </codes>
497
+ </language>
498
+ <language>
499
+ <englishName>Azeri</englishName>
500
+ <codes>
501
+ <code>
502
+ <standard>
503
+ <name>FB</name>
504
+ <representation>az_AZ</representation>
505
+ </standard>
506
+ </code>
507
+ </codes>
508
+ </language>
509
+ <language>
510
+ <englishName>Belarusian</englishName>
511
+ <codes>
512
+ <code>
513
+ <standard>
514
+ <name>FB</name>
515
+ <representation>be_BY</representation>
516
+ </standard>
517
+ </code>
518
+ </codes>
519
+ </language>
520
+ <language>
521
+ <englishName>Bengali</englishName>
522
+ <codes>
523
+ <code>
524
+ <standard>
525
+ <name>FB</name>
526
+ <representation>bn_IN</representation>
527
+ </standard>
528
+ </code>
529
+ </codes>
530
+ </language>
531
+ <language>
532
+ <englishName>Bosnian</englishName>
533
+ <codes>
534
+ <code>
535
+ <standard>
536
+ <name>FB</name>
537
+ <representation>bs_BA</representation>
538
+ </standard>
539
+ </code>
540
+ </codes>
541
+ </language>
542
+ <language>
543
+ <englishName>Bulgarian</englishName>
544
+ <codes>
545
+ <code>
546
+ <standard>
547
+ <name>FB</name>
548
+ <representation>bg_BG</representation>
549
+ </standard>
550
+ </code>
551
+ </codes>
552
+ </language>
553
+ <language>
554
+ <englishName>Croatian</englishName>
555
+ <codes>
556
+ <code>
557
+ <standard>
558
+ <name>FB</name>
559
+ <representation>hr_HR</representation>
560
+ </standard>
561
+ </code>
562
+ </codes>
563
+ </language>
564
+ <language>
565
+ <englishName>Dutch (België)</englishName>
566
+ <codes>
567
+ <code>
568
+ <standard>
569
+ <name>FB</name>
570
+ <representation>nl_BE</representation>
571
+ </standard>
572
+ </code>
573
+ </codes>
574
+ </language>
575
+ <language>
576
+ <englishName>English (UK)</englishName>
577
+ <codes>
578
+ <code>
579
+ <standard>
580
+ <name>FB</name>
581
+ <representation>en_GB</representation>
582
+ </standard>
583
+ </code>
584
+ </codes>
585
+ </language>
586
+ <language>
587
+ <englishName>Esperanto</englishName>
588
+ <codes>
589
+ <code>
590
+ <standard>
591
+ <name>FB</name>
592
+ <representation>eo_EO</representation>
593
+ </standard>
594
+ </code>
595
+ </codes>
596
+ </language>
597
+ <language>
598
+ <englishName>Estonian</englishName>
599
+ <codes>
600
+ <code>
601
+ <standard>
602
+ <name>FB</name>
603
+ <representation>et_EE</representation>
604
+ </standard>
605
+ </code>
606
+ </codes>
607
+ </language>
608
+ <language>
609
+ <englishName>Faroese</englishName>
610
+ <codes>
611
+ <code>
612
+ <standard>
613
+ <name>FB</name>
614
+ <representation>fo_FO</representation>
615
+ </standard>
616
+ </code>
617
+ </codes>
618
+ </language>
619
+ <language>
620
+ <englishName>French (Canada)</englishName>
621
+ <codes>
622
+ <code>
623
+ <standard>
624
+ <name>FB</name>
625
+ <representation>fr_CA</representation>
626
+ </standard>
627
+ </code>
628
+ </codes>
629
+ </language>
630
+ <language>
631
+ <englishName>Georgian</englishName>
632
+ <codes>
633
+ <code>
634
+ <standard>
635
+ <name>FB</name>
636
+ <representation>ka_GE</representation>
637
+ </standard>
638
+ </code>
639
+ </codes>
640
+ </language>
641
+ <language>
642
+ <englishName>Greek</englishName>
643
+ <codes>
644
+ <code>
645
+ <standard>
646
+ <name>FB</name>
647
+ <representation>el_GR</representation>
648
+ </standard>
649
+ </code>
650
+ </codes>
651
+ </language>
652
+ <language>
653
+ <englishName>Gujarati</englishName>
654
+ <codes>
655
+ <code>
656
+ <standard>
657
+ <name>FB</name>
658
+ <representation>gu_IN</representation>
659
+ </standard>
660
+ </code>
661
+ </codes>
662
+ </language>
663
+ <language>
664
+ <englishName>Hindi</englishName>
665
+ <codes>
666
+ <code>
667
+ <standard>
668
+ <name>FB</name>
669
+ <representation>hi_IN</representation>
670
+ </standard>
671
+ </code>
672
+ </codes>
673
+ </language>
674
+ <language>
675
+ <englishName>Icelandic</englishName>
676
+ <codes>
677
+ <code>
678
+ <standard>
679
+ <name>FB</name>
680
+ <representation>is_IS</representation>
681
+ </standard>
682
+ </code>
683
+ </codes>
684
+ </language>
685
+ <language>
686
+ <englishName>Indonesian</englishName>
687
+ <codes>
688
+ <code>
689
+ <standard>
690
+ <name>FB</name>
691
+ <representation>id_ID</representation>
692
+ </standard>
693
+ </code>
694
+ </codes>
695
+ </language>
696
+ <language>
697
+ <englishName>Irish</englishName>
698
+ <codes>
699
+ <code>
700
+ <standard>
701
+ <name>FB</name>
702
+ <representation>ga_IE</representation>
703
+ </standard>
704
+ </code>
705
+ </codes>
706
+ </language>
707
+ <language>
708
+ <englishName>Javanese</englishName>
709
+ <codes>
710
+ <code>
711
+ <standard>
712
+ <name>FB</name>
713
+ <representation>jv_ID</representation>
714
+ </standard>
715
+ </code>
716
+ </codes>
717
+ </language>
718
+ <language>
719
+ <englishName>Kannada</englishName>
720
+ <codes>
721
+ <code>
722
+ <standard>
723
+ <name>FB</name>
724
+ <representation>kn_IN</representation>
725
+ </standard>
726
+ </code>
727
+ </codes>
728
+ </language>
729
+ <language>
730
+ <englishName>Kazakh</englishName>
731
+ <codes>
732
+ <code>
733
+ <standard>
734
+ <name>FB</name>
735
+ <representation>kk_KZ</representation>
736
+ </standard>
737
+ </code>
738
+ </codes>
739
+ </language>
740
+ <language>
741
+ <englishName>Latin</englishName>
742
+ <codes>
743
+ <code>
744
+ <standard>
745
+ <name>FB</name>
746
+ <representation>la_VA</representation>
747
+ </standard>
748
+ </code>
749
+ </codes>
750
+ </language>
751
+ <language>
752
+ <englishName>Latvian</englishName>
753
+ <codes>
754
+ <code>
755
+ <standard>
756
+ <name>FB</name>
757
+ <representation>lv_LV</representation>
758
+ </standard>
759
+ </code>
760
+ </codes>
761
+ </language>
762
+ <language>
763
+ <englishName>Limburgish</englishName>
764
+ <codes>
765
+ <code>
766
+ <standard>
767
+ <name>FB</name>
768
+ <representation>li_NL</representation>
769
+ </standard>
770
+ </code>
771
+ </codes>
772
+ </language>
773
+ <language>
774
+ <englishName>Lithuanian</englishName>
775
+ <codes>
776
+ <code>
777
+ <standard>
778
+ <name>FB</name>
779
+ <representation>lt_LT</representation>
780
+ </standard>
781
+ </code>
782
+ </codes>
783
+ </language>
784
+ <language>
785
+ <englishName>Macedonian</englishName>
786
+ <codes>
787
+ <code>
788
+ <standard>
789
+ <name>FB</name>
790
+ <representation>mk_MK</representation>
791
+ </standard>
792
+ </code>
793
+ </codes>
794
+ </language>
795
+ <language>
796
+ <englishName>Malagasy</englishName>
797
+ <codes>
798
+ <code>
799
+ <standard>
800
+ <name>FB</name>
801
+ <representation>mg_MG</representation>
802
+ </standard>
803
+ </code>
804
+ </codes>
805
+ </language>
806
+ <language>
807
+ <englishName>Malay</englishName>
808
+ <codes>
809
+ <code>
810
+ <standard>
811
+ <name>FB</name>
812
+ <representation>ms_MY</representation>
813
+ </standard>
814
+ </code>
815
+ </codes>
816
+ </language>
817
+ <language>
818
+ <englishName>Maltese</englishName>
819
+ <codes>
820
+ <code>
821
+ <standard>
822
+ <name>FB</name>
823
+ <representation>mt_MT</representation>
824
+ </standard>
825
+ </code>
826
+ </codes>
827
+ </language>
828
+ <language>
829
+ <englishName>Marathi</englishName>
830
+ <codes>
831
+ <code>
832
+ <standard>
833
+ <name>FB</name>
834
+ <representation>mr_IN</representation>
835
+ </standard>
836
+ </code>
837
+ </codes>
838
+ </language>
839
+ <language>
840
+ <englishName>Mongolian</englishName>
841
+ <codes>
842
+ <code>
843
+ <standard>
844
+ <name>FB</name>
845
+ <representation>mn_MN</representation>
846
+ </standard>
847
+ </code>
848
+ </codes>
849
+ </language>
850
+ <language>
851
+ <englishName>Nepali</englishName>
852
+ <codes>
853
+ <code>
854
+ <standard>
855
+ <name>FB</name>
856
+ <representation>ne_NP</representation>
857
+ </standard>
858
+ </code>
859
+ </codes>
860
+ </language>
861
+ <language>
862
+ <englishName>Punjabi</englishName>
863
+ <codes>
864
+ <code>
865
+ <standard>
866
+ <name>FB</name>
867
+ <representation>pa_IN</representation>
868
+ </standard>
869
+ </code>
870
+ </codes>
871
+ </language>
872
+ <language>
873
+ <englishName>Romansh</englishName>
874
+ <codes>
875
+ <code>
876
+ <standard>
877
+ <name>FB</name>
878
+ <representation>rm_CH</representation>
879
+ </standard>
880
+ </code>
881
+ </codes>
882
+ </language>
883
+ <language>
884
+ <englishName>Sanskrit</englishName>
885
+ <codes>
886
+ <code>
887
+ <standard>
888
+ <name>FB</name>
889
+ <representation>sa_IN</representation>
890
+ </standard>
891
+ </code>
892
+ </codes>
893
+ </language>
894
+ <language>
895
+ <englishName>Serbian</englishName>
896
+ <codes>
897
+ <code>
898
+ <standard>
899
+ <name>FB</name>
900
+ <representation>sr_RS</representation>
901
+ </standard>
902
+ </code>
903
+ </codes>
904
+ </language>
905
+ <language>
906
+ <englishName>Somali</englishName>
907
+ <codes>
908
+ <code>
909
+ <standard>
910
+ <name>FB</name>
911
+ <representation>so_SO</representation>
912
+ </standard>
913
+ </code>
914
+ </codes>
915
+ </language>
916
+ <language>
917
+ <englishName>Swahili</englishName>
918
+ <codes>
919
+ <code>
920
+ <standard>
921
+ <name>FB</name>
922
+ <representation>sw_KE</representation>
923
+ </standard>
924
+ </code>
925
+ </codes>
926
+ </language>
927
+ <language>
928
+ <englishName>Filipino</englishName>
929
+ <codes>
930
+ <code>
931
+ <standard>
932
+ <name>FB</name>
933
+ <representation>tl_PH</representation>
934
+ </standard>
935
+ </code>
936
+ </codes>
937
+ </language>
938
+ <language>
939
+ <englishName>Tamil</englishName>
940
+ <codes>
941
+ <code>
942
+ <standard>
943
+ <name>FB</name>
944
+ <representation>ta_IN</representation>
945
+ </standard>
946
+ </code>
947
+ </codes>
948
+ </language>
949
+ <language>
950
+ <englishName>Tatar</englishName>
951
+ <codes>
952
+ <code>
953
+ <standard>
954
+ <name>FB</name>
955
+ <representation>tt_RU</representation>
956
+ </standard>
957
+ </code>
958
+ </codes>
959
+ </language>
960
+ <language>
961
+ <englishName>Telugu</englishName>
962
+ <codes>
963
+ <code>
964
+ <standard>
965
+ <name>FB</name>
966
+ <representation>te_IN</representation>
967
+ </standard>
968
+ </code>
969
+ </codes>
970
+ </language>
971
+ <language>
972
+ <englishName>Malayalam</englishName>
973
+ <codes>
974
+ <code>
975
+ <standard>
976
+ <name>FB</name>
977
+ <representation>ml_IN</representation>
978
+ </standard>
979
+ </code>
980
+ </codes>
981
+ </language>
982
+ <language>
983
+ <englishName>Ukrainian</englishName>
984
+ <codes>
985
+ <code>
986
+ <standard>
987
+ <name>FB</name>
988
+ <representation>uk_UA</representation>
989
+ </standard>
990
+ </code>
991
+ </codes>
992
+ </language>
993
+ <language>
994
+ <englishName>Uzbek</englishName>
995
+ <codes>
996
+ <code>
997
+ <standard>
998
+ <name>FB</name>
999
+ <representation>uz_UZ</representation>
1000
+ </standard>
1001
+ </code>
1002
+ </codes>
1003
+ </language>
1004
+ <language>
1005
+ <englishName>Vietnamese</englishName>
1006
+ <codes>
1007
+ <code>
1008
+ <standard>
1009
+ <name>FB</name>
1010
+ <representation>vi_VN</representation>
1011
+ </standard>
1012
+ </code>
1013
+ </codes>
1014
+ </language>
1015
+ <language>
1016
+ <englishName>Xhosa</englishName>
1017
+ <codes>
1018
+ <code>
1019
+ <standard>
1020
+ <name>FB</name>
1021
+ <representation>xh_ZA</representation>
1022
+ </standard>
1023
+ </code>
1024
+ </codes>
1025
+ </language>
1026
+ <language>
1027
+ <englishName>Zulu</englishName>
1028
+ <codes>
1029
+ <code>
1030
+ <standard>
1031
+ <name>FB</name>
1032
+ <representation>zu_ZA</representation>
1033
+ </standard>
1034
+ </code>
1035
+ </codes>
1036
+ </language>
1037
+ <language>
1038
+ <englishName>Khmer</englishName>
1039
+ <codes>
1040
+ <code>
1041
+ <standard>
1042
+ <name>FB</name>
1043
+ <representation>km_KH</representation>
1044
+ </standard>
1045
+ </code>
1046
+ </codes>
1047
+ </language>
1048
+ <language>
1049
+ <englishName>Tajik</englishName>
1050
+ <codes>
1051
+ <code>
1052
+ <standard>
1053
+ <name>FB</name>
1054
+ <representation>tg_TJ</representation>
1055
+ </standard>
1056
+ </code>
1057
+ </codes>
1058
+ </language>
1059
+ <language>
1060
+ <englishName>Arabic</englishName>
1061
+ <codes>
1062
+ <code>
1063
+ <standard>
1064
+ <name>FB</name>
1065
+ <representation>ar_AR</representation>
1066
+ </standard>
1067
+ </code>
1068
+ </codes>
1069
+ </language>
1070
+ <language>
1071
+ <englishName>Hebrew</englishName>
1072
+ <codes>
1073
+ <code>
1074
+ <standard>
1075
+ <name>FB</name>
1076
+ <representation>he_IL</representation>
1077
+ </standard>
1078
+ </code>
1079
+ </codes>
1080
+ </language>
1081
+ <language>
1082
+ <englishName>Urdu</englishName>
1083
+ <codes>
1084
+ <code>
1085
+ <standard>
1086
+ <name>FB</name>
1087
+ <representation>ur_PK</representation>
1088
+ </standard>
1089
+ </code>
1090
+ </codes>
1091
+ </language>
1092
+ <language>
1093
+ <englishName>Persian</englishName>
1094
+ <codes>
1095
+ <code>
1096
+ <standard>
1097
+ <name>FB</name>
1098
+ <representation>fa_IR</representation>
1099
+ </standard>
1100
+ </code>
1101
+ </codes>
1102
+ </language>
1103
+ <language>
1104
+ <englishName>Syriac</englishName>
1105
+ <codes>
1106
+ <code>
1107
+ <standard>
1108
+ <name>FB</name>
1109
+ <representation>sy_SY</representation>
1110
+ </standard>
1111
+ </code>
1112
+ </codes>
1113
+ </language>
1114
+ <language>
1115
+ <englishName>Yiddish</englishName>
1116
+ <codes>
1117
+ <code>
1118
+ <standard>
1119
+ <name>FB</name>
1120
+ <representation>yi_DE</representation>
1121
+ </standard>
1122
+ </code>
1123
+ </codes>
1124
+ </language>
1125
+ <language>
1126
+ <englishName>Guaraní</englishName>
1127
+ <codes>
1128
+ <code>
1129
+ <standard>
1130
+ <name>FB</name>
1131
+ <representation>gn_PY</representation>
1132
+ </standard>
1133
+ </code>
1134
+ </codes>
1135
+ </language>
1136
+ <language>
1137
+ <englishName>Quechua</englishName>
1138
+ <codes>
1139
+ <code>
1140
+ <standard>
1141
+ <name>FB</name>
1142
+ <representation>qu_PE</representation>
1143
+ </standard>
1144
+ </code>
1145
+ </codes>
1146
+ </language>
1147
+ <language>
1148
+ <englishName>Aymara</englishName>
1149
+ <codes>
1150
+ <code>
1151
+ <standard>
1152
+ <name>FB</name>
1153
+ <representation>ay_BO</representation>
1154
+ </standard>
1155
+ </code>
1156
+ </codes>
1157
+ </language>
1158
+ <language>
1159
+ <englishName>Northern Sámi</englishName>
1160
+ <codes>
1161
+ <code>
1162
+ <standard>
1163
+ <name>FB</name>
1164
+ <representation>se_NO</representation>
1165
+ </standard>
1166
+ </code>
1167
+ </codes>
1168
+ </language>
1169
+ <language>
1170
+ <englishName>Pashto</englishName>
1171
+ <codes>
1172
+ <code>
1173
+ <standard>
1174
+ <name>FB</name>
1175
+ <representation>ps_AF</representation>
1176
+ </standard>
1177
+ </code>
1178
+ </codes>
1179
+ </language>
1180
+ <language>
1181
+ <englishName>Klingon</englishName>
1182
+ <codes>
1183
+ <code>
1184
+ <standard>
1185
+ <name>FB</name>
1186
+ <representation>tl_ST</representation>
1187
+ </standard>
1188
+ </code>
1189
+ </codes>
1190
+ </language>
1191
+ </languages>
app/code/community/Bytes/Facebook/etc/config.xml ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Bytes_Facebook>
5
+ <version>0.9.5</version>
6
+ </Bytes_Facebook>
7
+ </modules>
8
+ <global>
9
+ <blocks>
10
+ <wishlist>
11
+ <rewrite>
12
+ <customer_wishlist>Bytes_Facebook_Block_Customer_Wishlist</customer_wishlist>
13
+ </rewrite>
14
+ </wishlist>
15
+ <facebook>
16
+ <class>Bytes_Facebook_Block</class>
17
+ </facebook>
18
+ </blocks>
19
+ <models>
20
+ <facebook>
21
+ <class>Bytes_Facebook_Model</class>
22
+ </facebook>
23
+ <wishlist>
24
+ <rewrite><wishlist>Bytes_Facebook_Model_Wishlist</wishlist></rewrite>
25
+ </wishlist>
26
+ </models>
27
+ <helpers>
28
+ <facebook>
29
+ <class>Bytes_Facebook_Helper</class>
30
+ </facebook>
31
+ </helpers>
32
+
33
+ <resources>
34
+ <facebook_setup>
35
+ <setup>
36
+ <module>Bytes_Facebook</module>
37
+ <class>Mage_Customer_Model_Entity_Setup</class>
38
+ </setup>
39
+ <connection>
40
+ <use>core_setup</use>
41
+ </connection>
42
+ </facebook_setup>
43
+ <facebook_write>
44
+ <connection>
45
+ <use>core_write</use>
46
+ </connection>
47
+ </facebook_write>
48
+ <facebook_read>
49
+ <connection>
50
+ <use>core_read</use>
51
+ </connection>
52
+ </facebook_read>
53
+ </resources>
54
+ </global>
55
+
56
+ <frontend>
57
+ <routers>
58
+ <facebook>
59
+ <use>standard</use>
60
+ <args>
61
+ <module>Bytes_Facebook</module>
62
+ <frontName>facebook</frontName>
63
+ </args>
64
+ </facebook>
65
+ </routers>
66
+ <layout>
67
+ <updates>
68
+ <facebook module="Bytes_Facebook">
69
+ <file>facebook.xml</file>
70
+ </facebook>
71
+ </updates>
72
+ </layout>
73
+ <translate>
74
+ <modules>
75
+ <Bytes_Facebook>
76
+ <files>
77
+ <default>Bytes_Facebook.csv</default>
78
+ </files>
79
+ </Bytes_Facebook>
80
+ </modules>
81
+ </translate>
82
+ </frontend>
83
+
84
+ <adminhtml>
85
+ <translate>
86
+ <modules>
87
+ <Bytes_Facebook>
88
+ <files>
89
+ <default>Bytes_Facebook.csv</default>
90
+ </files>
91
+ </Bytes_Facebook>
92
+ </modules>
93
+ </translate>
94
+ <acl>
95
+ <resources>
96
+ <all>
97
+ <title>Allow Everything</title>
98
+ </all>
99
+ <admin>
100
+ <children>
101
+ <Bytes_Facebook>
102
+ <title>Facebook Connect Module</title>
103
+ <sort_order>10</sort_order>
104
+ </Bytes_Facebook>
105
+ <system>
106
+ <children>
107
+ <config>
108
+ <children>
109
+ <bytes_facebook>
110
+ <title>Bytes Facebook</title>
111
+ </bytes_facebook>
112
+ </children>
113
+ </config>
114
+ </children>
115
+ </system>
116
+ </children>
117
+ </admin>
118
+ </resources>
119
+ </acl>
120
+ </adminhtml>
121
+ </config>
app/code/community/Bytes/Facebook/etc/system.xml ADDED
@@ -0,0 +1,318 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <bytes translate="label">
5
+ <label>Bytes</label>
6
+ <sort_order>101</sort_order>
7
+ </bytes>
8
+ </tabs>
9
+ <sections>
10
+ <bytes_facebook>
11
+ <label>Facebook</label>
12
+ <tab>bytes</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>1000001</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="facebook">
20
+ <label>General</label>
21
+ <sort_order>1</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
+ <fields>
26
+ <enabled translate="label">
27
+ <label>Enabled</label>
28
+ <frontend_type>select</frontend_type>
29
+ <source_model>adminhtml/system_config_source_yesno</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
+ <api_key translate="label">
36
+ <label>Application Api Key</label>
37
+ <frontend_type>text</frontend_type>
38
+ <sort_order>20</sort_order>
39
+ <show_in_default>1</show_in_default>
40
+ <show_in_website>1</show_in_website>
41
+ <show_in_store>1</show_in_store>
42
+ </api_key>
43
+ <secret translate="label">
44
+ <label>Application Secret</label>
45
+ <frontend_type>text</frontend_type>
46
+ <sort_order>30</sort_order>
47
+ <show_in_default>1</show_in_default>
48
+ <show_in_website>1</show_in_website>
49
+ <show_in_store>1</show_in_store>
50
+ </secret>
51
+ <language translate="label">
52
+ <label>Language</label>
53
+ <frontend_type>select</frontend_type>
54
+ <source_model>facebook/adminhtml_system_config_source_language</source_model>
55
+ <sort_order>40</sort_order>
56
+ <show_in_default>1</show_in_default>
57
+ <show_in_website>1</show_in_website>
58
+ <show_in_store>1</show_in_store>
59
+ </language>
60
+ </fields>
61
+ </general>
62
+ <productfblike translate="label" module="facebook">
63
+ <label>Product Facebook Like</label>
64
+ <sort_order>2</sort_order>
65
+ <show_in_default>1</show_in_default>
66
+ <show_in_website>1</show_in_website>
67
+ <show_in_store>1</show_in_store>
68
+ <fields>
69
+ <layout translate="label">
70
+ <label>Layout Style</label>
71
+ <frontend_type>select</frontend_type>
72
+ <source_model>facebook/adminhtml_system_config_source_layout</source_model>
73
+ <sort_order>25</sort_order>
74
+ <show_in_default>1</show_in_default>
75
+ <show_in_website>1</show_in_website>
76
+ <show_in_store>1</show_in_store>
77
+ </layout>
78
+ <showfaces translate="lable">
79
+ <label>Show faces</label>
80
+ <frontend_type>select</frontend_type>
81
+ <source_model>adminhtml/system_config_source_yesno</source_model>
82
+ <sort_order>30</sort_order>
83
+ <show_in_default>1</show_in_default>
84
+ <show_in_website>1</show_in_website>
85
+ <show_in_store>1</show_in_store>
86
+ </showfaces>
87
+ <width translate="lable">
88
+ <label>Width</label>
89
+ <frontend_type>text</frontend_type>
90
+ <sort_order>40</sort_order>
91
+ <show_in_default>1</show_in_default>
92
+ <show_in_website>1</show_in_website>
93
+ <show_in_store>1</show_in_store>
94
+ </width>
95
+ <verb translate="label">
96
+ <label>Verb to display</label>
97
+ <frontend_type>select</frontend_type>
98
+ <source_model>facebook/adminhtml_system_config_source_verb</source_model>
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
+ </verb>
104
+ <font translate="label">
105
+ <label>Font</label>
106
+ <frontend_type>select</frontend_type>
107
+ <source_model>facebook/adminhtml_system_config_source_font</source_model>
108
+ <sort_order>70</sort_order>
109
+ <show_in_default>1</show_in_default>
110
+ <show_in_website>1</show_in_website>
111
+ <show_in_store>1</show_in_store>
112
+ </font>
113
+ <color translate="label">
114
+ <label>Color Scheme</label>
115
+ <frontend_type>select</frontend_type>
116
+ <source_model>facebook/adminhtml_system_config_source_color</source_model>
117
+ <sort_order>80</sort_order>
118
+ <show_in_default>1</show_in_default>
119
+ <show_in_website>1</show_in_website>
120
+ <show_in_store>1</show_in_store>
121
+ </color>
122
+ </fields>
123
+ </productfblike>
124
+ <categoryfblike translate="label" module="facebook">
125
+ <label>Category Facebook Like</label>
126
+ <sort_order>4</sort_order>
127
+ <show_in_default>1</show_in_default>
128
+ <show_in_website>1</show_in_website>
129
+ <show_in_store>1</show_in_store>
130
+ <fields>
131
+ <layout translate="label">
132
+ <label>Layout Style</label>
133
+ <frontend_type>select</frontend_type>
134
+ <source_model>facebook/adminhtml_system_config_source_layout</source_model>
135
+ <sort_order>25</sort_order>
136
+ <show_in_default>1</show_in_default>
137
+ <show_in_website>1</show_in_website>
138
+ <show_in_store>1</show_in_store>
139
+ </layout>
140
+ <showfaces translate="lable">
141
+ <label>Show faces</label>
142
+ <frontend_type>select</frontend_type>
143
+ <source_model>adminhtml/system_config_source_yesno</source_model>
144
+ <sort_order>30</sort_order>
145
+ <show_in_default>1</show_in_default>
146
+ <show_in_website>1</show_in_website>
147
+ <show_in_store>1</show_in_store>
148
+ </showfaces>
149
+ <width translate="lable">
150
+ <label>Width</label>
151
+ <frontend_type>text</frontend_type>
152
+ <sort_order>40</sort_order>
153
+ <show_in_default>1</show_in_default>
154
+ <show_in_website>1</show_in_website>
155
+ <show_in_store>1</show_in_store>
156
+ </width>
157
+ <verb translate="label">
158
+ <label>Verb to display</label>
159
+ <frontend_type>select</frontend_type>
160
+ <source_model>facebook/adminhtml_system_config_source_verb</source_model>
161
+ <sort_order>60</sort_order>
162
+ <show_in_default>1</show_in_default>
163
+ <show_in_website>1</show_in_website>
164
+ <show_in_store>1</show_in_store>
165
+ </verb>
166
+ <font translate="label">
167
+ <label>Font</label>
168
+ <frontend_type>select</frontend_type>
169
+ <source_model>facebook/adminhtml_system_config_source_font</source_model>
170
+ <sort_order>70</sort_order>
171
+ <show_in_default>1</show_in_default>
172
+ <show_in_website>1</show_in_website>
173
+ <show_in_store>1</show_in_store>
174
+ </font>
175
+ <color translate="label">
176
+ <label>Color Scheme</label>
177
+ <frontend_type>select</frontend_type>
178
+ <source_model>facebook/adminhtml_system_config_source_color</source_model>
179
+ <sort_order>80</sort_order>
180
+ <show_in_default>1</show_in_default>
181
+ <show_in_website>1</show_in_website>
182
+ <show_in_store>1</show_in_store>
183
+ </color>
184
+ </fields>
185
+ </categoryfblike>
186
+ <cmsfblike translate="label" module="facebook">
187
+ <label>CMS Facebook Like</label>
188
+ <sort_order>5</sort_order>
189
+ <show_in_default>1</show_in_default>
190
+ <show_in_website>1</show_in_website>
191
+ <show_in_store>1</show_in_store>
192
+ <fields>
193
+ <layout translate="label">
194
+ <label>Layout Style</label>
195
+ <frontend_type>select</frontend_type>
196
+ <source_model>facebook/adminhtml_system_config_source_layout</source_model>
197
+ <sort_order>25</sort_order>
198
+ <show_in_default>1</show_in_default>
199
+ <show_in_website>1</show_in_website>
200
+ <show_in_store>1</show_in_store>
201
+ </layout>
202
+ <showfaces translate="lable">
203
+ <label>Show faces</label>
204
+ <frontend_type>select</frontend_type>
205
+ <source_model>adminhtml/system_config_source_yesno</source_model>
206
+ <sort_order>30</sort_order>
207
+ <show_in_default>1</show_in_default>
208
+ <show_in_website>1</show_in_website>
209
+ <show_in_store>1</show_in_store>
210
+ </showfaces>
211
+ <width translate="lable">
212
+ <label>Width</label>
213
+ <frontend_type>text</frontend_type>
214
+ <sort_order>40</sort_order>
215
+ <show_in_default>1</show_in_default>
216
+ <show_in_website>1</show_in_website>
217
+ <show_in_store>1</show_in_store>
218
+ </width>
219
+ <verb translate="label">
220
+ <label>Verb to display</label>
221
+ <frontend_type>select</frontend_type>
222
+ <source_model>facebook/adminhtml_system_config_source_verb</source_model>
223
+ <sort_order>60</sort_order>
224
+ <show_in_default>1</show_in_default>
225
+ <show_in_website>1</show_in_website>
226
+ <show_in_store>1</show_in_store>
227
+ </verb>
228
+ <font translate="label">
229
+ <label>Font</label>
230
+ <frontend_type>select</frontend_type>
231
+ <source_model>facebook/adminhtml_system_config_source_font</source_model>
232
+ <sort_order>70</sort_order>
233
+ <show_in_default>1</show_in_default>
234
+ <show_in_website>1</show_in_website>
235
+ <show_in_store>1</show_in_store>
236
+ </font>
237
+ <color translate="label">
238
+ <label>Color Scheme</label>
239
+ <frontend_type>select</frontend_type>
240
+ <source_model>facebook/adminhtml_system_config_source_color</source_model>
241
+ <sort_order>80</sort_order>
242
+ <show_in_default>1</show_in_default>
243
+ <show_in_website>1</show_in_website>
244
+ <show_in_store>1</show_in_store>
245
+ </color>
246
+ </fields>
247
+ </cmsfblike>
248
+ <fbcomments translate="label">
249
+ <label>Facebook Comment Configuration</label>
250
+ <frontend_type>text</frontend_type>
251
+ <sort_order>6</sort_order>
252
+ <show_in_default>1</show_in_default>
253
+ <show_in_website>1</show_in_website>
254
+ <show_in_store>1</show_in_store>
255
+ <fields>
256
+ <unique_id_of_site translate="label">
257
+ <label>Unique ID of this site</label>
258
+ <frontend_type>text</frontend_type>
259
+ <sort_order>0</sort_order>
260
+ <show_in_default>1</show_in_default>
261
+ <show_in_website>1</show_in_website>
262
+ <show_in_store>1</show_in_store>
263
+ <comment><![CDATA[<a href="http://developers.facebook.com/setup/" target="_bank">Register</a>]]></comment>
264
+ </unique_id_of_site>
265
+ <reverse_ordering translate="label">
266
+ <label>Reverse Ordering</label>
267
+ <source_model>adminhtml/system_config_source_yesno</source_model>
268
+ <frontend_type>select</frontend_type>
269
+ <sort_order>10</sort_order>
270
+ <show_in_default>1</show_in_default>
271
+ <show_in_website>1</show_in_website>
272
+ <show_in_store>1</show_in_store>
273
+ <comment></comment>
274
+ </reverse_ordering>
275
+ <show_number_of_comment translate="label">
276
+ <label>Show number of comment</label>
277
+ <frontend_type>text</frontend_type>
278
+ <sort_order>15</sort_order>
279
+ <show_in_default>1</show_in_default>
280
+ <show_in_website>1</show_in_website>
281
+ <show_in_store>1</show_in_store>
282
+ <comment></comment>
283
+ </show_number_of_comment>
284
+ <width_of_comment_box translate="label">
285
+ <label>Width of comment box</label>
286
+ <frontend_type>text</frontend_type>
287
+ <sort_order>20</sort_order>
288
+ <show_in_default>1</show_in_default>
289
+ <show_in_website>1</show_in_website>
290
+ <show_in_store>1</show_in_store>
291
+ <comment>pixel</comment>
292
+ </width_of_comment_box>
293
+ <publish_feed translate="label">
294
+ <label>Public feed story</label>
295
+ <frontend_type>select</frontend_type>
296
+ <source_model>adminhtml/system_config_source_yesno</source_model>
297
+ <sort_order>30</sort_order>
298
+ <show_in_default>1</show_in_default>
299
+ <show_in_website>1</show_in_website>
300
+ <show_in_store>1</show_in_store>
301
+ <comment>Whether the public feed story checkbox is checked</comment>
302
+ </publish_feed>
303
+ <rounded_box>
304
+ <label>Rounded Form</label>
305
+ <frontend_type>select</frontend_type>
306
+ <source_model>adminhtml/system_config_source_yesno</source_model>
307
+ <sort_order>40</sort_order>
308
+ <show_in_default>1</show_in_default>
309
+ <show_in_website>1</show_in_website>
310
+ <show_in_store>1</show_in_store>
311
+ <comment></comment>
312
+ </rounded_box>
313
+ </fields>
314
+ </fbcomments>
315
+ </groups>
316
+ </bytes_facebook>
317
+ </sections>
318
+ </config>
app/code/community/Bytes/Facebook/sql/facebook_setup/mysql4-install-0.9.0.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->addAttribute('customer', 'facebook_uid', array(
8
+ 'type' => 'varchar',
9
+ 'label' => 'Facebook Uid',
10
+ 'visible' => false,
11
+ 'required' => false
12
+ ));
13
+
14
+ $installer->endSetup();
app/code/community/Bytes/Facebook/sql/facebook_setup/mysql4-upgrade-0.9.0-0.9.1.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ if (!$this->getAttribute('customer', 'facebook_uid', 'attribute_id')) {
8
+ $installer->addAttribute('customer', 'facebook_uid', array(
9
+ 'type' => 'varchar',
10
+ 'label' => 'Facebook Uid',
11
+ 'visible' => false,
12
+ 'required' => false
13
+ ));
14
+ }
15
+
16
+ $installer->endSetup();
app/design/frontend/default/default/layout/facebook.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout>
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addCss"><stylesheet>css/facebook/fb.css</stylesheet></action>
6
+ </reference>
7
+ <reference name="after_body_start">
8
+ <block type="facebook/template" template="facebook/init.phtml" name="facebook_init" />
9
+ </reference>
10
+ <reference name="top.links">
11
+ <block type="facebook/template" name="facebook.login">
12
+ <action method="addFacebookLink"></action>
13
+ </block>
14
+ </reference>
15
+ </default>
16
+ <customer_account_login>
17
+ <reference name="content">
18
+ <block type="facebook/template" template="facebook/login.phtml" name="facebook_login" />
19
+ </reference>
20
+ </customer_account_login>
21
+ <catalog_product_view>
22
+ <reference name="product.info.additional">
23
+ <block type="facebook/template" name="fbpcomment" before="-" template="facebook/fbcomment.phtml" />
24
+ </reference>
25
+ </catalog_product_view>
26
+ </layout>
app/design/frontend/default/default/template/facebook/category.like.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php if (Mage::getStoreConfig('bytes_facebook/general/enabled')) : ?>
2
+ <div><fb:like send="true" width="<?php echo Mage::getStoreConfig('bytes_facebook/categoryfblike/width') ?>" show_faces="<?php echo Mage::getStoreConfig('bytes_facebook/categoryfblike/showfaces'); ?>" action="<?php echo Mage::getStoreConfig('bytes_facebook/categoryfblike/verb') ?>" layout="<?php echo Mage::getStoreConfig('bytes_facebook/categoryfblike/layout') ?>" font="<?php echo Mage::getStoreConfig('bytes_facebook/categoryfblike/font'); ?>" colorscheme="<?php echo Mage::getStoreConfig('bytes_facebook/categoryfblike/color') ?>" ref="middle" fb_source="category" expr:href=' <?php echo Mage::helper('core/url')->getCurrentUrl(); ?>'/></div>
3
+ <?php endif; ?>
app/design/frontend/default/default/template/facebook/cms.like.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php if (Mage::getStoreConfig('bytes_facebook/general/enabled')) : ?>
2
+ <div><fb:like send="true" width="<?php echo Mage::getStoreConfig('bytes_facebook/cmsfblike/width') ?>" show_faces="<?php echo Mage::getStoreConfig('bytes_facebook/cmsfblike/showfaces'); ?>" action="<?php echo Mage::getStoreConfig('bytes_facebook/cmsfblike/verb') ?>" layout="<?php echo Mage::getStoreConfig('bytes_facebook/cmsfblike/layout') ?>" font="<?php echo Mage::getStoreConfig('bytes_facebook/cmsfblike/font'); ?>" colorscheme="<?php echo Mage::getStoreConfig('bytes_facebook/cmsfblike/color') ?>" ref="middle" fb_source="cms" expr:href=' <?php echo Mage::helper('core/url')->getCurrentUrl(); ?>'/></div>
3
+ <?php endif; ?>
app/design/frontend/default/default/template/facebook/fbcomment.phtml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php if (Mage::getStoreConfig('bytes_facebook/general/enabled')) : ?>
2
+ <h2>Comments</h2>
3
+ <div class="fblike">
4
+ <fb:comments numposts="<?php echo Mage::getStoreConfig('idhasoft_facebook/fbcomments/show_number_of_comment') ?>" width="<?php echo Mage::getStoreConfig('idhasoft_facebook/fbcomments/width_of_comment_box') ?>" publish_feed="<?php echo Mage::getStoreConfig('idhasoft_facebook/fbcomments/publish_feed') ?>" reverse="<?php echo Mage::getStoreConfig('idhasoft_facebook/fbcomments/reverse_ordering') ?>" simple="<?php echo Mage::getStoreConfig('idhasoft_facebook/fbcomments/rounded_box') ?>">
5
+ <fb:title></fb:title>
6
+ </fb:comments>
7
+ </div>
8
+ <?php endif; ?>
app/design/frontend/default/default/template/facebook/fblogin.phtml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php if (Mage::getStoreConfig('idhasoft_facebook/general/enabled')) : ?>
2
+ <?php if(!Mage::getSingleton('customer/session')->isLoggedIn()): ?>
3
+ <a href="javascript:void(0);"><img src="<?php echo Mage::getDesign()->getSkinUrl('images/facebook/fblogin.gif') ?>" rel="facebook-connect"></a>
4
+ <?php endif; ?>
5
+ <?php endif; ?>
app/design/frontend/default/default/template/facebook/fbwishlist.phtml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php if (Mage::getStoreConfig('bytes_facebook/general/enabled')) : ?>
2
+ <?php
3
+ $wishlistShareURL = $this->getShareWishlistURL();
4
+ ?>
5
+ <a name="fb_share" type="button_count" share_url="<?php echo urlencode($wishlistShareURL); ?>" href="http://www.facebook.com/sharer.php?u=<?php echo urlencode($wishlistShareURL); ?>">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
6
+ <?php endif; ?>
app/design/frontend/default/default/template/facebook/init.phtml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if (Mage::getStoreConfig('bytes_facebook/general/enabled')) : ?>
2
+ <!-- BEGIN Idhasoft Facebook Connect -->
3
+ <div id="fb-root"></div>
4
+ <script type="text/javascript">
5
+ //<![CDATA[
6
+ window.fbAsyncInit = function() {
7
+ FB.init({
8
+ appId : <?php echo json_encode($this->getApiKey()) ?>,
9
+ status : true, // check login status
10
+ cookie : true, // enable cookies to allow the server to access the session
11
+ xfbml : true, // parse XFBML
12
+ channelUrl : '<?php echo $this->getChannelUrl() ?>' // custom channel
13
+ });
14
+ Event.fire(window, "facebook:fbAsyncInit");
15
+ };
16
+
17
+ (function() {
18
+ var e = document.createElement('script');
19
+ e.src = document.location.protocol + '//connect.facebook.net/<?php echo $this->getLanguage() ?>/all.js';
20
+ e.async = true;
21
+ document.getElementById('fb-root').appendChild(e);
22
+ }());
23
+
24
+ document.observe('click', function(e){
25
+ var target = e.findElement('a[rel^=facebook-connect]') || e.findElement('img[rel^=facebook-connect]');
26
+ if (target && target.readAttribute('rel')=='facebook-connect') {
27
+ e.stop();
28
+ try{
29
+ FB.login(function(response){
30
+ if(response.status=='connected') setLocation('<?php echo $this->getConnectUrl() ?>');
31
+ }, {perms:<?php echo $this->getRequiredPermissions() ?>});
32
+ }catch(error){}
33
+ }
34
+ });
35
+ //]]>
36
+ </script>
37
+ <?php endif; ?>
app/design/frontend/default/default/template/facebook/login.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php if (Mage::getStoreConfig('bytes_facebook/general/enabled')) : ?>
2
+ <div class="fb-login" "rel"=>"facebook-connect"><a href="javascript:void(0);" rel="facebook-connect"><img src="<?php echo Mage::getDesign()->getSkinUrl('images/facebook/fb-login.jpg') ?>" rel="facebook-connect"></a></div>
3
+ <?php endif; ?>
app/design/frontend/default/default/template/facebook/loginviafb.phtml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php if (Mage::getStoreConfig('idhasoft_facebook/general/enabled')) : ?>
2
+ <?php if(!Mage::getSingleton('customer/session')->isLoggedIn()): ?>
3
+ <a href="javascript:void(0);"><img src="<?php echo Mage::getDesign()->getSkinUrl('images/facebook/fb-login.jpg') ?>" rel="facebook-connect"></a>
4
+ <?php endif; ?>
5
+ <?php endif; ?>
app/design/frontend/default/default/template/facebook/product.like.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php if (Mage::getStoreConfig('bytes_facebook/general/enabled')) : ?>
2
+ <div><fb:like send="true" width="<?php echo Mage::getStoreConfig('bytes_facebook/productfblike/width') ?>" show_faces="<?php echo Mage::getStoreConfig('bytes_facebook/productfblike/showfaces'); ?>" action="<?php echo Mage::getStoreConfig('bytes_facebook/productfblike/verb') ?>" layout="<?php echo Mage::getStoreConfig('bytes_facebook/productfblike/layout') ?>" font="<?php echo Mage::getStoreConfig('bytes_facebook/productfblike/font'); ?>" colorscheme="<?php echo Mage::getStoreConfig('bytes_facebook/productfblike/color') ?>" ref="middle" fb_source="product" expr:href=' <?php echo Mage::helper('core/url')->getCurrentUrl(); ?>'/></div>
3
+ <?php endif; ?>
app/etc/modules/Bytes_Facebook.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Bytes_Facebook>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Bytes_Facebook>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Facebook_Connect_Like_Share_Wishlist_And_Post_Comment</name>
4
+ <version>1.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 connect, Like, Share Wishlist and Post Comment extension allows to connect store using your Facebook account, share product via Facebook, Post product comment on Profile Page, Share your Wishlist, Like products via Facebook Like Button and Send to friends using Send button.</summary>
10
+ <description>2.1 FACEBOOK CONNECTS&#xD;
11
+ &#x2022; Automatic shop-account creation&#xD;
12
+ &#x2022; Single click Login with using Facebook&#xD;
13
+ &#x2022; Facebook Connect on checkout page&#xD;
14
+ &#x2022; Allow to place Facebook login block to anywhere in site&#xD;
15
+ &#xD;
16
+ 2.2 FACEBOOK LIKE&#xD;
17
+ &#x2022; Easy to add anywhere in site.&#xD;
18
+ &#x2022; Configure all aspects of the Like + Send button from one place in Magento admin&#xD;
19
+ &#xD;
20
+ 2.3 FACEBOOK SHARE WISHLIST&#xD;
21
+ &#x2022; Any logged in user can share his wishlist.&#xD;
22
+ &#x2022; Allow to view shared wishlist by one click without login into system&#xD;
23
+ &#xD;
24
+ 2.4 FACEBOOK POST COMMENTS&#xD;
25
+ &#x2022; Magento Store user can post comments on products using Facebook and publish that comments on facebook user profile.&#xD;
26
+ &#x2022; Allow to like posted comments</description>
27
+ <notes>Facebook Connect, Like, Share Wishlist and Post Comment preview release</notes>
28
+ <authors><author><name>Bytes Technolab</name><user>bhaveshsurani</user><email>bhaveshsurani@gmail.com</email></author></authors>
29
+ <date>2011-12-09</date>
30
+ <time>12:04:45</time>
31
+ <contents><target name="magecommunity"><dir name="Bytes"><dir name="Facebook"><dir name="Block"><file name="Channel.php" hash="ff3b32eae419d2963574329f489e3150"/><dir name="Customer"><file name="Wishlist.php" hash="3888e5fa47d065ef91d9a8d1d80b0f62"/></dir><file name="Template.php" hash="84b0197664e1e2212a418a1bb302e9d0"/></dir><dir name="Helper"><file name="Data.php" hash="cd923d1fb501114953569e5759e05b8a"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Color.php" hash="5ead5532ff0f5fd4b5234baa88d90791"/><file name="Font.php" hash="23d1dd921281a3e616706b107806e68d"/><file name="Language.php" hash="0a93d00735c31424ab8a5a1751c4aca9"/><file name="Layout.php" hash="f79ba3c9d9bebfb37e49bd79a10c5573"/><file name="Verb.php" hash="0df040fb642d9784705920bb888f6d58"/></dir></dir></dir></dir><file name="Client.php" hash="2354ddea8140e398c27cd57a132f9f22"/><file name="Config.php" hash="6a6640789e3610738874bd79563689a7"/><file name="Language.php" hash="413095a744ce30bd2e0d7432e13fc899"/><file name="Session.php" hash="756f06d3751f4c4a6bec00398aa75d47"/><file name="Wishlist.php" hash="16d9d9134fdacb740005225a7faa9299"/></dir><dir name="controllers"><file name="ChannelController.php" hash="029f8330a33bb3a02876bbbe95afe388"/><dir name="Customer"><file name="AccountController.php" hash="642e4006396792f193e884d99db6f7a9"/></dir></dir><dir name="etc"><file name="FacebookLanguages.xml" hash="5ebbbe1a7eb21fdc8fed5a44950da164"/><file name="config.xml" hash="8ac61ad2436b574a84d26c32b259828b"/><file name="system.xml" hash="ecf039290e431c3cda6a23addcb80abe"/></dir><dir name="sql"><dir name="facebook_setup"><file name="mysql4-install-0.9.0.php" hash="3d0579de082e6295e5d6f43865b578b7"/><file name="mysql4-upgrade-0.9.0-0.9.1.php" hash="f6cac718cd1df2be5e5ce42440dc94a7"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Bytes_Facebook.xml" hash="27caa96acf287104c72ed248ff344547"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="facebook.xml" hash="60178d6e3df6d5cf6cecd1d3d34bdc1c"/></dir><dir name="template"><dir name="facebook"><file name="category.like.phtml" hash="05ed3570be7c8439056fb12eff596e3b"/><file name="cms.like.phtml" hash="76564119cabef48380ed34262d32c3ab"/><file name="fbcomment.phtml" hash="4d7b88583bebd1b210fcb5c71b6ca0b1"/><file name="fblogin.phtml" hash="01504fd577068136314cfc540ebc229f"/><file name="fbwishlist.phtml" hash="224a5ce2f08601f9f44ead501b2d9acb"/><file name="init.phtml" hash="d13aa98cf704f9755cbb41010482e137"/><file name="login.phtml" hash="fa01d050455b28f1756a38db3013ed23"/><file name="loginviafb.phtml" hash="907d3ab4b0e3e25e3d21afa684382a80"/><file name="product.like.phtml" hash="6bdc948a83bac34854eb3682d7c09c9e"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="images"><dir name="facebook"><file name="Thumbs.db" hash="dbdd6f41831aa6c84276bfe427bf4243"/><file name="fb-login.jpg" hash="ea97f22ec1859a83367208ed46079af4"/><file name="fblogin.gif" hash="865312ef4436675a9c79bacb7c97407f"/></dir></dir><dir name="css"><dir name="facebook"><file name="fb.css" hash="e22ec035bc261958620cf190b96be0c2"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="user-guide"><file name="Bytes_Facebook_UG_V1.0.pdf" hash="823a3fd8070c523f842b4cacbe0d8cf8"/></dir></target></contents>
32
+ <compatible/>
33
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.3</min><max>1.7</max></package></required></dependencies>
34
+ </package>
skin/frontend/default/default/css/facebook/fb.css ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* CSS Document */
2
+ .fb-login{
3
+ clear:both;
4
+ margin: 30px 0 0 0;
5
+ text-align:center;
6
+ }
7
+
8
+ .fblike{
9
+ clear:both;
10
+ margin: 30px 0 0 0;
11
+ text-align:center;
12
+ }
skin/frontend/default/default/images/facebook/Thumbs.db ADDED
Binary file
skin/frontend/default/default/images/facebook/fb-login.jpg ADDED
Binary file
skin/frontend/default/default/images/facebook/fblogin.gif ADDED
Binary file
user-guide/Bytes_Facebook_UG_V1.0.pdf ADDED
Binary file