Version Notes
http://store.belvg.com/facebook-connect-and-like-free.html
Download this release
Release Info
Developer | Magento Core Team |
Extension | facebookfreebelvg |
Version | 2.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.7 to 2.0.1
- app/code/community/Belvg/All/Block/Extensions.php +61 -42
- app/code/community/Belvg/All/Block/Store.php +66 -12
- app/code/community/Belvg/All/Helper/Config.php +97 -0
- app/code/community/Belvg/All/Helper/Data.php +94 -15
- app/code/community/Belvg/All/Model/Feed.php +87 -90
- app/code/community/Belvg/All/Model/Observer.php +47 -0
- app/code/community/Belvg/All/Model/Source/Updates/Type.php +46 -8
- app/code/community/Belvg/All/etc/adminhtml.xml +31 -11
- app/code/community/Belvg/All/etc/config.xml +88 -110
- app/code/community/Belvg/All/etc/system.xml +33 -33
- app/code/community/Belvg/All/sql/belvgall_setup/mysql4-install-1.0.0.php +31 -1
- app/code/community/Belvg/All/sql/belvgall_setup/mysql4-upgrade-1.0.0-1.0.1.php +35 -22
- app/code/community/Belvg/All/sql/belvgall_setup/mysql4-upgrade-1.0.1-2.0.0.php +33 -0
- app/code/community/Belvg/FacebookFree/Block/Active.php +0 -86
- app/code/community/Belvg/FacebookFree/Block/Init.php +36 -0
- app/code/community/Belvg/FacebookFree/Block/Like/Meta.php +56 -0
- app/code/community/Belvg/FacebookFree/Block/Links.php +6 -48
- app/code/community/Belvg/FacebookFree/Block/Links/Button.php +37 -0
- app/code/community/Belvg/FacebookFree/Block/Page/Html/Header.php +29 -0
- app/code/community/Belvg/FacebookFree/Helper/Active.php +0 -121
- app/code/community/Belvg/FacebookFree/Helper/Config.php +121 -0
- app/code/community/Belvg/FacebookFree/Helper/Data.php +28 -31
- app/code/community/Belvg/FacebookFree/Model/Customer.php +86 -0
- app/code/community/Belvg/FacebookFree/Model/FacebookFree.php +0 -39
- app/code/community/Belvg/FacebookFree/Model/Facebookfree.php +62 -0
- app/code/community/Belvg/FacebookFree/Model/Locale.php +49 -0
- app/code/community/Belvg/FacebookFree/Model/Mysql4/FacebookFree.php +2 -34
- app/code/community/Belvg/FacebookFree/Model/Mysql4/Setup.php +0 -34
- app/code/community/Belvg/FacebookFree/Model/Request.php +83 -0
- app/code/community/Belvg/FacebookFree/Model/Request/Cookie.php +87 -0
- app/code/community/Belvg/FacebookFree/Model/Resource/Facebookfree.php +10 -0
- app/code/community/Belvg/FacebookFree/Model/Resource/Facebookfree/Collection.php +9 -0
- app/code/community/Belvg/FacebookFree/Model/System/Config/Source/Layout.php +1 -1
- app/code/community/Belvg/FacebookFree/controllers/CustomerController.php +63 -186
- app/code/community/Belvg/FacebookFree/etc/adminhtml.xml +0 -32
- app/code/community/Belvg/FacebookFree/etc/config.xml +83 -120
- app/code/community/Belvg/FacebookFree/etc/locale.xml +327 -0
- app/code/community/Belvg/FacebookFree/etc/system.xml +8 -107
- app/code/community/Belvg/FacebookFree/sql/facebookfree_setup/mysql4-install-1.0.1.php +16 -41
- app/design/frontend/base/default/layout/belvg/facebookfree.xml +63 -0
- app/design/frontend/base/default/template/belvg/facebookfree/block.phtml +46 -0
- app/design/frontend/base/default/template/belvg/facebookfree/form/button.phtml +5 -0
- app/design/frontend/{default/default/template/facebookfree/checkoutlogin.phtml → base/default/template/belvg/facebookfree/form/checkout/login.phtml} +54 -24
- app/design/frontend/{default/default/template/facebookfree → base/default/template/belvg/facebookfree/form/customer}/login.phtml +34 -24
- app/design/frontend/base/default/template/belvg/facebookfree/like/meta.phtml +7 -0
- app/design/frontend/base/default/template/belvg/facebookfree/like/product/view/addto.phtml +45 -0
- app/design/frontend/base/default/template/belvg/facebookfree/links.phtml +5 -0
- app/design/frontend/default/default/layout/facebookfree.xml +0 -93
- app/design/frontend/default/default/template/facebookfree/activity.phtml +0 -36
- app/design/frontend/default/default/template/facebookfree/block.phtml +0 -82
- app/design/frontend/default/default/template/facebookfree/like/head.phtml +0 -43
- app/design/frontend/default/default/template/facebookfree/like/product/view/addto.phtml +0 -45
- app/design/frontend/default/default/template/facebookfree/links.phtml +0 -54
- app/design/frontend/default/default/template/facebookfree/top.links.phtml +0 -48
- app/etc/modules/Belvg_All.xml +34 -35
- app/etc/modules/Belvg_FacebookFree.xml +4 -1
- lib/Facebook/Api.php +0 -872
- lib/Facebook/Exception.php +0 -83
- lib/Facebook/fb_ca_chain_bundle.crt +0 -121
- package.xml +9 -9
- skin/adminhtml/default/default/images/belvgall/bad.gif +0 -0
- skin/adminhtml/default/default/images/belvgall/delete.jpg +0 -0
- skin/adminhtml/default/default/images/belvgall/info.gif +0 -0
- skin/adminhtml/default/default/images/belvgall/ok.gif +0 -0
- skin/adminhtml/default/default/images/belvgall/update.gif +0 -0
- skin/frontend/default/default/css/belvg/facebookfree.css +0 -33
- skin/frontend/default/default/images/belvg/fb.gif +0 -0
app/code/community/Belvg/All/Block/Extensions.php
CHANGED
@@ -1,10 +1,48 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
protected $_fieldRenderer;
|
6 |
-
protected $_values;
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
public function render(Varien_Data_Form_Element_Abstract $element)
|
9 |
{
|
10 |
$html = $this->_getHeaderHtml($element);
|
@@ -21,71 +59,52 @@ class Belvg_All_Block_Extensions extends Mage_Adminhtml_Block_System_Config_Form
|
|
21 |
continue;
|
22 |
}
|
23 |
|
24 |
-
$html.= $this->_getFieldHtml($element, $moduleName);
|
25 |
}
|
|
|
26 |
$html .= $this->_getFooterHtml($element);
|
27 |
|
28 |
return $html;
|
29 |
}
|
30 |
-
|
31 |
|
|
|
|
|
|
|
|
|
|
|
32 |
protected function _getFieldRenderer()
|
33 |
{
|
34 |
if (empty($this->_fieldRenderer)) {
|
35 |
$this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
|
36 |
}
|
|
|
37 |
return $this->_fieldRenderer;
|
38 |
}
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
protected function _getFieldHtml($fieldset, $moduleCode)
|
41 |
{
|
42 |
$currentVer = Mage::getConfig()->getModuleConfig($moduleCode)->version;
|
43 |
-
if (!$currentVer)
|
44 |
return '';
|
45 |
-
|
46 |
-
$moduleName = substr($moduleCode, strpos($moduleCode, '_') + 1); // in case we have no data in the RSS
|
47 |
-
|
48 |
-
$allExtensions = unserialize(Mage::app()->loadCache('belvgall_extensions'));
|
49 |
-
|
50 |
-
$status = '<a target="_blank"><img src="' . $this->getSkinUrl('images/belvgall/ok.gif') . '" title="' . $this->__("Installed") . '"/></a>';
|
51 |
-
|
52 |
-
if ($allExtensions && isset($allExtensions[$moduleCode])) {
|
53 |
-
$ext = $allExtensions[$moduleCode];
|
54 |
-
|
55 |
-
$url = $ext['url'];
|
56 |
-
$name = $ext['name'];
|
57 |
-
$lastVer = $ext['version'];
|
58 |
-
|
59 |
-
$moduleName = '<a href="' . $url . '" target="_blank" title="' . $name . '">' . $name . "</a>";
|
60 |
-
|
61 |
-
if ($this->_convertVersion($currentVer) < $this->_convertVersion($lastVer)) {
|
62 |
-
$status = '<a href="' . $url . '" target="_blank"><img src="' . $this->getSkinUrl('images/belvgall/update.gif') . '" alt="' . $this->__("Update available") . '" title="' . $this->__("Update available") . '"/></a>';
|
63 |
-
}
|
64 |
}
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
$moduleName = $status . ' ' . $moduleName;
|
69 |
|
70 |
$field = $fieldset->addField($moduleCode, 'label', array(
|
71 |
'name' => 'dummy',
|
72 |
-
'label' => $
|
73 |
'value' => $currentVer,
|
74 |
))->setRenderer($this->_getFieldRenderer());
|
75 |
|
76 |
return $field->toHtml();
|
77 |
}
|
78 |
|
79 |
-
|
80 |
-
{
|
81 |
-
$digits = @explode(".", $v);
|
82 |
-
$version = 0;
|
83 |
-
if (is_array($digits)) {
|
84 |
-
foreach ($digits as $k => $v) {
|
85 |
-
$version += ($v * pow(10, max(0, (3 - $k))));
|
86 |
-
}
|
87 |
-
}
|
88 |
-
return $version;
|
89 |
-
}
|
90 |
-
|
91 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* BelVG LLC.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
+
*
|
13 |
+
* **************************************
|
14 |
+
* MAGENTO EDITION USAGE NOTICE *
|
15 |
+
* ***************************************
|
16 |
+
* This package designed for Magento COMMUNITY edition
|
17 |
+
* BelVG does not guarantee correct work of this extension
|
18 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
+
* BelVG does not provide extension support in case of
|
20 |
+
* incorrect edition usage.
|
21 |
+
* **************************************
|
22 |
+
* DISCLAIMER *
|
23 |
+
* ***************************************
|
24 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
+
* versions in the future.
|
26 |
+
* ****************************************************
|
27 |
+
* @category Belvg
|
28 |
+
* @package Belvg_All
|
29 |
+
* @copyright Copyright (c) 2010 - 2014 BelVG LLC. (http://www.belvg.com)
|
30 |
+
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
+
*/
|
32 |
+
class Belvg_All_Block_Extensions extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
|
33 |
+
{
|
34 |
+
|
35 |
+
/**
|
36 |
+
* @var Mage_Adminhtml_Block_System_Config_Form_Field
|
37 |
+
*/
|
38 |
protected $_fieldRenderer;
|
|
|
39 |
|
40 |
+
/**
|
41 |
+
* Render installed belvg modules
|
42 |
+
*
|
43 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
44 |
+
* @return string
|
45 |
+
*/
|
46 |
public function render(Varien_Data_Form_Element_Abstract $element)
|
47 |
{
|
48 |
$html = $this->_getHeaderHtml($element);
|
59 |
continue;
|
60 |
}
|
61 |
|
62 |
+
$html .= $this->_getFieldHtml($element, $moduleName);
|
63 |
}
|
64 |
+
|
65 |
$html .= $this->_getFooterHtml($element);
|
66 |
|
67 |
return $html;
|
68 |
}
|
|
|
69 |
|
70 |
+
/**
|
71 |
+
* Get renderer class
|
72 |
+
*
|
73 |
+
* @return Mage_Adminhtml_Block_System_Config_Form_Field
|
74 |
+
*/
|
75 |
protected function _getFieldRenderer()
|
76 |
{
|
77 |
if (empty($this->_fieldRenderer)) {
|
78 |
$this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
|
79 |
}
|
80 |
+
|
81 |
return $this->_fieldRenderer;
|
82 |
}
|
83 |
|
84 |
+
/**
|
85 |
+
* Fromat list of BelVG extensions
|
86 |
+
*
|
87 |
+
* @param type $fieldset
|
88 |
+
* @param string $moduleCode
|
89 |
+
* @return string
|
90 |
+
*/
|
91 |
protected function _getFieldHtml($fieldset, $moduleCode)
|
92 |
{
|
93 |
$currentVer = Mage::getConfig()->getModuleConfig($moduleCode)->version;
|
94 |
+
if (!$currentVer) {
|
95 |
return '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
}
|
97 |
|
98 |
+
$moduleName = substr($moduleCode, strpos($moduleCode, '_') + 1);
|
99 |
+
$module = __('<img src="%s" title="%s"></a> %s', $this->getSkinUrl('images/success_msg_icon.gif'), $this->__('installed'), $moduleName);
|
|
|
100 |
|
101 |
$field = $fieldset->addField($moduleCode, 'label', array(
|
102 |
'name' => 'dummy',
|
103 |
+
'label' => $module,
|
104 |
'value' => $currentVer,
|
105 |
))->setRenderer($this->_getFieldRenderer());
|
106 |
|
107 |
return $field->toHtml();
|
108 |
}
|
109 |
|
110 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Belvg/All/Block/Store.php
CHANGED
@@ -1,24 +1,78 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
class Belvg_All_Block_Store extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
|
5 |
{
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
11 |
public function render(Varien_Data_Form_Element_Abstract $element)
|
12 |
{
|
13 |
-
return '<div id="' . $element->getId() . '">'
|
14 |
-
return $html;
|
15 |
}
|
16 |
-
|
17 |
-
private function getContent() {
|
18 |
-
$data = null;
|
19 |
-
$url = 'http://belvg.com/promoadmin/fbfree.xml';
|
20 |
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
return $data;
|
23 |
}
|
|
|
24 |
}
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* BelVG LLC.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
+
*
|
13 |
+
* **************************************
|
14 |
+
* MAGENTO EDITION USAGE NOTICE *
|
15 |
+
* ***************************************
|
16 |
+
* This package designed for Magento COMMUNITY edition
|
17 |
+
* BelVG does not guarantee correct work of this extension
|
18 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
+
* BelVG does not provide extension support in case of
|
20 |
+
* incorrect edition usage.
|
21 |
+
* **************************************
|
22 |
+
* DISCLAIMER *
|
23 |
+
* ***************************************
|
24 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
+
* versions in the future.
|
26 |
+
* ****************************************************
|
27 |
+
* @category Belvg
|
28 |
+
* @package Belvg_All
|
29 |
+
* @copyright Copyright (c) 2010 - 2014 BelVG LLC. (http://www.belvg.com)
|
30 |
+
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
+
*/
|
32 |
class Belvg_All_Block_Store extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
|
33 |
{
|
34 |
|
35 |
+
/**
|
36 |
+
* Render extensions store tab
|
37 |
+
*
|
38 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
39 |
+
* @return string
|
40 |
+
*/
|
41 |
public function render(Varien_Data_Form_Element_Abstract $element)
|
42 |
{
|
43 |
+
return '<div id="' . $element->getId() . '">' . $this->getContent() . '</div>';
|
|
|
44 |
}
|
|
|
|
|
|
|
|
|
45 |
|
46 |
+
/**
|
47 |
+
* Read html from the store feed
|
48 |
+
*
|
49 |
+
* @return string
|
50 |
+
*/
|
51 |
+
private function getContent()
|
52 |
+
{
|
53 |
+
$data = NULL;
|
54 |
+
|
55 |
+
if (!extension_loaded('curl')) {
|
56 |
+
return $data;
|
57 |
+
}
|
58 |
+
|
59 |
+
$url = Mage::helper('belvgall')->getStoreUrl();
|
60 |
+
|
61 |
+
$curl = new Varien_Http_Adapter_Curl();
|
62 |
+
$curl->setConfig(array(
|
63 |
+
'timeout' => 2,
|
64 |
+
'header' => FALSE,
|
65 |
+
));
|
66 |
+
|
67 |
+
$curl->write(Zend_Http_Client::GET, $url, '1.0');
|
68 |
+
$data = $curl->read();
|
69 |
+
if ($data === FALSE) {
|
70 |
+
return NULL;
|
71 |
+
}
|
72 |
+
|
73 |
+
$curl->close();
|
74 |
+
|
75 |
return $data;
|
76 |
}
|
77 |
+
|
78 |
}
|
app/code/community/Belvg/All/Helper/Config.php
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* BelVG LLC.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
+
*
|
13 |
+
* **************************************
|
14 |
+
* MAGENTO EDITION USAGE NOTICE *
|
15 |
+
* ***************************************
|
16 |
+
* This package designed for Magento COMMUNITY edition
|
17 |
+
* BelVG does not guarantee correct work of this extension
|
18 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
+
* BelVG does not provide extension support in case of
|
20 |
+
* incorrect edition usage.
|
21 |
+
* **************************************
|
22 |
+
* DISCLAIMER *
|
23 |
+
* ***************************************
|
24 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
+
* versions in the future.
|
26 |
+
* ****************************************************
|
27 |
+
* @category Belvg
|
28 |
+
* @package Belvg_All
|
29 |
+
* @copyright Copyright (c) 2010 - 2014 BelVG LLC. (http://www.belvg.com)
|
30 |
+
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
+
*/
|
32 |
+
class Belvg_All_Helper_Config extends Mage_Core_Helper_Data
|
33 |
+
{
|
34 |
+
|
35 |
+
const XML_PATH_FREQUENCY = 'belvgall/feed/check_frequency';
|
36 |
+
const XML_PATH_LAST_UPDATE = 'belvgall/feed/last_update';
|
37 |
+
const XML_PATH_INTERESTS = 'belvgall/feed/interests';
|
38 |
+
const XML_PATH_INSTALLED = 'belvgall/feed/installed';
|
39 |
+
const URL_NEWS = 'http://belvg.com/feed-news.xml';
|
40 |
+
const URL_STORE = 'http://belvg.com/promoadmin/fbfree.xml';
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Return URL to the feed
|
44 |
+
*
|
45 |
+
* @return string
|
46 |
+
*/
|
47 |
+
public function getFeedUrl()
|
48 |
+
{
|
49 |
+
return self::URL_NEWS;
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Get URL for the etension store tab
|
54 |
+
*
|
55 |
+
* @return string
|
56 |
+
*/
|
57 |
+
public function getStoreUrl()
|
58 |
+
{
|
59 |
+
return self::URL_STORE;
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Get user selected interests
|
64 |
+
*
|
65 |
+
* @return string
|
66 |
+
*/
|
67 |
+
public function getInterests()
|
68 |
+
{
|
69 |
+
return Mage::getStoreConfig(self::XML_PATH_INTERESTS);
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Date of the Belvg_ALL module installation (timestamp)
|
74 |
+
* @return int
|
75 |
+
*/
|
76 |
+
public function getInstalledDate()
|
77 |
+
{
|
78 |
+
return Mage::getStoreConfig(self::XML_PATH_INSTALLED);
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Save data to the configuration and cache
|
83 |
+
*
|
84 |
+
* @param string $key
|
85 |
+
* @param string $data
|
86 |
+
* @param string $scope
|
87 |
+
* @param int $store
|
88 |
+
* @return Belvg_All_Helper_Config
|
89 |
+
*/
|
90 |
+
public function saveConfig($key, $data, $scope = 'default', $store = 0)
|
91 |
+
{
|
92 |
+
Mage::app()->saveCache($data, $key);
|
93 |
+
Mage::getModel('core/config')->saveConfig($key, $data, $scope, $store);
|
94 |
+
return $this;
|
95 |
+
}
|
96 |
+
|
97 |
+
}
|
app/code/community/Belvg/All/Helper/Data.php
CHANGED
@@ -1,21 +1,100 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
{
|
7 |
-
|
8 |
-
|
9 |
-
foreach ($need as $k => $v){
|
10 |
-
if ($curr[$k] != $v)
|
11 |
-
return ($curr[$k] < $v);
|
12 |
}
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
{
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* BelVG LLC.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
+
*
|
13 |
+
* **************************************
|
14 |
+
* MAGENTO EDITION USAGE NOTICE *
|
15 |
+
* ***************************************
|
16 |
+
* This package designed for Magento COMMUNITY edition
|
17 |
+
* BelVG does not guarantee correct work of this extension
|
18 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
+
* BelVG does not provide extension support in case of
|
20 |
+
* incorrect edition usage.
|
21 |
+
* **************************************
|
22 |
+
* DISCLAIMER *
|
23 |
+
* ***************************************
|
24 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
+
* versions in the future.
|
26 |
+
* ****************************************************
|
27 |
+
* @category Belvg
|
28 |
+
* @package Belvg_All
|
29 |
+
* @copyright Copyright (c) 2010 - 2014 BelVG LLC. (http://www.belvg.com)
|
30 |
+
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
+
*/
|
32 |
+
class Belvg_All_Helper_Data extends Belvg_All_Helper_Config
|
33 |
{
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Get update feed frequency
|
37 |
+
*
|
38 |
+
* @return int
|
39 |
+
*/
|
40 |
+
public function getFrequency()
|
41 |
+
{
|
42 |
+
$frequency = Mage::app()->loadCache(self::XML_PATH_FREQUENCY);
|
43 |
+
|
44 |
+
if (!$frequency) {
|
45 |
+
$frequency = Mage::getStoreConfig(self::XML_PATH_FREQUENCY);
|
46 |
+
$this->saveConfig(self::XML_PATH_FREQUENCY, $frequency);
|
47 |
+
}
|
48 |
+
|
49 |
+
return $frequency;
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Get timestamp of the date when last feed update was performed
|
54 |
+
*
|
55 |
+
* @return int
|
56 |
+
*/
|
57 |
+
public function getLastUpdate()
|
58 |
+
{
|
59 |
+
$last_check = Mage::app()->loadCache(self::XML_PATH_LAST_UPDATE);
|
60 |
+
if (!$last_check) {
|
61 |
+
$last_check = Mage::getStoreConfig(self::XML_PATH_LAST_UPDATE);
|
62 |
+
$this->saveConfig(self::XML_PATH_LAST_UPDATE, $last_check);
|
63 |
+
}
|
64 |
+
|
65 |
+
return $last_check;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Save date of the last feed update (timestamp)
|
70 |
+
*
|
71 |
+
* @param Belvg_All_Helper_Data
|
72 |
+
*/
|
73 |
+
public function setLastUpdate($datetime = NULL)
|
74 |
{
|
75 |
+
if (is_null($datetime)) {
|
76 |
+
$datetime = Zend_Date::now()->getTimestamp();
|
|
|
|
|
|
|
77 |
}
|
78 |
+
|
79 |
+
$this->saveConfig(self::XML_PATH_LAST_UPDATE, $datetime);
|
80 |
+
return $this;
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Check if extension is installed
|
85 |
+
*
|
86 |
+
* @param string $code
|
87 |
+
* @return boolean
|
88 |
+
*/
|
89 |
+
public function hasExtension($code)
|
90 |
{
|
91 |
+
$modules = array_keys((array) Mage::getConfig()->getNode('modules')->children());
|
92 |
+
|
93 |
+
if (in_array($code, $modules)) {
|
94 |
+
return TRUE;
|
95 |
+
}
|
96 |
+
|
97 |
+
return FALSE;
|
98 |
+
}
|
99 |
+
|
100 |
+
}
|
app/code/community/Belvg/All/Model/Feed.php
CHANGED
@@ -1,145 +1,142 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
{
|
13 |
-
|
|
|
14 |
}
|
15 |
|
|
|
|
|
|
|
|
|
|
|
16 |
public function checkUpdate()
|
17 |
{
|
18 |
-
|
|
|
|
|
19 |
return $this;
|
20 |
}
|
21 |
|
22 |
-
$this->setLastUpdate();
|
23 |
|
24 |
if (!extension_loaded('curl')) {
|
25 |
return $this;
|
26 |
}
|
27 |
|
28 |
-
|
29 |
-
$
|
30 |
-
$
|
31 |
-
|
32 |
-
$wasInstalled = gmdate('Y-m-d H:i:s', Mage::getStoreConfig('belvgall/feed/installed'));
|
33 |
|
34 |
-
if ($
|
35 |
-
foreach ($
|
36 |
$date = $this->getDate((string) $item->pubDate);
|
37 |
|
38 |
-
|
39 |
-
if ($date < $wasInstalled) {
|
40 |
continue;
|
41 |
}
|
|
|
42 |
if (!$this->isInteresting($item)) {
|
43 |
continue;
|
44 |
}
|
45 |
|
46 |
-
$
|
47 |
'severity' => 3,
|
48 |
'date_added' => $this->getDate($date),
|
49 |
'title' => (string) $item->title,
|
50 |
'description' => (string) $item->description,
|
51 |
'url' => (string) $item->link,
|
52 |
);
|
53 |
-
}
|
54 |
-
if ($feedData) {
|
55 |
-
Mage::getModel('adminnotification/inbox')->parse($feedData);
|
56 |
}
|
57 |
-
}
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
$feedData = array();
|
62 |
-
$feedXml = $this->getFeedData();
|
63 |
-
if ($feedXml && $feedXml->channel && $feedXml->channel->item) {
|
64 |
-
foreach ($feedXml->channel->item as $item) {
|
65 |
-
$feedData[(string) $item->code] = array(
|
66 |
-
'name' => (string) $item->title,
|
67 |
-
'url' => (string) $item->link,
|
68 |
-
'version' => (string) $item->version,
|
69 |
-
);
|
70 |
-
}
|
71 |
-
if ($feedData) {
|
72 |
-
Mage::app()->saveCache(serialize($feedData), 'belvgall_extensions');
|
73 |
}
|
74 |
}
|
75 |
-
|
76 |
-
return $this;
|
77 |
-
}
|
78 |
-
|
79 |
-
public function getFrequency()
|
80 |
-
{
|
81 |
-
return Mage::getStoreConfig(self::XML_FREQUENCY_PATH);
|
82 |
-
}
|
83 |
-
|
84 |
-
public function getLastUpdate()
|
85 |
-
{
|
86 |
-
return Mage::app()->loadCache('belvgall_notifications_lastcheck');
|
87 |
-
}
|
88 |
-
|
89 |
-
public function setLastUpdate()
|
90 |
-
{
|
91 |
-
Mage::app()->saveCache(time(), 'belvgall_notifications_lastcheck');
|
92 |
-
return $this;
|
93 |
}
|
94 |
|
|
|
|
|
|
|
|
|
95 |
public function getFeedUrl()
|
96 |
{
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
$query = '?s=' . urlencode(Mage::getStoreConfig('web/unsecure/base_url'));
|
101 |
-
return $this->_feedUrl . $query;
|
102 |
-
}
|
103 |
|
104 |
-
|
105 |
-
{
|
106 |
-
return Mage::getStoreConfig(self::XML_ITERESTS);
|
107 |
}
|
108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
protected function isInteresting($item)
|
110 |
-
{
|
111 |
-
$interests = @explode(',', $this->getInterests());
|
112 |
$types = @explode(':', (string) $item->type);
|
113 |
|
114 |
$extenion = (string) $item->extension;
|
115 |
|
116 |
-
$selfUpgrades = array_search(Belvg_All_Model_Source_Updates_Type::TYPE_INSTALLED_UPDATE, $types);
|
117 |
-
|
118 |
foreach ($types as $type) {
|
119 |
-
if (
|
120 |
-
return
|
121 |
}
|
122 |
|
123 |
-
if ($extenion && ($type == Belvg_All_Model_Source_Updates_Type::TYPE_UPDATE_RELEASE)
|
124 |
-
if ($this->
|
125 |
-
return
|
126 |
}
|
127 |
}
|
128 |
}
|
129 |
|
130 |
-
return
|
131 |
-
}
|
132 |
-
|
133 |
-
protected function isExtensionInstalled($code)
|
134 |
-
{
|
135 |
-
$modules = array_keys((array) Mage::getConfig()->getNode('modules')->children());
|
136 |
-
foreach ($modules as $moduleName) {
|
137 |
-
if ($moduleName == $code) {
|
138 |
-
return true;
|
139 |
-
}
|
140 |
-
}
|
141 |
-
|
142 |
-
return false;
|
143 |
}
|
144 |
|
145 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* BelVG LLC.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
+
*
|
13 |
+
* **************************************
|
14 |
+
* MAGENTO EDITION USAGE NOTICE *
|
15 |
+
* ***************************************
|
16 |
+
* This package designed for Magento COMMUNITY edition
|
17 |
+
* BelVG does not guarantee correct work of this extension
|
18 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
+
* BelVG does not provide extension support in case of
|
20 |
+
* incorrect edition usage.
|
21 |
+
* **************************************
|
22 |
+
* DISCLAIMER *
|
23 |
+
* ***************************************
|
24 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
+
* versions in the future.
|
26 |
+
* ****************************************************
|
27 |
+
* @category Belvg
|
28 |
+
* @package Belvg_All
|
29 |
+
* @copyright Copyright (c) 2010 - 2014 BelVG LLC. (http://www.belvg.com)
|
30 |
+
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
+
*/
|
32 |
+
class Belvg_All_Model_Feed extends Mage_AdminNotification_Model_Feed
|
33 |
+
{
|
34 |
+
|
35 |
+
/**
|
36 |
+
* @var Belvg_All_Helper_Data
|
37 |
+
*/
|
38 |
+
private $_helper;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Init model, create helper instance
|
42 |
+
*
|
43 |
+
* @return void
|
44 |
+
*/
|
45 |
+
public function _construct()
|
46 |
{
|
47 |
+
$this->_helper = Mage::helper('belvgall');
|
48 |
+
parent::_construct();
|
49 |
}
|
50 |
|
51 |
+
/**
|
52 |
+
* Check feed for modification
|
53 |
+
*
|
54 |
+
* @return Belvg_All_Model_Feed
|
55 |
+
*/
|
56 |
public function checkUpdate()
|
57 |
{
|
58 |
+
$now = Zend_Date::now()->getTimestamp();
|
59 |
+
|
60 |
+
if (($this->_helper->getFrequency() + $this->_helper->getLastUpdate()) > $now) {
|
61 |
return $this;
|
62 |
}
|
63 |
|
64 |
+
$this->_helper->setLastUpdate($now);
|
65 |
|
66 |
if (!extension_loaded('curl')) {
|
67 |
return $this;
|
68 |
}
|
69 |
|
70 |
+
$feed_data = array();
|
71 |
+
$feed_xml = $this->getFeedData();
|
72 |
+
$was_installed = gmdate('Y-m-d H:i:s', $this->_helper->getInstalledDate());
|
|
|
|
|
73 |
|
74 |
+
if ($feed_xml && $feed_xml->channel && $feed_xml->channel->item) {
|
75 |
+
foreach ($feed_xml->channel->item as $item) {
|
76 |
$date = $this->getDate((string) $item->pubDate);
|
77 |
|
78 |
+
if ($date < $was_installed) {
|
|
|
79 |
continue;
|
80 |
}
|
81 |
+
|
82 |
if (!$this->isInteresting($item)) {
|
83 |
continue;
|
84 |
}
|
85 |
|
86 |
+
$feed_data[] = array(
|
87 |
'severity' => 3,
|
88 |
'date_added' => $this->getDate($date),
|
89 |
'title' => (string) $item->title,
|
90 |
'description' => (string) $item->description,
|
91 |
'url' => (string) $item->link,
|
92 |
);
|
|
|
|
|
|
|
93 |
}
|
|
|
94 |
|
95 |
+
if ($feed_data) {
|
96 |
+
Mage::getModel('adminnotification/inbox')->parse($feed_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
}
|
98 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
}
|
100 |
|
101 |
+
/**
|
102 |
+
* Get feed xml URL
|
103 |
+
* @return string
|
104 |
+
*/
|
105 |
public function getFeedUrl()
|
106 |
{
|
107 |
+
$feedUrl = $this->_helper->getFeedUrl();
|
108 |
+
$base_url = Mage::getStoreConfig('web/unsecure/base_url');
|
109 |
+
$query = '?s=' . urlencode($base_url);
|
|
|
|
|
|
|
110 |
|
111 |
+
return $feedUrl . $query;
|
|
|
|
|
112 |
}
|
113 |
|
114 |
+
/**
|
115 |
+
* Process user's selections for feed filters
|
116 |
+
*
|
117 |
+
* @param SimpleXMLElement $item
|
118 |
+
* @return boolean
|
119 |
+
*/
|
120 |
protected function isInteresting($item)
|
121 |
+
{
|
122 |
+
$interests = @explode(',', $this->_helper->getInterests());
|
123 |
$types = @explode(':', (string) $item->type);
|
124 |
|
125 |
$extenion = (string) $item->extension;
|
126 |
|
|
|
|
|
127 |
foreach ($types as $type) {
|
128 |
+
if (in_array($type, $interests)) {
|
129 |
+
return TRUE;
|
130 |
}
|
131 |
|
132 |
+
if ($extenion && ($type == Belvg_All_Model_Source_Updates_Type::TYPE_UPDATE_RELEASE)) {
|
133 |
+
if ($this->_helper->hasExtension($extenion)) {
|
134 |
+
return TRUE;
|
135 |
}
|
136 |
}
|
137 |
}
|
138 |
|
139 |
+
return FALSE;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
}
|
141 |
|
142 |
+
}
|
app/code/community/Belvg/All/Model/Observer.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* BelVG LLC.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
+
*
|
13 |
+
* **************************************
|
14 |
+
* MAGENTO EDITION USAGE NOTICE *
|
15 |
+
* ***************************************
|
16 |
+
* This package designed for Magento COMMUNITY edition
|
17 |
+
* BelVG does not guarantee correct work of this extension
|
18 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
+
* BelVG does not provide extension support in case of
|
20 |
+
* incorrect edition usage.
|
21 |
+
* **************************************
|
22 |
+
* DISCLAIMER *
|
23 |
+
* ***************************************
|
24 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
+
* versions in the future.
|
26 |
+
* ****************************************************
|
27 |
+
* @category Belvg
|
28 |
+
* @package Belvg_All
|
29 |
+
* @copyright Copyright (c) 2010 - 2014 BelVG LLC. (http://www.belvg.com)
|
30 |
+
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
+
*/
|
32 |
+
class Belvg_All_Model_Observer
|
33 |
+
{
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Check feed for modification
|
37 |
+
*
|
38 |
+
* @return Belvg_All_Model_Observer
|
39 |
+
*/
|
40 |
+
public function checkFeed()
|
41 |
+
{
|
42 |
+
/* @see Belvg_All_Model_Feed */
|
43 |
+
Mage::getModel('belvgall/feed')->checkUpdate();
|
44 |
+
return $this;
|
45 |
+
}
|
46 |
+
|
47 |
+
}
|
app/code/community/Belvg/All/Model/Source/Updates/Type.php
CHANGED
@@ -1,21 +1,57 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
const TYPE_PROMO = 'PROMO';
|
5 |
const TYPE_NEW_RELEASE = 'NEW_RELEASE';
|
6 |
const TYPE_UPDATE_RELEASE = 'UPDATE_RELEASE';
|
7 |
const TYPE_INFO = 'INFO';
|
8 |
const TYPE_INSTALLED_UPDATE = 'INSTALLED_UPDATE';
|
9 |
|
|
|
|
|
|
|
|
|
|
|
10 |
public function toOptionArray()
|
11 |
{
|
12 |
-
$
|
13 |
return array(
|
14 |
-
array('value' => self::TYPE_INSTALLED_UPDATE, 'label' => $
|
15 |
-
array('value' => self::TYPE_UPDATE_RELEASE, 'label' => $
|
16 |
-
array('value' => self::TYPE_NEW_RELEASE, 'label' => $
|
17 |
-
array('value' => self::TYPE_PROMO, 'label' => $
|
18 |
-
array('value' => self::TYPE_INFO, 'label' => $
|
19 |
);
|
20 |
}
|
21 |
|
@@ -42,12 +78,13 @@ class Belvg_All_Model_Source_Updates_Type extends Mage_Eav_Model_Entity_Attribut
|
|
42 |
return $v['label'];
|
43 |
}
|
44 |
}
|
|
|
45 |
return '';
|
46 |
}
|
47 |
|
48 |
/**
|
49 |
* Returns array ready for use by grid
|
50 |
-
* @return array
|
51 |
*/
|
52 |
public function getGridOptions()
|
53 |
{
|
@@ -56,6 +93,7 @@ class Belvg_All_Model_Source_Updates_Type extends Mage_Eav_Model_Entity_Attribut
|
|
56 |
foreach ($items as $item) {
|
57 |
$out[$item['value']] = $item['label'];
|
58 |
}
|
|
|
59 |
return $out;
|
60 |
}
|
61 |
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* BelVG LLC.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
+
*
|
13 |
+
* **************************************
|
14 |
+
* MAGENTO EDITION USAGE NOTICE *
|
15 |
+
* ***************************************
|
16 |
+
* This package designed for Magento COMMUNITY edition
|
17 |
+
* BelVG does not guarantee correct work of this extension
|
18 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
+
* BelVG does not provide extension support in case of
|
20 |
+
* incorrect edition usage.
|
21 |
+
* **************************************
|
22 |
+
* DISCLAIMER *
|
23 |
+
* ***************************************
|
24 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
+
* versions in the future.
|
26 |
+
* ****************************************************
|
27 |
+
* @category Belvg
|
28 |
+
* @package Belvg_All
|
29 |
+
* @copyright Copyright (c) 2010 - 2014 BelVG LLC. (http://www.belvg.com)
|
30 |
+
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
+
*/
|
32 |
+
class Belvg_All_Model_Source_Updates_Type extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
|
33 |
+
{
|
34 |
+
|
35 |
const TYPE_PROMO = 'PROMO';
|
36 |
const TYPE_NEW_RELEASE = 'NEW_RELEASE';
|
37 |
const TYPE_UPDATE_RELEASE = 'UPDATE_RELEASE';
|
38 |
const TYPE_INFO = 'INFO';
|
39 |
const TYPE_INSTALLED_UPDATE = 'INSTALLED_UPDATE';
|
40 |
|
41 |
+
/**
|
42 |
+
* Get array of select options
|
43 |
+
*
|
44 |
+
* @return array
|
45 |
+
*/
|
46 |
public function toOptionArray()
|
47 |
{
|
48 |
+
$helper = Mage::helper('belvgall');
|
49 |
return array(
|
50 |
+
array('value' => self::TYPE_INSTALLED_UPDATE, 'label' => $helper->__('My extensions updates')),
|
51 |
+
array('value' => self::TYPE_UPDATE_RELEASE, 'label' => $helper->__('All extensions updates')),
|
52 |
+
array('value' => self::TYPE_NEW_RELEASE, 'label' => $helper->__('New Releases')),
|
53 |
+
array('value' => self::TYPE_PROMO, 'label' => $helper->__('Promotions/Discounts')),
|
54 |
+
array('value' => self::TYPE_INFO, 'label' => $helper->__('Other information'))
|
55 |
);
|
56 |
}
|
57 |
|
78 |
return $v['label'];
|
79 |
}
|
80 |
}
|
81 |
+
|
82 |
return '';
|
83 |
}
|
84 |
|
85 |
/**
|
86 |
* Returns array ready for use by grid
|
87 |
+
* @return array
|
88 |
*/
|
89 |
public function getGridOptions()
|
90 |
{
|
93 |
foreach ($items as $item) {
|
94 |
$out[$item['value']] = $item['label'];
|
95 |
}
|
96 |
+
|
97 |
return $out;
|
98 |
}
|
99 |
|
app/code/community/Belvg/All/etc/adminhtml.xml
CHANGED
@@ -1,4 +1,35 @@
|
|
1 |
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<config>
|
3 |
<acl>
|
4 |
<resources>
|
@@ -25,15 +56,4 @@
|
|
25 |
</admin>
|
26 |
</resources>
|
27 |
</acl>
|
28 |
-
<events>
|
29 |
-
<controller_action_predispatch>
|
30 |
-
<observers>
|
31 |
-
<belvgall_upds>
|
32 |
-
<type>singleton</type>
|
33 |
-
<class>belvgall/feed</class>
|
34 |
-
<method>check</method>
|
35 |
-
</belvgall_upds>
|
36 |
-
</observers>
|
37 |
-
</controller_action_predispatch>
|
38 |
-
</events>
|
39 |
</config>
|
1 |
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* BelVG LLC.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
+
*
|
13 |
+
* **************************************
|
14 |
+
* MAGENTO EDITION USAGE NOTICE *
|
15 |
+
* ***************************************
|
16 |
+
* This package designed for Magento COMMUNITY edition
|
17 |
+
* BelVG does not guarantee correct work of this extension
|
18 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
+
* BelVG does not provide extension support in case of
|
20 |
+
* incorrect edition usage.
|
21 |
+
* **************************************
|
22 |
+
* DISCLAIMER *
|
23 |
+
* ***************************************
|
24 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
+
* versions in the future.
|
26 |
+
* ****************************************************
|
27 |
+
* @category Belvg
|
28 |
+
* @package Belvg_All
|
29 |
+
* @copyright Copyright (c) 2010 - 2014 BelVG LLC. (http://www.belvg.com)
|
30 |
+
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
+
*/
|
32 |
+
-->
|
33 |
<config>
|
34 |
<acl>
|
35 |
<resources>
|
56 |
</admin>
|
57 |
</resources>
|
58 |
</acl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
</config>
|
app/code/community/Belvg/All/etc/config.xml
CHANGED
@@ -1,111 +1,89 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* BelVG LLC.
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the EULA
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
-
*
|
13 |
-
|
14 |
-
* MAGENTO EDITION USAGE NOTICE *
|
15 |
-
|
16 |
-
|
17 |
-
* BelVG does not guarantee correct work of this extension
|
18 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
-
* BelVG does not provide extension support in case of
|
20 |
-
* incorrect edition usage.
|
21 |
-
|
22 |
-
* DISCLAIMER *
|
23 |
-
|
24 |
-
|
25 |
-
* versions in the future.
|
26 |
-
|
27 |
-
* @category
|
28 |
-
* @package
|
29 |
-
* @copyright
|
30 |
-
* @license
|
31 |
-
*/
|
32 |
-
|
33 |
-
<config>
|
34 |
-
<modules>
|
35 |
-
<Belvg_All>
|
36 |
-
<version>
|
37 |
-
</Belvg_All>
|
38 |
-
</modules>
|
39 |
-
<global>
|
40 |
-
<blocks>
|
41 |
-
<belvgall>
|
42 |
-
<class>Belvg_All_Block</class>
|
43 |
-
</belvgall>
|
44 |
-
</blocks>
|
45 |
-
<helpers>
|
46 |
-
<belvgall>
|
47 |
-
<class>Belvg_All_Helper</class>
|
48 |
-
</belvgall>
|
49 |
-
</helpers>
|
50 |
-
<models>
|
51 |
-
<belvgall>
|
52 |
-
<class>Belvg_All_Model</class>
|
53 |
-
</belvgall>
|
54 |
-
</models>
|
55 |
-
<resources>
|
56 |
-
<belvgall_setup>
|
57 |
-
<setup>
|
58 |
-
<module>Belvg_All</module>
|
59 |
-
</setup>
|
60 |
-
<connection>
|
61 |
-
<use>core_setup</use>
|
62 |
-
</connection>
|
63 |
-
</belvgall_setup>
|
64 |
-
<belvgall_write>
|
65 |
-
<connection>
|
66 |
-
<use>core_write</use>
|
67 |
-
</connection>
|
68 |
-
</belvgall_write>
|
69 |
-
<belvgall_read>
|
70 |
-
<connection>
|
71 |
-
<use>core_read</use>
|
72 |
-
</connection>
|
73 |
-
</belvgall_read>
|
74 |
-
</resources>
|
75 |
-
</global>
|
76 |
-
<adminhtml>
|
77 |
-
<
|
78 |
-
<
|
79 |
-
<
|
80 |
-
<
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
<title>Belvg - Extensions</title>
|
90 |
-
</belvgall>
|
91 |
-
</children>
|
92 |
-
</config>
|
93 |
-
</children>
|
94 |
-
</system>
|
95 |
-
</children>
|
96 |
-
</admin>
|
97 |
-
</resources>
|
98 |
-
</acl>
|
99 |
-
<events>
|
100 |
-
<controller_action_predispatch>
|
101 |
-
<observers>
|
102 |
-
<ambase_upds>
|
103 |
-
<type>singleton</type>
|
104 |
-
<class>belvgall/feed</class>
|
105 |
-
<method>check</method>
|
106 |
-
</ambase_upds>
|
107 |
-
</observers>
|
108 |
-
</controller_action_predispatch>
|
109 |
-
</events>
|
110 |
-
</adminhtml>
|
111 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* BelVG LLC.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
+
*
|
13 |
+
* **************************************
|
14 |
+
* MAGENTO EDITION USAGE NOTICE *
|
15 |
+
* ***************************************
|
16 |
+
* This package designed for Magento COMMUNITY edition
|
17 |
+
* BelVG does not guarantee correct work of this extension
|
18 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
+
* BelVG does not provide extension support in case of
|
20 |
+
* incorrect edition usage.
|
21 |
+
* **************************************
|
22 |
+
* DISCLAIMER *
|
23 |
+
* ***************************************
|
24 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
+
* versions in the future.
|
26 |
+
* ****************************************************
|
27 |
+
* @category Belvg
|
28 |
+
* @package Belvg_All
|
29 |
+
* @copyright Copyright (c) 2010 - 2014 BelVG LLC. (http://www.belvg.com)
|
30 |
+
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
+
*/
|
32 |
+
-->
|
33 |
+
<config>
|
34 |
+
<modules>
|
35 |
+
<Belvg_All>
|
36 |
+
<version>2.0.0</version>
|
37 |
+
</Belvg_All>
|
38 |
+
</modules>
|
39 |
+
<global>
|
40 |
+
<blocks>
|
41 |
+
<belvgall>
|
42 |
+
<class>Belvg_All_Block</class>
|
43 |
+
</belvgall>
|
44 |
+
</blocks>
|
45 |
+
<helpers>
|
46 |
+
<belvgall>
|
47 |
+
<class>Belvg_All_Helper</class>
|
48 |
+
</belvgall>
|
49 |
+
</helpers>
|
50 |
+
<models>
|
51 |
+
<belvgall>
|
52 |
+
<class>Belvg_All_Model</class>
|
53 |
+
</belvgall>
|
54 |
+
</models>
|
55 |
+
<resources>
|
56 |
+
<belvgall_setup>
|
57 |
+
<setup>
|
58 |
+
<module>Belvg_All</module>
|
59 |
+
</setup>
|
60 |
+
<connection>
|
61 |
+
<use>core_setup</use>
|
62 |
+
</connection>
|
63 |
+
</belvgall_setup>
|
64 |
+
<belvgall_write>
|
65 |
+
<connection>
|
66 |
+
<use>core_write</use>
|
67 |
+
</connection>
|
68 |
+
</belvgall_write>
|
69 |
+
<belvgall_read>
|
70 |
+
<connection>
|
71 |
+
<use>core_read</use>
|
72 |
+
</connection>
|
73 |
+
</belvgall_read>
|
74 |
+
</resources>
|
75 |
+
</global>
|
76 |
+
<adminhtml>
|
77 |
+
<events>
|
78 |
+
<controller_action_predispatch>
|
79 |
+
<observers>
|
80 |
+
<belvgall>
|
81 |
+
<type>singleton</type>
|
82 |
+
<class>belvgall/observer</class>
|
83 |
+
<method>checkFeed</method>
|
84 |
+
</belvgall>
|
85 |
+
</observers>
|
86 |
+
</controller_action_predispatch>
|
87 |
+
</events>
|
88 |
+
</adminhtml>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
</config>
|
app/code/community/Belvg/All/etc/system.xml
CHANGED
@@ -1,35 +1,35 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
<config>
|
34 |
<tabs>
|
35 |
<belvg translate="label" module="belvgall">
|
@@ -38,7 +38,7 @@
|
|
38 |
<sort_order>300</sort_order>
|
39 |
</belvg>
|
40 |
</tabs>
|
41 |
-
|
42 |
<sections>
|
43 |
<belvgall translate="label">
|
44 |
<label>General</label>
|
@@ -76,8 +76,8 @@
|
|
76 |
<show_in_store>1</show_in_store>
|
77 |
<can_be_empty>1</can_be_empty>
|
78 |
<source_model>belvgall/source_updates_type</source_model>
|
79 |
-
</interests>
|
80 |
-
</fields>
|
81 |
</feed>
|
82 |
</groups>
|
83 |
</belvgall>
|
@@ -100,6 +100,6 @@
|
|
100 |
<show_in_store>1</show_in_store>
|
101 |
</extensions>
|
102 |
</groups>
|
103 |
-
</related>
|
104 |
</sections>
|
105 |
</config>
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
+
* BelVG LLC.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
+
*
|
13 |
+
* **************************************
|
14 |
+
* MAGENTO EDITION USAGE NOTICE *
|
15 |
+
* ***************************************
|
16 |
+
* This package designed for Magento COMMUNITY edition
|
17 |
+
* BelVG does not guarantee correct work of this extension
|
18 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
+
* BelVG does not provide extension support in case of
|
20 |
+
* incorrect edition usage.
|
21 |
+
* **************************************
|
22 |
+
* DISCLAIMER *
|
23 |
+
* ***************************************
|
24 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
+
* versions in the future.
|
26 |
+
* ****************************************************
|
27 |
+
* @category Belvg
|
28 |
+
* @package Belvg_All
|
29 |
+
* @copyright Copyright (c) 2010 - 2014 BelVG LLC. (http://www.belvg.com)
|
30 |
+
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
+
*/
|
32 |
+
-->
|
33 |
<config>
|
34 |
<tabs>
|
35 |
<belvg translate="label" module="belvgall">
|
38 |
<sort_order>300</sort_order>
|
39 |
</belvg>
|
40 |
</tabs>
|
41 |
+
|
42 |
<sections>
|
43 |
<belvgall translate="label">
|
44 |
<label>General</label>
|
76 |
<show_in_store>1</show_in_store>
|
77 |
<can_be_empty>1</can_be_empty>
|
78 |
<source_model>belvgall/source_updates_type</source_model>
|
79 |
+
</interests>
|
80 |
+
</fields>
|
81 |
</feed>
|
82 |
</groups>
|
83 |
</belvgall>
|
100 |
<show_in_store>1</show_in_store>
|
101 |
</extensions>
|
102 |
</groups>
|
103 |
+
</related>
|
104 |
</sections>
|
105 |
</config>
|
app/code/community/Belvg/All/sql/belvgall_setup/mysql4-install-1.0.0.php
CHANGED
@@ -1,3 +1,33 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
$this->startSetup();
|
3 |
-
$this->endSetup();
|
1 |
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* BelVG LLC.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
+
*
|
13 |
+
* **************************************
|
14 |
+
* MAGENTO EDITION USAGE NOTICE *
|
15 |
+
* ***************************************
|
16 |
+
* This package designed for Magento COMMUNITY edition
|
17 |
+
* BelVG does not guarantee correct work of this extension
|
18 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
+
* BelVG does not provide extension support in case of
|
20 |
+
* incorrect edition usage.
|
21 |
+
* **************************************
|
22 |
+
* DISCLAIMER *
|
23 |
+
* ***************************************
|
24 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
+
* versions in the future.
|
26 |
+
* ****************************************************
|
27 |
+
* @category Belvg
|
28 |
+
* @package Belvg_All
|
29 |
+
* @copyright Copyright (c) 2010 - 2014 BelVG LLC. (http://www.belvg.com)
|
30 |
+
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
+
*/
|
32 |
$this->startSetup();
|
33 |
+
$this->endSetup();
|
app/code/community/Belvg/All/sql/belvgall_setup/mysql4-upgrade-1.0.0-1.0.1.php
CHANGED
@@ -1,29 +1,42 @@
|
|
1 |
<?php
|
2 |
-
$this->startSetup();
|
3 |
-
|
4 |
-
Mage::getModel('core/config_data')
|
5 |
-
->setScope('default')
|
6 |
-
->setPath('belvgall/feed/installed')
|
7 |
-
->setValue(time())
|
8 |
-
->save();
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
-
Mage::
|
17 |
-
->
|
18 |
-
->
|
19 |
-
->
|
20 |
-
->
|
21 |
|
22 |
-
Mage::getModel('core/config_data')
|
23 |
-
->setScope('default')
|
24 |
-
->setPath('belvgall/feed/interests')
|
25 |
-
->setValue('INSTALLED_UPDATE,UPDATE_RELEASE,NEW_RELEASE,PROMO,INFO')
|
26 |
-
->save();
|
27 |
|
28 |
$feedData = array();
|
29 |
$feedData[] = array(
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
+
/**
|
4 |
+
* BelVG LLC.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
+
*
|
13 |
+
* **************************************
|
14 |
+
* MAGENTO EDITION USAGE NOTICE *
|
15 |
+
* ***************************************
|
16 |
+
* This package designed for Magento COMMUNITY edition
|
17 |
+
* BelVG does not guarantee correct work of this extension
|
18 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
+
* BelVG does not provide extension support in case of
|
20 |
+
* incorrect edition usage.
|
21 |
+
* **************************************
|
22 |
+
* DISCLAIMER *
|
23 |
+
* ***************************************
|
24 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
+
* versions in the future.
|
26 |
+
* ****************************************************
|
27 |
+
* @category Belvg
|
28 |
+
* @package Belvg_All
|
29 |
+
* @copyright Copyright (c) 2010 - 2014 BelVG LLC. (http://www.belvg.com)
|
30 |
+
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
+
*/
|
32 |
+
$this->startSetup();
|
33 |
|
34 |
+
$helper = Mage::helper('belvgall')
|
35 |
+
->saveConfig(Belvg_All_Helper_Config::XML_PATH_INSTALLED, time())
|
36 |
+
->saveConfig(Belvg_All_Helper_Config::XML_PATH_FREQUENCY, 3600*6)
|
37 |
+
->saveConfig(Belvg_All_Helper_Config::XML_PATH_LAST_UPDATE, 0)
|
38 |
+
->saveConfig(Belvg_All_Helper_Config::XML_PATH_INTERESTS, 'INSTALLED_UPDATE,UPDATE_RELEASE,NEW_RELEASE,PROMO,INFO');
|
39 |
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
$feedData = array();
|
42 |
$feedData[] = array(
|
app/code/community/Belvg/All/sql/belvgall_setup/mysql4-upgrade-1.0.1-2.0.0.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* BelVG LLC.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
+
*
|
13 |
+
* **************************************
|
14 |
+
* MAGENTO EDITION USAGE NOTICE *
|
15 |
+
* ***************************************
|
16 |
+
* This package designed for Magento COMMUNITY edition
|
17 |
+
* BelVG does not guarantee correct work of this extension
|
18 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
+
* BelVG does not provide extension support in case of
|
20 |
+
* incorrect edition usage.
|
21 |
+
* **************************************
|
22 |
+
* DISCLAIMER *
|
23 |
+
* ***************************************
|
24 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
+
* versions in the future.
|
26 |
+
* ****************************************************
|
27 |
+
* @category Belvg
|
28 |
+
* @package Belvg_All
|
29 |
+
* @copyright Copyright (c) 2010 - 2014 BelVG LLC. (http://www.belvg.com)
|
30 |
+
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
+
*/
|
32 |
+
$this->startSetup();
|
33 |
+
$this->endSetup();
|
app/code/community/Belvg/FacebookFree/Block/Active.php
DELETED
@@ -1,86 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* BelVG LLC.
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the EULA
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
11 |
-
*
|
12 |
-
/***************************************
|
13 |
-
* MAGENTO EDITION USAGE NOTICE *
|
14 |
-
*****************************************/
|
15 |
-
/* This package designed for Magento COMMUNITY edition
|
16 |
-
* BelVG does not guarantee correct work of this extension
|
17 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
-
* BelVG does not provide extension support in case of
|
19 |
-
* incorrect edition usage.
|
20 |
-
/***************************************
|
21 |
-
* DISCLAIMER *
|
22 |
-
*****************************************/
|
23 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
24 |
-
* versions in the future.
|
25 |
-
*****************************************************
|
26 |
-
* @category Belvg
|
27 |
-
* @package Belvg_FacebookFree
|
28 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
29 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
30 |
-
*/
|
31 |
-
|
32 |
-
class Belvg_FacebookFree_Block_Active extends Mage_Core_Block_Template {
|
33 |
-
|
34 |
-
public function getAppId()
|
35 |
-
{
|
36 |
-
return Mage::getStoreConfig('facebookfree/settings/appid');
|
37 |
-
}
|
38 |
-
|
39 |
-
public function getSecretKey()
|
40 |
-
{
|
41 |
-
return Mage::getStoreConfig('facebookfree/settings/secret');
|
42 |
-
}
|
43 |
-
|
44 |
-
public function isActiveLike()
|
45 |
-
{
|
46 |
-
return Mage::getStoreConfig('facebookfree/like/enabled');
|
47 |
-
}
|
48 |
-
|
49 |
-
public function isFacesLikeActive()
|
50 |
-
{
|
51 |
-
return Mage::getStoreConfig('facebookfree/like/faces')?'true':'false';
|
52 |
-
}
|
53 |
-
|
54 |
-
public function getLikeWidth()
|
55 |
-
{
|
56 |
-
return Mage::getStoreConfig('facebookfree/like/width');
|
57 |
-
}
|
58 |
-
|
59 |
-
public function getLikeColor()
|
60 |
-
{
|
61 |
-
return Mage::getStoreConfig('facebookfree/like/color');
|
62 |
-
}
|
63 |
-
|
64 |
-
public function getLikeLayout()
|
65 |
-
{
|
66 |
-
return Mage::getStoreConfig('facebookfree/like/layout');
|
67 |
-
}
|
68 |
-
|
69 |
-
public function checkFbUser()
|
70 |
-
{
|
71 |
-
$user_id = Mage::getSingleton('customer/session')->getCustomer()->getId();
|
72 |
-
$uid = 0;
|
73 |
-
$db_read = Mage::getSingleton('core/resource')->getConnection('facebookfree_read');
|
74 |
-
$tablePrefix = (string)Mage::getConfig()->getTablePrefix();
|
75 |
-
|
76 |
-
$sql = 'SELECT `fb_id`
|
77 |
-
FROM `'.$tablePrefix.'belvg_facebook_customer`
|
78 |
-
WHERE `customer_id` = '.$user_id.'
|
79 |
-
LIMIT 1';
|
80 |
-
$data = $db_read->fetchRow($sql);
|
81 |
-
if (count($data)) {
|
82 |
-
$uid = $data['fb_id'];
|
83 |
-
}
|
84 |
-
return $uid;
|
85 |
-
}
|
86 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Belvg/FacebookFree/Block/Init.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Belvg_Facebookfree_Block_Init extends Mage_Core_Block_Template
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Return applicaton Id
|
8 |
+
*
|
9 |
+
* @return string
|
10 |
+
*/
|
11 |
+
public function getAppId()
|
12 |
+
{
|
13 |
+
return Mage::helper('facebookfree')->getAppId();
|
14 |
+
}
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Return encoded current URL for after auth redirection
|
18 |
+
*
|
19 |
+
* @return string
|
20 |
+
*/
|
21 |
+
public function getLoginUrl()
|
22 |
+
{
|
23 |
+
return Mage::helper('facebookfree')->getLoginUrl();
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Get current FB locale according to the selected store locale
|
28 |
+
*
|
29 |
+
* @return string
|
30 |
+
*/
|
31 |
+
public function getLocale()
|
32 |
+
{
|
33 |
+
return Mage::getModel('facebookfree/locale')->getLocale();
|
34 |
+
}
|
35 |
+
|
36 |
+
}
|
app/code/community/Belvg/FacebookFree/Block/Like/Meta.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Belvg_Facebookfree_Block_Like_Meta extends Belvg_Facebookfree_Block_Init
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Get current product
|
8 |
+
*
|
9 |
+
* @return Mage_Catalog_Model_Product
|
10 |
+
*/
|
11 |
+
public function getProduct()
|
12 |
+
{
|
13 |
+
return Mage::registry('current_product');
|
14 |
+
}
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Check if like option is enabled
|
18 |
+
*
|
19 |
+
* @return boolean
|
20 |
+
*/
|
21 |
+
public function isActive()
|
22 |
+
{
|
23 |
+
return ($this->helper('facebookfree')->isActiveLike() && $this->getProduct());
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Get current product name
|
28 |
+
*
|
29 |
+
* @return string
|
30 |
+
*/
|
31 |
+
public function getProductName()
|
32 |
+
{
|
33 |
+
return $this->escapeHtml($this->getProduct()->getName());
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Get current product thumbnail
|
38 |
+
*
|
39 |
+
* @return string
|
40 |
+
*/
|
41 |
+
public function getProductImage()
|
42 |
+
{
|
43 |
+
return $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail');
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Get current product URL
|
48 |
+
*
|
49 |
+
* @return string
|
50 |
+
*/
|
51 |
+
public function getProductUrl()
|
52 |
+
{
|
53 |
+
return $this->getProduct()->getProductUrl();
|
54 |
+
}
|
55 |
+
|
56 |
+
}
|
app/code/community/Belvg/FacebookFree/Block/Links.php
CHANGED
@@ -1,52 +1,10 @@
|
|
1 |
<?php
|
2 |
-
/**
|
3 |
-
* BelVG LLC.
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the EULA
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
11 |
-
*
|
12 |
-
/***************************************
|
13 |
-
* MAGENTO EDITION USAGE NOTICE *
|
14 |
-
*****************************************/
|
15 |
-
/* This package designed for Magento COMMUNITY edition
|
16 |
-
* BelVG does not guarantee correct work of this extension
|
17 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
-
* BelVG does not provide extension support in case of
|
19 |
-
* incorrect edition usage.
|
20 |
-
/***************************************
|
21 |
-
* DISCLAIMER *
|
22 |
-
*****************************************/
|
23 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
24 |
-
* versions in the future.
|
25 |
-
*****************************************************
|
26 |
-
* @category Belvg
|
27 |
-
* @package Belvg_FacebookFree
|
28 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
29 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
30 |
-
*/
|
31 |
|
32 |
-
class Belvg_FacebookFree_Block_Links extends
|
33 |
{
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
if ($count == 1) {
|
40 |
-
$text = $this->__('My Cart (%s item)', $count);
|
41 |
-
} elseif ($count > 0) {
|
42 |
-
$text = $this->__('My Cart (%s items)', $count);
|
43 |
-
} else {
|
44 |
-
$text = $this->__('My Cart');
|
45 |
-
}
|
46 |
-
|
47 |
-
//$parentBlock->addLink($text, 'checkout/cart', $text, true, array(), 90, null, 'class="top-link-cart"');
|
48 |
-
}
|
49 |
-
return $this;
|
50 |
-
}
|
51 |
-
|
52 |
}
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
+
class Belvg_FacebookFree_Block_Links extends Mage_Page_Block_Template_Links_Block
|
4 |
{
|
5 |
+
/**
|
6 |
+
* Position in link list
|
7 |
+
* @var int
|
8 |
+
*/
|
9 |
+
protected $_position = 1000;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
}
|
app/code/community/Belvg/FacebookFree/Block/Links/Button.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Belvg_FacebookFree_Block_Links_Button extends Mage_Core_Block_Template
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Get image for the connect button
|
8 |
+
*
|
9 |
+
* @return string
|
10 |
+
*/
|
11 |
+
public function getImage()
|
12 |
+
{
|
13 |
+
$img_button = $this->getDefaultImage();
|
14 |
+
|
15 |
+
if ($image = $this->helper('facebookfree')->getImageLogin()) {
|
16 |
+
$img_button_path = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . 'facebookfree' . DS . $image;
|
17 |
+
|
18 |
+
// if configured image was foud - use it
|
19 |
+
if (file_exists($img_button_path)) {
|
20 |
+
$img_button = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'facebookfree/' . $image;
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
return $img_button;
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Get default image button
|
29 |
+
*
|
30 |
+
* @return string
|
31 |
+
*/
|
32 |
+
public function getDefaultImage()
|
33 |
+
{
|
34 |
+
return $this->getSkinUrl($this->helper('facebookfree')->getDefaultImageLogin());
|
35 |
+
}
|
36 |
+
|
37 |
+
}
|
app/code/community/Belvg/FacebookFree/Block/Page/Html/Header.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Belvg_FacebookFree_Block_Page_Html_Header extends Mage_Page_Block_Html_Header
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->addData(array(
|
9 |
+
'cache_lifetime' => 0,
|
10 |
+
));
|
11 |
+
}
|
12 |
+
|
13 |
+
public function getWelcome()
|
14 |
+
{
|
15 |
+
if (empty($this->_data['welcome'])) {
|
16 |
+
if (Mage::isInstalled() && Mage::getSingleton('customer/session')->isLoggedIn()) {
|
17 |
+
$this->_data['welcome'] = $this->__('Welcome, %s!', $this->escapeHtml(Mage::getSingleton('customer/session')->getCustomer()->getName()));
|
18 |
+
if ($this->helper('facebookfree')->isActive() && $user_id = $this->helper('facebookfree')->getFbUserId()) {
|
19 |
+
$this->_data['welcome'] .= ' <img src="https://graph.facebook.com/' . $user_id . '/picture" height="20"/>';
|
20 |
+
}
|
21 |
+
} else {
|
22 |
+
$this->_data['welcome'] = Mage::getStoreConfig('design/header/welcome');
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
return $this->_data['welcome'];
|
27 |
+
}
|
28 |
+
|
29 |
+
}
|
app/code/community/Belvg/FacebookFree/Helper/Active.php
DELETED
@@ -1,121 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* BelVG LLC.
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the EULA
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
-
*
|
13 |
-
/***************************************
|
14 |
-
* MAGENTO EDITION USAGE NOTICE *
|
15 |
-
* *************************************** */
|
16 |
-
/* This package designed for Magento COMMUNITY edition
|
17 |
-
* BelVG does not guarantee correct work of this extension
|
18 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
-
* BelVG does not provide extension support in case of
|
20 |
-
* incorrect edition usage.
|
21 |
-
/***************************************
|
22 |
-
* DISCLAIMER *
|
23 |
-
* *************************************** */
|
24 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
-
* versions in the future.
|
26 |
-
* ****************************************************
|
27 |
-
* @category Belvg
|
28 |
-
* @package Belvg_FacebookFree
|
29 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
30 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
-
*/
|
32 |
-
|
33 |
-
class Belvg_FacebookFree_Helper_Active extends Mage_Core_Helper_Abstract {
|
34 |
-
|
35 |
-
public function getAppId() {
|
36 |
-
return Mage::getStoreConfig('facebookfree/settings/appid');
|
37 |
-
}
|
38 |
-
|
39 |
-
public function getSecretKey() {
|
40 |
-
return Mage::getStoreConfig('facebookfree/settings/secret');
|
41 |
-
}
|
42 |
-
|
43 |
-
public function isActiveLike() {
|
44 |
-
return Mage::getStoreConfig('facebookfree/like/enabled');
|
45 |
-
}
|
46 |
-
|
47 |
-
public function isFacesLikeActive() {
|
48 |
-
return Mage::getStoreConfig('facebookfree/like/faces') ? 'true' : 'false';
|
49 |
-
}
|
50 |
-
|
51 |
-
public function getLikeWidth() {
|
52 |
-
return Mage::getStoreConfig('facebookfree/like/width');
|
53 |
-
}
|
54 |
-
|
55 |
-
public function getLikeColor() {
|
56 |
-
return Mage::getStoreConfig('facebookfree/like/color');
|
57 |
-
}
|
58 |
-
|
59 |
-
public function getLikeLayout() {
|
60 |
-
return Mage::getStoreConfig('facebookfree/like/layout');
|
61 |
-
}
|
62 |
-
|
63 |
-
public function getProducts($order) {
|
64 |
-
$db_read = Mage::getSingleton('core/resource')->getConnection('facebookfree_read');
|
65 |
-
$tablePrefix = (string) Mage::getConfig()->getTablePrefix();
|
66 |
-
|
67 |
-
$sql = 'SELECT `product_id` FROM `' . $tablePrefix . 'sales_flat_order_item` as i
|
68 |
-
LEFT JOIN `' . $tablePrefix . 'sales_flat_order` as o ON o.`increment_id` = "' . $order . '"
|
69 |
-
WHERE i.`order_id` = o.`entity_id` AND i.`parent_item_id` IS NULL';
|
70 |
-
$data = $db_read->fetchAll($sql);
|
71 |
-
return $data;
|
72 |
-
}
|
73 |
-
|
74 |
-
public function getLoginImg() {
|
75 |
-
$img = Mage::getStoreConfig('facebookfree/settings/imglogin');
|
76 |
-
if (empty($img)) {
|
77 |
-
$img = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) .
|
78 |
-
'frontend/default/default/images/belvg/fb.gif';
|
79 |
-
} else {
|
80 |
-
$img = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) .
|
81 |
-
'facebookfree/' . $img;
|
82 |
-
}
|
83 |
-
return $img;
|
84 |
-
}
|
85 |
-
|
86 |
-
public function isActiveActivity()
|
87 |
-
{
|
88 |
-
return Mage::getStoreConfig('facebookfree/activity/enabled');
|
89 |
-
}
|
90 |
-
|
91 |
-
public function getActivityWidth()
|
92 |
-
{
|
93 |
-
return Mage::getStoreConfig('facebookfree/activity/width');
|
94 |
-
}
|
95 |
-
|
96 |
-
public function getActivityHeight()
|
97 |
-
{
|
98 |
-
return Mage::getStoreConfig('facebookfree/activity/height');
|
99 |
-
}
|
100 |
-
|
101 |
-
public function getActivityHeader()
|
102 |
-
{
|
103 |
-
return Mage::getStoreConfig('facebookfree/activity/header')?'true':'false';
|
104 |
-
}
|
105 |
-
|
106 |
-
public function getActivityColor()
|
107 |
-
{
|
108 |
-
return Mage::getStoreConfig('facebookfree/activity/color');
|
109 |
-
}
|
110 |
-
|
111 |
-
public function getActivityRecommendations()
|
112 |
-
{
|
113 |
-
return Mage::getStoreConfig('facebookfree/activity/recommendations')?'true':'false';
|
114 |
-
}
|
115 |
-
|
116 |
-
public function getActivityMaxage()
|
117 |
-
{
|
118 |
-
return Mage::getStoreConfig('facebookfree/activity/maxage');
|
119 |
-
}
|
120 |
-
|
121 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Belvg/FacebookFree/Helper/Config.php
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Belvg_FacebookFree_Helper_Config extends Mage_Core_Helper_Data
|
4 |
+
{
|
5 |
+
|
6 |
+
const XML_PATH_FBFREE_ENABLED = 'facebookfree/settings/enabled';
|
7 |
+
const XML_PATH_FBFREE_APP_ID = 'facebookfree/settings/appid';
|
8 |
+
const XML_PATH_FBFREE_APP_SECRET = 'facebookfree/settings/secret';
|
9 |
+
const XML_PATH_FBFREE_CONNECT_IMAGE = 'facebookfree/settings/imglogin';
|
10 |
+
const XML_PATH_FBFREE_CONNECT_DEFIMAGE = 'facebookfree/settings/defimage';
|
11 |
+
const XML_PATH_FBFREE_LIKE_ENABLED = 'facebookfree/like/enabled';
|
12 |
+
const XML_PATH_FBFREE_LIKE_LAYOUT = 'facebookfree/like/layout';
|
13 |
+
const XML_PATH_FBFREE_LIKE_FACES = 'facebookfree/like/faces';
|
14 |
+
const XML_PATH_FBFREE_LIKE_WIDTH = 'facebookfree/like/width';
|
15 |
+
const XML_PATH_FBFREE_LIKE_COLOR = 'facebookfree/like/color';
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Check if module is enabled
|
19 |
+
*
|
20 |
+
* @param mixed $store
|
21 |
+
* @return boolen
|
22 |
+
*/
|
23 |
+
public function isActive($store = '')
|
24 |
+
{
|
25 |
+
return Mage::getStoreConfigFlag(self::XML_PATH_FBFREE_ENABLED, $store);
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Get application ID (see https://developers.facebook.com/apps/)
|
30 |
+
*
|
31 |
+
* @param mixed $store
|
32 |
+
* @return string
|
33 |
+
*/
|
34 |
+
public function getAppId($store = '')
|
35 |
+
{
|
36 |
+
return Mage::getStoreConfig(self::XML_PATH_FBFREE_APP_ID, $store);
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Get application secret key
|
41 |
+
*
|
42 |
+
* @param mixed $store
|
43 |
+
* @return string
|
44 |
+
*/
|
45 |
+
public function getAppSecret($store = '')
|
46 |
+
{
|
47 |
+
return Mage::getStoreConfig(self::XML_PATH_FBFREE_APP_SECRET, $store);
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Check if like option is enabled
|
52 |
+
*
|
53 |
+
* @param mixed $store
|
54 |
+
* @return boolen
|
55 |
+
*/
|
56 |
+
public function isActiveLike($store = '')
|
57 |
+
{
|
58 |
+
return Mage::getStoreConfigFlag(self::XML_PATH_FBFREE_LIKE_ENABLED, $store);
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Get like button layout
|
63 |
+
*
|
64 |
+
* @return string
|
65 |
+
*/
|
66 |
+
public function getLikeLayout()
|
67 |
+
{
|
68 |
+
return Mage::getStoreConfig(self::XML_PATH_FBFREE_LIKE_LAYOUT);
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Show profile pictures below the button.
|
73 |
+
*
|
74 |
+
* @return string (fb:like accepts true/false param)
|
75 |
+
*/
|
76 |
+
public function isFacesLikeActive()
|
77 |
+
{
|
78 |
+
return Mage::getStoreConfigFlag(self::XML_PATH_FBFREE_LIKE_FACES) ? 'true' : 'false';
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* The width of the plugin, in pixels.
|
83 |
+
*
|
84 |
+
* @return int
|
85 |
+
*/
|
86 |
+
public function getLikeWidth()
|
87 |
+
{
|
88 |
+
return Mage::getStoreConfig(self::XML_PATH_FBFREE_LIKE_WIDTH);
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* The color scheme of the plugin.
|
93 |
+
*
|
94 |
+
* @return string
|
95 |
+
*/
|
96 |
+
public function getLikeColor()
|
97 |
+
{
|
98 |
+
return Mage::getStoreConfig(self::XML_PATH_FBFREE_LIKE_COLOR);
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Get name of the configured connect button image
|
103 |
+
*
|
104 |
+
* @return string
|
105 |
+
*/
|
106 |
+
public function getImageLogin()
|
107 |
+
{
|
108 |
+
return Mage::getStoreConfig(self::XML_PATH_FBFREE_CONNECT_IMAGE);
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Get name of the default connect button image
|
113 |
+
*
|
114 |
+
* @return string
|
115 |
+
*/
|
116 |
+
public function getDefaultImageLogin()
|
117 |
+
{
|
118 |
+
return Mage::getStoreConfig(self::XML_PATH_FBFREE_CONNECT_DEFIMAGE);
|
119 |
+
}
|
120 |
+
|
121 |
+
}
|
app/code/community/Belvg/FacebookFree/Helper/Data.php
CHANGED
@@ -1,35 +1,32 @@
|
|
1 |
<?php
|
2 |
-
/**
|
3 |
-
* BelVG LLC.
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the EULA
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
11 |
-
*
|
12 |
-
/***************************************
|
13 |
-
* MAGENTO EDITION USAGE NOTICE *
|
14 |
-
*****************************************/
|
15 |
-
/* This package designed for Magento COMMUNITY edition
|
16 |
-
* BelVG does not guarantee correct work of this extension
|
17 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
-
* BelVG does not provide extension support in case of
|
19 |
-
* incorrect edition usage.
|
20 |
-
/***************************************
|
21 |
-
* DISCLAIMER *
|
22 |
-
*****************************************/
|
23 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
24 |
-
* versions in the future.
|
25 |
-
*****************************************************
|
26 |
-
* @category Belvg
|
27 |
-
* @package Belvg_FacebookFree
|
28 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
29 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
30 |
-
*/
|
31 |
|
32 |
-
class Belvg_FacebookFree_Helper_Data extends
|
33 |
{
|
34 |
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
+
class Belvg_FacebookFree_Helper_Data extends Belvg_FacebookFree_Helper_Config
|
4 |
{
|
5 |
|
6 |
+
/**
|
7 |
+
* Return encoded current URL for after auth redirection
|
8 |
+
*
|
9 |
+
* @return string
|
10 |
+
*/
|
11 |
+
public function getLoginUrl()
|
12 |
+
{
|
13 |
+
$referer = Mage::helper('core')->urlEncode(Mage::helper('core/url')->getCurrentUrl());
|
14 |
+
return Mage::getUrl('facebookfree/customer/login', array('referer' => $referer));
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
*
|
19 |
+
* @return int
|
20 |
+
*/
|
21 |
+
public function getFbUserId()
|
22 |
+
{
|
23 |
+
$user_id = NULL;
|
24 |
+
|
25 |
+
if ($data = Mage::getModel('facebookfree/request_cookie')->getParsedCookie()) {
|
26 |
+
$user_id = $data['user_id'];
|
27 |
+
}
|
28 |
+
|
29 |
+
return $user_id;
|
30 |
+
}
|
31 |
+
|
32 |
+
}
|
app/code/community/Belvg/FacebookFree/Model/Customer.php
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Belvg_FacebookFree_Model_Customer extends Mage_Customer_Model_Customer
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Array of the FB user profile information
|
8 |
+
* @var array
|
9 |
+
*/
|
10 |
+
private $_fb_data = array();
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Assign FB data to the entity
|
14 |
+
*
|
15 |
+
* @param array $fb_data
|
16 |
+
* @return Belvg_FacebookFree_Model_Customer
|
17 |
+
*/
|
18 |
+
public function setFbData(array $fb_data)
|
19 |
+
{
|
20 |
+
$this->_fb_data = $fb_data;
|
21 |
+
return $this;
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Get data from the entity
|
26 |
+
*
|
27 |
+
* @param string|NULL $key
|
28 |
+
* @return type
|
29 |
+
*/
|
30 |
+
public function getFbData($key = NULL)
|
31 |
+
{
|
32 |
+
$data = $this->_fb_data;
|
33 |
+
|
34 |
+
if (!is_null($key) && isset($data[$key])) {
|
35 |
+
$data = $data[$key];
|
36 |
+
}
|
37 |
+
|
38 |
+
return $data;
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Check if customer exists
|
43 |
+
*
|
44 |
+
* @return boolean
|
45 |
+
*/
|
46 |
+
public function checkCustomer()
|
47 |
+
{
|
48 |
+
$this->setWebsiteId(Mage::app()->getStore()->getWebsiteId());
|
49 |
+
$this->setStoreId(Mage::app()->getStore()->getStoreId());
|
50 |
+
|
51 |
+
$this->loadByEmail($this->getFbData('email'));
|
52 |
+
|
53 |
+
if ($this->getId()) {
|
54 |
+
return $this->getId();
|
55 |
+
}
|
56 |
+
|
57 |
+
return FALSE;
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Check if customer was already logged in with FB before
|
62 |
+
*
|
63 |
+
* @return boolean
|
64 |
+
*/
|
65 |
+
public function checkFbCustomer()
|
66 |
+
{
|
67 |
+
return Mage::getModel('facebookfree/facebookfree')->checkFbCustomer($this->getFbData());
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Map FB data to the entity
|
72 |
+
*
|
73 |
+
* @return Belvg_FacebookFree_Model_Customer
|
74 |
+
*/
|
75 |
+
public function prepareData()
|
76 |
+
{
|
77 |
+
$this->setData('firstname', $this->getFbData('first_name'));
|
78 |
+
$this->setData('lastname', $this->getFbData('last_name'));
|
79 |
+
$this->setData('email', $this->getFbData('email'));
|
80 |
+
$this->setData('password', $this->generatePassword());
|
81 |
+
$this->setData('is_active', TRUE);
|
82 |
+
$this->setData('confirmation', NULL);
|
83 |
+
return $this;
|
84 |
+
}
|
85 |
+
|
86 |
+
}
|
app/code/community/Belvg/FacebookFree/Model/FacebookFree.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* BelVG LLC.
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the EULA
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
11 |
-
*
|
12 |
-
/***************************************
|
13 |
-
* MAGENTO EDITION USAGE NOTICE *
|
14 |
-
*****************************************/
|
15 |
-
/* This package designed for Magento COMMUNITY edition
|
16 |
-
* BelVG does not guarantee correct work of this extension
|
17 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
-
* BelVG does not provide extension support in case of
|
19 |
-
* incorrect edition usage.
|
20 |
-
/***************************************
|
21 |
-
* DISCLAIMER *
|
22 |
-
*****************************************/
|
23 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
24 |
-
* versions in the future.
|
25 |
-
*****************************************************
|
26 |
-
* @category Belvg
|
27 |
-
* @package Belvg_FacebookFree
|
28 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
29 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
30 |
-
*/
|
31 |
-
|
32 |
-
class Belvg_FacebookFree_Model_FacebookFree extends Mage_Core_Model_Abstract
|
33 |
-
{
|
34 |
-
public function _construct()
|
35 |
-
{
|
36 |
-
parent::_construct();
|
37 |
-
$this->_init('facebookfree/facebookfree');
|
38 |
-
}
|
39 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Belvg/FacebookFree/Model/Facebookfree.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Belvg_FacebookFree_Model_FacebookFree extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Event prefix for observer
|
8 |
+
*
|
9 |
+
* @var string
|
10 |
+
*/
|
11 |
+
protected $_eventPrefix = 'facebookfree';
|
12 |
+
|
13 |
+
/**
|
14 |
+
* init model
|
15 |
+
*
|
16 |
+
* @return void
|
17 |
+
*/
|
18 |
+
public function _construct()
|
19 |
+
{
|
20 |
+
parent::_construct();
|
21 |
+
$this->_init('facebookfree/facebookfree');
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Check if customer was already logged in with FB before
|
26 |
+
*
|
27 |
+
* @param array $fb_data
|
28 |
+
* @return boolean
|
29 |
+
*/
|
30 |
+
public function checkFbCustomer(array $fb_data)
|
31 |
+
{
|
32 |
+
$this->setWebsiteId(Mage::app()->getStore()->getWebsiteId());
|
33 |
+
$collection = $this->getCollection();
|
34 |
+
$collection->addFieldToFilter('fb_id', $fb_data['id'])
|
35 |
+
->addFieldToFilter('website_id', $this->getWebsiteId());
|
36 |
+
if ($collection->count() && $customer_id = $collection->getFirstItem()->getCustomerId()) {
|
37 |
+
return $customer_id;
|
38 |
+
}
|
39 |
+
|
40 |
+
return FALSE;
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Load data to the entity
|
45 |
+
*
|
46 |
+
* @param Belvg_FacebookFree_Model_Customer $customer
|
47 |
+
* @return Belvg_FacebookFree_Model_FacebookFree
|
48 |
+
*/
|
49 |
+
public function prepareData(Belvg_FacebookFree_Model_Customer $customer)
|
50 |
+
{
|
51 |
+
$data = array(
|
52 |
+
'customer_id' => $customer->getId(),
|
53 |
+
'website_id' => (int)$customer->getWebsiteId(),
|
54 |
+
'store_id' => (int)$customer->getStoreId(),
|
55 |
+
'fb_id' => (int)$customer->getFbData('id'),
|
56 |
+
);
|
57 |
+
|
58 |
+
$this->setData($data);
|
59 |
+
return $this;
|
60 |
+
}
|
61 |
+
|
62 |
+
}
|
app/code/community/Belvg/FacebookFree/Model/Locale.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Belvg_FacebookFree_Model_Locale extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
* @var SimpleXMLElement|NULL
|
9 |
+
*/
|
10 |
+
protected $_locales = NULL;
|
11 |
+
|
12 |
+
const FBFREE_DEFAULT_LOCALE = 'en_US';
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Read locales
|
16 |
+
*/
|
17 |
+
public function __construct()
|
18 |
+
{
|
19 |
+
$classArr = explode('_', get_class($this));
|
20 |
+
$moduleName = $classArr[0] . '_' . $classArr[1];
|
21 |
+
$etcDir = Mage::getConfig()->getModuleDir('etc', $moduleName);
|
22 |
+
|
23 |
+
$fileName = $etcDir . DS . 'locale.xml';
|
24 |
+
if (is_readable($fileName)) {
|
25 |
+
$localesXml = file_get_contents($fileName);
|
26 |
+
$this->_locales = new Varien_Simplexml_Element($localesXml);
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Get current FB locale according to the selected store locale
|
32 |
+
*
|
33 |
+
* @return string
|
34 |
+
*/
|
35 |
+
public function getLocale()
|
36 |
+
{
|
37 |
+
$store_locale = Mage::app()->getLocale()->getLocaleCode();
|
38 |
+
$localeParams = array();
|
39 |
+
|
40 |
+
if (isset($this->_locales->$store_locale)) {
|
41 |
+
$localeParams = new Varien_Object($this->_locales->$store_locale->asArray());
|
42 |
+
}
|
43 |
+
|
44 |
+
$locale = isset($localeParams['code']) ? $localeParams['code'] : self::FBFREE_DEFAULT_LOCALE;
|
45 |
+
|
46 |
+
return $locale;
|
47 |
+
}
|
48 |
+
|
49 |
+
}
|
app/code/community/Belvg/FacebookFree/Model/Mysql4/FacebookFree.php
CHANGED
@@ -1,38 +1,6 @@
|
|
1 |
<?php
|
2 |
-
/**
|
3 |
-
* BelVG LLC.
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the EULA
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
11 |
-
*
|
12 |
-
/***************************************
|
13 |
-
* MAGENTO EDITION USAGE NOTICE *
|
14 |
-
*****************************************/
|
15 |
-
/* This package designed for Magento COMMUNITY edition
|
16 |
-
* BelVG does not guarantee correct work of this extension
|
17 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
-
* BelVG does not provide extension support in case of
|
19 |
-
* incorrect edition usage.
|
20 |
-
/***************************************
|
21 |
-
* DISCLAIMER *
|
22 |
-
*****************************************/
|
23 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
24 |
-
* versions in the future.
|
25 |
-
*****************************************************
|
26 |
-
* @category Belvg
|
27 |
-
* @package Belvg_FacebookReferral
|
28 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
29 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
30 |
-
*/
|
31 |
|
32 |
-
class Belvg_FacebookFree_Model_Mysql4_FacebookFree extends
|
33 |
{
|
34 |
-
|
35 |
-
{
|
36 |
-
$this->_init('facebookfree/facebookfree', 'id');
|
37 |
-
}
|
38 |
}
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
+
class Belvg_FacebookFree_Model_Mysql4_FacebookFree extends Belvg_FacebookFree_Model_Resource_FacebookFree
|
4 |
{
|
5 |
+
|
|
|
|
|
|
|
6 |
}
|
app/code/community/Belvg/FacebookFree/Model/Mysql4/Setup.php
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* BelVG LLC.
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the EULA
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
11 |
-
*
|
12 |
-
/***************************************
|
13 |
-
* MAGENTO EDITION USAGE NOTICE *
|
14 |
-
*****************************************/
|
15 |
-
/* This package designed for Magento COMMUNITY edition
|
16 |
-
* BelVG does not guarantee correct work of this extension
|
17 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
-
* BelVG does not provide extension support in case of
|
19 |
-
* incorrect edition usage.
|
20 |
-
/***************************************
|
21 |
-
* DISCLAIMER *
|
22 |
-
*****************************************/
|
23 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
24 |
-
* versions in the future.
|
25 |
-
*****************************************************
|
26 |
-
* @category Belvg
|
27 |
-
* @package Belvg_FacebookFree
|
28 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
29 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
30 |
-
*/
|
31 |
-
|
32 |
-
class Belvg_FacebookFree_Mysql4_Setup extends Mage_Eav_Model_Entity_Setup
|
33 |
-
{
|
34 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Belvg/FacebookFree/Model/Request.php
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Belvg_FacebookFree_Model_Request extends Varien_Object
|
4 |
+
{
|
5 |
+
|
6 |
+
const FB_REQUEST_URL = 'https://graph.facebook.com/oauth/access_token?client_id=%s&redirect_uri=&client_secret=%s&code=%s';
|
7 |
+
const FB_USER_URL = 'https://graph.facebook.com/%s?access_token=%s';
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Send request to FB
|
11 |
+
*
|
12 |
+
* @param string $url
|
13 |
+
* @return string
|
14 |
+
* @throws Exception
|
15 |
+
*/
|
16 |
+
private function getFbData($url)
|
17 |
+
{
|
18 |
+
$data = NULL;
|
19 |
+
|
20 |
+
if (extension_loaded('curl')) {
|
21 |
+
$request = curl_init();
|
22 |
+
curl_setopt($request, CURLOPT_URL, $url);
|
23 |
+
curl_setopt($request, CURLOPT_RETURNTRANSFER, TRUE);
|
24 |
+
$data = curl_exec($request);
|
25 |
+
} else {
|
26 |
+
throw new Exception('Curl extension should be loaded');
|
27 |
+
}
|
28 |
+
|
29 |
+
return $data;
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Get Application Token from FB cookie
|
34 |
+
*
|
35 |
+
* @return string
|
36 |
+
* @throws Exception
|
37 |
+
*/
|
38 |
+
public function getToken()
|
39 |
+
{
|
40 |
+
$app_id = Mage::helper('facebookfree')->getAppId();
|
41 |
+
$secret = Mage::helper('facebookfree')->getAppSecret();
|
42 |
+
|
43 |
+
if ($data = Mage::getModel('facebookfree/request_cookie')->getParsedCookie()) {
|
44 |
+
if (isset($data['code'])) {
|
45 |
+
$url = sprintf(self::FB_REQUEST_URL, $app_id, $secret, $data['code']);
|
46 |
+
$token_response = $this->getFbData($url);
|
47 |
+
parse_str($token_response, $signed_request);
|
48 |
+
|
49 |
+
if (isset($signed_request['access_token'])) {
|
50 |
+
return $signed_request['access_token'];
|
51 |
+
}
|
52 |
+
|
53 |
+
throw new Exception('Access Token not found');
|
54 |
+
}
|
55 |
+
|
56 |
+
throw new Exception('Request code not found');
|
57 |
+
} else {
|
58 |
+
throw new Exception('False Signed Request');
|
59 |
+
}
|
60 |
+
|
61 |
+
return NULL;
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Load object data
|
66 |
+
*
|
67 |
+
* @param int $fb_id
|
68 |
+
* @return array
|
69 |
+
* @throws Exception
|
70 |
+
*/
|
71 |
+
public function load($fb_id = 'me')
|
72 |
+
{
|
73 |
+
$url = sprintf(self::FB_USER_URL, $fb_id, $this->getToken());
|
74 |
+
$user_data_json = $this->getFbData($url);
|
75 |
+
|
76 |
+
$user_data = json_decode($user_data_json);
|
77 |
+
if (is_null($user_data)) {
|
78 |
+
throw new Exception('FB-connect user data parse error: ' . json_last_error());
|
79 |
+
}
|
80 |
+
|
81 |
+
return (array)$user_data;
|
82 |
+
}
|
83 |
+
}
|
app/code/community/Belvg/FacebookFree/Model/Request/Cookie.php
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Belvg_FacebookFree_Model_Request_Cookie extends Mage_Core_Model_Cookie
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Original FB cookie
|
8 |
+
*
|
9 |
+
* @var string
|
10 |
+
*/
|
11 |
+
private $_fb_cookie = null;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* get FB cookie
|
15 |
+
*/
|
16 |
+
public function __construct()
|
17 |
+
{
|
18 |
+
$cookie_name = 'fbsr_' . Mage::helper('facebookfree')->getAppId();
|
19 |
+
$this->_fb_cookie = $this->get($cookie_name);
|
20 |
+
}
|
21 |
+
/**
|
22 |
+
* get FB cookie
|
23 |
+
*
|
24 |
+
* @return string
|
25 |
+
*/
|
26 |
+
public function getFbCookie()
|
27 |
+
{
|
28 |
+
return $this->_fb_cookie;
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Decode and parce FB cookie
|
33 |
+
*
|
34 |
+
* @return array|NULL
|
35 |
+
* @throws Exception
|
36 |
+
*/
|
37 |
+
private function parseCookie()
|
38 |
+
{
|
39 |
+
if (!empty($this->_fb_cookie)) {
|
40 |
+
if (list($encoded_sig, $payload) = explode('.', $this->_fb_cookie, 2)) {
|
41 |
+
|
42 |
+
// decode the data
|
43 |
+
$sig = $this->base64_url_decode($encoded_sig);
|
44 |
+
$data = json_decode($this->base64_url_decode($payload), TRUE);
|
45 |
+
|
46 |
+
if (strtoupper($data['algorithm']) !== 'HMAC-SHA256') {
|
47 |
+
throw new Exception('Unknown algorithm. Expected HMAC-SHA256');
|
48 |
+
return NULL;
|
49 |
+
}
|
50 |
+
|
51 |
+
$secret = Mage::helper('facebookfree')->getAppSecret();
|
52 |
+
// Adding the verification of the signed_request below
|
53 |
+
$expected_sig = hash_hmac('sha256', $payload, $secret, TRUE);
|
54 |
+
if ($sig !== $expected_sig) {
|
55 |
+
throw new Exception('Bad Signed JSON signature!');
|
56 |
+
return NULL;
|
57 |
+
}
|
58 |
+
|
59 |
+
return $data;
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
return NULL;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Getter for parceCookie() method
|
68 |
+
*
|
69 |
+
* @return array
|
70 |
+
*/
|
71 |
+
public function getParsedCookie()
|
72 |
+
{
|
73 |
+
return $this->parseCookie();
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* See http://developers.facebook.com/docs/authentication/signed_request/ for more info
|
78 |
+
*
|
79 |
+
* @param string $input
|
80 |
+
* @return string
|
81 |
+
*/
|
82 |
+
private function base64_url_decode($input)
|
83 |
+
{
|
84 |
+
return base64_decode(strtr($input, '-_', '+/'));
|
85 |
+
}
|
86 |
+
|
87 |
+
}
|
app/code/community/Belvg/FacebookFree/Model/Resource/Facebookfree.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Belvg_FacebookFree_Model_Resource_FacebookFree extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
$this->_init('facebookfree/facebookfree', 'id');
|
8 |
+
}
|
9 |
+
|
10 |
+
}
|
app/code/community/Belvg/FacebookFree/Model/Resource/Facebookfree/Collection.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Belvg_FacebookFree_Model_Resource_Facebookfree_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
$this->_init('facebookfree/facebookfree');
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Belvg/FacebookFree/Model/System/Config/Source/Layout.php
CHANGED
@@ -35,7 +35,7 @@ class Belvg_FacebookFree_Model_System_Config_Source_Layout
|
|
35 |
{
|
36 |
return array(
|
37 |
//array('value'=>'', 'label'=>''),
|
38 |
-
array('value'=>'
|
39 |
array('value'=>'button_count', 'label'=>Mage::helper('facebookfree')->__('Button Count')),
|
40 |
array('value'=>'box_count', 'label'=>Mage::helper('facebookfree')->__('Box Count')),
|
41 |
);
|
35 |
{
|
36 |
return array(
|
37 |
//array('value'=>'', 'label'=>''),
|
38 |
+
array('value'=>'standard', 'label'=>Mage::helper('facebookfree')->__('Standard')),
|
39 |
array('value'=>'button_count', 'label'=>Mage::helper('facebookfree')->__('Button Count')),
|
40 |
array('value'=>'box_count', 'label'=>Mage::helper('facebookfree')->__('Box Count')),
|
41 |
);
|
app/code/community/Belvg/FacebookFree/controllers/CustomerController.php
CHANGED
@@ -1,123 +1,85 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
*
|
13 |
-
/***************************************
|
14 |
-
* MAGENTO EDITION USAGE NOTICE *
|
15 |
-
* *************************************** */
|
16 |
-
/* This package designed for Magento COMMUNITY edition
|
17 |
-
* BelVG does not guarantee correct work of this extension
|
18 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
-
* BelVG does not provide extension support in case of
|
20 |
-
* incorrect edition usage.
|
21 |
-
/***************************************
|
22 |
-
* DISCLAIMER *
|
23 |
-
* *************************************** */
|
24 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
-
* versions in the future.
|
26 |
-
* ****************************************************
|
27 |
-
* @category Belvg
|
28 |
-
* @package Belvg_FacebookFree
|
29 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
30 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
-
*/
|
32 |
-
|
33 |
-
class Belvg_FacebookFree_CustomerController extends Mage_Core_Controller_Front_Action {
|
34 |
-
|
35 |
-
public function LoginAction()
|
36 |
{
|
|
|
|
|
|
|
|
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
$me = json_decode($this->getFbData('https://graph.facebook.com/me?access_token=' . $cookie['access_token']));
|
43 |
-
|
44 |
-
if (!is_null($me)) {
|
45 |
-
$me = (array)$me;
|
46 |
-
$session = Mage::getSingleton('customer/session');
|
47 |
-
|
48 |
-
$db_read = Mage::getSingleton('core/resource')->getConnection('facebookfree_read');
|
49 |
-
$tablePrefix = (string) Mage::getConfig()->getTablePrefix();
|
50 |
-
$sql = 'SELECT `customer_id`
|
51 |
-
FROM `' . $tablePrefix . 'belvg_facebook_customer`
|
52 |
-
WHERE `fb_id` = ' . $me['id'] . '
|
53 |
-
LIMIT 1';
|
54 |
-
$data = $db_read->fetchRow($sql);
|
55 |
-
|
56 |
-
if ($data) {
|
57 |
-
$session->loginById($data['customer_id']);
|
58 |
-
} else {
|
59 |
-
$sql = 'SELECT `entity_id`
|
60 |
-
FROM `' . $tablePrefix . 'customer_entity`
|
61 |
-
WHERE email = "' . $me['email'] . '"
|
62 |
-
AND store_id = "'.Mage::app()->getStore()->getStoreId().'"
|
63 |
-
AND website_id = "'.Mage::getModel('core/store')->load(Mage::app()->getStore()->getStoreId())->getWebsiteId().'"
|
64 |
-
LIMIT 1';
|
65 |
-
$r = $db_read->fetchRow($sql);
|
66 |
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
$
|
72 |
-
$session->loginById($r['entity_id']);
|
73 |
-
} else {
|
74 |
-
$this->_registerCustomer($me, $session);
|
75 |
}
|
|
|
|
|
|
|
76 |
}
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
}
|
80 |
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
{
|
83 |
-
$
|
84 |
-
$session->logout()
|
85 |
-
->setBeforeAuthUrl(Mage::getUrl());
|
86 |
|
87 |
-
$this
|
88 |
-
}
|
89 |
|
90 |
-
|
91 |
-
|
92 |
-
$customer = Mage::getModel('customer/customer')->setId(null);
|
93 |
-
$customer->setData('firstname', $data['first_name']);
|
94 |
-
$customer->setData('lastname', $data['last_name']);
|
95 |
-
$customer->setData('email', $data['email']);
|
96 |
-
$customer->setData('password', md5(time() . $data['id'] . $data['locale']));
|
97 |
-
$customer->setData('is_active', 1);
|
98 |
-
$customer->setData('confirmation', null);
|
99 |
-
$customer->setConfirmation(null);
|
100 |
-
$customer->getGroupId();
|
101 |
-
$customer->save();
|
102 |
|
103 |
-
|
104 |
-
$customer->setConfirmation(null);
|
105 |
-
$session->setCustomerAsLoggedIn($customer);
|
106 |
-
$customer_id = $session->getCustomerId();
|
107 |
-
$db_write = Mage::getSingleton('core/resource')->getConnection('facebookfree_write');
|
108 |
-
$tablePrefix = (string) Mage::getConfig()->getTablePrefix();
|
109 |
-
$sql = 'INSERT INTO `' . $tablePrefix . 'belvg_facebook_customer`
|
110 |
-
VALUES (' . $customer_id . ', ' . $data['id'] . ')';
|
111 |
-
$db_write->query($sql);
|
112 |
}
|
113 |
|
114 |
-
|
|
|
|
|
|
|
|
|
|
|
115 |
{
|
|
|
|
|
116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
if ($referer = $this->getRequest()->getParam(Mage_Customer_Helper_Data::REFERER_QUERY_PARAM_NAME)) {
|
118 |
$referer = Mage::helper('core')->urlDecode($referer);
|
119 |
if ((strpos($referer, Mage::app()->getStore()->getBaseUrl()) === 0)
|
120 |
-
|| (strpos($referer, Mage::app()->getStore()->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK,
|
121 |
$session->setBeforeAuthUrl($referer);
|
122 |
} else {
|
123 |
$session->setBeforeAuthUrl(Mage::helper('customer')->getDashboardUrl());
|
@@ -125,93 +87,8 @@ class Belvg_FacebookFree_CustomerController extends Mage_Core_Controller_Front_A
|
|
125 |
} else {
|
126 |
$session->setBeforeAuthUrl(Mage::helper('customer')->getDashboardUrl());
|
127 |
}
|
128 |
-
$this->_redirectUrl($session->getBeforeAuthUrl(true));
|
129 |
-
}
|
130 |
|
131 |
-
|
132 |
-
{
|
133 |
-
if ($_COOKIE['fbsr_' . $app_id] != '') {
|
134 |
-
return $this->get_new_facebook_cookie($app_id, $app_secret);
|
135 |
-
} else {
|
136 |
-
return $this->get_old_facebook_cookie($app_id, $app_secret);
|
137 |
-
}
|
138 |
}
|
139 |
|
140 |
-
|
141 |
-
{
|
142 |
-
$args = array();
|
143 |
-
parse_str(trim($_COOKIE['fbs_' . $app_id], '\\"'), $args);
|
144 |
-
ksort($args);
|
145 |
-
$payload = '';
|
146 |
-
foreach ($args as $key => $value) {
|
147 |
-
if ($key != 'sig') {
|
148 |
-
$payload .= $key . '=' . $value;
|
149 |
-
}
|
150 |
-
}
|
151 |
-
if (md5($payload . $app_secret) != $args['sig']) {
|
152 |
-
return array();
|
153 |
-
}
|
154 |
-
return $args;
|
155 |
-
}
|
156 |
-
|
157 |
-
private function get_new_facebook_cookie($app_id, $app_secret)
|
158 |
-
{
|
159 |
-
$signed_request = $this->parse_signed_request($_COOKIE['fbsr_' . $app_id], $app_secret);
|
160 |
-
// $signed_request should now have most of the old elements
|
161 |
-
$signed_request['uid'] = $signed_request['user_id']; // for compatibility
|
162 |
-
if (!is_null($signed_request)) {
|
163 |
-
// the cookie is valid/signed correctly
|
164 |
-
// lets change "code" into an "access_token"
|
165 |
-
$access_token_response = $this->getFbData("https://graph.facebook.com/oauth/access_token?client_id=$app_id&redirect_uri=&client_secret=$app_secret&code=$signed_request[code]");
|
166 |
-
parse_str($access_token_response);
|
167 |
-
$signed_request['access_token'] = $access_token;
|
168 |
-
$signed_request['expires'] = time() + $expires;
|
169 |
-
}
|
170 |
-
|
171 |
-
return $signed_request;
|
172 |
-
}
|
173 |
-
|
174 |
-
private function parse_signed_request($signed_request, $secret)
|
175 |
-
{
|
176 |
-
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
|
177 |
-
|
178 |
-
// decode the data
|
179 |
-
$sig = $this->base64_url_decode($encoded_sig);
|
180 |
-
$data = json_decode($this->base64_url_decode($payload), true);
|
181 |
-
|
182 |
-
if (strtoupper($data['algorithm']) !== 'HMAC-SHA256') {
|
183 |
-
error_log('Unknown algorithm. Expected HMAC-SHA256');
|
184 |
-
return null;
|
185 |
-
}
|
186 |
-
|
187 |
-
// check sig
|
188 |
-
$expected_sig = hash_hmac('sha256', $payload, $secret, $raw = true);
|
189 |
-
if ($sig !== $expected_sig) {
|
190 |
-
error_log('Bad Signed JSON signature!');
|
191 |
-
return null;
|
192 |
-
}
|
193 |
-
|
194 |
-
return $data;
|
195 |
-
}
|
196 |
-
|
197 |
-
private function base64_url_decode($input)
|
198 |
-
{
|
199 |
-
return base64_decode(strtr($input, '-_', '+/'));
|
200 |
-
}
|
201 |
-
|
202 |
-
private function getFbData($url)
|
203 |
-
{
|
204 |
-
$data = null;
|
205 |
-
|
206 |
-
if (ini_get('allow_url_fopen') && function_exists('file_get_contents')) {
|
207 |
-
$data = file_get_contents($url);
|
208 |
-
} else {
|
209 |
-
$ch = curl_init();
|
210 |
-
curl_setopt($ch, CURLOPT_URL, $url);
|
211 |
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
212 |
-
$data = curl_exec($ch);
|
213 |
-
}
|
214 |
-
return $data;
|
215 |
-
}
|
216 |
-
|
217 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
class Belvg_FacebookFree_CustomerController extends Mage_Core_Controller_Front_Action
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Login FB user
|
8 |
+
*
|
9 |
+
* @return void
|
10 |
+
*/
|
11 |
+
public function loginAction()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
{
|
13 |
+
if ($this->_getSession()->isLoggedIn()) {
|
14 |
+
$this->_redirect('*/*/');
|
15 |
+
return;
|
16 |
+
}
|
17 |
|
18 |
+
try {
|
19 |
+
$fb_data = Mage::getModel('facebookfree/request')->load();
|
20 |
+
$customer_model = Mage::getModel('facebookfree/customer')->setFbData($fb_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
+
// check if we need to create customer or register FB user
|
23 |
+
if (!$customer_id = $customer_model->checkFbCustomer()) {
|
24 |
+
if (!$customer_id = $customer_model->checkCustomer()) {
|
25 |
+
// create customer
|
26 |
+
$customer_id = $this->createCustomer($customer_model);
|
|
|
|
|
|
|
27 |
}
|
28 |
+
|
29 |
+
// create record about FB user
|
30 |
+
Mage::getModel('facebookfree/facebookfree')->prepareData($customer_model)->save();
|
31 |
}
|
32 |
+
|
33 |
+
// login customer
|
34 |
+
$this->_getSession()->loginById($customer_id);
|
35 |
+
$this->_loginPostRedirect();
|
36 |
+
} catch (Exception $e) {
|
37 |
+
Mage::log($e->getMessage(), NULL, 'facebookfree.log');
|
38 |
+
$this->_getSession()->addError(Mage::helper('facebookfree')->__('Facebook Connect attempt failed'));
|
39 |
+
$this->_redirect('customer/account/login');
|
40 |
}
|
41 |
}
|
42 |
|
43 |
+
/**
|
44 |
+
* Trigger customer save process
|
45 |
+
*
|
46 |
+
* @param Belvg_FacebookFree_Model_Customer $customer_model
|
47 |
+
* @return int
|
48 |
+
*/
|
49 |
+
private function createCustomer(Belvg_FacebookFree_Model_Customer $customer_model)
|
50 |
{
|
51 |
+
$customer_model->prepareData()->save();
|
|
|
|
|
52 |
|
53 |
+
Mage::dispatchEvent('customer_register_success', array('account_controller' => $this, 'customer' => $customer_model));
|
|
|
54 |
|
55 |
+
$customer_model->setConfirmation(NULL)->save();
|
56 |
+
$customer_model->sendNewAccountEmail();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
+
return $customer_model->getId();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
}
|
60 |
|
61 |
+
/**
|
62 |
+
* Retrieve customer session model object
|
63 |
+
*
|
64 |
+
* @return Mage_Customer_Model_Session
|
65 |
+
*/
|
66 |
+
protected function _getSession()
|
67 |
{
|
68 |
+
return Mage::getSingleton('customer/session');
|
69 |
+
}
|
70 |
|
71 |
+
/**
|
72 |
+
* Prepare to autoredirect customer after successful login
|
73 |
+
*
|
74 |
+
* @return void
|
75 |
+
*/
|
76 |
+
private function _loginPostRedirect()
|
77 |
+
{
|
78 |
+
$session = $this->_getSession();
|
79 |
if ($referer = $this->getRequest()->getParam(Mage_Customer_Helper_Data::REFERER_QUERY_PARAM_NAME)) {
|
80 |
$referer = Mage::helper('core')->urlDecode($referer);
|
81 |
if ((strpos($referer, Mage::app()->getStore()->getBaseUrl()) === 0)
|
82 |
+
|| (strpos($referer, Mage::app()->getStore()->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK, TRUE)) === 0)) {
|
83 |
$session->setBeforeAuthUrl($referer);
|
84 |
} else {
|
85 |
$session->setBeforeAuthUrl(Mage::helper('customer')->getDashboardUrl());
|
87 |
} else {
|
88 |
$session->setBeforeAuthUrl(Mage::helper('customer')->getDashboardUrl());
|
89 |
}
|
|
|
|
|
90 |
|
91 |
+
$this->_redirectUrl($session->getBeforeAuthUrl(TRUE));
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
}
|
93 |
|
94 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Belvg/FacebookFree/etc/adminhtml.xml
CHANGED
@@ -1,35 +1,3 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* BelVG LLC.
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the EULA
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
-
*
|
13 |
-
/***************************************
|
14 |
-
* MAGENTO EDITION USAGE NOTICE *
|
15 |
-
*****************************************/
|
16 |
-
/* This package designed for Magento COMMUNITY edition
|
17 |
-
* BelVG does not guarantee correct work of this extension
|
18 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
-
* BelVG does not provide extension support in case of
|
20 |
-
* incorrect edition usage.
|
21 |
-
/***************************************
|
22 |
-
* DISCLAIMER *
|
23 |
-
*****************************************/
|
24 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
-
* versions in the future.
|
26 |
-
*****************************************************
|
27 |
-
* @category Belvg
|
28 |
-
* @package Belvg_FacebookFree
|
29 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
30 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
-
*/
|
32 |
-
-->
|
33 |
<config>
|
34 |
<acl>
|
35 |
<resources>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<config>
|
2 |
<acl>
|
3 |
<resources>
|
app/code/community/Belvg/FacebookFree/etc/config.xml
CHANGED
@@ -1,124 +1,87 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* BelVG LLC.
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the EULA
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
-
*
|
13 |
-
/***************************************
|
14 |
-
* MAGENTO EDITION USAGE NOTICE *
|
15 |
-
*****************************************/
|
16 |
-
/* This package designed for Magento COMMUNITY edition
|
17 |
-
* BelVG does not guarantee correct work of this extension
|
18 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
-
* BelVG does not provide extension support in case of
|
20 |
-
* incorrect edition usage.
|
21 |
-
/***************************************
|
22 |
-
* DISCLAIMER *
|
23 |
-
*****************************************/
|
24 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
-
* versions in the future.
|
26 |
-
*****************************************************
|
27 |
-
* @category Belvg
|
28 |
-
* @package Belvg_FacebookFree
|
29 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
30 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
-
*/
|
32 |
-
-->
|
33 |
<config>
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
</
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
</args>
|
47 |
-
</facebookfree>
|
48 |
-
</routers>
|
49 |
-
<layout>
|
50 |
-
<updates>
|
51 |
-
<facebookfree>
|
52 |
-
<file>facebookfree.xml</file>
|
53 |
-
</facebookfree>
|
54 |
-
</updates>
|
55 |
-
</layout>
|
56 |
-
</frontend>
|
57 |
-
<global>
|
58 |
-
<models>
|
59 |
-
<facebookfree>
|
60 |
-
<class>Belvg_FacebookFree_Model</class>
|
61 |
-
<resourceModel>facebookfree_mysql4</resourceModel>
|
62 |
-
</facebookfree>
|
63 |
-
<facebookfree_mysql4>
|
64 |
-
<class>Belvg_FacebookFree_Model</class>
|
65 |
-
<entities>
|
66 |
-
<facebookfree>
|
67 |
-
<table>belvg_facebook_customer</table>
|
68 |
-
</facebookfree>
|
69 |
-
</entities>
|
70 |
-
</facebookfree_mysql4>
|
71 |
-
</models>
|
72 |
-
<resources>
|
73 |
-
<facebookfree_setup>
|
74 |
-
<setup>
|
75 |
-
<module>Belvg_FacebookFree</module>
|
76 |
-
</setup>
|
77 |
-
<connection>
|
78 |
-
<use>core_setup</use>
|
79 |
-
</connection>
|
80 |
-
</facebookfree_setup>
|
81 |
-
<facebookfree_write>
|
82 |
-
<connection>
|
83 |
-
<use>core_write</use>
|
84 |
-
</connection>
|
85 |
-
</facebookfree_write>
|
86 |
-
<facebookfree_read>
|
87 |
-
<connection>
|
88 |
-
<use>core_read</use>
|
89 |
-
</connection>
|
90 |
-
</facebookfree_read>
|
91 |
-
</resources>
|
92 |
-
<blocks>
|
93 |
-
<facebookfree>
|
94 |
-
<class>Belvg_FacebookFree_Block</class>
|
95 |
-
</facebookfree>
|
96 |
-
</blocks>
|
97 |
-
<helpers>
|
98 |
-
<facebookfree>
|
99 |
-
<class>Belvg_FacebookFree_Helper</class>
|
100 |
-
</facebookfree>
|
101 |
-
</helpers>
|
102 |
-
</global>
|
103 |
-
<default>
|
104 |
<facebookfree>
|
105 |
-
|
106 |
-
<enabled>0</enabled>
|
107 |
-
<faces>0</faces>
|
108 |
-
<width>450</width>
|
109 |
-
<color>light</color>
|
110 |
-
<layout>standart</layout>
|
111 |
-
<enabled>0</enabled>
|
112 |
-
</like>
|
113 |
-
<activity>
|
114 |
-
<enabled>0</enabled>
|
115 |
-
<width>200</width>
|
116 |
-
<height>300</height>
|
117 |
-
<header>1</header>
|
118 |
-
<color>light</color>
|
119 |
-
<recommendations>1</recommendations>
|
120 |
-
<maxage>0</maxage>
|
121 |
-
</activity>
|
122 |
</facebookfree>
|
123 |
-
|
124 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<config>
|
3 |
+
<frontend>
|
4 |
+
<routers>
|
5 |
+
<facebookfree>
|
6 |
+
<use>standard</use>
|
7 |
+
<args>
|
8 |
+
<module>Belvg_FacebookFree</module>
|
9 |
+
<frontName>facebookfree</frontName>
|
10 |
+
</args>
|
11 |
+
</facebookfree>
|
12 |
+
</routers>
|
13 |
+
<layout>
|
14 |
+
<updates>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
<facebookfree>
|
16 |
+
<file>belvg/facebookfree.xml</file>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
</facebookfree>
|
18 |
+
</updates>
|
19 |
+
</layout>
|
20 |
+
</frontend>
|
21 |
+
<global>
|
22 |
+
<blocks>
|
23 |
+
<facebookfree>
|
24 |
+
<class>Belvg_FacebookFree_Block</class>
|
25 |
+
</facebookfree>
|
26 |
+
<page>
|
27 |
+
<rewrite>
|
28 |
+
<html_header>Belvg_FacebookFree_Block_Page_Html_Header</html_header>
|
29 |
+
</rewrite>
|
30 |
+
</page>
|
31 |
+
</blocks>
|
32 |
+
<helpers>
|
33 |
+
<facebookfree>
|
34 |
+
<class>Belvg_FacebookFree_Helper</class>
|
35 |
+
</facebookfree>
|
36 |
+
</helpers>
|
37 |
+
<models>
|
38 |
+
<facebookfree>
|
39 |
+
<class>Belvg_FacebookFree_Model</class>
|
40 |
+
<resourceModel>facebookfree_resource</resourceModel>
|
41 |
+
</facebookfree>
|
42 |
+
<facebookfree_resource>
|
43 |
+
<class>Belvg_FacebookFree_Model_Resource</class>
|
44 |
+
<deprecatedNode>facebookfree_mysql4</deprecatedNode>
|
45 |
+
<entities>
|
46 |
+
<facebookfree>
|
47 |
+
<table>belvg_facebook_customer</table>
|
48 |
+
</facebookfree>
|
49 |
+
</entities>
|
50 |
+
</facebookfree_resource>
|
51 |
+
</models>
|
52 |
+
<resources>
|
53 |
+
<facebookfree_setup>
|
54 |
+
<setup>
|
55 |
+
<module>Belvg_FacebookFree</module>
|
56 |
+
</setup>
|
57 |
+
<connection>
|
58 |
+
<use>core_setup</use>
|
59 |
+
</connection>
|
60 |
+
</facebookfree_setup>
|
61 |
+
<facebookfree_write>
|
62 |
+
<connection>
|
63 |
+
<use>core_write</use>
|
64 |
+
</connection>
|
65 |
+
</facebookfree_write>
|
66 |
+
<facebookfree_read>
|
67 |
+
<connection>
|
68 |
+
<use>core_read</use>
|
69 |
+
</connection>
|
70 |
+
</facebookfree_read>
|
71 |
+
</resources>
|
72 |
+
</global>
|
73 |
+
<default>
|
74 |
+
<facebookfree>
|
75 |
+
<settings>
|
76 |
+
<defimage><![CDATA[images/belvg/fb.gif]]></defimage>
|
77 |
+
</settings>
|
78 |
+
<like>
|
79 |
+
<enabled>0</enabled>
|
80 |
+
<faces>0</faces>
|
81 |
+
<width>450</width>
|
82 |
+
<color>light</color>
|
83 |
+
<layout>standart</layout>
|
84 |
+
</like>
|
85 |
+
</facebookfree>
|
86 |
+
</default>
|
87 |
+
</config>
|
app/code/community/Belvg/FacebookFree/etc/locale.xml
ADDED
@@ -0,0 +1,327 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<locales version="1.0">
|
3 |
+
<af_ZA>
|
4 |
+
<code>af_ZA</code>
|
5 |
+
<name>Afrikaans</name>
|
6 |
+
</af_ZA>
|
7 |
+
<sq_AL>
|
8 |
+
<code>Albanian</code>
|
9 |
+
<name>sq_AL</name>
|
10 |
+
</sq_AL>
|
11 |
+
<ar_DZ>
|
12 |
+
<name>Arabic</name>
|
13 |
+
<code>ar_AR</code>
|
14 |
+
</ar_DZ>
|
15 |
+
<ar_EG>
|
16 |
+
<name>Arabic</name>
|
17 |
+
<code>ar_AR</code>
|
18 |
+
</ar_EG>
|
19 |
+
<ar_KW>
|
20 |
+
<name>Arabic</name>
|
21 |
+
<code>ar_AR</code>
|
22 |
+
</ar_KW>
|
23 |
+
<ar_MA>
|
24 |
+
<name>Arabic</name>
|
25 |
+
<code>ar_AR</code>
|
26 |
+
</ar_MA>
|
27 |
+
<ar_SA>
|
28 |
+
<name>Arabic</name>
|
29 |
+
<code>ar_AR</code>
|
30 |
+
</ar_SA>
|
31 |
+
<az_AZ>
|
32 |
+
<name>Azerbaijani</name>
|
33 |
+
<code>az_AZ</code>
|
34 |
+
</az_AZ>
|
35 |
+
<be_BY>
|
36 |
+
<name>Belarusian</name>
|
37 |
+
<code>be_BY</code>
|
38 |
+
</be_BY>
|
39 |
+
<bn_BD>
|
40 |
+
<name>Bengali</name>
|
41 |
+
<code>bn_IN</code>
|
42 |
+
</bn_BD>
|
43 |
+
<bs_BA>
|
44 |
+
<name>Bosnian</name>
|
45 |
+
<code>bs_BA</code>
|
46 |
+
</bs_BA>
|
47 |
+
<bg_BG>
|
48 |
+
<name>Bulgarian</name>
|
49 |
+
<code>bg_BG</code>
|
50 |
+
</bg_BG>
|
51 |
+
<ca_ES>
|
52 |
+
<name>Catalan</name>
|
53 |
+
<code>ca_ES</code>
|
54 |
+
</ca_ES>
|
55 |
+
<zh_CN>
|
56 |
+
<name>Simplified Chinese (China)</name>
|
57 |
+
<code>zh_CN</code>
|
58 |
+
</zh_CN>
|
59 |
+
<zh_HK>
|
60 |
+
<name>Traditional Chinese (Hong Kong)</name>
|
61 |
+
<code>zh_HK</code>
|
62 |
+
</zh_HK>
|
63 |
+
<zh_TW>
|
64 |
+
<name>Traditional Chinese (Taiwan)</name>
|
65 |
+
<code>zh_TW</code>
|
66 |
+
</zh_TW>
|
67 |
+
<hr_HR>
|
68 |
+
<name>Croatian</name>
|
69 |
+
<code>hr_HR</code>
|
70 |
+
</hr_HR>
|
71 |
+
<cs_CZ>
|
72 |
+
<name>Czech</name>
|
73 |
+
<code>cs_CZ</code>
|
74 |
+
</cs_CZ>
|
75 |
+
<da_DK>
|
76 |
+
<name>Danish</name>
|
77 |
+
<code>da_DK</code>
|
78 |
+
</da_DK>
|
79 |
+
<nl_NL>
|
80 |
+
<name>Dutch</name>
|
81 |
+
<code>nl_NL</code>
|
82 |
+
</nl_NL>
|
83 |
+
<en_AU>
|
84 |
+
<name>English (US)</name>
|
85 |
+
<code>en_US</code>
|
86 |
+
</en_AU>
|
87 |
+
<en_CA>
|
88 |
+
<name>English (US)</name>
|
89 |
+
<code>en_US</code>
|
90 |
+
</en_CA>
|
91 |
+
<en_IE>
|
92 |
+
<name>English (US)</name>
|
93 |
+
<code>en_US</code>
|
94 |
+
</en_IE>
|
95 |
+
<en_NZ>
|
96 |
+
<name>English (US)</name>
|
97 |
+
<code>en_US</code>
|
98 |
+
</en_NZ>
|
99 |
+
<en_GB>
|
100 |
+
<name>English (UK)</name>
|
101 |
+
<code>en_GB</code>
|
102 |
+
</en_GB>
|
103 |
+
<en_US>
|
104 |
+
<name>English (US)</name>
|
105 |
+
<code>en_US</code>
|
106 |
+
</en_US>
|
107 |
+
<et_EE>
|
108 |
+
<name>Estonian</name>
|
109 |
+
<code>et_EE</code>
|
110 |
+
</et_EE>
|
111 |
+
<fil_PH>
|
112 |
+
<name>Filipino</name>
|
113 |
+
<code>tl_PH</code>
|
114 |
+
</fil_PH>
|
115 |
+
<fi_FI>
|
116 |
+
<name>Finnish</name>
|
117 |
+
<code>fi_FI</code>
|
118 |
+
</fi_FI>
|
119 |
+
<fr_CA>
|
120 |
+
<name>French (Canada)</name>
|
121 |
+
<code>fr_CA</code>
|
122 |
+
</fr_CA>
|
123 |
+
<fr_FR>
|
124 |
+
<name>French (France)</name>
|
125 |
+
<code>fr_FR</code>
|
126 |
+
</fr_FR>
|
127 |
+
<gl_ES>
|
128 |
+
<name>Galician</name>
|
129 |
+
<code>gl_ES</code>
|
130 |
+
</gl_ES>
|
131 |
+
<ka_GE>
|
132 |
+
<name>Georgian</name>
|
133 |
+
<code>ka_GE</code>
|
134 |
+
</ka_GE>
|
135 |
+
<de_AT>
|
136 |
+
<name>German</name>
|
137 |
+
<code>de_DE</code>
|
138 |
+
</de_AT>
|
139 |
+
<de_DE>
|
140 |
+
<name>German</name>
|
141 |
+
<code>de_DE</code>
|
142 |
+
</de_DE>
|
143 |
+
<de_CH>
|
144 |
+
<name>German</name>
|
145 |
+
<code>de_DE</code>
|
146 |
+
</de_CH>
|
147 |
+
<el_GR>
|
148 |
+
<name>Greek</name>
|
149 |
+
<code>el_GR</code>
|
150 |
+
</el_GR>
|
151 |
+
<gu_IN>
|
152 |
+
<name>English (US)</name>
|
153 |
+
<code>en_US</code>
|
154 |
+
</gu_IN>
|
155 |
+
<he_IL>
|
156 |
+
<name>Hebrew</name>
|
157 |
+
<code>he_IL</code>
|
158 |
+
</he_IL>
|
159 |
+
<hi_IN>
|
160 |
+
<name>Hindi</name>
|
161 |
+
<code>hi_IN</code>
|
162 |
+
</hi_IN>
|
163 |
+
<hu_HU>
|
164 |
+
<name>Hungarian</name>
|
165 |
+
<code>hu_HU</code>
|
166 |
+
</hu_HU>
|
167 |
+
<is_IS>
|
168 |
+
<name>Icelandic</name>
|
169 |
+
<code>is_IS</code>
|
170 |
+
</is_IS>
|
171 |
+
<id_ID>
|
172 |
+
<name>Indonesian</name>
|
173 |
+
<code>id_ID</code>
|
174 |
+
</id_ID>
|
175 |
+
<it_IT>
|
176 |
+
<name>Italian</name>
|
177 |
+
<code>it_IT</code>
|
178 |
+
</it_IT>
|
179 |
+
<it_CH>
|
180 |
+
<name>Italian</name>
|
181 |
+
<code>it_IT</code>
|
182 |
+
</it_CH>
|
183 |
+
<ja_JP>
|
184 |
+
<name>Japanese</name>
|
185 |
+
<code>ja_JP</code>
|
186 |
+
</ja_JP>
|
187 |
+
<km_KH>
|
188 |
+
<name>Khmer</name>
|
189 |
+
<code>km_KH</code>
|
190 |
+
</km_KH>
|
191 |
+
<ko_KR>
|
192 |
+
<name>Korean</name>
|
193 |
+
<code>ko_KR</code>
|
194 |
+
</ko_KR>
|
195 |
+
<lo_LA>
|
196 |
+
<name>English (US)</name>
|
197 |
+
<code>en_US</code>
|
198 |
+
</lo_LA>
|
199 |
+
<lv_LV>
|
200 |
+
<name>Latvian</name>
|
201 |
+
<code>lv_LV</code>
|
202 |
+
</lv_LV>
|
203 |
+
<lt_LT>
|
204 |
+
<name>Lithuanian</name>
|
205 |
+
<code>lt_LT</code>
|
206 |
+
</lt_LT>
|
207 |
+
<mk_MK>
|
208 |
+
<name>Macedonian</name>
|
209 |
+
<code>mk_MK</code>
|
210 |
+
</mk_MK>
|
211 |
+
<ms_MY>
|
212 |
+
<name>Malay</name>
|
213 |
+
<code>ms_MY</code>
|
214 |
+
</ms_MY>
|
215 |
+
<mn_MN>
|
216 |
+
<name>English (US)</name>
|
217 |
+
<code>en_US</code>
|
218 |
+
</mn_MN>
|
219 |
+
<nb_NO>
|
220 |
+
<name>Norwegian (bokmal)</name>
|
221 |
+
<code>nb_NO</code>
|
222 |
+
</nb_NO>
|
223 |
+
<nn_NO>
|
224 |
+
<name>Norwegian (nynorsk)</name>
|
225 |
+
<code>nn_NO</code>
|
226 |
+
</nn_NO>
|
227 |
+
<fa_IR>
|
228 |
+
<name>Persian</name>
|
229 |
+
<code>fa_IR</code>
|
230 |
+
</fa_IR>
|
231 |
+
<pl_PL>
|
232 |
+
<name>Polish</name>
|
233 |
+
<code>pl_PL</code>
|
234 |
+
</pl_PL>
|
235 |
+
<pt_BR>
|
236 |
+
<name>Portuguese (Brazil)</name>
|
237 |
+
<code>pt_BR</code>
|
238 |
+
</pt_BR>
|
239 |
+
<pt_PT>
|
240 |
+
<name>Portuguese (Portugal)</name>
|
241 |
+
<code>pt_PT</code>
|
242 |
+
</pt_PT>
|
243 |
+
<ro_RO>
|
244 |
+
<name>Romanian</name>
|
245 |
+
<code>ro_RO</code>
|
246 |
+
</ro_RO>
|
247 |
+
<ru_RU>
|
248 |
+
<name>Russian</name>
|
249 |
+
<code>ru_RU</code>
|
250 |
+
</ru_RU>
|
251 |
+
<sr_RS>
|
252 |
+
<name>Serbian</name>
|
253 |
+
<code>sr_RS</code>
|
254 |
+
</sr_RS>
|
255 |
+
<sk_SK>
|
256 |
+
<name>Slovak</name>
|
257 |
+
<code>sk_SK</code>
|
258 |
+
</sk_SK>
|
259 |
+
<sl_SI>
|
260 |
+
<name>Slovenian</name>
|
261 |
+
<code>sl_SI</code>
|
262 |
+
</sl_SI>
|
263 |
+
<es_AR>
|
264 |
+
<name>Spanish (Spain)</name>
|
265 |
+
<code>es_ES</code>
|
266 |
+
</es_AR>
|
267 |
+
<es_CL>
|
268 |
+
<name>Spanish (Spain)</name>
|
269 |
+
<code>es_ES</code>
|
270 |
+
</es_CL>
|
271 |
+
<es_CO>
|
272 |
+
<name>Spanish (Spain)</name>
|
273 |
+
<code>es_ES</code>
|
274 |
+
</es_CO>
|
275 |
+
<es_CR>
|
276 |
+
<name>Spanish (Spain)</name>
|
277 |
+
<code>es_ES</code>
|
278 |
+
</es_CR>
|
279 |
+
<es_MX>
|
280 |
+
<name>Spanish (Spain)</name>
|
281 |
+
<code>es_ES</code>
|
282 |
+
</es_MX>
|
283 |
+
<es_PA>
|
284 |
+
<name>Spanish (Spain)</name>
|
285 |
+
<code>es_ES</code>
|
286 |
+
</es_PA>
|
287 |
+
<es_PE>
|
288 |
+
<name>Spanish (Spain)</name>
|
289 |
+
<code>es_ES</code>
|
290 |
+
</es_PE>
|
291 |
+
<es_ES>
|
292 |
+
<name>Spanish (Spain)</name>
|
293 |
+
<code>es_ES</code>
|
294 |
+
</es_ES>
|
295 |
+
<es_VE>
|
296 |
+
<name>Spanish (Spain)</name>
|
297 |
+
<code>es_ES</code>
|
298 |
+
</es_VE>
|
299 |
+
<sw_KE>
|
300 |
+
<name>Swahili</name>
|
301 |
+
<code>sw_KE</code>
|
302 |
+
</sw_KE>
|
303 |
+
<sv_SE>
|
304 |
+
<name>Swedish</name>
|
305 |
+
<code>sv_SE</code>
|
306 |
+
</sv_SE>
|
307 |
+
<th_TH>
|
308 |
+
<name>Thai</name>
|
309 |
+
<code>th_TH</code>
|
310 |
+
</th_TH>
|
311 |
+
<tr_TR>
|
312 |
+
<name>Turkish</name>
|
313 |
+
<code>tr_TR</code>
|
314 |
+
</tr_TR>
|
315 |
+
<uk_UA>
|
316 |
+
<name>Ukrainian</name>
|
317 |
+
<code>uk_UA</code>
|
318 |
+
</uk_UA>
|
319 |
+
<vi_VN>
|
320 |
+
<name>Vietnamese</name>
|
321 |
+
<code>vi_VN</code>
|
322 |
+
</vi_VN>
|
323 |
+
<cy_GB>
|
324 |
+
<name>Welsh</name>
|
325 |
+
<code>cy_GB</code>
|
326 |
+
</cy_GB>
|
327 |
+
</locales>
|
app/code/community/Belvg/FacebookFree/etc/system.xml
CHANGED
@@ -1,35 +1,5 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
-
|
3 |
-
/**
|
4 |
-
* BelVG LLC.
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the EULA
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
-
*
|
13 |
-
/***************************************
|
14 |
-
* MAGENTO EDITION USAGE NOTICE *
|
15 |
-
*****************************************/
|
16 |
-
/* This package designed for Magento COMMUNITY edition
|
17 |
-
* BelVG does not guarantee correct work of this extension
|
18 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
-
* BelVG does not provide extension support in case of
|
20 |
-
* incorrect edition usage.
|
21 |
-
/***************************************
|
22 |
-
* DISCLAIMER *
|
23 |
-
*****************************************/
|
24 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
-
* versions in the future.
|
26 |
-
*****************************************************
|
27 |
-
* @category Belvg
|
28 |
-
* @package Belvg_FacebookFree
|
29 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
30 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
-
*/
|
32 |
-
-->
|
33 |
<config>
|
34 |
<sections>
|
35 |
<facebookfree translate="label">
|
@@ -70,25 +40,28 @@
|
|
70 |
</enabled>
|
71 |
<appid translate="label comment">
|
72 |
<label>Application Id</label>
|
73 |
-
|
|
|
74 |
<frontend_type>text</frontend_type>
|
75 |
<sort_order>11</sort_order>
|
76 |
<show_in_default>1</show_in_default>
|
77 |
<show_in_website>1</show_in_website>
|
78 |
<show_in_store>1</show_in_store>
|
|
|
79 |
</appid>
|
80 |
<secret translate="label comment">
|
81 |
<label>Secret Key</label>
|
82 |
-
<!-- <comment><![CDATA[]]></comment> -->
|
83 |
<frontend_type>text</frontend_type>
|
84 |
<sort_order>12</sort_order>
|
85 |
<show_in_default>1</show_in_default>
|
86 |
<show_in_website>1</show_in_website>
|
87 |
<show_in_store>1</show_in_store>
|
|
|
88 |
</secret>
|
89 |
<imglogin translate="label comment">
|
90 |
<label>Login Button</label>
|
91 |
-
|
|
|
92 |
<frontend_type>image</frontend_type>
|
93 |
<backend_model>adminhtml/system_config_backend_image</backend_model>
|
94 |
<upload_dir config="system/filesystem/media" scope_info="1">facebookfree</upload_dir>
|
@@ -154,82 +127,10 @@
|
|
154 |
<show_in_default>1</show_in_default>
|
155 |
<show_in_website>1</show_in_website>
|
156 |
<show_in_store>1</show_in_store>
|
|
|
157 |
</width>
|
158 |
</fields>
|
159 |
</like>
|
160 |
-
<activity translate="label">
|
161 |
-
<label>Activity</label>
|
162 |
-
<frontend_type>text</frontend_type>
|
163 |
-
<sort_order>130</sort_order>
|
164 |
-
<show_in_default>1</show_in_default>
|
165 |
-
<show_in_website>1</show_in_website>
|
166 |
-
<show_in_store>1</show_in_store>
|
167 |
-
<fields>
|
168 |
-
<enabled translate="label comment">
|
169 |
-
<label>Enabled</label>
|
170 |
-
<frontend_type>select</frontend_type>
|
171 |
-
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
172 |
-
<sort_order>10</sort_order>
|
173 |
-
<show_in_default>1</show_in_default>
|
174 |
-
<show_in_website>1</show_in_website>
|
175 |
-
<show_in_store>1</show_in_store>
|
176 |
-
</enabled>
|
177 |
-
<width translate="label comment">
|
178 |
-
<label>Width</label>
|
179 |
-
<comment>in px</comment>
|
180 |
-
<frontend_type>text</frontend_type>
|
181 |
-
<sort_order>11</sort_order>
|
182 |
-
<show_in_default>1</show_in_default>
|
183 |
-
<show_in_website>1</show_in_website>
|
184 |
-
<show_in_store>1</show_in_store>
|
185 |
-
</width>
|
186 |
-
<height translate="label comment">
|
187 |
-
<label>Height</label>
|
188 |
-
<comment>in px</comment>
|
189 |
-
<frontend_type>text</frontend_type>
|
190 |
-
<sort_order>12</sort_order>
|
191 |
-
<show_in_default>1</show_in_default>
|
192 |
-
<show_in_website>1</show_in_website>
|
193 |
-
<show_in_store>1</show_in_store>
|
194 |
-
</height>
|
195 |
-
<header translate="label comment">
|
196 |
-
<label>Show Header</label>
|
197 |
-
<frontend_type>select</frontend_type>
|
198 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
199 |
-
<sort_order>13</sort_order>
|
200 |
-
<show_in_default>1</show_in_default>
|
201 |
-
<show_in_website>1</show_in_website>
|
202 |
-
<show_in_store>1</show_in_store>
|
203 |
-
</header>
|
204 |
-
<color translate="label">
|
205 |
-
<label>Color Scheme</label>
|
206 |
-
<frontend_type>select</frontend_type>
|
207 |
-
<source_model>facebookfree/system_config_source_color</source_model>
|
208 |
-
<sort_order>14</sort_order>
|
209 |
-
<show_in_default>1</show_in_default>
|
210 |
-
<show_in_website>1</show_in_website>
|
211 |
-
<show_in_store>1</show_in_store>
|
212 |
-
</color>
|
213 |
-
<recommendations translate="label comment">
|
214 |
-
<label>Add recommendations</label>
|
215 |
-
<frontend_type>select</frontend_type>
|
216 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
217 |
-
<sort_order>16</sort_order>
|
218 |
-
<show_in_default>1</show_in_default>
|
219 |
-
<show_in_website>1</show_in_website>
|
220 |
-
<show_in_store>1</show_in_store>
|
221 |
-
</recommendations>
|
222 |
-
<maxage translate="label comment">
|
223 |
-
<label>Max Age</label>
|
224 |
-
<comment>The default is 0 (we don’t take age into account). Otherwise the valid values are 1-180, which specifies the number of days. For example, if you specify '7' the plugin will only show URLs which were created in the past week.</comment>
|
225 |
-
<frontend_type>text</frontend_type>
|
226 |
-
<sort_order>17</sort_order>
|
227 |
-
<show_in_default>1</show_in_default>
|
228 |
-
<show_in_website>1</show_in_website>
|
229 |
-
<show_in_store>1</show_in_store>
|
230 |
-
</maxage>
|
231 |
-
</fields>
|
232 |
-
</activity>
|
233 |
</groups>
|
234 |
</facebookfree>
|
235 |
</sections>
|
1 |
<?xml version="1.0"?>
|
2 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
<config>
|
4 |
<sections>
|
5 |
<facebookfree translate="label">
|
40 |
</enabled>
|
41 |
<appid translate="label comment">
|
42 |
<label>Application Id</label>
|
43 |
+
<comment><![CDATA[<a href="https://developers.facebook.com/apps/" target="_blank">Create</a> your Facebook Application Id]]>
|
44 |
+
</comment>
|
45 |
<frontend_type>text</frontend_type>
|
46 |
<sort_order>11</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 |
+
<validate>required-entry validate-digits</validate>
|
51 |
</appid>
|
52 |
<secret translate="label comment">
|
53 |
<label>Secret Key</label>
|
|
|
54 |
<frontend_type>text</frontend_type>
|
55 |
<sort_order>12</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 |
+
<validate>required-entry validate-alphanum</validate>
|
60 |
</secret>
|
61 |
<imglogin translate="label comment">
|
62 |
<label>Login Button</label>
|
63 |
+
<comment><![CDATA[*.jpg, *.png, *.gif]]>
|
64 |
+
</comment>
|
65 |
<frontend_type>image</frontend_type>
|
66 |
<backend_model>adminhtml/system_config_backend_image</backend_model>
|
67 |
<upload_dir config="system/filesystem/media" scope_info="1">facebookfree</upload_dir>
|
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 |
+
<validate>required-entry validate-digits</validate>
|
131 |
</width>
|
132 |
</fields>
|
133 |
</like>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
</groups>
|
135 |
</facebookfree>
|
136 |
</sections>
|
app/code/community/Belvg/FacebookFree/sql/facebookfree_setup/mysql4-install-1.0.1.php
CHANGED
@@ -1,52 +1,27 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
/**
|
4 |
-
* BelVG LLC.
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the EULA
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
-
*
|
13 |
-
/***************************************
|
14 |
-
* MAGENTO EDITION USAGE NOTICE *
|
15 |
-
* *************************************** */
|
16 |
-
/* This package designed for Magento COMMUNITY edition
|
17 |
-
* BelVG does not guarantee correct work of this extension
|
18 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
-
* BelVG does not provide extension support in case of
|
20 |
-
* incorrect edition usage.
|
21 |
-
/***************************************
|
22 |
-
* DISCLAIMER *
|
23 |
-
* *************************************** */
|
24 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
-
* versions in the future.
|
26 |
-
* ****************************************************
|
27 |
-
* @category Belvg
|
28 |
-
* @package Belvg_FacebookAll
|
29 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
30 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
-
*/
|
32 |
-
|
33 |
$installer = $this;
|
34 |
|
35 |
$installer->startSetup();
|
|
|
36 |
|
37 |
$installer->run("
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
40 |
`fb_id` bigint(20) NOT NULL,
|
41 |
-
|
42 |
-
|
|
|
|
|
43 |
|
44 |
-
ALTER TABLE `{$
|
45 |
-
|
|
|
46 |
|
47 |
-
ALTER TABLE `{$this->getTable('belvg_facebook_customer')}`
|
48 |
-
ADD FOREIGN KEY ( `customer_id` ) REFERENCES `{$this->getTable('customer_entity')}` (
|
49 |
-
`entity_id`
|
50 |
-
) ON DELETE CASCADE ;
|
51 |
");
|
52 |
-
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
$installer = $this;
|
4 |
|
5 |
$installer->startSetup();
|
6 |
+
$table = $this->getTable('facebookfree/facebookfree');
|
7 |
|
8 |
$installer->run("
|
9 |
+
|
10 |
+
CREATE TABLE IF NOT EXISTS `{$table}` (
|
11 |
+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
12 |
+
`customer_id` int(10) unsigned NOT NULL,
|
13 |
+
`store_id` smallint(5) unsigned NOT NULL,
|
14 |
+
`website_id` smallint(5) unsigned NOT NULL,
|
15 |
`fb_id` bigint(20) NOT NULL,
|
16 |
+
PRIMARY KEY (`id`),
|
17 |
+
UNIQUE KEY `customer_id` (`customer_id`),
|
18 |
+
UNIQUE KEY `store_id` (`store_id`,`website_id`,`fb_id`)
|
19 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
20 |
|
21 |
+
ALTER TABLE `{$table}`
|
22 |
+
ADD CONSTRAINT `belvg_facebook_customer_ibfk_2` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core_store')}` (`store_id`) ON DELETE CASCADE ON UPDATE NO ACTION,
|
23 |
+
ADD CONSTRAINT `belvg_facebook_customer_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `{$this->getTable('customer_entity')}` (`entity_id`) ON DELETE CASCADE ON UPDATE NO ACTION;
|
24 |
|
|
|
|
|
|
|
|
|
25 |
");
|
26 |
+
|
27 |
+
$installer->endSetup();
|
app/design/frontend/base/default/layout/belvg/facebookfree.xml
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
|
3 |
+
<layout version="0.1.0">
|
4 |
+
<default>
|
5 |
+
<reference name="before_body_end">
|
6 |
+
<block type="facebookfree/init" name="belvg_facebookfree_block">
|
7 |
+
<action method="setTemplate" ifconfig="facebookfree/settings/enabled" ifvalue="1">
|
8 |
+
<template>belvg/facebookfree/block.phtml</template>
|
9 |
+
</action>
|
10 |
+
</block>
|
11 |
+
</reference>
|
12 |
+
</default>
|
13 |
+
|
14 |
+
<customer_logged_out>
|
15 |
+
<reference name="top.links">
|
16 |
+
<block type="facebookfree/links" name="belvg_facebookfree_link">
|
17 |
+
<action method="setTemplate">
|
18 |
+
<template>belvg/facebookfree/links.phtml</template>
|
19 |
+
</action>
|
20 |
+
<block type="facebookfree/links_button" name="belvg_facebookfree_button" template="belvg/facebookfree/form/button.phtml" />
|
21 |
+
</block>
|
22 |
+
<action method="addLinkBlock" ifconfig="facebookfree/settings/enabled" ifvalue="1">
|
23 |
+
<blockName>belvg_facebookfree_link</blockName>
|
24 |
+
</action>
|
25 |
+
</reference>
|
26 |
+
</customer_logged_out>
|
27 |
+
|
28 |
+
<customer_account_login>
|
29 |
+
<reference name="customer_form_login">
|
30 |
+
<action method="setTemplate">
|
31 |
+
<template>belvg/facebookfree/form/customer/login.phtml</template>
|
32 |
+
</action>
|
33 |
+
<block type="persistent/form_remember" name="persistent.remember.me" template="persistent/remember_me.phtml" />
|
34 |
+
<block type="core/template" name="persistent.remember.me.tooltip" template="persistent/remember_me_tooltip.phtml" />
|
35 |
+
<block type="facebookfree/links_button" name="belvg_facebookfree_button" template="belvg/facebookfree/form/button.phtml" />
|
36 |
+
</reference>
|
37 |
+
</customer_account_login>
|
38 |
+
|
39 |
+
<checkout_onepage_index>
|
40 |
+
<reference name="checkout.onepage.login">
|
41 |
+
<action method="setTemplate">
|
42 |
+
<template>belvg/facebookfree/form/checkout/login.phtml</template>
|
43 |
+
</action>
|
44 |
+
<block type="persistent/form_remember" name="persistent.remember.me" template="persistent/remember_me.phtml" />
|
45 |
+
<block type="facebookfree/links_button" name="belvg_facebookfree_button" template="belvg/facebookfree/form/button.phtml" />
|
46 |
+
</reference>
|
47 |
+
</checkout_onepage_index>
|
48 |
+
|
49 |
+
<catalog_product_view>
|
50 |
+
<reference name="head">
|
51 |
+
<block type="facebookfree/like_meta" name="facebookfree_meta" before="-">
|
52 |
+
<action method="setTemplate" ifconfig="facebookfree/settings/enabled" ifvalue="1">
|
53 |
+
<template>belvg/facebookfree/like/meta.phtml</template>
|
54 |
+
</action>
|
55 |
+
</block>
|
56 |
+
</reference>
|
57 |
+
<reference name="product.info.addto">
|
58 |
+
<action method="setTemplate" ifconfig="facebookfree/settings/enabled" ifvalue="1">
|
59 |
+
<template>belvg/facebookfree/like/product/view/addto.phtml</template>
|
60 |
+
</action>
|
61 |
+
</reference>
|
62 |
+
</catalog_product_view>
|
63 |
+
</layout>
|
app/design/frontend/base/default/template/belvg/facebookfree/block.phtml
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div id="fb-root"></div>
|
2 |
+
<script type="text/javascript">
|
3 |
+
window.fbAsyncInit = function() {
|
4 |
+
FB.init({
|
5 |
+
appId : '<?php echo $this->getAppId() ?>', // App ID
|
6 |
+
status : true, // check login status
|
7 |
+
cookie : true, // enable cookies to allow the server to access the session
|
8 |
+
xfbml : true // parse XFBML
|
9 |
+
});
|
10 |
+
};
|
11 |
+
|
12 |
+
// Load the SDK Asynchronously
|
13 |
+
(function(d){
|
14 |
+
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
|
15 |
+
if (d.getElementById(id)) {return;}
|
16 |
+
js = d.createElement('script'); js.id = id; js.async = true;
|
17 |
+
js.src = "//connect.facebook.net/<?php echo $this->getLocale() ?>/all.js";
|
18 |
+
ref.parentNode.insertBefore(js, ref);
|
19 |
+
}(document));
|
20 |
+
|
21 |
+
function greet(id){
|
22 |
+
FB.api('/me', function(response) {
|
23 |
+
var src = 'https://graph.facebook.com/'+id+'/picture';
|
24 |
+
$$('.welcome-msg')[0].insert('<img height="20" src="'+src+'"/>');
|
25 |
+
});
|
26 |
+
}
|
27 |
+
|
28 |
+
function fblogin(){
|
29 |
+
try {
|
30 |
+
FB.login(function(response) {
|
31 |
+
if (response.status == 'connected') {
|
32 |
+
var url = '<?php echo $this->getLoginUrl() ?>';
|
33 |
+
setLocation(url);
|
34 |
+
} else if (response.status === 'not_authorized') {
|
35 |
+
alert('<?php echo $this->__('Please, approve our application') ?>');
|
36 |
+
} else {
|
37 |
+
// user is not logged in
|
38 |
+
window.location.reload();
|
39 |
+
}
|
40 |
+
}, {scope:'email'});
|
41 |
+
} catch (err) {
|
42 |
+
fblogin();
|
43 |
+
}
|
44 |
+
return false;
|
45 |
+
}
|
46 |
+
</script>
|
app/design/frontend/base/default/template/belvg/facebookfree/form/button.phtml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if ($this->helper('facebookfree')->isActive()):?>
|
2 |
+
<a href="#" onclick="return fblogin();">
|
3 |
+
<img src="<?php echo $this->getImage() ?>" alt="<?php echo $this->__('Connect with Facebook') ?>" />
|
4 |
+
</a>
|
5 |
+
<?php endif?>
|
app/design/frontend/{default/default/template/facebookfree/checkoutlogin.phtml → base/default/template/belvg/facebookfree/form/checkout/login.phtml}
RENAMED
@@ -1,34 +1,37 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
7 |
-
* This source file is subject to the
|
8 |
-
* that is bundled with this package in the file
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://
|
|
|
|
|
|
|
11 |
*
|
12 |
-
|
13 |
-
*
|
14 |
-
|
15 |
-
|
16 |
-
*
|
17 |
-
*
|
18 |
-
*
|
19 |
-
*
|
20 |
-
|
21 |
-
*
|
22 |
-
*****************************************/
|
23 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
24 |
-
* versions in the future.
|
25 |
-
*****************************************************
|
26 |
-
* @category Belvg
|
27 |
-
* @package Belvg_FacebookFree
|
28 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
29 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
30 |
*/
|
31 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
<div class="col2-set">
|
33 |
<?php echo $this->getChildHtml('login_before')?>
|
34 |
<div class="col-1">
|
@@ -69,6 +72,7 @@
|
|
69 |
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
70 |
<form id="login-form" action="<?php echo $this->getPostAction() ?>" method="post">
|
71 |
<fieldset>
|
|
|
72 |
<h4><?php echo $this->__('Already registered?') ?></h4>
|
73 |
<p><?php echo $this->__('Please log in below:') ?></p>
|
74 |
<ul class="form-list">
|
@@ -84,7 +88,10 @@
|
|
84 |
<input type="password" class="input-text required-entry" id="login-password" name="login[password]" />
|
85 |
</div>
|
86 |
</li>
|
|
|
|
|
87 |
</ul>
|
|
|
88 |
</fieldset>
|
89 |
</form>
|
90 |
</div>
|
@@ -93,7 +100,15 @@
|
|
93 |
<div class="col-1">
|
94 |
<div class="buttons-set">
|
95 |
<p class="required"> </p>
|
96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
</div>
|
98 |
</div>
|
99 |
<div class="col-2">
|
@@ -101,7 +116,7 @@
|
|
101 |
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
102 |
<a href="<?php echo $this->getUrl('customer/account/forgotpassword') ?>" class="f-left"><?php echo $this->__('Forgot your password?') ?></a>
|
103 |
<button type="submit" class="button" onclick="onepageLogin(this)"><span><span><?php echo $this->__('Login') ?></span></span></button>
|
104 |
-
|
105 |
</div>
|
106 |
</div>
|
107 |
</div>
|
@@ -124,3 +139,18 @@
|
|
124 |
}
|
125 |
//]]>
|
126 |
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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) 2012 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 |
+
<?php
|
28 |
+
/**
|
29 |
+
* Customer onepage checkout login form template
|
30 |
+
*
|
31 |
+
* @see app/design/frontend/base/default/template/checkout/onepage/login.phtml
|
32 |
+
*/
|
33 |
+
/** @var $this Mage_Checkout_Block_Onepage_Login */
|
34 |
+
?>
|
35 |
<div class="col2-set">
|
36 |
<?php echo $this->getChildHtml('login_before')?>
|
37 |
<div class="col-1">
|
72 |
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
73 |
<form id="login-form" action="<?php echo $this->getPostAction() ?>" method="post">
|
74 |
<fieldset>
|
75 |
+
<?php echo $this->getBlockHtml('formkey'); ?>
|
76 |
<h4><?php echo $this->__('Already registered?') ?></h4>
|
77 |
<p><?php echo $this->__('Please log in below:') ?></p>
|
78 |
<ul class="form-list">
|
88 |
<input type="password" class="input-text required-entry" id="login-password" name="login[password]" />
|
89 |
</div>
|
90 |
</li>
|
91 |
+
<?php echo $this->getChildHtml('form.additional.info'); ?>
|
92 |
+
<?php echo $this->getChildHtml('persistent.remember.me'); ?>
|
93 |
</ul>
|
94 |
+
<input name="context" type="hidden" value="checkout" />
|
95 |
</fieldset>
|
96 |
</form>
|
97 |
</div>
|
100 |
<div class="col-1">
|
101 |
<div class="buttons-set">
|
102 |
<p class="required"> </p>
|
103 |
+
<?php if ($this->getQuote()->isAllowedGuestCheckout()): ?>
|
104 |
+
<button id="onepage-guest-register-button" type="button" class="button" onclick="checkout.setMethod();"><span><span><?php echo $this->__('Continue') ?></span></span></button>
|
105 |
+
<?php elseif ($this->helper('checkout')->isCustomerMustBeLogged()): ?>
|
106 |
+
<button id="onepage-guest-register-button" type="button" class="button" onclick="window.location='<?php echo $this->helper('checkout/url')->getRegistrationUrl();?>'"><span><span><?php echo $this->__('Register') ?></span></span></button>
|
107 |
+
<?php else: ?>
|
108 |
+
<form action="<?php echo $this->getUrl('persistent/index/saveMethod'); ?>">
|
109 |
+
<button id="onepage-guest-register-button" type="submit" class="button"><span><span><?php echo $this->__('Register') ?></span></span></button>
|
110 |
+
</form>
|
111 |
+
<?php endif; ?>
|
112 |
</div>
|
113 |
</div>
|
114 |
<div class="col-2">
|
116 |
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
117 |
<a href="<?php echo $this->getUrl('customer/account/forgotpassword') ?>" class="f-left"><?php echo $this->__('Forgot your password?') ?></a>
|
118 |
<button type="submit" class="button" onclick="onepageLogin(this)"><span><span><?php echo $this->__('Login') ?></span></span></button>
|
119 |
+
<?php echo $this->getChildHtml('belvg_facebookfree_button'); ?>
|
120 |
</div>
|
121 |
</div>
|
122 |
</div>
|
139 |
}
|
140 |
//]]>
|
141 |
</script>
|
142 |
+
<?php
|
143 |
+
$registerParam = $this->getRequest()->getParam('register');
|
144 |
+
if ($registerParam || $registerParam === ''):
|
145 |
+
?>
|
146 |
+
<script type="text/javascript">
|
147 |
+
//<![CDATA[
|
148 |
+
document.observe("dom:loaded", function() {
|
149 |
+
if($('login:register')) {
|
150 |
+
$('login:register').checked = true;
|
151 |
+
checkout.setMethod();
|
152 |
+
}
|
153 |
+
})
|
154 |
+
//]]>
|
155 |
+
</script>
|
156 |
+
<?php endif; ?>
|
app/design/frontend/{default/default/template/facebookfree → base/default/template/belvg/facebookfree/form/customer}/login.phtml
RENAMED
@@ -1,33 +1,36 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
7 |
-
* This source file is subject to the
|
8 |
-
* that is bundled with this package in the file
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://
|
|
|
|
|
|
|
11 |
*
|
12 |
-
|
13 |
-
*
|
14 |
-
|
15 |
-
|
16 |
-
*
|
17 |
-
*
|
18 |
-
*
|
19 |
-
*
|
20 |
-
|
21 |
-
*
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
*
|
27 |
-
*
|
28 |
-
* @
|
29 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
30 |
*/
|
|
|
31 |
?>
|
32 |
<div class="account-login">
|
33 |
<div class="page-title">
|
@@ -35,6 +38,7 @@
|
|
35 |
</div>
|
36 |
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
37 |
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form">
|
|
|
38 |
<div class="col2-set">
|
39 |
<div class="col-1 new-users">
|
40 |
<div class="content">
|
@@ -59,7 +63,10 @@
|
|
59 |
<input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" />
|
60 |
</div>
|
61 |
</li>
|
|
|
|
|
62 |
</ul>
|
|
|
63 |
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
64 |
</div>
|
65 |
</div>
|
@@ -67,17 +74,20 @@
|
|
67 |
<div class="col2-set">
|
68 |
<div class="col-1 new-users">
|
69 |
<div class="buttons-set">
|
70 |
-
<button type="button" title="<?php echo $this->__('Create an Account') ?>" class="button" onclick="window.location='<?php echo $this->getCreateAccountUrl() ?>';"><span><span><?php echo $this->__('Create an Account') ?></span></span></button>
|
71 |
</div>
|
72 |
</div>
|
73 |
<div class="col-2 registered-users">
|
74 |
<div class="buttons-set">
|
75 |
<a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left"><?php echo $this->__('Forgot Your Password?') ?></a>
|
76 |
<button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><span><span><?php echo $this->__('Login') ?></span></span></button>
|
77 |
-
|
78 |
</div>
|
79 |
</div>
|
80 |
</div>
|
|
|
|
|
|
|
81 |
</form>
|
82 |
<script type="text/javascript">
|
83 |
//<![CDATA[
|
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) 2012 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 |
+
<?php
|
28 |
+
/**
|
29 |
+
* Customer login form template
|
30 |
+
*
|
31 |
+
* @see app/design/frontend/base/default/template/customer/form/login.phtml
|
|
|
32 |
*/
|
33 |
+
/** @var $this Mage_Customer_Block_Form_Login */
|
34 |
?>
|
35 |
<div class="account-login">
|
36 |
<div class="page-title">
|
38 |
</div>
|
39 |
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
40 |
<form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form">
|
41 |
+
<?php echo $this->getBlockHtml('formkey'); ?>
|
42 |
<div class="col2-set">
|
43 |
<div class="col-1 new-users">
|
44 |
<div class="content">
|
63 |
<input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" />
|
64 |
</div>
|
65 |
</li>
|
66 |
+
<?php echo $this->getChildHtml('form.additional.info'); ?>
|
67 |
+
<?php echo $this->getChildHtml('persistent.remember.me'); ?>
|
68 |
</ul>
|
69 |
+
<?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
|
70 |
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
71 |
</div>
|
72 |
</div>
|
74 |
<div class="col2-set">
|
75 |
<div class="col-1 new-users">
|
76 |
<div class="buttons-set">
|
77 |
+
<button type="button" title="<?php echo $this->__('Create an Account') ?>" class="button" onclick="window.location='<?php echo Mage::helper('persistent')->getCreateAccountUrl($this->getCreateAccountUrl()) ?>';"><span><span><?php echo $this->__('Create an Account') ?></span></span></button>
|
78 |
</div>
|
79 |
</div>
|
80 |
<div class="col-2 registered-users">
|
81 |
<div class="buttons-set">
|
82 |
<a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left"><?php echo $this->__('Forgot Your Password?') ?></a>
|
83 |
<button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><span><span><?php echo $this->__('Login') ?></span></span></button>
|
84 |
+
<?php echo $this->getChildHtml('belvg_facebookfree_button'); ?>
|
85 |
</div>
|
86 |
</div>
|
87 |
</div>
|
88 |
+
<?php if (Mage::helper('checkout')->isContextCheckout()): ?>
|
89 |
+
<input name="context" type="hidden" value="checkout" />
|
90 |
+
<?php endif; ?>
|
91 |
</form>
|
92 |
<script type="text/javascript">
|
93 |
//<![CDATA[
|
app/design/frontend/base/default/template/belvg/facebookfree/like/meta.phtml
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if($this->isActive()):?>
|
2 |
+
<meta property="fb:app_id" content="<?php echo $this->getAppId()?>"/>
|
3 |
+
<meta property="og:title" content="<?php echo $this->getProductName(); ?>"/>
|
4 |
+
<meta property="og:image" content="<?php echo $this->getProductImage(); ?>"/>
|
5 |
+
<meta property="og:url" content="<?php echo $this->getProductUrl(); ?>"/>
|
6 |
+
<meta property="og:type" content="product"/>
|
7 |
+
<?php endif?>
|
app/design/frontend/base/default/template/belvg/facebookfree/like/product/view/addto.phtml
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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) 2012 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 |
+
|
28 |
+
<?php $_product = $this->getProduct(); ?>
|
29 |
+
<?php $_wishlistSubmitUrl = $this->helper('wishlist')->getAddUrl($_product); ?>
|
30 |
+
|
31 |
+
<ul class="add-to-links">
|
32 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
33 |
+
<li><a href="<?php echo $_wishlistSubmitUrl ?>" onclick="productAddToCartForm.submitLight(this, this.href); return false;" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
34 |
+
<?php endif; ?>
|
35 |
+
<?php
|
36 |
+
$_compareUrl = $this->helper('catalog/product_compare')->getAddUrl($_product);
|
37 |
+
?>
|
38 |
+
<?php if($_compareUrl) : ?>
|
39 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
40 |
+
<?php endif; ?>
|
41 |
+
</ul>
|
42 |
+
<?php if($this->helper('facebookfree')->isActiveLike()):?>
|
43 |
+
<fb:like href="<?php echo $_product->getProductUrl()?>" layout="<?php echo $this->helper('facebookfree')->getLikeLayout()?>" show_faces="<?php echo $this->helper('facebookfree')->isFacesLikeActive()?>" width="<?php echo $this->helper('facebookfree')->getLikeWidth()?>" colorscheme="<?php echo $this->helper('facebookfree')->getLikeColor()?>" style="z-index:10000"></fb:like>
|
44 |
+
<?php endif?>
|
45 |
+
|
app/design/frontend/base/default/template/belvg/facebookfree/links.phtml
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if (!Mage::getSingleton('customer/session')->isLoggedIn()): ?>
|
2 |
+
<li class="last">
|
3 |
+
<?php echo $this->getChildHtml('belvg_facebookfree_button'); ?>
|
4 |
+
</li>
|
5 |
+
<?php endif?>
|
app/design/frontend/default/default/layout/facebookfree.xml
DELETED
@@ -1,93 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* BelVG LLC.
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the EULA
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
-
*
|
13 |
-
/***************************************
|
14 |
-
* MAGENTO EDITION USAGE NOTICE *
|
15 |
-
*****************************************/
|
16 |
-
/* This package designed for Magento COMMUNITY edition
|
17 |
-
* BelVG does not guarantee correct work of this extension
|
18 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
-
* BelVG does not provide extension support in case of
|
20 |
-
* incorrect edition usage.
|
21 |
-
/***************************************
|
22 |
-
* DISCLAIMER *
|
23 |
-
*****************************************/
|
24 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
-
* versions in the future.
|
26 |
-
*****************************************************
|
27 |
-
* @category Belvg
|
28 |
-
* @package Belvg_FacebookFree
|
29 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
30 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
-
*/
|
32 |
-
-->
|
33 |
-
<layout version="0.1.0">
|
34 |
-
<default>
|
35 |
-
<reference name="head">
|
36 |
-
<action method="addItem" ifconfig="facebookfree/settings/enabled" ifvalue="1">
|
37 |
-
<type>skin_css</type>
|
38 |
-
<name>css/belvg/facebookfree.css</name>
|
39 |
-
<params />
|
40 |
-
</action>
|
41 |
-
</reference>
|
42 |
-
<reference name="top.links">
|
43 |
-
<action method="setTemplate" ifconfig="facebookfree/settings/enabled" ifvalue="1">
|
44 |
-
<template>facebookfree/links.phtml</template>
|
45 |
-
</action>
|
46 |
-
</reference>
|
47 |
-
<reference name="before_body_end">
|
48 |
-
<block type="facebookfree/active" name="belvg.facebookfree.block">
|
49 |
-
<action method="setTemplate" ifconfig="facebookfree/settings/enabled" ifvalue="1">
|
50 |
-
<template>facebookfree/block.phtml</template>
|
51 |
-
</action>
|
52 |
-
</block>
|
53 |
-
</reference>
|
54 |
-
<reference name="right">
|
55 |
-
<block type="facebookfree/active" name="fb.activity" template="facebookfree/activity.phtml" />
|
56 |
-
</reference>
|
57 |
-
</default>
|
58 |
-
|
59 |
-
<catalog_product_view>
|
60 |
-
<reference name="head">
|
61 |
-
<block type="facebookfree/active" name="facebookfree_meta" before="-">
|
62 |
-
<action method="setTemplate" ifconfig="facebookfree/settings/enabled" ifvalue="1">
|
63 |
-
<template>facebookfree/like/head.phtml</template>
|
64 |
-
</action>
|
65 |
-
</block>
|
66 |
-
</reference>
|
67 |
-
<reference name="product.info.addto">
|
68 |
-
<action method="setTemplate" ifconfig="facebookfree/settings/enabled" ifvalue="1">
|
69 |
-
<template>facebookfree/like/product/view/addto.phtml</template>
|
70 |
-
</action>
|
71 |
-
</reference>
|
72 |
-
</catalog_product_view>
|
73 |
-
|
74 |
-
<customer_account_login translate="label">
|
75 |
-
<reference name="customer_form_login">
|
76 |
-
<block type="customer/form_login" name="customer_form_login" template="customer/form/login.phtml">
|
77 |
-
<action method="setTemplate" ifconfig="facebookfree/settings/enabled" ifvalue="1">
|
78 |
-
<template>facebookfree/login.phtml</template>
|
79 |
-
</action>
|
80 |
-
</block>
|
81 |
-
</reference>
|
82 |
-
</customer_account_login>
|
83 |
-
|
84 |
-
<checkout_onepage_index translate="label">
|
85 |
-
<reference name="checkout.onepage">
|
86 |
-
<block type="checkout/onepage_login" name="checkout.onepage.login" as="login" template="checkout/onepage/login.phtml">
|
87 |
-
<action method="setTemplate" ifconfig="facebookfree/settings/enabled" ifvalue="1">
|
88 |
-
<template>facebookfree/checkoutlogin.phtml</template>
|
89 |
-
</action>
|
90 |
-
</block>
|
91 |
-
</reference>
|
92 |
-
</checkout_onepage_index>
|
93 |
-
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/default/default/template/facebookfree/activity.phtml
DELETED
@@ -1,36 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* BelVG LLC.
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the EULA
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
11 |
-
*
|
12 |
-
/***************************************
|
13 |
-
* MAGENTO EDITION USAGE NOTICE *
|
14 |
-
*****************************************/
|
15 |
-
/* This package designed for Magento COMMUNITY edition
|
16 |
-
* BelVG does not guarantee correct work of this extension
|
17 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
-
* BelVG does not provide extension support in case of
|
19 |
-
* incorrect edition usage.
|
20 |
-
/***************************************
|
21 |
-
* DISCLAIMER *
|
22 |
-
*****************************************/
|
23 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
24 |
-
* versions in the future.
|
25 |
-
*****************************************************
|
26 |
-
* @category Belvg
|
27 |
-
* @package Belvg_FacebookFree
|
28 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
29 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
30 |
-
*/
|
31 |
-
?>
|
32 |
-
|
33 |
-
<?php if($this->helper('facebookfree/active')->isActiveActivity()):?>
|
34 |
-
<?php preg_match('/[^.]+\.[^.]+$/', Mage::getBaseUrl(), $matches);?>
|
35 |
-
<fb:activity site="<?php echo $matches[0]?>" width="<?php echo $this->helper('facebookfree/active')->getActivityWidth()?>" height="<?php echo $this->helper('facebookfree/active')->getActivityHeight()?>" header="<?php echo $this->helper('facebookfree/active')->getActivityHeader()?>" colorscheme="<?php echo $this->helper('facebookfree/active')->getActivityColor()?>" recommendations="<?php echo $this->helper('facebookfree/active')->getActivityRecommendations()?>" max_age="<?php echo $this->helper('facebookfree/active')->getActivityMaxage()?>" />
|
36 |
-
<?php endif?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/default/default/template/facebookfree/block.phtml
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* BelVG LLC.
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the EULA
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
11 |
-
*
|
12 |
-
/***************************************
|
13 |
-
* MAGENTO EDITION USAGE NOTICE *
|
14 |
-
*****************************************/
|
15 |
-
/* This package designed for Magento COMMUNITY edition
|
16 |
-
* BelVG does not guarantee correct work of this extension
|
17 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
-
* BelVG does not provide extension support in case of
|
19 |
-
* incorrect edition usage.
|
20 |
-
/***************************************
|
21 |
-
* DISCLAIMER *
|
22 |
-
*****************************************/
|
23 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
24 |
-
* versions in the future.
|
25 |
-
*****************************************************
|
26 |
-
* @category Belvg
|
27 |
-
* @package Belvg_FacebookFree
|
28 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
29 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
30 |
-
*/
|
31 |
-
?>
|
32 |
-
<script language="JavaScript" type="text/javascript">
|
33 |
-
/*<![CDATA[*/
|
34 |
-
window.fbAsyncInit = function() {
|
35 |
-
FB.init({appId: '<?php echo $this->getAppId()?>',
|
36 |
-
status : true,
|
37 |
-
cookie : true,
|
38 |
-
xfbml : true,
|
39 |
-
oauth : true});
|
40 |
-
|
41 |
-
FB.getLoginStatus(function(response) {
|
42 |
-
if (response.status == 'connected') {
|
43 |
-
<?php if (Mage::getSingleton('customer/session')->isLoggedIn() && $uid = $this->checkFbUser()):?>
|
44 |
-
greet('<?php echo $uid?>');
|
45 |
-
<?php endif?>
|
46 |
-
}
|
47 |
-
});
|
48 |
-
};
|
49 |
-
(function(d){
|
50 |
-
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
|
51 |
-
js = d.createElement('script'); js.id = id; js.async = true;
|
52 |
-
js.src = "//connect.facebook.net/<?php echo Mage::app()->getLocale()->getLocaleCode()?>/all.js";
|
53 |
-
d.getElementsByTagName('head')[0].appendChild(js);
|
54 |
-
}(document));
|
55 |
-
|
56 |
-
function login(){
|
57 |
-
document.location.href="<?php echo $this->getUrl('facebookfree/customer/login')?>?referer=<?php echo Mage::helper('core')->urlEncode($this->helper('core/url')->getCurrentUrl())?>";
|
58 |
-
}
|
59 |
-
function logout(){
|
60 |
-
document.location.href="<?php echo $this->getUrl('facebookfree/customer/logout')?>";
|
61 |
-
}
|
62 |
-
function greet(id){
|
63 |
-
FB.api('/me', function(response) {
|
64 |
-
var src = 'https://graph.facebook.com/'+id+'/picture';
|
65 |
-
$$('.welcome-msg')[0].insert('<img height="20" src="'+src+'"/>');
|
66 |
-
});
|
67 |
-
}
|
68 |
-
|
69 |
-
function fblogin(){
|
70 |
-
FB.login(function(response) {
|
71 |
-
|
72 |
-
if (response.status == 'connected') {
|
73 |
-
login();
|
74 |
-
} else {
|
75 |
-
// user is not logged in
|
76 |
-
window.location.reload();
|
77 |
-
}
|
78 |
-
}, {scope:'email,publish_stream'});
|
79 |
-
return false;
|
80 |
-
}
|
81 |
-
/*]]>*/
|
82 |
-
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/default/default/template/facebookfree/like/head.phtml
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* BelVG LLC.
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the EULA
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
11 |
-
*
|
12 |
-
/***************************************
|
13 |
-
* MAGENTO EDITION USAGE NOTICE *
|
14 |
-
*****************************************/
|
15 |
-
/* This package designed for Magento COMMUNITY edition
|
16 |
-
* BelVG does not guarantee correct work of this extension
|
17 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
-
* BelVG does not provide extension support in case of
|
19 |
-
* incorrect edition usage.
|
20 |
-
/***************************************
|
21 |
-
* DISCLAIMER *
|
22 |
-
*****************************************/
|
23 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
24 |
-
* versions in the future.
|
25 |
-
*****************************************************
|
26 |
-
* @category Belvg
|
27 |
-
* @package Belvg_FacebookFree
|
28 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
29 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
30 |
-
*/
|
31 |
-
?>
|
32 |
-
|
33 |
-
<?php if($this->isActiveLike()):?>
|
34 |
-
<?php $product = Mage::registry('current_product'); ?>
|
35 |
-
|
36 |
-
<meta property="fb:app_id" content="<?php echo $this->getAppId()?>"/>
|
37 |
-
<?php if ($product): ?>
|
38 |
-
<meta property="og:title" content="<?php echo htmlspecialchars(trim($product->getName())); ?>"/>
|
39 |
-
<meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($product, 'thumbnail')?>"/>
|
40 |
-
<?php endif; ?>
|
41 |
-
<meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>"/>
|
42 |
-
<meta property="og:type" content="product"/>
|
43 |
-
<?php endif?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/default/default/template/facebookfree/like/product/view/addto.phtml
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* BelVG LLC.
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the EULA
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
11 |
-
*
|
12 |
-
/***************************************
|
13 |
-
* MAGENTO EDITION USAGE NOTICE *
|
14 |
-
*****************************************/
|
15 |
-
/* This package designed for Magento COMMUNITY edition
|
16 |
-
* BelVG does not guarantee correct work of this extension
|
17 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
-
* BelVG does not provide extension support in case of
|
19 |
-
* incorrect edition usage.
|
20 |
-
/***************************************
|
21 |
-
* DISCLAIMER *
|
22 |
-
*****************************************/
|
23 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
24 |
-
* versions in the future.
|
25 |
-
*****************************************************
|
26 |
-
* @category Belvg
|
27 |
-
* @package Belvg_FacebookFree
|
28 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
29 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
30 |
-
*/
|
31 |
-
?>
|
32 |
-
|
33 |
-
<?php $_product = $this->getProduct() ?>
|
34 |
-
<ul class="add-to-links">
|
35 |
-
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
36 |
-
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
37 |
-
<?php endif; ?>
|
38 |
-
<?php if($_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product) ): ?>
|
39 |
-
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
40 |
-
<?php endif; ?>
|
41 |
-
</ul>
|
42 |
-
<br />
|
43 |
-
<?php if($this->helper('facebookfree/active')->isActiveLike()):?>
|
44 |
-
<fb:like href="<?php echo $this->helper('core/url')->getCurrentUrl()?>" layout="<?php echo $this->helper('facebookfree/active')->getLikeLayout()?>" show_faces="<?php echo $this->helper('facebookfree/active')->isFacesLikeActive()?>" width="<?php echo $this->helper('facebookfree/active')->getLikeWidth()?>" colorscheme="<?php echo $this->helper('facebookfree/active')->getLikeColor()?>"></fb:like>
|
45 |
-
<?php endif?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/default/default/template/facebookfree/links.phtml
DELETED
@@ -1,54 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* BelVG LLC.
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the EULA
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
11 |
-
*
|
12 |
-
/***************************************
|
13 |
-
* MAGENTO EDITION USAGE NOTICE *
|
14 |
-
*****************************************/
|
15 |
-
/* This package designed for Magento COMMUNITY edition
|
16 |
-
* BelVG does not guarantee correct work of this extension
|
17 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
-
* BelVG does not provide extension support in case of
|
19 |
-
* incorrect edition usage.
|
20 |
-
/***************************************
|
21 |
-
* DISCLAIMER *
|
22 |
-
*****************************************/
|
23 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
24 |
-
* versions in the future.
|
25 |
-
*****************************************************
|
26 |
-
* @category Belvg
|
27 |
-
* @package Belvg_FacebookAll
|
28 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
29 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
30 |
-
*/
|
31 |
-
?>
|
32 |
-
<?php
|
33 |
-
/**
|
34 |
-
* @see Mage_Page_Block_Template_Links
|
35 |
-
*/
|
36 |
-
?>
|
37 |
-
<?php $_links = $this->getLinks(); ?>
|
38 |
-
|
39 |
-
<div id="fb-root"></div>
|
40 |
-
<?php if(!Mage::getSingleton('customer/session')->isLoggedIn()):?>
|
41 |
-
<a href="#" onclick="return fblogin();" class="fb_button_ps"><img src="<?php echo $this->helper('facebookfree/active')->getLoginImg()?>" alt="<?php echo $this->__('Connect with Facebook')?>" /></a>
|
42 |
-
<?php endif?>
|
43 |
-
|
44 |
-
<?php if(count($_links)>0): ?>
|
45 |
-
<ul class="links"<?php if($this->getName()): ?> id="<?php echo $this->getName() ?>"<?php endif;?>>
|
46 |
-
<?php foreach($_links as $_link): ?>
|
47 |
-
<?php if ($_link instanceof Mage_Core_Block_Abstract):?>
|
48 |
-
<?php echo $_link->toHtml() ?>
|
49 |
-
<?php else: ?>
|
50 |
-
<li<?php if($_link->getIsFirst()||$_link->getIsLast()): ?> class="<?php if($_link->getIsFirst()): ?>first<?php endif; ?><?php if($_link->getIsLast()): ?> last<?php endif; ?>"<?php endif; ?> <?php echo $_link->getLiParams() ?>><?php echo $_link->getBeforeText() ?><a href="<?php echo $_link->getUrl() ?>" title="<?php echo $_link->getTitle() ?>" <?php echo $_link->getAParams() ?>><?php echo $_link->getLabel() ?></a><?php echo $_link->getAfterText() ?></li>
|
51 |
-
<?php endif;?>
|
52 |
-
<?php endforeach; ?>
|
53 |
-
</ul>
|
54 |
-
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/default/default/template/facebookfree/top.links.phtml
DELETED
@@ -1,48 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* BelVG LLC.
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the EULA
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
11 |
-
*
|
12 |
-
/***************************************
|
13 |
-
* MAGENTO EDITION USAGE NOTICE *
|
14 |
-
*****************************************/
|
15 |
-
/* This package designed for Magento COMMUNITY edition
|
16 |
-
* BelVG does not guarantee correct work of this extension
|
17 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
-
* BelVG does not provide extension support in case of
|
19 |
-
* incorrect edition usage.
|
20 |
-
/***************************************
|
21 |
-
* DISCLAIMER *
|
22 |
-
*****************************************/
|
23 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
24 |
-
* versions in the future.
|
25 |
-
*****************************************************
|
26 |
-
* @category Belvg
|
27 |
-
* @package Belvg_FacebookFree
|
28 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
29 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
30 |
-
*/
|
31 |
-
?>
|
32 |
-
|
33 |
-
<?php $_links = $this->getLinks(); ?>
|
34 |
-
<div id="fb-root"></div>
|
35 |
-
<?php if(!Mage::getSingleton('customer/session')->isLoggedIn()):?>
|
36 |
-
<a href="#" onclick="return fblogin();" class="fb_button_ps"><img src="<?php echo $this->helper('facebookfree/active')->getLoginImg()?>" alt="<?php echo $this->__('Connect with Facebook')?>" /></a>
|
37 |
-
<?php endif?>
|
38 |
-
<?php if(count($_links)>0): ?>
|
39 |
-
<ul class="links"<?php if($this->getName()): ?> id="<?php echo $this->getName() ?>"<?php endif;?>>
|
40 |
-
<?php foreach($_links as $_link): ?>
|
41 |
-
<li<?php if($_link->getIsFirst()||$_link->getIsLast()): ?> class="<?php if($_link->getIsFirst()): ?>first<?php endif; ?><?php if($_link->getIsLast()): ?> last<?php endif; ?>"<?php endif; ?> <?php echo $_link->getLiParams() ?>><?php echo $_link->getBeforeText() ?><a href="<?php echo $_link->getUrl() ?>" title="<?php echo $_link->getTitle() ?>" <?php echo $_link->getAParams() ?>><?php echo $_link->getLabel() ?></a><?php echo $_link->getAfterText() ?></li>
|
42 |
-
<?php endforeach; ?>
|
43 |
-
</ul>
|
44 |
-
<?php endif; ?>
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/etc/modules/Belvg_All.xml
CHANGED
@@ -1,41 +1,40 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
<config>
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
<version>1.0</version>
|
39 |
</Belvg_All>
|
40 |
-
|
41 |
</config>
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
+
* BelVG LLC.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
+
*
|
13 |
+
* **************************************
|
14 |
+
* MAGENTO EDITION USAGE NOTICE *
|
15 |
+
* ***************************************
|
16 |
+
* This package designed for Magento COMMUNITY edition
|
17 |
+
* BelVG does not guarantee correct work of this extension
|
18 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
+
* BelVG does not provide extension support in case of
|
20 |
+
* incorrect edition usage.
|
21 |
+
* **************************************
|
22 |
+
* DISCLAIMER *
|
23 |
+
* ***************************************
|
24 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
+
* versions in the future.
|
26 |
+
* ****************************************************
|
27 |
+
* @category Belvg
|
28 |
+
* @package Belvg_All
|
29 |
+
* @copyright Copyright (c) 2010 - 2014 BelVG LLC. (http://www.belvg.com)
|
30 |
+
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
+
*/
|
32 |
+
-->
|
33 |
<config>
|
34 |
+
<modules>
|
35 |
+
<Belvg_All>
|
36 |
+
<active>true</active>
|
37 |
+
<codePool>community</codePool>
|
|
|
38 |
</Belvg_All>
|
39 |
+
</modules>
|
40 |
</config>
|
app/etc/modules/Belvg_FacebookFree.xml
CHANGED
@@ -35,7 +35,10 @@
|
|
35 |
<Belvg_FacebookFree>
|
36 |
<active>true</active>
|
37 |
<codePool>community</codePool>
|
38 |
-
<version>
|
|
|
|
|
|
|
39 |
</Belvg_FacebookFree>
|
40 |
</modules>
|
41 |
</config>
|
35 |
<Belvg_FacebookFree>
|
36 |
<active>true</active>
|
37 |
<codePool>community</codePool>
|
38 |
+
<version>2.0.1</version>
|
39 |
+
<depends>
|
40 |
+
<Mage_Customer />
|
41 |
+
</depends>
|
42 |
</Belvg_FacebookFree>
|
43 |
</modules>
|
44 |
</config>
|
lib/Facebook/Api.php
DELETED
@@ -1,872 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Provides access to the Facebook Platform.
|
4 |
-
*
|
5 |
-
* @author Naitik Shah <naitik@facebook.com>
|
6 |
-
*/
|
7 |
-
class Facebook_Api
|
8 |
-
{
|
9 |
-
/**
|
10 |
-
* Version.
|
11 |
-
*/
|
12 |
-
const VERSION = '2.1.2';
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Default options for curl.
|
16 |
-
*/
|
17 |
-
public static $CURL_OPTS = array(
|
18 |
-
CURLOPT_CONNECTTIMEOUT => 10,
|
19 |
-
CURLOPT_RETURNTRANSFER => true,
|
20 |
-
CURLOPT_TIMEOUT => 60,
|
21 |
-
CURLOPT_USERAGENT => 'facebook-php-2.0',
|
22 |
-
);
|
23 |
-
|
24 |
-
/**
|
25 |
-
* List of query parameters that get automatically dropped when rebuilding
|
26 |
-
* the current URL.
|
27 |
-
*/
|
28 |
-
protected static $DROP_QUERY_PARAMS = array(
|
29 |
-
'session',
|
30 |
-
'signed_request',
|
31 |
-
);
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Maps aliases to Facebook domains.
|
35 |
-
*/
|
36 |
-
public static $DOMAIN_MAP = array(
|
37 |
-
'api' => 'https://api.facebook.com/',
|
38 |
-
'api_read' => 'https://api-read.facebook.com/',
|
39 |
-
'graph' => 'https://graph.facebook.com/',
|
40 |
-
'www' => 'https://www.facebook.com/',
|
41 |
-
);
|
42 |
-
|
43 |
-
/**
|
44 |
-
* The Application ID.
|
45 |
-
*/
|
46 |
-
protected $appId;
|
47 |
-
|
48 |
-
/**
|
49 |
-
* The Application API Secret.
|
50 |
-
*/
|
51 |
-
protected $apiSecret;
|
52 |
-
|
53 |
-
/**
|
54 |
-
* The active user session, if one is available.
|
55 |
-
*/
|
56 |
-
protected $session;
|
57 |
-
|
58 |
-
/**
|
59 |
-
* The data from the signed_request token.
|
60 |
-
*/
|
61 |
-
protected $signedRequest;
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Indicates that we already loaded the session as best as we could.
|
65 |
-
*/
|
66 |
-
protected $sessionLoaded = false;
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Indicates if Cookie support should be enabled.
|
70 |
-
*/
|
71 |
-
protected $cookieSupport = false;
|
72 |
-
|
73 |
-
/**
|
74 |
-
* Base domain for the Cookie.
|
75 |
-
*/
|
76 |
-
protected $baseDomain = '';
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Indicates if the CURL based @ syntax for file uploads is enabled.
|
80 |
-
*/
|
81 |
-
protected $fileUploadSupport = false;
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Initialize a Facebook Application.
|
85 |
-
*
|
86 |
-
* The configuration:
|
87 |
-
* - appId: the application ID
|
88 |
-
* - secret: the application secret
|
89 |
-
* - cookie: (optional) boolean true to enable cookie support
|
90 |
-
* - domain: (optional) domain for the cookie
|
91 |
-
* - fileUpload: (optional) boolean indicating if file uploads are enabled
|
92 |
-
*
|
93 |
-
* @param Array $config the application configuration
|
94 |
-
*/
|
95 |
-
public function __construct($config) {
|
96 |
-
$this->setAppId($config['appId']);
|
97 |
-
$this->setApiSecret($config['secret']);
|
98 |
-
if (isset($config['cookie'])) {
|
99 |
-
$this->setCookieSupport($config['cookie']);
|
100 |
-
}
|
101 |
-
if (isset($config['domain'])) {
|
102 |
-
$this->setBaseDomain($config['domain']);
|
103 |
-
}
|
104 |
-
if (isset($config['fileUpload'])) {
|
105 |
-
$this->setFileUploadSupport($config['fileUpload']);
|
106 |
-
}
|
107 |
-
}
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Set the Application ID.
|
111 |
-
*
|
112 |
-
* @param String $appId the Application ID
|
113 |
-
*/
|
114 |
-
public function setAppId($appId) {
|
115 |
-
$this->appId = $appId;
|
116 |
-
return $this;
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* Get the Application ID.
|
121 |
-
*
|
122 |
-
* @return String the Application ID
|
123 |
-
*/
|
124 |
-
public function getAppId() {
|
125 |
-
return $this->appId;
|
126 |
-
}
|
127 |
-
|
128 |
-
/**
|
129 |
-
* Set the API Secret.
|
130 |
-
*
|
131 |
-
* @param String $appId the API Secret
|
132 |
-
*/
|
133 |
-
public function setApiSecret($apiSecret) {
|
134 |
-
$this->apiSecret = $apiSecret;
|
135 |
-
return $this;
|
136 |
-
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
* Get the API Secret.
|
140 |
-
*
|
141 |
-
* @return String the API Secret
|
142 |
-
*/
|
143 |
-
public function getApiSecret() {
|
144 |
-
return $this->apiSecret;
|
145 |
-
}
|
146 |
-
|
147 |
-
/**
|
148 |
-
* Set the Cookie Support status.
|
149 |
-
*
|
150 |
-
* @param Boolean $cookieSupport the Cookie Support status
|
151 |
-
*/
|
152 |
-
public function setCookieSupport($cookieSupport) {
|
153 |
-
$this->cookieSupport = $cookieSupport;
|
154 |
-
return $this;
|
155 |
-
}
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Get the Cookie Support status.
|
159 |
-
*
|
160 |
-
* @return Boolean the Cookie Support status
|
161 |
-
*/
|
162 |
-
public function useCookieSupport() {
|
163 |
-
return $this->cookieSupport;
|
164 |
-
}
|
165 |
-
|
166 |
-
/**
|
167 |
-
* Set the base domain for the Cookie.
|
168 |
-
*
|
169 |
-
* @param String $domain the base domain
|
170 |
-
*/
|
171 |
-
public function setBaseDomain($domain) {
|
172 |
-
$this->baseDomain = $domain;
|
173 |
-
return $this;
|
174 |
-
}
|
175 |
-
|
176 |
-
/**
|
177 |
-
* Get the base domain for the Cookie.
|
178 |
-
*
|
179 |
-
* @return String the base domain
|
180 |
-
*/
|
181 |
-
public function getBaseDomain() {
|
182 |
-
return $this->baseDomain;
|
183 |
-
}
|
184 |
-
|
185 |
-
/**
|
186 |
-
* Set the file upload support status.
|
187 |
-
*
|
188 |
-
* @param String $domain the base domain
|
189 |
-
*/
|
190 |
-
public function setFileUploadSupport($fileUploadSupport) {
|
191 |
-
$this->fileUploadSupport = $fileUploadSupport;
|
192 |
-
return $this;
|
193 |
-
}
|
194 |
-
|
195 |
-
/**
|
196 |
-
* Get the file upload support status.
|
197 |
-
*
|
198 |
-
* @return String the base domain
|
199 |
-
*/
|
200 |
-
public function useFileUploadSupport() {
|
201 |
-
return $this->fileUploadSupport;
|
202 |
-
}
|
203 |
-
|
204 |
-
/**
|
205 |
-
* Get the data from a signed_request token
|
206 |
-
*
|
207 |
-
* @return String the base domain
|
208 |
-
*/
|
209 |
-
public function getSignedRequest() {
|
210 |
-
if (!$this->signedRequest) {
|
211 |
-
if (isset($_REQUEST['signed_request'])) {
|
212 |
-
$this->signedRequest = $this->parseSignedRequest(
|
213 |
-
$_REQUEST['signed_request']);
|
214 |
-
}
|
215 |
-
}
|
216 |
-
return $this->signedRequest;
|
217 |
-
}
|
218 |
-
|
219 |
-
/**
|
220 |
-
* Set the Session.
|
221 |
-
*
|
222 |
-
* @param Array $session the session
|
223 |
-
* @param Boolean $write_cookie indicate if a cookie should be written. this
|
224 |
-
* value is ignored if cookie support has been disabled.
|
225 |
-
*/
|
226 |
-
public function setSession($session=null, $write_cookie=true) {
|
227 |
-
$session = $this->validateSessionObject($session);
|
228 |
-
$this->sessionLoaded = true;
|
229 |
-
$this->session = $session;
|
230 |
-
if ($write_cookie) {
|
231 |
-
$this->setCookieFromSession($session);
|
232 |
-
}
|
233 |
-
return $this;
|
234 |
-
}
|
235 |
-
|
236 |
-
/**
|
237 |
-
* Get the session object. This will automatically look for a signed session
|
238 |
-
* sent via the signed_request, Cookie or Query Parameters if needed.
|
239 |
-
*
|
240 |
-
* @return Array the session
|
241 |
-
*/
|
242 |
-
public function getSession() {
|
243 |
-
if (!$this->sessionLoaded) {
|
244 |
-
$session = null;
|
245 |
-
$write_cookie = true;
|
246 |
-
|
247 |
-
// try loading session from signed_request in $_REQUEST
|
248 |
-
$signedRequest = $this->getSignedRequest();
|
249 |
-
if ($signedRequest) {
|
250 |
-
// sig is good, use the signedRequest
|
251 |
-
$session = $this->createSessionFromSignedRequest($signedRequest);
|
252 |
-
}
|
253 |
-
|
254 |
-
// try loading session from $_REQUEST
|
255 |
-
if (!$session && isset($_REQUEST['session'])) {
|
256 |
-
$session = json_decode(
|
257 |
-
get_magic_quotes_gpc()
|
258 |
-
? stripslashes($_REQUEST['session'])
|
259 |
-
: $_REQUEST['session'],
|
260 |
-
true
|
261 |
-
);
|
262 |
-
$session = $this->validateSessionObject($session);
|
263 |
-
}
|
264 |
-
|
265 |
-
// try loading session from cookie if necessary
|
266 |
-
if (!$session && $this->useCookieSupport()) {
|
267 |
-
$cookieName = $this->getSessionCookieName();
|
268 |
-
if (isset($_COOKIE[$cookieName])) {
|
269 |
-
$session = array();
|
270 |
-
parse_str(trim(
|
271 |
-
get_magic_quotes_gpc()
|
272 |
-
? stripslashes($_COOKIE[$cookieName])
|
273 |
-
: $_COOKIE[$cookieName],
|
274 |
-
'"'
|
275 |
-
), $session);
|
276 |
-
$session = $this->validateSessionObject($session);
|
277 |
-
// write only if we need to delete a invalid session cookie
|
278 |
-
$write_cookie = empty($session);
|
279 |
-
}
|
280 |
-
}
|
281 |
-
|
282 |
-
$this->setSession($session, $write_cookie);
|
283 |
-
}
|
284 |
-
|
285 |
-
return $this->session;
|
286 |
-
}
|
287 |
-
|
288 |
-
/**
|
289 |
-
* Get the UID from the session.
|
290 |
-
*
|
291 |
-
* @return String the UID if available
|
292 |
-
*/
|
293 |
-
public function getUser() {
|
294 |
-
$session = $this->getSession();
|
295 |
-
return $session ? $session['uid'] : null;
|
296 |
-
}
|
297 |
-
|
298 |
-
/**
|
299 |
-
* Gets a OAuth access token.
|
300 |
-
*
|
301 |
-
* @return String the access token
|
302 |
-
*/
|
303 |
-
public function getAccessToken() {
|
304 |
-
$session = $this->getSession();
|
305 |
-
// either user session signed, or app signed
|
306 |
-
if ($session) {
|
307 |
-
return $session['access_token'];
|
308 |
-
} else {
|
309 |
-
return $this->getAppId() .'|'. $this->getApiSecret();
|
310 |
-
}
|
311 |
-
}
|
312 |
-
|
313 |
-
/**
|
314 |
-
* Get a Login URL for use with redirects. By default, full page redirect is
|
315 |
-
* assumed. If you are using the generated URL with a window.open() call in
|
316 |
-
* JavaScript, you can pass in display=popup as part of the $params.
|
317 |
-
*
|
318 |
-
* The parameters:
|
319 |
-
* - next: the url to go to after a successful login
|
320 |
-
* - cancel_url: the url to go to after the user cancels
|
321 |
-
* - req_perms: comma separated list of requested extended perms
|
322 |
-
* - display: can be "page" (default, full page) or "popup"
|
323 |
-
*
|
324 |
-
* @param Array $params provide custom parameters
|
325 |
-
* @return String the URL for the login flow
|
326 |
-
*/
|
327 |
-
public function getLoginUrl($params=array()) {
|
328 |
-
$currentUrl = $this->getCurrentUrl();
|
329 |
-
return $this->getUrl(
|
330 |
-
'www',
|
331 |
-
'login.php',
|
332 |
-
array_merge(array(
|
333 |
-
'api_key' => $this->getAppId(),
|
334 |
-
'cancel_url' => $currentUrl,
|
335 |
-
'display' => 'page',
|
336 |
-
'fbconnect' => 1,
|
337 |
-
'next' => $currentUrl,
|
338 |
-
'return_session' => 1,
|
339 |
-
'session_version' => 3,
|
340 |
-
'v' => '1.0',
|
341 |
-
), $params)
|
342 |
-
);
|
343 |
-
}
|
344 |
-
|
345 |
-
/**
|
346 |
-
* Get a Logout URL suitable for use with redirects.
|
347 |
-
*
|
348 |
-
* The parameters:
|
349 |
-
* - next: the url to go to after a successful logout
|
350 |
-
*
|
351 |
-
* @param Array $params provide custom parameters
|
352 |
-
* @return String the URL for the logout flow
|
353 |
-
*/
|
354 |
-
public function getLogoutUrl($params=array()) {
|
355 |
-
return $this->getUrl(
|
356 |
-
'www',
|
357 |
-
'logout.php',
|
358 |
-
array_merge(array(
|
359 |
-
'next' => $this->getCurrentUrl(),
|
360 |
-
'access_token' => $this->getAccessToken(),
|
361 |
-
), $params)
|
362 |
-
);
|
363 |
-
}
|
364 |
-
|
365 |
-
/**
|
366 |
-
* Get a login status URL to fetch the status from facebook.
|
367 |
-
*
|
368 |
-
* The parameters:
|
369 |
-
* - ok_session: the URL to go to if a session is found
|
370 |
-
* - no_session: the URL to go to if the user is not connected
|
371 |
-
* - no_user: the URL to go to if the user is not signed into facebook
|
372 |
-
*
|
373 |
-
* @param Array $params provide custom parameters
|
374 |
-
* @return String the URL for the logout flow
|
375 |
-
*/
|
376 |
-
public function getLoginStatusUrl($params=array()) {
|
377 |
-
return $this->getUrl(
|
378 |
-
'www',
|
379 |
-
'extern/login_status.php',
|
380 |
-
array_merge(array(
|
381 |
-
'api_key' => $this->getAppId(),
|
382 |
-
'no_session' => $this->getCurrentUrl(),
|
383 |
-
'no_user' => $this->getCurrentUrl(),
|
384 |
-
'ok_session' => $this->getCurrentUrl(),
|
385 |
-
'session_version' => 3,
|
386 |
-
), $params)
|
387 |
-
);
|
388 |
-
}
|
389 |
-
|
390 |
-
/**
|
391 |
-
* Make an API call.
|
392 |
-
*
|
393 |
-
* @param Array $params the API call parameters
|
394 |
-
* @return the decoded response
|
395 |
-
*/
|
396 |
-
public function api(/* polymorphic */) {
|
397 |
-
$args = func_get_args();
|
398 |
-
if (is_array($args[0])) {
|
399 |
-
return $this->_restserver($args[0]);
|
400 |
-
} else {
|
401 |
-
return call_user_func_array(array($this, '_graph'), $args);
|
402 |
-
}
|
403 |
-
}
|
404 |
-
|
405 |
-
/**
|
406 |
-
* Invoke the old restserver.php endpoint.
|
407 |
-
*
|
408 |
-
* @param Array $params method call object
|
409 |
-
* @return the decoded response object
|
410 |
-
* @throws Facebook_Exception
|
411 |
-
*/
|
412 |
-
protected function _restserver($params) {
|
413 |
-
// generic application level parameters
|
414 |
-
$params['api_key'] = $this->getAppId();
|
415 |
-
$params['format'] = 'json-strings';
|
416 |
-
|
417 |
-
$result = json_decode($this->_oauthRequest(
|
418 |
-
$this->getApiUrl($params['method']),
|
419 |
-
$params
|
420 |
-
), true);
|
421 |
-
|
422 |
-
// results are returned, errors are thrown
|
423 |
-
if (is_array($result) && isset($result['error_code'])) {
|
424 |
-
throw new Facebook_Exception($result);
|
425 |
-
}
|
426 |
-
return $result;
|
427 |
-
}
|
428 |
-
|
429 |
-
/**
|
430 |
-
* Invoke the Graph API.
|
431 |
-
*
|
432 |
-
* @param String $path the path (required)
|
433 |
-
* @param String $method the http method (default 'GET')
|
434 |
-
* @param Array $params the query/post data
|
435 |
-
* @return the decoded response object
|
436 |
-
* @throws Facebook_Exception
|
437 |
-
*/
|
438 |
-
protected function _graph($path, $method='GET', $params=array()) {
|
439 |
-
if (is_array($method) && empty($params)) {
|
440 |
-
$params = $method;
|
441 |
-
$method = 'GET';
|
442 |
-
}
|
443 |
-
$params['method'] = $method; // method override as we always do a POST
|
444 |
-
|
445 |
-
$result = json_decode($this->_oauthRequest(
|
446 |
-
$this->getUrl('graph', $path),
|
447 |
-
$params
|
448 |
-
), true);
|
449 |
-
|
450 |
-
// results are returned, errors are thrown
|
451 |
-
if (is_array($result) && isset($result['error'])) {
|
452 |
-
$e = new Facebook_Exception($result);
|
453 |
-
switch ($e->getType()) {
|
454 |
-
// OAuth 2.0 Draft 00 style
|
455 |
-
case 'OAuthException':
|
456 |
-
// OAuth 2.0 Draft 10 style
|
457 |
-
case 'invalid_token':
|
458 |
-
$this->setSession(null);
|
459 |
-
}
|
460 |
-
throw $e;
|
461 |
-
}
|
462 |
-
return $result;
|
463 |
-
}
|
464 |
-
|
465 |
-
/**
|
466 |
-
* Make a OAuth Request
|
467 |
-
*
|
468 |
-
* @param String $path the path (required)
|
469 |
-
* @param Array $params the query/post data
|
470 |
-
* @return the decoded response object
|
471 |
-
* @throws Facebook_Exception
|
472 |
-
*/
|
473 |
-
protected function _oauthRequest($url, $params) {
|
474 |
-
if (!isset($params['access_token'])) {
|
475 |
-
$params['access_token'] = $this->getAccessToken();
|
476 |
-
}
|
477 |
-
|
478 |
-
// json_encode all params values that are not strings
|
479 |
-
foreach ($params as $key => $value) {
|
480 |
-
if (!is_string($value)) {
|
481 |
-
$params[$key] = json_encode($value);
|
482 |
-
}
|
483 |
-
}
|
484 |
-
return $this->makeRequest($url, $params);
|
485 |
-
}
|
486 |
-
|
487 |
-
/**
|
488 |
-
* Makes an HTTP request. This method can be overriden by subclasses if
|
489 |
-
* developers want to do fancier things or use something other than curl to
|
490 |
-
* make the request.
|
491 |
-
*
|
492 |
-
* @param String $url the URL to make the request to
|
493 |
-
* @param Array $params the parameters to use for the POST body
|
494 |
-
* @param CurlHandler $ch optional initialized curl handle
|
495 |
-
* @return String the response text
|
496 |
-
*/
|
497 |
-
protected function makeRequest($url, $params, $ch=null) {
|
498 |
-
if (!$ch) {
|
499 |
-
$ch = curl_init();
|
500 |
-
}
|
501 |
-
|
502 |
-
$opts = self::$CURL_OPTS;
|
503 |
-
if ($this->useFileUploadSupport()) {
|
504 |
-
$opts[CURLOPT_POSTFIELDS] = $params;
|
505 |
-
} else {
|
506 |
-
$opts[CURLOPT_POSTFIELDS] = http_build_query($params, null, '&');
|
507 |
-
}
|
508 |
-
$opts[CURLOPT_URL] = $url;
|
509 |
-
|
510 |
-
// disable the 'Expect: 100-continue' behaviour. This causes CURL to wait
|
511 |
-
// for 2 seconds if the server does not support this header.
|
512 |
-
if (isset($opts[CURLOPT_HTTPHEADER])) {
|
513 |
-
$existing_headers = $opts[CURLOPT_HTTPHEADER];
|
514 |
-
$existing_headers[] = 'Expect:';
|
515 |
-
$opts[CURLOPT_HTTPHEADER] = $existing_headers;
|
516 |
-
} else {
|
517 |
-
$opts[CURLOPT_HTTPHEADER] = array('Expect:');
|
518 |
-
}
|
519 |
-
|
520 |
-
curl_setopt_array($ch, $opts);
|
521 |
-
$result = curl_exec($ch);
|
522 |
-
|
523 |
-
if (curl_errno($ch) == 60) { // CURLE_SSL_CACERT
|
524 |
-
self::errorLog('Invalid or no certificate authority found, using bundled information');
|
525 |
-
curl_setopt($ch, CURLOPT_CAINFO,
|
526 |
-
dirname(__FILE__) . '/fb_ca_chain_bundle.crt');
|
527 |
-
$result = curl_exec($ch);
|
528 |
-
}
|
529 |
-
|
530 |
-
if ($result === false) {
|
531 |
-
$e = new Facebook_Exception(array(
|
532 |
-
'error_code' => curl_errno($ch),
|
533 |
-
'error' => array(
|
534 |
-
'message' => curl_error($ch),
|
535 |
-
'type' => 'CurlException',
|
536 |
-
),
|
537 |
-
));
|
538 |
-
curl_close($ch);
|
539 |
-
throw $e;
|
540 |
-
}
|
541 |
-
curl_close($ch);
|
542 |
-
return $result;
|
543 |
-
}
|
544 |
-
|
545 |
-
/**
|
546 |
-
* The name of the Cookie that contains the session.
|
547 |
-
*
|
548 |
-
* @return String the cookie name
|
549 |
-
*/
|
550 |
-
protected function getSessionCookieName() {
|
551 |
-
return 'fbs_' . $this->getAppId();
|
552 |
-
}
|
553 |
-
|
554 |
-
/**
|
555 |
-
* Set a JS Cookie based on the _passed in_ session. It does not use the
|
556 |
-
* currently stored session -- you need to explicitly pass it in.
|
557 |
-
*
|
558 |
-
* @param Array $session the session to use for setting the cookie
|
559 |
-
*/
|
560 |
-
protected function setCookieFromSession($session=null) {
|
561 |
-
if (!$this->useCookieSupport()) {
|
562 |
-
return;
|
563 |
-
}
|
564 |
-
|
565 |
-
$cookieName = $this->getSessionCookieName();
|
566 |
-
$value = 'deleted';
|
567 |
-
$expires = time() - 3600;
|
568 |
-
$domain = $this->getBaseDomain();
|
569 |
-
if ($session) {
|
570 |
-
$value = '"' . http_build_query($session, null, '&') . '"';
|
571 |
-
if (isset($session['base_domain'])) {
|
572 |
-
$domain = $session['base_domain'];
|
573 |
-
}
|
574 |
-
$expires = $session['expires'];
|
575 |
-
}
|
576 |
-
|
577 |
-
// prepend dot if a domain is found
|
578 |
-
if ($domain) {
|
579 |
-
$domain = '.' . $domain;
|
580 |
-
}
|
581 |
-
|
582 |
-
// if an existing cookie is not set, we dont need to delete it
|
583 |
-
if ($value == 'deleted' && empty($_COOKIE[$cookieName])) {
|
584 |
-
return;
|
585 |
-
}
|
586 |
-
|
587 |
-
if (headers_sent()) {
|
588 |
-
self::errorLog('Could not set cookie. Headers already sent.');
|
589 |
-
|
590 |
-
// ignore for code coverage as we will never be able to setcookie in a CLI
|
591 |
-
// environment
|
592 |
-
// @codeCoverageIgnoreStart
|
593 |
-
} else {
|
594 |
-
setcookie($cookieName, $value, $expires, '/', $domain);
|
595 |
-
}
|
596 |
-
// @codeCoverageIgnoreEnd
|
597 |
-
}
|
598 |
-
|
599 |
-
/**
|
600 |
-
* Validates a session_version=3 style session object.
|
601 |
-
*
|
602 |
-
* @param Array $session the session object
|
603 |
-
* @return Array the session object if it validates, null otherwise
|
604 |
-
*/
|
605 |
-
protected function validateSessionObject($session) {
|
606 |
-
// make sure some essential fields exist
|
607 |
-
if (is_array($session) &&
|
608 |
-
isset($session['uid']) &&
|
609 |
-
isset($session['access_token']) &&
|
610 |
-
isset($session['sig'])) {
|
611 |
-
// validate the signature
|
612 |
-
$session_without_sig = $session;
|
613 |
-
unset($session_without_sig['sig']);
|
614 |
-
$expected_sig = self::generateSignature(
|
615 |
-
$session_without_sig,
|
616 |
-
$this->getApiSecret()
|
617 |
-
);
|
618 |
-
if ($session['sig'] != $expected_sig) {
|
619 |
-
self::errorLog('Got invalid session signature in cookie.');
|
620 |
-
$session = null;
|
621 |
-
}
|
622 |
-
// check expiry time
|
623 |
-
} else {
|
624 |
-
$session = null;
|
625 |
-
}
|
626 |
-
return $session;
|
627 |
-
}
|
628 |
-
|
629 |
-
/**
|
630 |
-
* Returns something that looks like our JS session object from the
|
631 |
-
* signed token's data
|
632 |
-
*
|
633 |
-
* TODO: Nuke this once the login flow uses OAuth2
|
634 |
-
*
|
635 |
-
* @param Array the output of getSignedRequest
|
636 |
-
* @return Array Something that will work as a session
|
637 |
-
*/
|
638 |
-
protected function createSessionFromSignedRequest($data) {
|
639 |
-
if (!isset($data['oauth_token'])) {
|
640 |
-
return null;
|
641 |
-
}
|
642 |
-
|
643 |
-
$session = array(
|
644 |
-
'uid' => $data['user_id'],
|
645 |
-
'access_token' => $data['oauth_token'],
|
646 |
-
'expires' => $data['expires'],
|
647 |
-
);
|
648 |
-
|
649 |
-
// put a real sig, so that validateSignature works
|
650 |
-
$session['sig'] = self::generateSignature(
|
651 |
-
$session,
|
652 |
-
$this->getApiSecret()
|
653 |
-
);
|
654 |
-
|
655 |
-
return $session;
|
656 |
-
}
|
657 |
-
|
658 |
-
/**
|
659 |
-
* Parses a signed_request and validates the signature.
|
660 |
-
* Then saves it in $this->signed_data
|
661 |
-
*
|
662 |
-
* @param String A signed token
|
663 |
-
* @param Boolean Should we remove the parts of the payload that
|
664 |
-
* are used by the algorithm?
|
665 |
-
* @return Array the payload inside it or null if the sig is wrong
|
666 |
-
*/
|
667 |
-
protected function parseSignedRequest($signed_request) {
|
668 |
-
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
|
669 |
-
|
670 |
-
// decode the data
|
671 |
-
$sig = self::base64UrlDecode($encoded_sig);
|
672 |
-
$data = json_decode(self::base64UrlDecode($payload), true);
|
673 |
-
|
674 |
-
if (strtoupper($data['algorithm']) !== 'HMAC-SHA256') {
|
675 |
-
self::errorLog('Unknown algorithm. Expected HMAC-SHA256');
|
676 |
-
return null;
|
677 |
-
}
|
678 |
-
|
679 |
-
// check sig
|
680 |
-
$expected_sig = hash_hmac('sha256', $payload,
|
681 |
-
$this->getApiSecret(), $raw = true);
|
682 |
-
if ($sig !== $expected_sig) {
|
683 |
-
self::errorLog('Bad Signed JSON signature!');
|
684 |
-
return null;
|
685 |
-
}
|
686 |
-
|
687 |
-
return $data;
|
688 |
-
}
|
689 |
-
|
690 |
-
/**
|
691 |
-
* Build the URL for api given parameters.
|
692 |
-
*
|
693 |
-
* @param $method String the method name.
|
694 |
-
* @return String the URL for the given parameters
|
695 |
-
*/
|
696 |
-
protected function getApiUrl($method) {
|
697 |
-
static $READ_ONLY_CALLS =
|
698 |
-
array('admin.getallocation' => 1,
|
699 |
-
'admin.getappproperties' => 1,
|
700 |
-
'admin.getbannedusers' => 1,
|
701 |
-
'admin.getlivestreamvialink' => 1,
|
702 |
-
'admin.getmetrics' => 1,
|
703 |
-
'admin.getrestrictioninfo' => 1,
|
704 |
-
'application.getpublicinfo' => 1,
|
705 |
-
'auth.getapppublickey' => 1,
|
706 |
-
'auth.getsession' => 1,
|
707 |
-
'auth.getsignedpublicsessiondata' => 1,
|
708 |
-
'comments.get' => 1,
|
709 |
-
'connect.getunconnectedfriendscount' => 1,
|
710 |
-
'dashboard.getactivity' => 1,
|
711 |
-
'dashboard.getcount' => 1,
|
712 |
-
'dashboard.getglobalnews' => 1,
|
713 |
-
'dashboard.getnews' => 1,
|
714 |
-
'dashboard.multigetcount' => 1,
|
715 |
-
'dashboard.multigetnews' => 1,
|
716 |
-
'data.getcookies' => 1,
|
717 |
-
'events.get' => 1,
|
718 |
-
'events.getmembers' => 1,
|
719 |
-
'fbml.getcustomtags' => 1,
|
720 |
-
'feed.getappfriendstories' => 1,
|
721 |
-
'feed.getregisteredtemplatebundlebyid' => 1,
|
722 |
-
'feed.getregisteredtemplatebundles' => 1,
|
723 |
-
'fql.multiquery' => 1,
|
724 |
-
'fql.query' => 1,
|
725 |
-
'friends.arefriends' => 1,
|
726 |
-
'friends.get' => 1,
|
727 |
-
'friends.getappusers' => 1,
|
728 |
-
'friends.getlists' => 1,
|
729 |
-
'friends.getmutualfriends' => 1,
|
730 |
-
'gifts.get' => 1,
|
731 |
-
'groups.get' => 1,
|
732 |
-
'groups.getmembers' => 1,
|
733 |
-
'intl.gettranslations' => 1,
|
734 |
-
'links.get' => 1,
|
735 |
-
'notes.get' => 1,
|
736 |
-
'notifications.get' => 1,
|
737 |
-
'pages.getinfo' => 1,
|
738 |
-
'pages.isadmin' => 1,
|
739 |
-
'pages.isappadded' => 1,
|
740 |
-
'pages.isfan' => 1,
|
741 |
-
'permissions.checkavailableapiaccess' => 1,
|
742 |
-
'permissions.checkgrantedapiaccess' => 1,
|
743 |
-
'photos.get' => 1,
|
744 |
-
'photos.getalbums' => 1,
|
745 |
-
'photos.gettags' => 1,
|
746 |
-
'profile.getinfo' => 1,
|
747 |
-
'profile.getinfooptions' => 1,
|
748 |
-
'stream.get' => 1,
|
749 |
-
'stream.getcomments' => 1,
|
750 |
-
'stream.getfilters' => 1,
|
751 |
-
'users.getinfo' => 1,
|
752 |
-
'users.getloggedinuser' => 1,
|
753 |
-
'users.getstandardinfo' => 1,
|
754 |
-
'users.hasapppermission' => 1,
|
755 |
-
'users.isappuser' => 1,
|
756 |
-
'users.isverified' => 1,
|
757 |
-
'video.getuploadlimits' => 1);
|
758 |
-
$name = 'api';
|
759 |
-
if (isset($READ_ONLY_CALLS[strtolower($method)])) {
|
760 |
-
$name = 'api_read';
|
761 |
-
}
|
762 |
-
return self::getUrl($name, 'restserver.php');
|
763 |
-
}
|
764 |
-
|
765 |
-
/**
|
766 |
-
* Build the URL for given domain alias, path and parameters.
|
767 |
-
*
|
768 |
-
* @param $name String the name of the domain
|
769 |
-
* @param $path String optional path (without a leading slash)
|
770 |
-
* @param $params Array optional query parameters
|
771 |
-
* @return String the URL for the given parameters
|
772 |
-
*/
|
773 |
-
protected function getUrl($name, $path='', $params=array()) {
|
774 |
-
$url = self::$DOMAIN_MAP[$name];
|
775 |
-
if ($path) {
|
776 |
-
if ($path[0] === '/') {
|
777 |
-
$path = substr($path, 1);
|
778 |
-
}
|
779 |
-
$url .= $path;
|
780 |
-
}
|
781 |
-
if ($params) {
|
782 |
-
$url .= '?' . http_build_query($params, null, '&');
|
783 |
-
}
|
784 |
-
return $url;
|
785 |
-
}
|
786 |
-
|
787 |
-
/**
|
788 |
-
* Returns the Current URL, stripping it of known FB parameters that should
|
789 |
-
* not persist.
|
790 |
-
*
|
791 |
-
* @return String the current URL
|
792 |
-
*/
|
793 |
-
protected function getCurrentUrl() {
|
794 |
-
$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'
|
795 |
-
? 'https://'
|
796 |
-
: 'http://';
|
797 |
-
$currentUrl = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
798 |
-
$parts = parse_url($currentUrl);
|
799 |
-
|
800 |
-
// drop known fb params
|
801 |
-
$query = '';
|
802 |
-
if (!empty($parts['query'])) {
|
803 |
-
$params = array();
|
804 |
-
parse_str($parts['query'], $params);
|
805 |
-
foreach(self::$DROP_QUERY_PARAMS as $key) {
|
806 |
-
unset($params[$key]);
|
807 |
-
}
|
808 |
-
if (!empty($params)) {
|
809 |
-
$query = '?' . http_build_query($params, null, '&');
|
810 |
-
}
|
811 |
-
}
|
812 |
-
|
813 |
-
// use port if non default
|
814 |
-
$port =
|
815 |
-
isset($parts['port']) &&
|
816 |
-
(($protocol === 'http://' && $parts['port'] !== 80) ||
|
817 |
-
($protocol === 'https://' && $parts['port'] !== 443))
|
818 |
-
? ':' . $parts['port'] : '';
|
819 |
-
|
820 |
-
// rebuild
|
821 |
-
return $protocol . $parts['host'] . $port . $parts['path'] . $query;
|
822 |
-
}
|
823 |
-
|
824 |
-
/**
|
825 |
-
* Generate a signature for the given params and secret.
|
826 |
-
*
|
827 |
-
* @param Array $params the parameters to sign
|
828 |
-
* @param String $secret the secret to sign with
|
829 |
-
* @return String the generated signature
|
830 |
-
*/
|
831 |
-
protected static function generateSignature($params, $secret) {
|
832 |
-
// work with sorted data
|
833 |
-
ksort($params);
|
834 |
-
|
835 |
-
// generate the base string
|
836 |
-
$base_string = '';
|
837 |
-
foreach($params as $key => $value) {
|
838 |
-
$base_string .= $key . '=' . $value;
|
839 |
-
}
|
840 |
-
$base_string .= $secret;
|
841 |
-
|
842 |
-
return md5($base_string);
|
843 |
-
}
|
844 |
-
|
845 |
-
/**
|
846 |
-
* Prints to the error log if you aren't in command line mode.
|
847 |
-
*
|
848 |
-
* @param String log message
|
849 |
-
*/
|
850 |
-
protected static function errorLog($msg) {
|
851 |
-
// disable error log if we are running in a CLI environment
|
852 |
-
// @codeCoverageIgnoreStart
|
853 |
-
if (php_sapi_name() != 'cli') {
|
854 |
-
error_log($msg);
|
855 |
-
}
|
856 |
-
// uncomment this if you want to see the errors on the page
|
857 |
-
// print 'error_log: '.$msg."\n";
|
858 |
-
// @codeCoverageIgnoreEnd
|
859 |
-
}
|
860 |
-
|
861 |
-
/**
|
862 |
-
* Base64 encoding that doesn't need to be urlencode()ed.
|
863 |
-
* Exactly the same as base64_encode except it uses
|
864 |
-
* - instead of +
|
865 |
-
* _ instead of /
|
866 |
-
*
|
867 |
-
* @param String base64UrlEncodeded string
|
868 |
-
*/
|
869 |
-
protected static function base64UrlDecode($input) {
|
870 |
-
return base64_decode(strtr($input, '-_', '+/'));
|
871 |
-
}
|
872 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Facebook/Exception.php
DELETED
@@ -1,83 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Thrown when an API call returns an exception.
|
4 |
-
*
|
5 |
-
* @author Naitik Shah <naitik@facebook.com>
|
6 |
-
*/
|
7 |
-
class Facebook_Exception extends Exception
|
8 |
-
{
|
9 |
-
/**
|
10 |
-
* The result from the API server that represents the exception information.
|
11 |
-
*/
|
12 |
-
protected $result;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Make a new API Exception with the given result.
|
16 |
-
*
|
17 |
-
* @param Array $result the result from the API server
|
18 |
-
*/
|
19 |
-
public function __construct($result) {
|
20 |
-
$this->result = $result;
|
21 |
-
|
22 |
-
$code = isset($result['error_code']) ? $result['error_code'] : 0;
|
23 |
-
|
24 |
-
if (isset($result['error_description'])) {
|
25 |
-
// OAuth 2.0 Draft 10 style
|
26 |
-
$msg = $result['error_description'];
|
27 |
-
} else if (isset($result['error']) && is_array($result['error'])) {
|
28 |
-
// OAuth 2.0 Draft 00 style
|
29 |
-
$msg = $result['error']['message'];
|
30 |
-
} else if (isset($result['error_msg'])) {
|
31 |
-
// Rest server style
|
32 |
-
$msg = $result['error_msg'];
|
33 |
-
} else {
|
34 |
-
$msg = 'Unknown Error. Check getResult()';
|
35 |
-
}
|
36 |
-
|
37 |
-
parent::__construct($msg, $code);
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Return the associated result object returned by the API server.
|
42 |
-
*
|
43 |
-
* @returns Array the result from the API server
|
44 |
-
*/
|
45 |
-
public function getResult() {
|
46 |
-
return $this->result;
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Returns the associated type for the error. This will default to
|
51 |
-
* 'Exception' when a type is not available.
|
52 |
-
*
|
53 |
-
* @return String
|
54 |
-
*/
|
55 |
-
public function getType() {
|
56 |
-
if (isset($this->result['error'])) {
|
57 |
-
$error = $this->result['error'];
|
58 |
-
if (is_string($error)) {
|
59 |
-
// OAuth 2.0 Draft 10 style
|
60 |
-
return $error;
|
61 |
-
} else if (is_array($error)) {
|
62 |
-
// OAuth 2.0 Draft 00 style
|
63 |
-
if (isset($error['type'])) {
|
64 |
-
return $error['type'];
|
65 |
-
}
|
66 |
-
}
|
67 |
-
}
|
68 |
-
return 'Exception';
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* To make debugging easier.
|
73 |
-
*
|
74 |
-
* @returns String the string representation of the error
|
75 |
-
*/
|
76 |
-
public function __toString() {
|
77 |
-
$str = $this->getType() . ': ';
|
78 |
-
if ($this->code != 0) {
|
79 |
-
$str .= $this->code . ': ';
|
80 |
-
}
|
81 |
-
return $str . $this->message;
|
82 |
-
}
|
83 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Facebook/fb_ca_chain_bundle.crt
DELETED
@@ -1,121 +0,0 @@
|
|
1 |
-
-----BEGIN CERTIFICATE-----
|
2 |
-
MIIFgjCCBGqgAwIBAgIQDKKbZcnESGaLDuEaVk6fQjANBgkqhkiG9w0BAQUFADBm
|
3 |
-
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
4 |
-
d3cuZGlnaWNlcnQuY29tMSUwIwYDVQQDExxEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
|
5 |
-
ZSBDQS0zMB4XDTEwMDExMzAwMDAwMFoXDTEzMDQxMTIzNTk1OVowaDELMAkGA1UE
|
6 |
-
BhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExEjAQBgNVBAcTCVBhbG8gQWx0bzEX
|
7 |
-
MBUGA1UEChMORmFjZWJvb2ssIEluYy4xFzAVBgNVBAMUDiouZmFjZWJvb2suY29t
|
8 |
-
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9rzj7QIuLM3sdHu1HcI1VcR3g
|
9 |
-
b5FExKNV646agxSle1aQ/sJev1mh/u91ynwqd2BQmM0brZ1Hc3QrfYyAaiGGgEkp
|
10 |
-
xbhezyfeYhAyO0TKAYxPnm2cTjB5HICzk6xEIwFbA7SBJ2fSyW1CFhYZyo3tIBjj
|
11 |
-
19VjKyBfpRaPkzLmRwIDAQABo4ICrDCCAqgwHwYDVR0jBBgwFoAUUOpzidsp+xCP
|
12 |
-
nuUBINTeeZlIg/cwHQYDVR0OBBYEFPp+tsFBozkjrHlEnZ9J4cFj2eM0MA4GA1Ud
|
13 |
-
DwEB/wQEAwIFoDAMBgNVHRMBAf8EAjAAMF8GA1UdHwRYMFYwKaAnoCWGI2h0dHA6
|
14 |
-
Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9jYTMtZmIuY3JsMCmgJ6AlhiNodHRwOi8vY3Js
|
15 |
-
NC5kaWdpY2VydC5jb20vY2EzLWZiLmNybDCCAcYGA1UdIASCAb0wggG5MIIBtQYL
|
16 |
-
YIZIAYb9bAEDAAEwggGkMDoGCCsGAQUFBwIBFi5odHRwOi8vd3d3LmRpZ2ljZXJ0
|
17 |
-
LmNvbS9zc2wtY3BzLXJlcG9zaXRvcnkuaHRtMIIBZAYIKwYBBQUHAgIwggFWHoIB
|
18 |
-
UgBBAG4AeQAgAHUAcwBlACAAbwBmACAAdABoAGkAcwAgAEMAZQByAHQAaQBmAGkA
|
19 |
-
YwBhAHQAZQAgAGMAbwBuAHMAdABpAHQAdQB0AGUAcwAgAGEAYwBjAGUAcAB0AGEA
|
20 |
-
bgBjAGUAIABvAGYAIAB0AGgAZQAgAEQAaQBnAGkAQwBlAHIAdAAgAEMAUAAvAEMA
|
21 |
-
UABTACAAYQBuAGQAIAB0AGgAZQAgAFIAZQBsAHkAaQBuAGcAIABQAGEAcgB0AHkA
|
22 |
-
IABBAGcAcgBlAGUAbQBlAG4AdAAgAHcAaABpAGMAaAAgAGwAaQBtAGkAdAAgAGwA
|
23 |
-
aQBhAGIAaQBsAGkAdAB5ACAAYQBuAGQAIABhAHIAZQAgAGkAbgBjAG8AcgBwAG8A
|
24 |
-
cgBhAHQAZQBkACAAaABlAHIAZQBpAG4AIABiAHkAIAByAGUAZgBlAHIAZQBuAGMA
|
25 |
-
ZQAuMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjANBgkqhkiG9w0BAQUF
|
26 |
-
AAOCAQEACOkTIdxMy11+CKrbGNLBSg5xHaTvu/v1wbyn3dO/mf68pPfJnX6ShPYy
|
27 |
-
4XM4Vk0x4uaFaU4wAGke+nCKGi5dyg0Esg7nemLNKEJaFAJZ9enxZm334lSCeARy
|
28 |
-
wlDtxULGOFRyGIZZPmbV2eNq5xdU/g3IuBEhL722mTpAye9FU/J8Wsnw54/gANyO
|
29 |
-
Gzkewigua8ip8Lbs9Cht399yAfbfhUP1DrAm/xEcnHrzPr3cdCtOyJaM6SRPpRqH
|
30 |
-
ITK5Nc06tat9lXVosSinT3KqydzxBYua9gCFFiR3x3DgZfvXkC6KDdUlDrNcJUub
|
31 |
-
a1BHnLLP4mxTHL6faAXYd05IxNn/IA==
|
32 |
-
-----END CERTIFICATE-----
|
33 |
-
-----BEGIN CERTIFICATE-----
|
34 |
-
MIIGVTCCBT2gAwIBAgIQCFH5WYFBRcq94CTiEsnCDjANBgkqhkiG9w0BAQUFADBs
|
35 |
-
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
36 |
-
d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
|
37 |
-
ZSBFViBSb290IENBMB4XDTA3MDQwMzAwMDAwMFoXDTIyMDQwMzAwMDAwMFowZjEL
|
38 |
-
MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3
|
39 |
-
LmRpZ2ljZXJ0LmNvbTElMCMGA1UEAxMcRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug
|
40 |
-
Q0EtMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9hCikQH17+NDdR
|
41 |
-
CPge+yLtYb4LDXBMUGMmdRW5QYiXtvCgFbsIYOBC6AUpEIc2iihlqO8xB3RtNpcv
|
42 |
-
KEZmBMcqeSZ6mdWOw21PoF6tvD2Rwll7XjZswFPPAAgyPhBkWBATaccM7pxCUQD5
|
43 |
-
BUTuJM56H+2MEb0SqPMV9Bx6MWkBG6fmXcCabH4JnudSREoQOiPkm7YDr6ictFuf
|
44 |
-
1EutkozOtREqqjcYjbTCuNhcBoz4/yO9NV7UfD5+gw6RlgWYw7If48hl66l7XaAs
|
45 |
-
zPw82W3tzPpLQ4zJ1LilYRyyQLYoEt+5+F/+07LJ7z20Hkt8HEyZNp496+ynaF4d
|
46 |
-
32duXvsCAwEAAaOCAvcwggLzMA4GA1UdDwEB/wQEAwIBhjCCAcYGA1UdIASCAb0w
|
47 |
-
ggG5MIIBtQYLYIZIAYb9bAEDAAIwggGkMDoGCCsGAQUFBwIBFi5odHRwOi8vd3d3
|
48 |
-
LmRpZ2ljZXJ0LmNvbS9zc2wtY3BzLXJlcG9zaXRvcnkuaHRtMIIBZAYIKwYBBQUH
|
49 |
-
AgIwggFWHoIBUgBBAG4AeQAgAHUAcwBlACAAbwBmACAAdABoAGkAcwAgAEMAZQBy
|
50 |
-
AHQAaQBmAGkAYwBhAHQAZQAgAGMAbwBuAHMAdABpAHQAdQB0AGUAcwAgAGEAYwBj
|
51 |
-
AGUAcAB0AGEAbgBjAGUAIABvAGYAIAB0AGgAZQAgAEQAaQBnAGkAQwBlAHIAdAAg
|
52 |
-
AEMAUAAvAEMAUABTACAAYQBuAGQAIAB0AGgAZQAgAFIAZQBsAHkAaQBuAGcAIABQ
|
53 |
-
AGEAcgB0AHkAIABBAGcAcgBlAGUAbQBlAG4AdAAgAHcAaABpAGMAaAAgAGwAaQBt
|
54 |
-
AGkAdAAgAGwAaQBhAGIAaQBsAGkAdAB5ACAAYQBuAGQAIABhAHIAZQAgAGkAbgBj
|
55 |
-
AG8AcgBwAG8AcgBhAHQAZQBkACAAaABlAHIAZQBpAG4AIABiAHkAIAByAGUAZgBl
|
56 |
-
AHIAZQBuAGMAZQAuMA8GA1UdEwEB/wQFMAMBAf8wNAYIKwYBBQUHAQEEKDAmMCQG
|
57 |
-
CCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdpY2VydC5jb20wgY8GA1UdHwSBhzCB
|
58 |
-
hDBAoD6gPIY6aHR0cDovL2NybDMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0SGlnaEFz
|
59 |
-
c3VyYW5jZUVWUm9vdENBLmNybDBAoD6gPIY6aHR0cDovL2NybDQuZGlnaWNlcnQu
|
60 |
-
Y29tL0RpZ2lDZXJ0SGlnaEFzc3VyYW5jZUVWUm9vdENBLmNybDAfBgNVHSMEGDAW
|
61 |
-
gBSxPsNpA/i/RwHUmCYaCALvY2QrwzAdBgNVHQ4EFgQUUOpzidsp+xCPnuUBINTe
|
62 |
-
eZlIg/cwDQYJKoZIhvcNAQEFBQADggEBAF1PhPGoiNOjsrycbeUpSXfh59bcqdg1
|
63 |
-
rslx3OXb3J0kIZCmz7cBHJvUV5eR13UWpRLXuT0uiT05aYrWNTf58SHEW0CtWakv
|
64 |
-
XzoAKUMncQPkvTAyVab+hA4LmzgZLEN8rEO/dTHlIxxFVbdpCJG1z9fVsV7un5Tk
|
65 |
-
1nq5GMO41lJjHBC6iy9tXcwFOPRWBW3vnuzoYTYMFEuFFFoMg08iXFnLjIpx2vrF
|
66 |
-
EIRYzwfu45DC9fkpx1ojcflZtGQriLCnNseaIGHr+k61rmsb5OPs4tk8QUmoIKRU
|
67 |
-
9ZKNu8BVIASm2LAXFszj0Mi0PeXZhMbT9m5teMl5Q+h6N/9cNUm/ocU=
|
68 |
-
-----END CERTIFICATE-----
|
69 |
-
-----BEGIN CERTIFICATE-----
|
70 |
-
MIIEQjCCA6ugAwIBAgIEQoclDjANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC
|
71 |
-
VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u
|
72 |
-
ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc
|
73 |
-
KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u
|
74 |
-
ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEy
|
75 |
-
MjIxNTI3MjdaFw0xNDA3MjIxNTU3MjdaMGwxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
|
76 |
-
EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xKzApBgNV
|
77 |
-
BAMTIkRpZ2lDZXJ0IEhpZ2ggQXNzdXJhbmNlIEVWIFJvb3QgQ0EwggEiMA0GCSqG
|
78 |
-
SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGzOVz5vvUu+UtLTKm3+WBP8nNJUm2cSrD
|
79 |
-
1ZQ0Z6IKHLBfaaZAscS3so/QmKSpQVk609yU1jzbdDikSsxNJYL3SqVTEjju80lt
|
80 |
-
cZF+Y7arpl/DpIT4T2JRvvjF7Ns4kuMG5QiRDMQoQVX7y1qJFX5x6DW/TXIJPb46
|
81 |
-
OFBbdzEbjbPHJEWap6xtABRaBLe6E+tRCphBQSJOZWGHgUFQpnlcid4ZSlfVLuZd
|
82 |
-
HFMsfpjNGgYWpGhz0DQEE1yhcdNafFXbXmThN4cwVgTlEbQpgBLxeTmIogIRfCdm
|
83 |
-
t4i3ePLKCqg4qwpkwr9mXZWEwaElHoddGlALIBLMQbtuC1E4uEvLAgMBAAGjggET
|
84 |
-
MIIBDzASBgNVHRMBAf8ECDAGAQH/AgEBMCcGA1UdJQQgMB4GCCsGAQUFBwMBBggr
|
85 |
-
BgEFBQcDAgYIKwYBBQUHAwQwMwYIKwYBBQUHAQEEJzAlMCMGCCsGAQUFBzABhhdo
|
86 |
-
dHRwOi8vb2NzcC5lbnRydXN0Lm5ldDAzBgNVHR8ELDAqMCigJqAkhiJodHRwOi8v
|
87 |
-
Y3JsLmVudHJ1c3QubmV0L3NlcnZlcjEuY3JsMB0GA1UdDgQWBBSxPsNpA/i/RwHU
|
88 |
-
mCYaCALvY2QrwzALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8BdiE1U9s/8KAGv7
|
89 |
-
UISX8+1i0BowGQYJKoZIhvZ9B0EABAwwChsEVjcuMQMCAIEwDQYJKoZIhvcNAQEF
|
90 |
-
BQADgYEAUuVY7HCc/9EvhaYzC1rAIo348LtGIiMduEl5Xa24G8tmJnDioD2GU06r
|
91 |
-
1kjLX/ktCdpdBgXadbjtdrZXTP59uN0AXlsdaTiFufsqVLPvkp5yMnqnuI3E2o6p
|
92 |
-
NpAkoQSbB6kUCNnXcW26valgOjDLZFOnr241QiwdBAJAAE/rRa8=
|
93 |
-
-----END CERTIFICATE-----
|
94 |
-
-----BEGIN CERTIFICATE-----
|
95 |
-
MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC
|
96 |
-
VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u
|
97 |
-
ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc
|
98 |
-
KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u
|
99 |
-
ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1
|
100 |
-
MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE
|
101 |
-
ChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j
|
102 |
-
b3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF
|
103 |
-
bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUg
|
104 |
-
U2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUA
|
105 |
-
A4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQaO2f55M28Qpku0f1BBc/
|
106 |
-
I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5gXpa0zf3
|
107 |
-
wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OC
|
108 |
-
AdcwggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHb
|
109 |
-
oIHYpIHVMIHSMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5
|
110 |
-
BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p
|
111 |
-
dHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk
|
112 |
-
MTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp
|
113 |
-
b24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu
|
114 |
-
dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0
|
115 |
-
MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi
|
116 |
-
E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa
|
117 |
-
MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI
|
118 |
-
hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN
|
119 |
-
95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd
|
120 |
-
2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=
|
121 |
-
-----END CERTIFICATE-----
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>facebookfreebelvg</name>
|
4 |
-
<version>
|
5 |
<stability>stable</stability>
|
6 |
-
<license uri="http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt">
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
-
<description>
|
11 |
-
<notes>
|
12 |
-
<authors><author><name>
|
13 |
-
<date>
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Belvg"><dir name="All"><dir name="Block"><file name="Extensions.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>facebookfreebelvg</name>
|
4 |
+
<version>2.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license uri="http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt">EULA</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Connect your Magento store to Facebook and benefit from Login and Like features.</summary>
|
10 |
+
<description>Connect your Magento store to Facebook and benefit from Login and Like features.</description>
|
11 |
+
<notes>http://store.belvg.com/facebook-connect-and-like-free.html</notes>
|
12 |
+
<authors><author><name>BelVG</name><user>auto-converted</user><email>store@belvg.com</email></author></authors>
|
13 |
+
<date>2015-08-07</date>
|
14 |
+
<time>10:51:24</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Belvg"><dir name="All"><dir name="Block"><file name="Extensions.php" hash="7a1acbdaf1e3a507d6bfc8a46973cad4"/><file name="Store.php" hash="a91e4c7e02ef17297cad97efa6a5edc8"/></dir><dir name="Helper"><file name="Config.php" hash="173a4200bde91231142c11b267ef488c"/><file name="Data.php" hash="382f395273d184d54e2be04297300f26"/></dir><dir name="Model"><dir name="Source"><dir name="Updates"><file name="Type.php" hash="7e861f39d566a9f26e3b1e1a2c0448f5"/></dir></dir><file name="Feed.php" hash="63e8802d36f74e11f6213140e081e1c3"/><file name="Observer.php" hash="140a3145e71f6c076355e21e1720bdc2"/></dir><dir name="etc"><file name="adminhtml.xml" hash="ba3172ef47b6df83e6dd9e7283edc688"/><file name="config.xml" hash="4dd36439ea0d58923a62fb4f0bd5f915"/><file name="system.xml" hash="5d81781651401be847bd408eb1aa66ca"/></dir><dir name="sql"><dir name="belvgall_setup"><file name="mysql4-install-1.0.0.php" hash="65e66e24c877cdac3c8046f75b345063"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="b14da80b9c81773060527ce2a9ea741d"/><file name="mysql4-upgrade-1.0.1-2.0.0.php" hash="99a6d4c3dc36f58b8c7134e4695a8bc3"/></dir></dir></dir><dir name="FacebookFree"><dir name="Block"><dir name="Like"><file name="Meta.php" hash="638337358da365b406ea150e7addddaa"/></dir><dir name="Links"><file name="Button.php" hash="d6abbd88ba7f2cb7f114c3a8ccc327e1"/></dir><dir name="Page"><dir name="Html"><file name="Header.php" hash="fcd1316127bff43a86789adafa23d021"/></dir></dir><file name="Init.php" hash="d65a5d565200975a57173b3f92efbc96"/><file name="Links.php" hash="9420b0f12f864ac6259ca033a72e4fb9"/></dir><dir name="Helper"><file name="Config.php" hash="3058ac18b0d6e608a121209f714357c4"/><file name="Data.php" hash="685a189fea7101185b58e8e78cd4b02c"/></dir><dir name="Model"><dir name="Mysql4"><file name="FacebookFree.php" hash="8e53193e6c03c810c99c38e966a52005"/></dir><dir name="Request"><file name="Cookie.php" hash="c1ef0cca794fef5821ac4719ce347633"/></dir><dir name="Resource"><dir name="Facebookfree"><file name="Collection.php" hash="d4c73d33d559b5eaf7d08f3287bd76e8"/></dir><file name="Facebookfree.php" hash="64867ae5a21e93f4a97d288b906c471c"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Color.php" hash="f05f16bf0a791d527417e11945ea33f7"/><file name="Font.php" hash="88d5212453523acc35ee12ab740ba687"/><file name="Layout.php" hash="42363bf551b4d55101c323e095ff9ab5"/></dir></dir></dir><file name="Customer.php" hash="61ff82dcbf5efd57d4d93fc3439a4757"/><file name="Facebookfree.php" hash="783879dfe7458e87129d58a885ad539a"/><file name="Locale.php" hash="ec747efb16c4e357b471fd0fbf6b99ab"/><file name="Request.php" hash="50bac6f62e0a3b11473d8b513dab8a9a"/></dir><dir name="controllers"><file name="CustomerController.php" hash="a710a7334ebf613ffa4993646be6e668"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d242bf8a41a872f4f02b194359ee4d4c"/><file name="config.xml" hash="372bd3c7ab7c4db1670f20a18c341d8e"/><file name="locale.xml" hash="dc61fb00273719a64db2116282b98b2c"/><file name="system.xml" hash="f71c05f44e2d51676827a7fa051a6976"/></dir><dir name="sql"><dir name="facebookfree_setup"><file name="mysql4-install-1.0.1.php" hash="eb24580edb1bea4343ba3e1114a61eb6"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="belvg"><file name="facebookfree.xml" hash="f5f01e2adbf6b9aa3841f95ee22e852f"/></dir></dir><dir name="template"><dir name="belvg"><dir name="facebookfree"><dir name="form"><dir name="checkout"><file name="login.phtml" hash="9e2be195cd4fd66610fee6f33fff5418"/></dir><dir name="customer"><file name="login.phtml" hash="4f66f90ab25de8cea06b99d46e19f622"/></dir><file name="button.phtml" hash="7d556665664f037f2e8b31357cdd676b"/></dir><dir name="like"><dir name="product"><dir name="view"><file name="addto.phtml" hash="1053769320ed3a64f975e063edb916b4"/></dir></dir><file name="meta.phtml" hash="a76c08221c03593ffec1d1a98e43d1f7"/></dir><file name="block.phtml" hash="f6c1c8e44fac2bba46a17ac865af863d"/><file name="links.phtml" hash="20c5ca44c97b58180d7de47964560264"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Belvg_All.xml" hash="e04907d3a11eed6bc654876b9ac8ebc7"/><file name="Belvg_FacebookFree.xml" hash="6363051ab6807dc9bd4f16bcedc41a08"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
skin/adminhtml/default/default/images/belvgall/bad.gif
DELETED
Binary file
|
skin/adminhtml/default/default/images/belvgall/delete.jpg
DELETED
Binary file
|
skin/adminhtml/default/default/images/belvgall/info.gif
DELETED
Binary file
|
skin/adminhtml/default/default/images/belvgall/ok.gif
DELETED
Binary file
|
skin/adminhtml/default/default/images/belvgall/update.gif
DELETED
Binary file
|
skin/frontend/default/default/css/belvg/facebookfree.css
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* BelVG LLC.
|
3 |
-
*
|
4 |
-
* NOTICE OF LICENSE
|
5 |
-
*
|
6 |
-
* This source file is subject to the EULA
|
7 |
-
* that is bundled with this package in the file LICENSE.txt.
|
8 |
-
* It is also available through the world-wide-web at this URL:
|
9 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
10 |
-
*
|
11 |
-
/***************************************
|
12 |
-
* MAGENTO EDITION USAGE NOTICE *
|
13 |
-
*****************************************/
|
14 |
-
/* This package designed for Magento COMMUNITY edition
|
15 |
-
* BelVG does not guarantee correct work of this extension
|
16 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
17 |
-
* BelVG does not provide extension support in case of
|
18 |
-
* incorrect edition usage.
|
19 |
-
/***************************************
|
20 |
-
* DISCLAIMER *
|
21 |
-
*****************************************/
|
22 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
23 |
-
* versions in the future.
|
24 |
-
*****************************************************
|
25 |
-
* @category Belvg
|
26 |
-
* @package Belvg_FacebookFree
|
27 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
28 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
29 |
-
*/
|
30 |
-
|
31 |
-
|
32 |
-
.fb_button_ps { float: right; margin-left: 5px; }
|
33 |
-
.welcome-msg img { margin-left: 5px; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skin/frontend/default/default/images/belvg/fb.gif
DELETED
Binary file
|