Version Notes
Fourth release of Simplified Social Share extension
Download this release
Release Info
Developer | LoginRadius Team |
Extension | LoginRadiusShare |
Version | 2.0.0 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 2.0.0
- app/code/community/Loginradius/Sharing/Block/Getconfig.php +0 -168
- app/code/community/Loginradius/Sharing/Block/Help.php +56 -16
- app/code/community/Loginradius/Sharing/Block/Horizontalsharing.php +51 -9
- app/code/community/Loginradius/Sharing/Block/Sharing.php +328 -0
- app/code/community/Loginradius/Sharing/Block/Verticalsharing.php +51 -9
- app/code/community/Loginradius/Sharing/Helper/Data.php +25 -11
- app/code/community/Loginradius/Sharing/Model/Observer.php +190 -0
- app/code/community/Loginradius/Sharing/Model/Sharing.php +0 -9
- app/code/community/Loginradius/Sharing/Model/Source/HorizontalSharing.php +43 -12
- app/code/community/Loginradius/Sharing/Model/Source/SharingCount.php +0 -11
- app/code/community/Loginradius/Sharing/Model/Source/SharingVerticalAlignment.php +35 -10
- app/code/community/Loginradius/Sharing/Model/Source/VerticalSharing.php +40 -10
- app/code/community/Loginradius/Sharing/Model/System/Config/Help.php +0 -34
- app/code/community/Loginradius/Sharing/Model/System/Config/Info.php +144 -87
- app/code/community/Loginradius/Sharing/controllers/IndexController.php +0 -353
- app/code/community/Loginradius/Sharing/etc/config.xml +14 -4
- app/code/community/Loginradius/Sharing/etc/system.xml +225 -234
- app/design/adminhtml/default/default/layout/loginradius_sharing.xml +5 -5
- app/design/frontend/base/default/layout/sharing.xml +11 -11
- app/design/frontend/base/default/template/sharing/socialshare_head.phtml +21 -140
- app/design/frontend/base/default/template/sharing/socialshareproduct.phtml +7 -7
- app/design/frontend/base/default/template/sharing/socialsharesuccess.phtml +7 -7
- package.xml +6 -6
- skin/adminhtml/default/default/Loginradius/Sharing/css/admin-ui.css +189 -0
- skin/{frontend/base → adminhtml/default}/default/Loginradius/Sharing/css/lrshare_iconsprite32.png +0 -0
- skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Horizontal/horizonSharing16.png +0 -0
- skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Horizontal/horizonSharing32.png +0 -0
- skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Horizontal/horizontal.png +0 -0
- skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Horizontal/responsive-icons.png +0 -0
- skin/{frontend/base → adminhtml/default}/default/Loginradius/Sharing/images/Sharing/Horizontal/single-image-theme-large.png +0 -0
- skin/{frontend/base → adminhtml/default}/default/Loginradius/Sharing/images/Sharing/Horizontal/single-image-theme-small.png +0 -0
- skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Horizontal/vertical.png +0 -0
- skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Vertical/16VerticlewithBox.png +0 -0
- skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Vertical/32VerticlewithBox.png +0 -0
- skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Vertical/verticalhorizontal.png +0 -0
- skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Vertical/verticalvertical.png +0 -0
- skin/adminhtml/default/default/Loginradius/Sharing/js/admin-ui.js +269 -0
- skin/{frontend/base → adminhtml/default}/default/Loginradius/Sharing/js/jquery.js +0 -0
- skin/{frontend/base → adminhtml/default}/default/Loginradius/Sharing/js/jquery.ui.sortable.min.js +0 -0
- skin/frontend/base/default/Loginradius/Sharing/css/admin-ui.css +0 -130
- skin/frontend/base/default/Loginradius/Sharing/images/Sharing/Horizontal/horizonSharing16.png +0 -0
- skin/frontend/base/default/Loginradius/Sharing/images/Sharing/Horizontal/horizonSharing32.png +0 -0
- skin/frontend/base/default/Loginradius/Sharing/images/Sharing/Horizontal/horizontal.png +0 -0
- skin/frontend/base/default/Loginradius/Sharing/images/Sharing/Horizontal/vertical.png +0 -0
- skin/frontend/base/default/Loginradius/Sharing/images/Sharing/Vertical/16VerticlewithBox.png +0 -0
- skin/frontend/base/default/Loginradius/Sharing/images/Sharing/Vertical/32VerticlewithBox.png +0 -0
- skin/frontend/base/default/Loginradius/Sharing/images/Sharing/Vertical/verticalhorizontal.png +0 -0
- skin/frontend/base/default/Loginradius/Sharing/images/Sharing/Vertical/verticalvertical.png +0 -0
- skin/frontend/base/default/Loginradius/Sharing/images/loading_icon.gif +0 -0
- skin/frontend/base/default/Loginradius/Sharing/js/admin-ui.js +0 -272
app/code/community/Loginradius/Sharing/Block/Getconfig.php
DELETED
@@ -1,168 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Loginradius_Sharing_Block_Getconfig extends Mage_Core_Block_Template
|
3 |
-
{
|
4 |
-
protected function _construct(){
|
5 |
-
parent::_construct();
|
6 |
-
if( $this->horizontalShareEnable() == "1" || $this->verticalShareEnable() == "1" ){
|
7 |
-
$this->setTemplate('sharing/socialshare.phtml');
|
8 |
-
}
|
9 |
-
}
|
10 |
-
public function _prepareLayout(){
|
11 |
-
return parent::_prepareLayout();
|
12 |
-
}
|
13 |
-
public function getSharing(){
|
14 |
-
if (!$this->hasData('sharing')) {
|
15 |
-
$this->setData('sharing', Mage::registry('sharing'));
|
16 |
-
}
|
17 |
-
return $this->getData('sharing');
|
18 |
-
}
|
19 |
-
public function user_is_already_login() {
|
20 |
-
if( Mage::getSingleton('customer/session')->isLoggedIn() ){
|
21 |
-
return true;
|
22 |
-
}
|
23 |
-
return false;
|
24 |
-
}
|
25 |
-
public function getApikey(){
|
26 |
-
return Mage::getStoreConfig('sharing_options/messages/appid');
|
27 |
-
}
|
28 |
-
public function horizontalShareEnable(){
|
29 |
-
return Mage::getStoreConfig('sharing_options/horizontalSharing/horizontalShareEnable');
|
30 |
-
}
|
31 |
-
public function verticalShareEnable(){
|
32 |
-
return Mage::getStoreConfig('sharing_options/verticalSharing/verticalShareEnable');
|
33 |
-
}
|
34 |
-
public function horizontalShareProduct(){
|
35 |
-
return Mage::getStoreConfig('sharing_options/horizontalSharing/horizontalShareProduct');
|
36 |
-
}
|
37 |
-
public function verticalShareProduct(){
|
38 |
-
return Mage::getStoreConfig('sharing_options/verticalSharing/verticalShareProduct');
|
39 |
-
}
|
40 |
-
public function horizontalShareSuccess(){
|
41 |
-
return Mage::getStoreConfig('sharing_options/horizontalSharing/horizontalShareSuccess');
|
42 |
-
}
|
43 |
-
public function verticalShareSuccess(){
|
44 |
-
return Mage::getStoreConfig('sharing_options/verticalSharing/verticalShareSuccess');
|
45 |
-
}
|
46 |
-
public function sharingTitle(){
|
47 |
-
return Mage::getStoreConfig('sharing_options/horizontalSharing/sharingTitle');
|
48 |
-
}
|
49 |
-
public function horizontalSharingTheme(){
|
50 |
-
return Mage::getStoreConfig('sharing_options/horizontalSharing/horizontalSharingTheme');
|
51 |
-
}
|
52 |
-
public function verticalSharingTheme(){
|
53 |
-
return Mage::getStoreConfig('sharing_options/verticalSharing/verticalSharingTheme');
|
54 |
-
}
|
55 |
-
public function verticalAlignment(){
|
56 |
-
return Mage::getStoreConfig('sharing_options/verticalSharing/verticalAlignment');
|
57 |
-
}
|
58 |
-
public function offset(){
|
59 |
-
return Mage::getStoreConfig('sharing_options/verticalSharing/offset');
|
60 |
-
}
|
61 |
-
public function horizontalSharingProviders(){
|
62 |
-
return Mage::getStoreConfig('sharing_options/horizontalSharing/horizontalSharingProvidersHidden');
|
63 |
-
}
|
64 |
-
public function verticalSharingProviders(){
|
65 |
-
return Mage::getStoreConfig('sharing_options/verticalSharing/verticalSharingProvidersHidden');
|
66 |
-
}
|
67 |
-
public function horizontalCounterProviders(){
|
68 |
-
return Mage::getStoreConfig('sharing_options/horizontalSharing/horizontalCounterProvidersHidden');
|
69 |
-
}
|
70 |
-
public function verticalCounterProviders(){
|
71 |
-
return Mage::getStoreConfig('sharing_options/verticalSharing/verticalCounterProvidersHidden');
|
72 |
-
}
|
73 |
-
public function getApiResult($ApiKey, $ApiSecrete)
|
74 |
-
{
|
75 |
-
if ( !empty($ApiKey) && !empty($ApiSecrete) && preg_match('/^\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\}?$/i', $ApiKey) && preg_match('/^\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\}?$/i', $ApiSecrete) ) {
|
76 |
-
return true;
|
77 |
-
}
|
78 |
-
else {
|
79 |
-
return false;
|
80 |
-
}
|
81 |
-
}
|
82 |
-
/**
|
83 |
-
* Check if CURL/FSOCKOPEN are working.
|
84 |
-
*/
|
85 |
-
public function login_radius_check_connection($method){
|
86 |
-
$ValidateUrl = "https://hub.loginradius.com/ping/ApiKey/ApiSecrete";
|
87 |
-
$JsonResponse = $this->loginradius_call_api($ValidateUrl, $method);
|
88 |
-
$UserAuth = json_decode($JsonResponse);
|
89 |
-
if(isset($UserAuth->ok)){
|
90 |
-
return "ok";
|
91 |
-
}elseif($JsonResponse == "service connection timeout"){
|
92 |
-
return "service connection timeout";
|
93 |
-
}elseif($JsonResponse == "timeout"){
|
94 |
-
return "timeout";
|
95 |
-
}else{
|
96 |
-
return "connection error";
|
97 |
-
}
|
98 |
-
}
|
99 |
-
/**
|
100 |
-
* Login/register user to LR.
|
101 |
-
*/
|
102 |
-
public function login_radius_lr_login($ValidateUrl, $method){
|
103 |
-
$JsonResponse = $this->loginradius_call_api($ValidateUrl, $method, true);
|
104 |
-
$response = json_decode($JsonResponse);
|
105 |
-
return $response;
|
106 |
-
}
|
107 |
-
public function loginradius_call_api($ValidateUrl, $method = "", $post = false){
|
108 |
-
if($method == "curl"){
|
109 |
-
$curl_handle = curl_init();
|
110 |
-
curl_setopt($curl_handle, CURLOPT_URL, $ValidateUrl);
|
111 |
-
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 8);
|
112 |
-
curl_setopt($curl_handle, CURLOPT_TIMEOUT, 8);
|
113 |
-
if($post){
|
114 |
-
curl_setopt($curl_handle, CURLOPT_POST, 1);
|
115 |
-
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, '');
|
116 |
-
}
|
117 |
-
curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);
|
118 |
-
if(ini_get('open_basedir') == '' && (ini_get('safe_mode') == 'Off' or !ini_get('safe_mode'))){
|
119 |
-
curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, 1);
|
120 |
-
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
|
121 |
-
}else{
|
122 |
-
curl_setopt($curl_handle, CURLOPT_HEADER, 1);
|
123 |
-
$url = curl_getinfo($curl_handle, CURLINFO_EFFECTIVE_URL);
|
124 |
-
curl_close($curl_handle);
|
125 |
-
$curl_handle = curl_init();
|
126 |
-
$url = str_replace('?','/?',$url);
|
127 |
-
curl_setopt($curl_handle, CURLOPT_URL, $url);
|
128 |
-
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
|
129 |
-
}
|
130 |
-
$JsonResponse = curl_exec($curl_handle);
|
131 |
-
$httpCode = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE);
|
132 |
-
if(in_array($httpCode, array(400, 401, 404, 500, 503)) && $httpCode != 200){
|
133 |
-
return "service connection timeout";
|
134 |
-
}else{
|
135 |
-
if(curl_errno($curl_handle) == 28){
|
136 |
-
return "timeout";
|
137 |
-
}
|
138 |
-
}
|
139 |
-
curl_close($curl_handle);
|
140 |
-
}else{
|
141 |
-
if($post){
|
142 |
-
$postdata = http_build_query(
|
143 |
-
array(
|
144 |
-
'var1' => 'val'
|
145 |
-
)
|
146 |
-
);
|
147 |
-
$options = array('http' =>
|
148 |
-
array(
|
149 |
-
'method' => 'POST',
|
150 |
-
'timeout' => 10,
|
151 |
-
'header' => 'Content-type: application/x-www-form-urlencoded',
|
152 |
-
'content' => $postdata,
|
153 |
-
'ignore_errors' => true
|
154 |
-
)
|
155 |
-
);
|
156 |
-
$context = stream_context_create($options);
|
157 |
-
}else{
|
158 |
-
$context = NULL;
|
159 |
-
}
|
160 |
-
$JsonResponse = file_get_contents($ValidateUrl, false, $context);
|
161 |
-
if(strpos(@$http_response_header[0], "400") !== false || strpos(@$http_response_header[0], "401") !== false || strpos(@$http_response_header[0], "404") !== false || strpos(@$http_response_header[0], "500") !== false || strpos(@$http_response_header[0], "503") !== false){
|
162 |
-
return "service connection timeout";
|
163 |
-
}
|
164 |
-
}
|
165 |
-
//echo $JsonResponse; die;
|
166 |
-
return $JsonResponse;
|
167 |
-
}
|
168 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Loginradius/Sharing/Block/Help.php
CHANGED
@@ -1,24 +1,64 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
$html = $this->_getHeaderHtml($element);
|
5 |
-
$html.= $this->_getFieldHtml($element);
|
6 |
$html .= $this->_getFooterHtml($element);
|
|
|
7 |
return $html;
|
8 |
}
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
return $content;
|
23 |
}
|
24 |
}
|
1 |
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* Sharing socialsharing block
|
17 |
+
*
|
18 |
+
* @category Loginradius
|
19 |
+
* @package Loginradius_Sharing
|
20 |
+
* @author LoginRadius Team
|
21 |
+
*/
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Class Loginradius_Sharing_Block_Help which is responsible for generating help section on configuration page
|
25 |
+
*/
|
26 |
+
class Loginradius_Sharing_Block_Help extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
|
27 |
+
{
|
28 |
+
/**
|
29 |
+
* Function responsible for rendering this block
|
30 |
+
*
|
31 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
32 |
+
*
|
33 |
+
* @return string
|
34 |
+
*/
|
35 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
36 |
+
{
|
37 |
$html = $this->_getHeaderHtml($element);
|
38 |
+
$html .= $this->_getFieldHtml($element);
|
39 |
$html .= $this->_getFooterHtml($element);
|
40 |
+
|
41 |
return $html;
|
42 |
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Actual function for adding important links
|
46 |
+
*
|
47 |
+
* @param $element
|
48 |
+
*
|
49 |
+
* @return string
|
50 |
+
*/
|
51 |
+
protected function _getFieldHtml($element)
|
52 |
+
{
|
53 |
+
$content = '<tr>
|
54 |
+
<td><a target="_blank" href="http://ish.re/9WBZ">Extension Installation, Configuration and Troubleshooting</a></td>
|
55 |
+
<td><a target="_blank" href="http://ish.re/AEFD">How to get LoginRadius API Key</a></td></tr>
|
56 |
+
<tr><td><a target="_blank" href="http://ish.re/9WBZ">Magento Multisite Feature</a></td>
|
57 |
+
<td><a target="_blank" href="http://ish.re/5P2D">LoginRadius Products</a></td></tr>
|
58 |
+
<tr><td><a target="_blank" href="http://ish.re/HC0B">About LoginRadius</a></td>
|
59 |
+
<td><a target="_blank" href="http://ish.re/8PFR">Social Plugins</a></td></tr>
|
60 |
+
<tr><td><a target="_blank" href="http://ish.re/C9F7">Social SDKs</a></td></tr>';
|
61 |
+
|
62 |
return $content;
|
63 |
}
|
64 |
}
|
app/code/community/Loginradius/Sharing/Block/Horizontalsharing.php
CHANGED
@@ -1,17 +1,59 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
$content = "";
|
9 |
-
|
10 |
$content = "<div class='loginRadiusHorizontalSharing'></div>";
|
11 |
-
|
|
|
12 |
return $content;
|
13 |
}
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
parent::_prepareLayout();
|
16 |
}
|
17 |
}
|
1 |
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* Sharing horizontalsharing block
|
17 |
+
*
|
18 |
+
* @category Loginradius
|
19 |
+
* @package Loginradius_Sharing
|
20 |
+
* @author LoginRadius Team
|
21 |
+
*/
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Class Loginradius_Sharing_Block_Horizontalsharing which is responsible for horizontal social sharing interface generation.
|
25 |
+
*/
|
26 |
+
class Loginradius_Sharing_Block_Horizontalsharing extends Mage_Core_Block_Template implements Mage_Widget_Block_Interface
|
27 |
+
{
|
28 |
+
private $_loginRadiusHorizontalSharing;
|
29 |
+
|
30 |
+
public function __construct()
|
31 |
+
{
|
32 |
+
$this->_loginRadiusHorizontalSharing = new Loginradius_Sharing_Block_Sharing();
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Used to get horizontal social sharing container
|
37 |
+
*
|
38 |
+
* @return string
|
39 |
+
*/
|
40 |
+
protected function _toHtml()
|
41 |
+
{
|
42 |
$content = "";
|
43 |
+
if ($this->_loginRadiusHorizontalSharing->horizontalShareEnable() == "1") {
|
44 |
$content = "<div class='loginRadiusHorizontalSharing'></div>";
|
45 |
+
}
|
46 |
+
|
47 |
return $content;
|
48 |
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Override _prepareLayout method
|
52 |
+
*
|
53 |
+
* @return Mage_Core_Block_Abstract|void
|
54 |
+
*/
|
55 |
+
protected function _prepareLayout()
|
56 |
+
{
|
57 |
parent::_prepareLayout();
|
58 |
}
|
59 |
}
|
app/code/community/Loginradius/Sharing/Block/Sharing.php
ADDED
@@ -0,0 +1,328 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* Sharing socialsharing block
|
17 |
+
*
|
18 |
+
* @category Loginradius
|
19 |
+
* @package Loginradius_Sharing
|
20 |
+
* @author LoginRadius Team
|
21 |
+
*/
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Class Loginradius_Sharing_Block_Socialsharing which is responsible for generating social sharing script according to configuration!
|
25 |
+
*/
|
26 |
+
class Loginradius_Sharing_Block_Sharing extends Mage_Core_Block_Template
|
27 |
+
{
|
28 |
+
/**
|
29 |
+
* Calling constructor for parent class
|
30 |
+
*/
|
31 |
+
public function _construct()
|
32 |
+
{
|
33 |
+
parent::_construct();
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* @return LoginRadius API Key
|
38 |
+
*/
|
39 |
+
public function getApikey()
|
40 |
+
{
|
41 |
+
return Mage::getStoreConfig('sharing_options/messages/appid');
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Get title for social sharing container!
|
46 |
+
*
|
47 |
+
* @return string
|
48 |
+
*/
|
49 |
+
public function sharingTitle()
|
50 |
+
{
|
51 |
+
return Mage::getStoreConfig('sharing_options/horizontalSharing/sharingTitle');
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* @return mixed 1/0 according to option enabled or disabled
|
56 |
+
*/
|
57 |
+
public function horizontalShareEnable()
|
58 |
+
{
|
59 |
+
return Mage::getStoreConfig('sharing_options/horizontalSharing/horizontalShareEnable');
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* @return mixed 1/0 according to option enabled or disabled
|
64 |
+
*/
|
65 |
+
public function verticalShareEnable()
|
66 |
+
{
|
67 |
+
return Mage::getStoreConfig('sharing_options/verticalSharing/verticalShareEnable');
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Check if horizontal sharing is enabled on products page or not
|
72 |
+
*
|
73 |
+
* @return mixed 1/0
|
74 |
+
*/
|
75 |
+
public function horizontalShareProduct()
|
76 |
+
{
|
77 |
+
return Mage::getStoreConfig('sharing_options/horizontalSharing/horizontalShareProduct');
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Check if vertical sharing is enabled on products page or not
|
82 |
+
*
|
83 |
+
* @return mixed 1/0
|
84 |
+
*/
|
85 |
+
public function verticalShareProduct()
|
86 |
+
{
|
87 |
+
return Mage::getStoreConfig('sharing_options/verticalSharing/verticalShareProduct');
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Check if horizontal sharing is enabled on checkout success page or not
|
92 |
+
*
|
93 |
+
* @return mixed 1/0
|
94 |
+
*/
|
95 |
+
public function horizontalShareSuccess()
|
96 |
+
{
|
97 |
+
return Mage::getStoreConfig('sharing_options/horizontalSharing/horizontalShareSuccess');
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Check if vertical sharing is enabled on checkout success page or not
|
102 |
+
*
|
103 |
+
* @return mixed 1/0
|
104 |
+
*/
|
105 |
+
public function verticalShareSuccess()
|
106 |
+
{
|
107 |
+
return Mage::getStoreConfig('sharing_options/verticalSharing/verticalShareSuccess');
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* function returns script required for vertical sharing.
|
112 |
+
*/
|
113 |
+
public function getVerticalSharingScript($loginRadiusSettings, $apiKey)
|
114 |
+
{
|
115 |
+
$size = '';
|
116 |
+
$sharingScript = '';
|
117 |
+
$type = '';
|
118 |
+
$verticalThemvalue = isset($loginRadiusSettings['verticalSharingTheme']) ? $loginRadiusSettings['verticalSharingTheme'] : '';
|
119 |
+
|
120 |
+
switch ($verticalThemvalue) {
|
121 |
+
case '32':
|
122 |
+
$size = '32';
|
123 |
+
$interface = 'Simplefloat';
|
124 |
+
$sharingVariable = 'i';
|
125 |
+
break;
|
126 |
+
|
127 |
+
case '16':
|
128 |
+
$size = '16';
|
129 |
+
$interface = 'Simplefloat';
|
130 |
+
$sharingVariable = 'i';
|
131 |
+
break;
|
132 |
+
|
133 |
+
case 'counter_vertical':
|
134 |
+
$sharingVariable = 'S';
|
135 |
+
$ishorizontal = 'false';
|
136 |
+
$interface = 'simple';
|
137 |
+
$type = 'vertical';
|
138 |
+
break;
|
139 |
+
|
140 |
+
case 'counter_horizontal':
|
141 |
+
$sharingVariable = 'S';
|
142 |
+
$ishorizontal = 'false';
|
143 |
+
$interface = 'simple';
|
144 |
+
$type = 'horizontal';
|
145 |
+
break;
|
146 |
+
|
147 |
+
default:
|
148 |
+
$size = '32';
|
149 |
+
$interface = 'Simplefloat';
|
150 |
+
$sharingVariable = 'i';
|
151 |
+
}
|
152 |
+
|
153 |
+
$verticalPosition = isset($loginRadiusSettings['verticalAlignment']) ? $loginRadiusSettings['verticalAlignment'] : '';
|
154 |
+
switch ($verticalPosition) {
|
155 |
+
case "top_left":
|
156 |
+
$position1 = 'top';
|
157 |
+
$position2 = 'left';
|
158 |
+
break;
|
159 |
+
|
160 |
+
case "top_right":
|
161 |
+
$position1 = 'top';
|
162 |
+
$position2 = 'right';
|
163 |
+
break;
|
164 |
+
|
165 |
+
case "bottom_left":
|
166 |
+
$position1 = 'bottom';
|
167 |
+
$position2 = 'left';
|
168 |
+
break;
|
169 |
+
|
170 |
+
case "bottom_right":
|
171 |
+
$position1 = 'bottom';
|
172 |
+
$position2 = 'right';
|
173 |
+
break;
|
174 |
+
|
175 |
+
default:
|
176 |
+
$position1 = 'top';
|
177 |
+
$position2 = 'left';
|
178 |
+
}
|
179 |
+
|
180 |
+
$offset = '$' . $sharingVariable . '.' . $position1 . ' = \'0px\'; $' . $sharingVariable . '.' . $position2 . ' = \'0px\';';
|
181 |
+
|
182 |
+
if (isset($size) && empty($size)) {
|
183 |
+
$providers = $this->getCounterProviders('vertical', $loginRadiusSettings);
|
184 |
+
$sharingScript .= 'LoginRadius.util.ready( function() { $SC.Providers.Selected = ["' . $providers . '"]; $S = $SC.Interface.' . $interface . '; $S.isHorizontal = ' . $ishorizontal . '; $S.countertype = \'' . $type . '\'; ' . $offset . ' $u = LoginRadius.user_settings; if(typeof document.getElementsByName("viewport")[0] != "undefined"){$u.isMobileFriendly=true;}; $S.show( "loginRadiusVerticalSharing" ); } );';
|
185 |
+
} else {
|
186 |
+
$providers = self:: getSharingProviders('vertical', $loginRadiusSettings);
|
187 |
+
// prepare sharing script
|
188 |
+
$sharingScript .= 'LoginRadius.util.ready( function() { $i = $SS.Interface.' . $interface . '; $SS.Providers.Top = ["' . $providers . '"]; $u = LoginRadius.user_settings;';
|
189 |
+
if (isset($apiKey) && !empty($apiKey)) {
|
190 |
+
$sharingScript .= '$u.apikey= \'' . trim($apiKey) . '\';';
|
191 |
+
}
|
192 |
+
$sharingScript .= '$i.size = ' . $size . '; ' . $offset . ' if(typeof document.getElementsByName("viewport")[0] != "undefined"){$u.isMobileFriendly=true;}; $i.show( "loginRadiusVerticalSharing" ); } );';
|
193 |
+
}
|
194 |
+
|
195 |
+
return $sharingScript;
|
196 |
+
}
|
197 |
+
|
198 |
+
/**
|
199 |
+
* function returns comma separated counters lists
|
200 |
+
*/
|
201 |
+
public function getCounterProviders($themeType, $loginRadiusSettings)
|
202 |
+
{
|
203 |
+
$searchOption = $themeType . 'CounterProvidersHidden';
|
204 |
+
if (!empty($loginRadiusSettings[$searchOption])) {
|
205 |
+
return str_replace(',', '","', $loginRadiusSettings[$searchOption]);
|
206 |
+
} else {
|
207 |
+
return 'Facebook Like","Google+ +1","Pinterest Pin it","LinkedIn Share","Hybridshare';
|
208 |
+
}
|
209 |
+
}
|
210 |
+
|
211 |
+
/**
|
212 |
+
* function returns comma seperated sharing providers lists
|
213 |
+
*
|
214 |
+
* global $loginRadiusSettings;
|
215 |
+
*/
|
216 |
+
public static function getSharingProviders($themeType, $loginRadiusSettings)
|
217 |
+
{
|
218 |
+
$searchOption = $themeType . 'SharingProvidersHidden';
|
219 |
+
if (!empty($loginRadiusSettings[$searchOption])) {
|
220 |
+
return str_replace(',', '","', $loginRadiusSettings[$searchOption]);
|
221 |
+
} else {
|
222 |
+
return 'Facebook","Twitter","Pinterest","Print","Email';
|
223 |
+
}
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Override _prepareLayout method
|
228 |
+
*
|
229 |
+
* @return Mage_Core_Block_Abstract|void
|
230 |
+
*/
|
231 |
+
public function _prepareLayout()
|
232 |
+
{
|
233 |
+
return parent::_prepareLayout();
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Get all horizontal sharing configuration options
|
238 |
+
*
|
239 |
+
* @return mixed
|
240 |
+
*/
|
241 |
+
public function getHorizontalSharingSettings()
|
242 |
+
{
|
243 |
+
return Mage::getStoreConfig('sharing_options/horizontalSharing');
|
244 |
+
}
|
245 |
+
|
246 |
+
/**
|
247 |
+
* Get all vertical sharing configuration options
|
248 |
+
*
|
249 |
+
* @return mixed
|
250 |
+
*/
|
251 |
+
public function getVerticalSharingSettings()
|
252 |
+
{
|
253 |
+
return Mage::getStoreConfig('sharing_options/verticalSharing');
|
254 |
+
}
|
255 |
+
|
256 |
+
/**
|
257 |
+
* function returns script required for horizontal sharing.
|
258 |
+
*/
|
259 |
+
public function getHorizontalSharingScript($loginRadiusSettings, $apikey)
|
260 |
+
{
|
261 |
+
$size = '';
|
262 |
+
$sharingScript = '';
|
263 |
+
$countertype = '';
|
264 |
+
$horizontalThemvalue = isset($loginRadiusSettings['horizontalSharingTheme']) ? $loginRadiusSettings['horizontalSharingTheme'] : '';
|
265 |
+
|
266 |
+
switch ($horizontalThemvalue) {
|
267 |
+
case '32':
|
268 |
+
$size = '32';
|
269 |
+
$interface = 'horizontal';
|
270 |
+
break;
|
271 |
+
|
272 |
+
case '16':
|
273 |
+
$size = '16';
|
274 |
+
$interface = 'horizontal';
|
275 |
+
break;
|
276 |
+
|
277 |
+
case 'single_large':
|
278 |
+
$size = '32';
|
279 |
+
$interface = 'simpleimage';
|
280 |
+
break;
|
281 |
+
|
282 |
+
case 'single_small':
|
283 |
+
$size = '16';
|
284 |
+
$interface = 'simpleimage';
|
285 |
+
break;
|
286 |
+
|
287 |
+
case 'responsive':
|
288 |
+
$size = '32';
|
289 |
+
$interface = 'responsive';
|
290 |
+
break;
|
291 |
+
|
292 |
+
case 'counter_vertical':
|
293 |
+
$ishorizontal = 'true';
|
294 |
+
$interface = 'simple';
|
295 |
+
$countertype = 'vertical';
|
296 |
+
break;
|
297 |
+
|
298 |
+
case 'counter_horizontal':
|
299 |
+
$ishorizontal = 'true';
|
300 |
+
$interface = 'simple';
|
301 |
+
$countertype = 'horizontal';
|
302 |
+
break;
|
303 |
+
|
304 |
+
default:
|
305 |
+
$size = '32';
|
306 |
+
$interface = 'horizontal';
|
307 |
+
}
|
308 |
+
if (isset($ishorizontal) && !empty($ishorizontal)) {
|
309 |
+
$providers = $this->getCounterProviders('horizontal', $loginRadiusSettings);
|
310 |
+
|
311 |
+
// prepare counter script
|
312 |
+
$sharingScript .= 'LoginRadius.util.ready( function() { $SC.Providers.Selected = ["' . $providers . '"]; $S = $SC.Interface.' . $interface . '; $S.isHorizontal = ' . $ishorizontal . '; $S.countertype = \'' . $countertype . '\'; $u = LoginRadius.user_settings; if(typeof document.getElementsByName("viewport")[0] != "undefined"){$u.isMobileFriendly=true;}; $S.show( "loginRadiusHorizontalSharing" ); } );';
|
313 |
+
} else {
|
314 |
+
$providers = $this->getSharingProviders('horizontal', $loginRadiusSettings);
|
315 |
+
|
316 |
+
// prepare sharing script
|
317 |
+
$sharingScript .= 'LoginRadius.util.ready( function() { $i = $SS.Interface.' . $interface . '; $SS.Providers.Top = ["' . $providers . '"]; $u = LoginRadius.user_settings;';
|
318 |
+
if (isset($apikey) && !empty($apikey)) {
|
319 |
+
$sharingScript .= '$u.apikey= \'' . trim($apikey) . '\';';
|
320 |
+
}
|
321 |
+
$sharingScript .= '$i.size = ' . $size . '; $u.sharecounttype="url"; if(typeof document.getElementsByName("viewport")[0] != "undefined"){$u.isMobileFriendly=true;}; $i.show( "loginRadiusHorizontalSharing" ); } );';
|
322 |
+
}
|
323 |
+
|
324 |
+
return $sharingScript;
|
325 |
+
}
|
326 |
+
|
327 |
+
|
328 |
+
}
|
app/code/community/Loginradius/Sharing/Block/Verticalsharing.php
CHANGED
@@ -1,17 +1,59 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
$content = "";
|
9 |
-
|
10 |
$content = "<div class='loginRadiusVerticalSharing'></div>";
|
11 |
-
|
|
|
12 |
return $content;
|
13 |
}
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
parent::_prepareLayout();
|
16 |
}
|
17 |
}
|
1 |
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* Sharing verticalsharing block
|
17 |
+
*
|
18 |
+
* @category Loginradius
|
19 |
+
* @package Loginradius_Sharing
|
20 |
+
* @author LoginRadius Team
|
21 |
+
*/
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Class Loginradius_Sharing_Block_Verticalalsharing which is responsible for vertical social sharing interface generation.
|
25 |
+
*/
|
26 |
+
class Loginradius_Sharing_Block_Verticalsharing extends Mage_Core_Block_Template implements Mage_Widget_Block_Interface
|
27 |
+
{
|
28 |
+
private $loginRadiusVerticalSharing;
|
29 |
+
|
30 |
+
public function __construct()
|
31 |
+
{
|
32 |
+
$this->loginRadiusVerticalSharing = new Loginradius_Sharing_Block_Sharing();
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Used to get vertical social sharing container
|
37 |
+
*
|
38 |
+
* @return string
|
39 |
+
*/
|
40 |
+
protected function _toHtml()
|
41 |
+
{
|
42 |
$content = "";
|
43 |
+
if ($this->loginRadiusVerticalSharing->verticalShareEnable() == "1") {
|
44 |
$content = "<div class='loginRadiusVerticalSharing'></div>";
|
45 |
+
}
|
46 |
+
|
47 |
return $content;
|
48 |
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Override _prepareLayout method
|
52 |
+
*
|
53 |
+
* @return Mage_Core_Block_Abstract|void
|
54 |
+
*/
|
55 |
+
protected function _prepareLayout()
|
56 |
+
{
|
57 |
parent::_prepareLayout();
|
58 |
}
|
59 |
}
|
app/code/community/Loginradius/Sharing/Helper/Data.php
CHANGED
@@ -1,14 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
class Loginradius_Sharing_Helper_Data extends Mage_Core_Helper_Abstract {
|
3 |
-
|
4 |
-
* Returns whether the Enabled config variable is set to true
|
5 |
-
*
|
6 |
-
* @return bool
|
7 |
-
*/
|
8 |
-
public function isSharingEnabled() {
|
9 |
-
if (Mage::getStoreConfig('sharing_options/messages/enabled') == '1'){
|
10 |
-
return true;
|
11 |
-
}
|
12 |
-
return false;
|
13 |
-
}
|
14 |
}
|
1 |
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* Sharing data helper
|
17 |
+
*
|
18 |
+
* @category Loginradius
|
19 |
+
* @package Loginradius_Sharing
|
20 |
+
* @author LoginRadius Team
|
21 |
+
*/
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Class Loginradius_Sharing_Helper_Data which is default helper for loginradius module and it is required.
|
25 |
+
*/
|
26 |
class Loginradius_Sharing_Helper_Data extends Mage_Core_Helper_Abstract {
|
27 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|
app/code/community/Loginradius/Sharing/Model/Observer.php
ADDED
@@ -0,0 +1,190 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* Sharing observer model
|
17 |
+
*
|
18 |
+
* @category Loginradius
|
19 |
+
* @package Loginradius_Sharing
|
20 |
+
* @author LoginRadius Team
|
21 |
+
*/
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Class Loginradius_Sharing_Model_Observer responsible for LoginRadius api keys verification!
|
25 |
+
*/
|
26 |
+
class Loginradius_Sharing_Model_Observer extends Mage_Core_Helper_Abstract
|
27 |
+
{
|
28 |
+
/**
|
29 |
+
* @throws Exception while api keys are not valid!
|
30 |
+
*/
|
31 |
+
public function validateLoginradiusKeys()
|
32 |
+
{
|
33 |
+
|
34 |
+
$post = Mage::app()->getRequest()->getPost();
|
35 |
+
if (isset($post['config_state']['sharing_options_messages'])) {
|
36 |
+
$apiKey = $post['groups']['messages']['fields']['appid']['value'];
|
37 |
+
$data = array('addon' => 'Magento', 'version' => '2.0.0', 'agentstring' => $_SERVER["HTTP_USER_AGENT"], 'clientip' => $_SERVER["REMOTE_ADDR"], 'configuration' => 'Validating API Key');
|
38 |
+
if (!empty($apiKey)) {
|
39 |
+
$validateUrl = 'https://api.loginradius.com/api/v2/app/validatekey?apikey=' . rawurlencode($apiKey);
|
40 |
+
$response = json_decode($this->accessLoginradiusApi($validateUrl, $data, true));
|
41 |
+
$result['status'] = isset($response->Status) ? $response->Status : false;
|
42 |
+
$result['message'] = isset($response->Messages[0]) ? $response->Messages[0] : 'an error occurred';
|
43 |
+
|
44 |
+
if (isset($result['status']) && $result['status']) {
|
45 |
+
$result['message'] = '';
|
46 |
+
$result['status'] = 'Success';
|
47 |
+
} else {
|
48 |
+
if ($result['message'] == 'API_KEY_NOT_FORMATED') {
|
49 |
+
$result['message'] = 'LoginRadius API key is not correct.';
|
50 |
+
} elseif ($result['message'] == 'API_SECRET_NOT_FORMATED') {
|
51 |
+
$result['message'] = 'LoginRadius API Secret key is not correct.';
|
52 |
+
} elseif ($result['message'] == 'API_KEY_NOT_VALID') {
|
53 |
+
$result['message'] = 'LoginRadius API key is not valid.';
|
54 |
+
} elseif ($result['message'] == 'API_SECRET_NOT_VALID') {
|
55 |
+
$result['message'] = 'LoginRadius API Secret key is not valid.';
|
56 |
+
} else {
|
57 |
+
$result['message'] = 'Some error occurred, please try again later';
|
58 |
+
}
|
59 |
+
}
|
60 |
+
if ($result['status'] != 'Success') {
|
61 |
+
throw new Exception($result['message']);
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Function for caalling appropriate method ex. curl, fsockopen or magento default varien to call LoginRadius api.
|
69 |
+
*
|
70 |
+
* @param $url
|
71 |
+
* @param array $data
|
72 |
+
* @param bool $isPost
|
73 |
+
*
|
74 |
+
* @return mixed|string
|
75 |
+
*/
|
76 |
+
public function accessLoginradiusApi($url, $data = array(), $isPost = false)
|
77 |
+
{
|
78 |
+
|
79 |
+
if ($this->isCurlEnabled()) {
|
80 |
+
$JsonResponse = $this->curlApiMethod($url, $data, $isPost);
|
81 |
+
} else {
|
82 |
+
$JsonResponse = $this->fsockopenApiMethod($url, $data, $isPost);
|
83 |
+
}
|
84 |
+
$result = json_decode($JsonResponse);
|
85 |
+
if (is_object($result) && isset($result->customError)) {
|
86 |
+
$method = 'GET';
|
87 |
+
|
88 |
+
$client = new Varien_Http_Client($url);
|
89 |
+
$response = $client->request($method);
|
90 |
+
$Response = $response->getBody();
|
91 |
+
|
92 |
+
return $Response;
|
93 |
+
|
94 |
+
}
|
95 |
+
|
96 |
+
return $JsonResponse;
|
97 |
+
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Check if curl is enabled or not!
|
102 |
+
*
|
103 |
+
* @return bool
|
104 |
+
*/
|
105 |
+
public function isCurlEnabled()
|
106 |
+
{
|
107 |
+
return function_exists('curl_version') ? '1' : '0';
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Function for calling LoginRadius Api using curl method
|
112 |
+
*
|
113 |
+
* @param $url
|
114 |
+
* @param $data
|
115 |
+
* @param bool $post
|
116 |
+
*
|
117 |
+
* @return mixed|string
|
118 |
+
*/
|
119 |
+
public function curlApiMethod($url, $data = array(), $post = false)
|
120 |
+
{
|
121 |
+
$curl_handle = curl_init();
|
122 |
+
curl_setopt($curl_handle, CURLOPT_URL, $url);
|
123 |
+
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 10);
|
124 |
+
curl_setopt($curl_handle, CURLOPT_TIMEOUT, 20);
|
125 |
+
curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);
|
126 |
+
if ($post) {
|
127 |
+
curl_setopt($curl_handle, CURLOPT_POST, 1);
|
128 |
+
curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
|
129 |
+
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, http_build_query($data));
|
130 |
+
}
|
131 |
+
if (ini_get('open_basedir') == '' && (ini_get('safe_mode') == 'Off' or !ini_get('safe_mode'))) {
|
132 |
+
curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, 1);
|
133 |
+
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
|
134 |
+
} else {
|
135 |
+
curl_setopt($curl_handle, CURLOPT_HEADER, 1);
|
136 |
+
$url = curl_getinfo($curl_handle, CURLINFO_EFFECTIVE_URL);
|
137 |
+
curl_close($curl_handle);
|
138 |
+
$curl_handle = curl_init();
|
139 |
+
$url = str_replace('?', '/?', $url);
|
140 |
+
curl_setopt($curl_handle, CURLOPT_URL, $url);
|
141 |
+
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
|
142 |
+
}
|
143 |
+
$JsonResponse = curl_exec($curl_handle);
|
144 |
+
$httpCode = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE);
|
145 |
+
if (in_array($httpCode, array(400, 401, 403, 404, 500, 503))) {
|
146 |
+
$JsonResponse = json_encode(array("customError" => true, "Messages" => "Error in using curl connection ,Service connection error occurred"));
|
147 |
+
} else {
|
148 |
+
if (curl_errno($curl_handle) == 28) {
|
149 |
+
$JsonResponse = json_encode(array("customError" => true, "Messages" => "Connection timeout"));
|
150 |
+
}
|
151 |
+
}
|
152 |
+
curl_close($curl_handle);
|
153 |
+
|
154 |
+
return $JsonResponse;
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Function for calling LoginRadius Api using fsockopen method
|
159 |
+
*
|
160 |
+
* @param $ValidateUrl
|
161 |
+
* @param $data
|
162 |
+
* @param bool $post
|
163 |
+
*
|
164 |
+
* @return string
|
165 |
+
*/
|
166 |
+
public function fsockopenApiMethod($ValidateUrl, $data, $post = false)
|
167 |
+
{
|
168 |
+
if (!empty($data)) {
|
169 |
+
$options = array('http' => array('method' => 'POST', 'timeout' => 15, 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $data));
|
170 |
+
$context = stream_context_create($options);
|
171 |
+
} else {
|
172 |
+
$context = null;
|
173 |
+
}
|
174 |
+
$jsonResponse = @file_get_contents($ValidateUrl, false, $context);
|
175 |
+
if (strpos(@$http_response_header[0], "400") !== false
|
176 |
+
|| strpos(@$http_response_header[0], "401") !== false
|
177 |
+
|| strpos(@$http_response_header[0], "403") !== false
|
178 |
+
|| strpos(@$http_response_header[0], "404") !== false
|
179 |
+
|| strpos(@$http_response_header[0], "500") !== false
|
180 |
+
|| strpos(@$http_response_header[0], "503") !== false
|
181 |
+
) {
|
182 |
+
$jsonResponse = json_encode(array("customError" => true, "Messages" => "Error in using FSOCKOPEN connection method, Service connection timeout occurred"));
|
183 |
+
}
|
184 |
+
if (!$jsonResponse) {
|
185 |
+
$jsonResponse = json_encode(array("customError" => true, "Messages" => "FSOCKOPEN not working"));
|
186 |
+
}
|
187 |
+
|
188 |
+
return $jsonResponse;
|
189 |
+
}
|
190 |
+
}
|
app/code/community/Loginradius/Sharing/Model/Sharing.php
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Loginradius_Sharing_Model_Sociallogin extends Mage_Core_Model_Abstract
|
3 |
-
{
|
4 |
-
public function _construct()
|
5 |
-
{
|
6 |
-
parent::_construct();
|
7 |
-
$this->_init('sharing/sharing');
|
8 |
-
}
|
9 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Loginradius/Sharing/Model/Source/HorizontalSharing.php
CHANGED
@@ -1,15 +1,46 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
public function toOptionArray()
|
5 |
{
|
6 |
-
|
7 |
-
$result[] = array('value' => '32', 'label'=>'<img
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
1 |
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* Sharing horizontalsharing source model
|
17 |
+
*
|
18 |
+
* @category Loginradius
|
19 |
+
* @package Loginradius_Sharing
|
20 |
+
* @author LoginRadius Team
|
21 |
+
*/
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Class Loginradius_Sharing_Model_Source_HorizontalSharing which return horizontal sharing theme options
|
25 |
+
*/
|
26 |
+
class Loginradius_Sharing_Model_Source_HorizontalSharing
|
27 |
+
{
|
28 |
+
/**
|
29 |
+
* function return array of horizontal themes
|
30 |
+
*
|
31 |
+
* @return array
|
32 |
+
*/
|
33 |
public function toOptionArray()
|
34 |
{
|
35 |
+
$result = array();
|
36 |
+
$result[] = array('value' => '32', 'label' => '<img src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sharing/images/Sharing/Horizontal/horizonSharing32.png', array('_area' => 'adminhtml')) . '" /><div style="clear:both"></div>');
|
37 |
+
$result[] = array('value' => '16', 'label' => '<img src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sharing/images/Sharing/Horizontal/horizonSharing16.png', array('_area' => 'adminhtml')) . '" /><div style="clear:both"></div>');
|
38 |
+
$result[] = array('value' => 'responsive', 'label' => '<img src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sharing/images/Sharing/Horizontal/responsive-icons.png', array('_area' => 'adminhtml')) . '" /><div style="clear:both"></div>');
|
39 |
+
$result[] = array('value' => 'single_large', 'label' => '<img src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sharing/images/Sharing/Horizontal/single-image-theme-large.png', array('_area' => 'adminhtml')) . '" /><div style="clear:both"></div>');
|
40 |
+
$result[] = array('value' => 'single_small', 'label' => '<img src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sharing/images/Sharing/Horizontal/single-image-theme-small.png', array('_area' => 'adminhtml')) . '" /><div style="clear:both"></div>');
|
41 |
+
$result[] = array('value' => 'counter_vertical', 'label' => '<img src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sharing/images/Sharing/Horizontal/vertical.png', array('_area' => 'adminhtml')) . '" /><div style="clear:both"></div>');
|
42 |
+
$result[] = array('value' => 'counter_horizontal', 'label' => '<img style="width:375px;" src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sharing/images/Sharing/Horizontal/horizontal.png', array('_area' => 'adminhtml')) . '" /><div style="clear:both"></div>');
|
43 |
+
|
44 |
+
return $result;
|
45 |
+
}
|
46 |
+
}
|
app/code/community/Loginradius/Sharing/Model/Source/SharingCount.php
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Loginradius_Sharing_Model_Source_SharingCount
|
3 |
-
{
|
4 |
-
public function toOptionArray()
|
5 |
-
{
|
6 |
-
$result = array();
|
7 |
-
$result[] = array('value' => 'page', 'label'=>'Page Level <a style="text-decoration:none; margin-right:15px" href="javascript:void(0)" title="Number of times an individual page is shared" >(?)</a>');
|
8 |
-
$result[] = array('value' => 'website', 'label'=>'Website Level <a style="text-decoration:none" href="javascript:void(0)" title="Sum total of all pages. Number of times all the pages of website are shared" >(?)</a>');
|
9 |
-
return $result;
|
10 |
-
}
|
11 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Loginradius/Sharing/Model/Source/SharingVerticalAlignment.php
CHANGED
@@ -1,13 +1,38 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
public function toOptionArray()
|
5 |
{
|
6 |
-
|
7 |
-
$result[] = array('value' => 'top_left', 'label'=>'Top Left');
|
8 |
-
|
9 |
-
$result[] = array('value' => 'bottom_left', 'label'=>'Bottom Left');
|
10 |
-
$result[] = array('value' => 'bottom_right', 'label'=>'Bottom Right');
|
11 |
-
|
12 |
-
|
13 |
-
|
|
1 |
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* Sharing sharingverticalalignment source model
|
17 |
+
*
|
18 |
+
* @category Loginradius
|
19 |
+
* @package Loginradius_Sharing
|
20 |
+
* @author LoginRadius Team
|
21 |
+
*/
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Class Loginradius_Sharing_Model_Source_VerticalSharing which returns vertical alignment options
|
25 |
+
*/
|
26 |
+
class Loginradius_Sharing_Model_Source_SharingVerticalAlignment
|
27 |
+
{
|
28 |
public function toOptionArray()
|
29 |
{
|
30 |
+
$result = array();
|
31 |
+
$result[] = array('value' => 'top_left', 'label' => 'Top Left');
|
32 |
+
$result[] = array('value' => 'top_right', 'label' => 'Top Right');
|
33 |
+
$result[] = array('value' => 'bottom_left', 'label' => 'Bottom Left');
|
34 |
+
$result[] = array('value' => 'bottom_right', 'label' => 'Bottom Right');
|
35 |
+
|
36 |
+
return $result;
|
37 |
+
}
|
38 |
+
}
|
app/code/community/Loginradius/Sharing/Model/Source/VerticalSharing.php
CHANGED
@@ -1,13 +1,43 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
public function toOptionArray()
|
5 |
{
|
6 |
-
|
7 |
-
$result[] = array('value' => '32', 'label'=>'<img style="margin
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
1 |
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* Sharing verticalsharing source model
|
17 |
+
*
|
18 |
+
* @category Loginradius
|
19 |
+
* @package Loginradius_Sharing
|
20 |
+
* @author LoginRadius Team
|
21 |
+
*/
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Class Loginradius_Sharing_Model_Source_VerticalSharing which return vertical sharing theme options
|
25 |
+
*/
|
26 |
+
class Loginradius_Sharing_Model_Source_VerticalSharing
|
27 |
+
{
|
28 |
+
/**
|
29 |
+
* function return array of vertical themes
|
30 |
+
*
|
31 |
+
* @return array
|
32 |
+
*/
|
33 |
public function toOptionArray()
|
34 |
{
|
35 |
+
$result = array();
|
36 |
+
$result[] = array('value' => '32', 'label' => '<img style="margin:0 5px 0 4px" src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sharing/images/Sharing/Vertical/32VerticlewithBox.png', array('_area' => 'adminhtml')) . '" /><br />');
|
37 |
+
$result[] = array('value' => '16', 'label' => '<img style="margin:0 5px 0 4px" src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sharing/images/Sharing/Vertical/16VerticlewithBox.png', array('_area' => 'adminhtml')) . '" /><br />');
|
38 |
+
$result[] = array('value' => 'counter_vertical', 'label' => '<img style="margin:0" src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sharing/images/Sharing/Vertical/verticalvertical.png', array('_area' => 'adminhtml')) . '" /><br />');
|
39 |
+
$result[] = array('value' => 'counter_horizontal', 'label' => '<img style="margin:0" src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sharing/images/Sharing/Vertical/verticalhorizontal.png', array('_area' => 'adminhtml')) . '" /><br />');
|
40 |
+
|
41 |
+
return $result;
|
42 |
+
}
|
43 |
+
}
|
app/code/community/Loginradius/Sharing/Model/System/Config/Help.php
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Loginradius_Sharing_Model_System_Config_Help extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
|
3 |
-
{
|
4 |
-
/**
|
5 |
-
* Render fieldset html
|
6 |
-
*
|
7 |
-
* @param Varien_Data_Form_Element_Abstract $element
|
8 |
-
* @return string
|
9 |
-
*/
|
10 |
-
public function render(Varien_Data_Form_Element_Abstract $element){
|
11 |
-
$html = $element->getComment();
|
12 |
-
if(!$html){
|
13 |
-
$html = $element->getText();
|
14 |
-
}
|
15 |
-
?>
|
16 |
-
<!-- Help & Documentation -->
|
17 |
-
<fieldset class="loginRadiusHelpDiv" style="margin-right:13px; width:65%">
|
18 |
-
<h4 style="border-bottom:#d7d7d7 1px solid;"><strong>Help & Documentations</strong></h4>
|
19 |
-
<ul style="float:left; margin-right:43px">
|
20 |
-
<li><a target="_blank" href="http://support.loginradius.com/customer/portal/articles/1056696-magento-social-login-installation-configuration-and-troubleshooting">Extension Installation, Configuration and Troubleshooting</a></li>
|
21 |
-
<li><a target="_blank" href="http://support.loginradius.com/customer/portal/articles/677100-how-to-get-loginradius-api-key-and-secret">How to get LoginRadius API Key & Secret</a></li>
|
22 |
-
<li><a target="_blank" href="http://support.loginradius.com/customer/portal/articles/1056696-magento-social-login-installation-configuration-and-troubleshooting#multisite">Magento Multisite Feature</a></li>
|
23 |
-
<li><a target="_blank" href="http://www.loginradius.com/product/sociallogin">LoginRadius Products</a></li>
|
24 |
-
</ul>
|
25 |
-
<ul style="float:left; margin-right:43px">
|
26 |
-
<li><a target="_blank" href="http://community.loginradius.com/">Discussion Forum</a></li>
|
27 |
-
<li><a target="_blank" href="http://www.loginradius.com/loginradius/about">About LoginRadius</a></li>
|
28 |
-
<li><a target="_blank" href="http://www.loginradius.com/addons">Social Plugins</a></li>
|
29 |
-
<li><a target="_blank" href="http://www.loginradius.com/sdks/loginradiussdk">Social SDKs</a></li>
|
30 |
-
</ul>
|
31 |
-
</fieldset>
|
32 |
-
<?php
|
33 |
-
}
|
34 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Loginradius/Sharing/Model/System/Config/Info.php
CHANGED
@@ -1,32 +1,66 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
class Loginradius_Sharing_Model_System_Config_Info extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
|
3 |
{
|
4 |
-
|
5 |
* Render fieldset html
|
6 |
*
|
7 |
* @param Varien_Data_Form_Element_Abstract $element
|
|
|
8 |
* @return string
|
9 |
*/
|
10 |
-
public function render(Varien_Data_Form_Element_Abstract $element)
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
<a href="http://ish.re/ADDT" target="_blank">Wordpress</a>,
|
31 |
<a href="http://ish.re/8PE6" target="_blank">Joomla</a>,
|
32 |
<a href="http://ish.re/8PE9" target="_blank">Drupal</a>,
|
@@ -39,25 +73,36 @@ class Loginradius_Sharing_Model_System_Config_Info extends Mage_Adminhtml_Block_
|
|
39 |
<a href="http://ish.re/8PFS" target="_blank">DotNetNuke</a>,
|
40 |
<a href="http://ish.re/8PFT" target="_blank">SMF</a><?php echo $this->__('and') ?>
|
41 |
<a href="http://ish.re/8PFV" target="_blank">phpBB</a> !
|
42 |
-
|
43 |
-
|
44 |
<div style="margin-top:10px">
|
45 |
-
|
46 |
-
|
47 |
-
</a>
|
48 |
-
<a class="loginRadiusHow" target="_blank"
|
49 |
-
href="http://ish.re/ATM4">(<?php echo $this->__('How to set up an account?') ?>)</a>
|
50 |
</div>
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
<a target="_blank" href="https://www.facebook.com/loginradius"><img
|
62 |
src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'adminhtml/default/default/Loginradius/Sharing/images/media-pages/facebook.png'; ?>"></a>
|
63 |
<a target="_blank" href="https://twitter.com/LoginRadius"><img
|
@@ -69,54 +114,66 @@ class Loginradius_Sharing_Model_System_Config_Info extends Mage_Adminhtml_Block_
|
|
69 |
<a target="_blank" href="https://www.youtube.com/user/LoginRadius"> <img
|
70 |
src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'adminhtml/default/default/Loginradius/Sharing/images/media-pages/youtube.png'; ?>"></a>
|
71 |
</div>
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
}
|
122 |
}
|
1 |
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
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://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* Sharing system config info model
|
17 |
+
*
|
18 |
+
* @category Loginradius
|
19 |
+
* @package Loginradius_Sharing
|
20 |
+
* @author LoginRadius Team
|
21 |
+
*/
|
22 |
class Loginradius_Sharing_Model_System_Config_Info extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
|
23 |
{
|
24 |
+
/**
|
25 |
* Render fieldset html
|
26 |
*
|
27 |
* @param Varien_Data_Form_Element_Abstract $element
|
28 |
+
*
|
29 |
* @return string
|
30 |
*/
|
31 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
32 |
+
{
|
33 |
+
// Get LoginRadius Module Thanks message container..
|
34 |
+
$this->render_module_thanks_message_container();
|
35 |
+
|
36 |
+
// Get LoginRadius Module information container..
|
37 |
+
$this->render_module_info_container();
|
38 |
+
|
39 |
+
// Get LoginRadius Module Support Us container..
|
40 |
+
$this->render_module_admin_script_container();
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Get LoginRadius Module Thanks message container..
|
45 |
+
*/
|
46 |
+
public function render_module_thanks_message_container()
|
47 |
+
{
|
48 |
+
?>
|
49 |
+
<fieldset class="lr_admin_configuration_info_fieldsets lr_configuration_info_fieldsets_left" id="lr_thank_message_container">
|
50 |
+
<h4 class="lr_admin_fieldset_title"><strong><?php echo $this->__('Thank you for installing LoginRadius Extension!') ?></strong></h4>
|
51 |
+
|
52 |
+
<p>
|
53 |
+
<a href="https://www.loginradius.com/">LoginRadius</a> provides <a href="http://ish.re/9RZM" target="_blank"> Social Login</a>,
|
54 |
+
<a href="http://ish.re/9RZO" target="_blank">Social Share</a>,
|
55 |
+
<a href="http://ish.re/HNIA" target="_blank">Social Invite</a>,
|
56 |
+
<a href="http://ish.re/83Y8" target="_blank">User Social Profile Data</a>,
|
57 |
+
<a href="http://ish.re/9RZS" target="_blank">Single Sign-On</a>,
|
58 |
+
<a href="http://ish.re/AQ5L" target="_blank">Social Engagement Analytics</a>
|
59 |
+
as single Unified API.
|
60 |
+
</p>
|
61 |
+
|
62 |
+
<p>
|
63 |
+
<?php echo $this->__('We also offer Social Plugins for') ?>
|
64 |
<a href="http://ish.re/ADDT" target="_blank">Wordpress</a>,
|
65 |
<a href="http://ish.re/8PE6" target="_blank">Joomla</a>,
|
66 |
<a href="http://ish.re/8PE9" target="_blank">Drupal</a>,
|
73 |
<a href="http://ish.re/8PFS" target="_blank">DotNetNuke</a>,
|
74 |
<a href="http://ish.re/8PFT" target="_blank">SMF</a><?php echo $this->__('and') ?>
|
75 |
<a href="http://ish.re/8PFV" target="_blank">phpBB</a> !
|
76 |
+
</p>
|
77 |
+
</br>
|
78 |
<div style="margin-top:10px">
|
79 |
+
<input class="form-button" type="button" onclick="window.open('https://www.loginradius.com')" value="<?php echo $this->__('Set up LoginRadius account!') ?>"/>
|
80 |
+
<a class="loginRadiusHow" target="_blank" href="http://ish.re/ATM4">(<?php echo $this->__('How to set up an account?') ?>)</a>
|
|
|
|
|
|
|
81 |
</div>
|
82 |
+
</fieldset>
|
83 |
+
<?php
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Get LoginRadius Module information container..
|
88 |
+
*/
|
89 |
+
public function render_module_info_container()
|
90 |
+
{
|
91 |
+
?>
|
92 |
+
<fieldset class="lr_admin_configuration_info_fieldsets lr_configuration_info_fieldsets_right" id="lr_extension_info_container">
|
93 |
+
<h4 class="lr_admin_fieldset_title"><strong><?php echo $this->__('Extension Information!') ?></strong></h4>
|
94 |
+
|
95 |
+
<div style="margin:5px 0">
|
96 |
+
<strong>Version: </strong>2.0.0 <br/>
|
97 |
+
<strong>Author:</strong> LoginRadius<br/>
|
98 |
+
<strong>Website:</strong> <a href="https://www.loginradius.com" target="_blank">www.loginradius.com</a>
|
99 |
+
<br/>
|
100 |
+
<strong>Community:</strong> <a href="http://community.loginradius.com" target="_blank">community.loginradius.com</a>
|
101 |
+
<br/>
|
102 |
+
|
103 |
+
<div id="sociallogin_get_update" style="float:left;">To receive updates on new features, releases, etc. Please connect to one of our social media pages
|
104 |
+
</div>
|
105 |
+
<div id="lr_media_pages_container">
|
106 |
<a target="_blank" href="https://www.facebook.com/loginradius"><img
|
107 |
src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'adminhtml/default/default/Loginradius/Sharing/images/media-pages/facebook.png'; ?>"></a>
|
108 |
<a target="_blank" href="https://twitter.com/LoginRadius"><img
|
114 |
<a target="_blank" href="https://www.youtube.com/user/LoginRadius"> <img
|
115 |
src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'adminhtml/default/default/Loginradius/Sharing/images/media-pages/youtube.png'; ?>"></a>
|
116 |
</div>
|
117 |
+
</div>
|
118 |
+
</fieldset>
|
119 |
+
<?php
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Render script for extension admin configuration options
|
124 |
+
*/
|
125 |
+
public function render_module_admin_script_container()
|
126 |
+
{
|
127 |
+
?>
|
128 |
+
<script type="text/javascript">var islrsharing = true;
|
129 |
+
var islrsocialcounter = true;</script>
|
130 |
+
<script type="text/javascript" src="//share.loginradius.com/Content/js/LoginRadius.js" id="lrsharescript"></script>
|
131 |
+
<script type="text/javascript">
|
132 |
+
window.onload = function () {
|
133 |
+
var sharingType = ['horizontal', 'vertical'];
|
134 |
+
var sharingModes = ['Sharing', 'Counter'];
|
135 |
+
for (var i = 0; i < sharingType.length; i++) {
|
136 |
+
for (var j = 0; j < sharingModes.length; j++) {
|
137 |
+
if (sharingModes[j] == 'Counter') {
|
138 |
+
var providers = $SC.Providers.All;
|
139 |
+
} else {
|
140 |
+
var providers = $SS.Providers.More;
|
141 |
+
}
|
142 |
+
// populate sharing providers checkbox
|
143 |
+
loginRadiusCounterHtml = "<ul class='checkboxes'>";
|
144 |
+
// prepare HTML to be shown as Vertical Counter Providers
|
145 |
+
for (var ii = 0; ii < providers.length; ii++) {
|
146 |
+
loginRadiusCounterHtml += '<li><input type="checkbox" id="' + sharingType[i] + '_' + sharingModes[j] + '_' + providers[ii] + '" ';
|
147 |
+
loginRadiusCounterHtml += 'value="' + providers[ii] + '"> <label for="' + sharingType[i] + '_' + sharingModes[j] + '_' + providers[ii] + '">' + providers[ii] + '</label></li>';
|
148 |
+
}
|
149 |
+
loginRadiusCounterHtml += "</ul>";
|
150 |
+
var tds = document.getElementById('row_sharing_options_' + sharingType[i] + 'Sharing_' + sharingType[i] + sharingModes[j] + 'Providers').getElementsByTagName('td');
|
151 |
+
tds[1].innerHTML = loginRadiusCounterHtml;
|
152 |
+
}
|
153 |
+
document.getElementById('row_sharing_options_' + sharingType[i] + 'Sharing_' + sharingType[i] + 'CounterProvidersHidden').style.display = 'none';
|
154 |
+
}
|
155 |
+
loginRadiusSharingPrepareAdminUI();
|
156 |
+
}
|
157 |
+
// toggle sharing/counter providers according to the theme and sharing type
|
158 |
+
function loginRadiusToggleSharingProviders(element, sharingType) {
|
159 |
+
var sharingContainer = document.getElementById('row_sharing_options_' + sharingType + 'Sharing_' + sharingType + 'SharingProviders');
|
160 |
+
var countercontainer = document.getElementById('row_sharing_options_' + sharingType + 'Sharing_' + sharingType + 'CounterProviders');
|
161 |
+
var sharingContainerHidden = document.getElementById('row_sharing_options_' + sharingType + 'Sharing_' + sharingType + 'SharingProvidersHidden');
|
162 |
+
if (element.value == '32' || element.value == '16' || element.value == 'responsive') {
|
163 |
+
sharingContainer.style.display = 'table-row';
|
164 |
+
countercontainer.style.display = 'none';
|
165 |
+
sharingContainerHidden.style.display = 'table-row';
|
166 |
+
} else if (element.value == 'single_large' || element.value == 'single_small') {
|
167 |
+
sharingContainer.style.display = 'none';
|
168 |
+
countercontainer.style.display = 'none';
|
169 |
+
sharingContainerHidden.style.display = 'none';
|
170 |
+
} else {
|
171 |
+
sharingContainer.style.display = 'none';
|
172 |
+
countercontainer.style.display = 'table-row';
|
173 |
+
sharingContainerHidden.style.display = 'none';
|
174 |
+
}
|
175 |
+
}
|
176 |
+
</script>
|
177 |
+
<?php
|
178 |
}
|
179 |
}
|
app/code/community/Loginradius/Sharing/controllers/IndexController.php
DELETED
@@ -1,353 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
Mage::app('default');
|
3 |
-
function getMazeTable($tbl){
|
4 |
-
$tableName = Mage::getSingleton('core/resource')->getTableName($tbl);
|
5 |
-
return($tableName);
|
6 |
-
}
|
7 |
-
//customer will be re-directed to this file. this file handle all token, email etc things.
|
8 |
-
class Loginradius_Sharing_IndexController extends Mage_Core_Controller_Front_Action
|
9 |
-
{
|
10 |
-
/**
|
11 |
-
* call LR api to login/register user.
|
12 |
-
*/
|
13 |
-
public function indexAction(){
|
14 |
-
if(!isset($_POST['UserName']) || !isset($_POST['password'])){
|
15 |
-
header('Location:'.Mage::getBaseUrl());
|
16 |
-
die;
|
17 |
-
}
|
18 |
-
$loginRadiusObject = new Loginradius_Sharing_Block_Getconfig();
|
19 |
-
$method = "";
|
20 |
-
// api connection handler detection
|
21 |
-
if(in_array('curl', get_loaded_extensions())){
|
22 |
-
$response = $loginRadiusObject->login_radius_check_connection($method = "curl");
|
23 |
-
if($response == "service connection timeout" || $response == "timeout"){
|
24 |
-
die(
|
25 |
-
json_encode(
|
26 |
-
array(
|
27 |
-
'status' => 0,
|
28 |
-
'message' => 'Uh oh, looks like something went wrong. Try again in a sec!'
|
29 |
-
)
|
30 |
-
)
|
31 |
-
);
|
32 |
-
}elseif($response == "connection error"){
|
33 |
-
die(
|
34 |
-
json_encode(
|
35 |
-
array(
|
36 |
-
'status' => 0,
|
37 |
-
'message' => 'Problem in communicating LoginRadius API. Please check if one of the API Connection method mentioned above is working.'
|
38 |
-
)
|
39 |
-
)
|
40 |
-
);
|
41 |
-
}
|
42 |
-
}elseif(ini_get('allow_url_fopen') == 1){
|
43 |
-
$response = $loginRadiusObject->login_radius_check_connection($method = "fopen");
|
44 |
-
if($response == "service connection timeout" || $response == "timeout"){
|
45 |
-
die(
|
46 |
-
json_encode(
|
47 |
-
array(
|
48 |
-
'status' => 0,
|
49 |
-
'message' => 'Uh oh, looks like something went wrong. Try again in a sec!'
|
50 |
-
)
|
51 |
-
)
|
52 |
-
);
|
53 |
-
}elseif($response == "connection error"){
|
54 |
-
die(
|
55 |
-
json_encode(
|
56 |
-
array(
|
57 |
-
'status' => 0,
|
58 |
-
'message' => 'Problem in communicating LoginRadius API. Please check if one of the API Connection method mentioned above is working.'
|
59 |
-
)
|
60 |
-
)
|
61 |
-
);
|
62 |
-
}
|
63 |
-
}else{
|
64 |
-
die(
|
65 |
-
json_encode(
|
66 |
-
array(
|
67 |
-
'status' => 0,
|
68 |
-
'message' => 'Please check your php.ini settings to enable CURL or FSOCKOPEN'
|
69 |
-
)
|
70 |
-
)
|
71 |
-
);
|
72 |
-
}
|
73 |
-
// if any value posted is blank, halt
|
74 |
-
foreach($_POST as $value){
|
75 |
-
if(trim($value) == ""){
|
76 |
-
die(
|
77 |
-
json_encode(
|
78 |
-
array(
|
79 |
-
'status' => 0,
|
80 |
-
'message' => 'Unexpected error occurred'
|
81 |
-
)
|
82 |
-
)
|
83 |
-
);
|
84 |
-
}
|
85 |
-
}
|
86 |
-
if(isset($_POST['lrsite'])){
|
87 |
-
$append = 'create';
|
88 |
-
}else{
|
89 |
-
$append = 'login';
|
90 |
-
}
|
91 |
-
$queryString = array(
|
92 |
-
'UserName' => trim($_POST["UserName"]),
|
93 |
-
'password' => trim($_POST["password"]),
|
94 |
-
'ip' => $_SERVER["REMOTE_ADDR"],
|
95 |
-
'Url' => Mage::getBaseUrl (Mage_Core_Model_Store::URL_TYPE_WEB),
|
96 |
-
'Useragent' => $_SERVER["HTTP_USER_AGENT"],
|
97 |
-
'Technology' => 'Magento'
|
98 |
-
);
|
99 |
-
// append LR site name
|
100 |
-
if(isset($_POST['lrsite'])){
|
101 |
-
$queryString['AppName'] = trim($_POST['lrsite']);
|
102 |
-
}
|
103 |
-
$apiEndpoint = 'https://www.loginradius.com/api/v1/user.'.$append.'?'.http_build_query($queryString);
|
104 |
-
// call LR api function
|
105 |
-
$result = $loginRadiusObject -> login_radius_lr_login($apiEndpoint, $method);
|
106 |
-
if(isset($result -> errorCode)){
|
107 |
-
// error in login/registration
|
108 |
-
die(
|
109 |
-
json_encode(
|
110 |
-
array(
|
111 |
-
'status' => 0,
|
112 |
-
'message' => $result -> message
|
113 |
-
)
|
114 |
-
)
|
115 |
-
);
|
116 |
-
}else{
|
117 |
-
// if new user created at LR
|
118 |
-
if(isset($_POST['lrsite'])){
|
119 |
-
// send post registration emails
|
120 |
-
$this -> login_radius_send_registration_emails(trim($_POST["UserName"]), isset($_POST['admin']) ? $_POST['admin'] : '');
|
121 |
-
die(
|
122 |
-
json_encode(
|
123 |
-
array(
|
124 |
-
'status' => 1,
|
125 |
-
'message' => 'registration successful',
|
126 |
-
'apikey' => $result[0] -> apikey
|
127 |
-
)
|
128 |
-
)
|
129 |
-
);
|
130 |
-
}else{ // user login at LR
|
131 |
-
// show APPs in admin
|
132 |
-
die(
|
133 |
-
json_encode(
|
134 |
-
array(
|
135 |
-
'status' => 1,
|
136 |
-
'message' => 'login successful',
|
137 |
-
'result' => $result
|
138 |
-
)
|
139 |
-
)
|
140 |
-
);
|
141 |
-
}
|
142 |
-
}
|
143 |
-
}
|
144 |
-
/**
|
145 |
-
* send post-registration emails to newly registered user at LR.
|
146 |
-
*/
|
147 |
-
private function login_radius_send_registration_emails($email, $adminName){
|
148 |
-
// send welcome emails
|
149 |
-
$loginRadiusSubject = 'Welcome to LoginRadius, leading social infrastructure provider';
|
150 |
-
$loginRadiusMessage = '<html>
|
151 |
-
<body style="margin: 0; padding: 0; background: #E3EEFA;">
|
152 |
-
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
153 |
-
<tr>
|
154 |
-
<td align="center" bgcolor="#E3EEFA" style="margin: 0;"><table cellpadding="0" cellspacing="0" border="0" align="center" width="600" style="font-family:\'proxima-nova\',sans-serif; color: #6f6f6f;">
|
155 |
-
<tr bgcolor="#fff;" style="background-color:#ffffff;">
|
156 |
-
<td height="6" bgcolor="#ffffff;" style="background-color:#ffffff;"><img src="https://www.loginradius.com/cdn/content/images/top.jpg" width="600" height="60" border="0" /></td>
|
157 |
-
</tr>
|
158 |
-
<tr bgcolor="#ffffff;" style="background-color:#ffffff;">
|
159 |
-
<td align="center" bgcolor="#ffffff;" style="background-color:#ffffff;border-bottom:1px solid #D7E1EE; padding-bottom: 20px;"><img src="https://www.loginradius.com/cdn/content/images/logo.png" alt="Logo" width="245" height="48" border="0" /></td>
|
160 |
-
</tr>
|
161 |
-
<tr>
|
162 |
-
<td height="20" bgcolor="ffffff"></td>
|
163 |
-
</tr>
|
164 |
-
<tr>
|
165 |
-
<td bgcolor="#ffffff" style="padding-left:40px;padding-right:40px;line-height:20px;padding-bottom:20px;">
|
166 |
-
<p style="color:#000; font-size:15px; margin: 0px; padding: 0px;">Hi '.$adminName.',<br />
|
167 |
-
<br />
|
168 |
-
Thank you for signing up with<a href="https://www.loginradius.com" target="_blank"> LoginRadius</a>. You can log into<a href="https://www.loginradius.com" target="_blank"> www.loginradius.com </a>
|
169 |
-
<span>with the following User Name :</span><br/>
|
170 |
-
<strong>Email:</strong> '.$email.'</p>
|
171 |
-
</p></td>
|
172 |
-
</tr>
|
173 |
-
<tr>
|
174 |
-
<td bgcolor="#ffffff" style="padding-left:40px;padding-right:40px;line-height:20px;padding-bottom:20px;">
|
175 |
-
<p style="color:#000; font-size:15px; margin: 0px; padding: 0px;">We will be sending another email in a few moments to explain how to get started with LoginRadius. </p></td>
|
176 |
-
</tr>
|
177 |
-
<tr>
|
178 |
-
<td bgcolor="#ffffff" style="padding-left:40px;padding-right:40px;line-height:20px;padding-bottom:20px;">
|
179 |
-
<p style="color:#000; font-size:15px; margin: 0px; padding: 0px;"> To stay tuned with LoginRadius updates, we highly recommend you connect with us on:<a href="https://www.facebook.com/pages/LoginRadius/119745918110130" target="_blank"> Facebook</a>, <a href="https://plus.google.com/114515662991809002122/" target="_blank">Google+</a>, <a href="https://twitter.com/LoginRadius">Twitter</a> and/or <a href="http://www.linkedin.com/company/2748191?trk=tyah" target="_blank">Linkedin</a> </p></td>
|
180 |
-
</tr>
|
181 |
-
<tr>
|
182 |
-
<td bgcolor="#ffffff" style="padding:10px 0;"><table width="520" cellpadding="0" cellspacing="0" border="0" align="center" bgcolor="#ffffff" style="font-size: 13px;">
|
183 |
-
<tr>
|
184 |
-
<td height="20"><p style="color:#000; font-size:14px; text-align: justify; padding-bottom:4px;margin: 0px;">Thank you,</p></td>
|
185 |
-
</tr>
|
186 |
-
<tr>
|
187 |
-
<td height="20"><p style="color:#000; font-size:14px; text-align: justify; padding-bottom: 4px;margin: 0px;"><strong>LoginRadius Team</strong></p></td>
|
188 |
-
</tr>
|
189 |
-
<tr>
|
190 |
-
<td height="20"><p style="color:#6c6c6c; font-size:14px; text-align: justify;margin: 0px; padding: 0px;"><a href="http://www.loginradius.com/" target="_blank">www.LoginRadius.com</a></p></td>
|
191 |
-
</tr>
|
192 |
-
</table></td>
|
193 |
-
</tr>
|
194 |
-
<tr>
|
195 |
-
<td bgcolor="#ffffff"><table width="600" cellpadding="0" cellspacing="0" border="0" style="font-size: 11px;">
|
196 |
-
<tr>
|
197 |
-
<td align="center">
|
198 |
-
<p style="line-height: 18px; color: rgb(0, 0, 0); border-top: 1px solid rgb(215, 225, 238); padding-top: 20px; font-size: 12px;margin: 0px;">LoginRadius is <strong>Canada\'s Top 50 Startup </strong><br/>
|
199 |
-
Partner with<strong> Mozilla, Microsoft, DynDNS, X-Cart </strong></b></p></td>
|
200 |
-
</tr>
|
201 |
-
</table></td>
|
202 |
-
</tr>
|
203 |
-
<tr>
|
204 |
-
<td bgcolor="#ffffff"><table width="600" cellpadding="0" cellspacing="0" border="0" style="font-size: 12px;">
|
205 |
-
<tr>
|
206 |
-
<td align="center" style="padding-top:5px;"><table cellpadding="0" cellspacing="0" border="0">
|
207 |
-
<tr>
|
208 |
-
<td><p style="line-height: 18px; color: rgb(0, 0, 0); font-size: 12px;margin: 0px; padding: 0px;"><strong>Connect to us :</strong> </p></td>
|
209 |
-
<td style="padding-left:5px;"><a href="http://blog.LoginRadius.com" target="_blank"><img src="https://www.loginradius.com/cdn/content/images/blog.png" border="0" alt="Blog" ></a></td>
|
210 |
-
<td style="padding-left:5px;"><a href="https://www.facebook.com/pages/LoginRadius/119745918110130" target="_blank"><img src="https://www.loginradius.com/cdn/content/images/facebook.png" border="0" alt="Facebook" ></a></td>
|
211 |
-
<td style="padding-left:5px;"><a href="https://plus.google.com/114515662991809002122/" target="_blank"><img src="https://www.loginradius.com/cdn/content/images/googleplus.png" border="0" alt="Google Plus" ></a></td>
|
212 |
-
<td style="padding-left:5px;"><a href="https://twitter.com/LoginRadius"> <img src="https://www.loginradius.com/cdn/content/images/twitter.png" border="0" alt="Twitter" ></a></td>
|
213 |
-
<td style="padding-left:5px;"><a href="http://www.linkedin.com/company/2748191?trk=tyah" target="_blank"><img src="https://www.loginradius.com/cdn/content/images/linkedin.png" border="0" alt="Linkedin" ></a></td>
|
214 |
-
</tr>
|
215 |
-
</table></td>
|
216 |
-
</tr>
|
217 |
-
</table></td>
|
218 |
-
</tr>
|
219 |
-
|
220 |
-
<tr>
|
221 |
-
<td height="6"><img src="https://www.loginradius.com/cdn/content/images/bottom.jpg" width="600" height="80" border="0" /></td>
|
222 |
-
</tr>
|
223 |
-
|
224 |
-
</table></td>
|
225 |
-
</tr>
|
226 |
-
</table>
|
227 |
-
</body>
|
228 |
-
</html>';
|
229 |
-
$this -> loginRadiusEmail($loginRadiusSubject, $loginRadiusMessage, $email);
|
230 |
-
$loginRadiusSubject = 'Getting started with LoginRadius - how to integrate social login';
|
231 |
-
$loginRadiusMessage = '<html>
|
232 |
-
<body style="margin: 0; padding: 0; background: #E3EEFA;">
|
233 |
-
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
234 |
-
<tr>
|
235 |
-
<td align="center" bgcolor="#E3EEFA" style="margin: 0;"><table cellpadding="0" cellspacing="0" border="0" align="center" width="600" style="font-family:\'proxima-nova\',sans-serif; color: #6f6f6f;">
|
236 |
-
<tr bgcolor="#fff;" style="background-color:#ffffff;">
|
237 |
-
<td height="6"><img src="https://www.loginradius.com/cdn/content/images/top.jpg" width="600" height="60" border="0" /></td>
|
238 |
-
</tr>
|
239 |
-
<tr bgcolor="#fff;" style="background-color:#ffffff;">
|
240 |
-
<td align="center" bgcolor="#ffffff;" style="background-color:#ffffff;border-bottom:1px solid #D7E1EE; padding-bottom: 20px;"><img src="https://www.loginradius.com/cdn/content/images/logo.png" alt="Logo" width="245" height="48" border="0" /></td>
|
241 |
-
</tr>
|
242 |
-
<tr>
|
243 |
-
<td height="20" bgcolor="ffffff"></td>
|
244 |
-
</tr>
|
245 |
-
<tr>
|
246 |
-
<td bgcolor="#ffffff" style="padding-left:40px;padding-right:40px;line-height:20px;padding-bottom:20px;">
|
247 |
-
<p style="color:#000; font-size:15px; margin: 0px; padding: 0px;">Hi '.$adminName.',<br />
|
248 |
-
<br />
|
249 |
-
To make sure that you successfully implement LoginRadius on your website, we want to share some important documents with you and to tell you how LoginRadius Support works. </p></td>
|
250 |
-
</tr>
|
251 |
-
<tr>
|
252 |
-
<td bgcolor="#ffffff" style="padding-left:40px;padding-right:40px;line-height:20px;padding-bottom:20px;">
|
253 |
-
<p style="color:#000; font-size:15px; margin: 0px; padding: 0px;"> <strong>Getting started</strong> </p>
|
254 |
-
<ul>
|
255 |
-
<li style="color:#000; font-size:15px;"><a href="http://support.loginradius.com/customer/portal/articles/593958-how-do-i-implement-loginradius-on-my-website-" target="_blank">How to implement LoginRadius on a website?</a></li>
|
256 |
-
<li style="color:#000; font-size:15px; padding-top: 7px;"><a href="http://support.loginradius.com/customer/portal/articles/677100-how-to-get-loginradius-api-key-and-secret" target="_blank">How to get LoginRadius API Key and Secret?</a></li>
|
257 |
-
<li style="color:#000; font-size:15px; padding-top: 7px;"><a href="http://support.loginradius.com/customer/portal/topics/277795-id-providers-apps/articles" target="_blank">How to get API Key and Secret for various ID Providers?</a></li>
|
258 |
-
<li style="color:#000; font-size:15px; padding-top: 7px;"><a href="http://support.loginradius.com/customer/portal/articles/594002-loginradius-add-ons" target="_blank">List of LoginRadius CMS Plugins</a></li>
|
259 |
-
<li style="color:#000; font-size:15px; padding-top: 7px;"><a href="https://www.loginradius.com/loginradius-for-developers/loginRadius-sdks" target="_blank">List of LoginRadius Programming SDKs </a></li>
|
260 |
-
</ul></td>
|
261 |
-
</tr>
|
262 |
-
<tr>
|
263 |
-
<td bgcolor="#ffffff" style="padding-left:40px;padding-right:40px;line-height:20px;padding-bottom:20px;">
|
264 |
-
<p style="color:#000; font-size:15px;margin: 0px; padding: 0px; "> <strong>How does LoginRadius Support work? </strong> </p>
|
265 |
-
<ul>
|
266 |
-
<li style="color:#000; font-size:15px;">You can access & search all of our help documents at our <a href="http://support.loginradius.com/" target="_blank">Support Centre.</a></li>
|
267 |
-
<li style="color:#000; font-size:15px; padding-top: 7px;">For VIP customers, we provide <a href="http://support.loginradius.com/" target="_blank">24/7 email support.</a> (Click on \'Email Us\')</li>
|
268 |
-
<li style="color:#000; font-size:15px; padding-top: 7px;">For Basic (FREE) customers, we have a <a href="http://community.loginradius.com/" target="_blank">LoginRadius Developer Community</a>.</li>
|
269 |
-
</ul></td>
|
270 |
-
</tr>
|
271 |
-
<tr>
|
272 |
-
<td bgcolor="#ffffff" style="padding-left: 40px; padding-right: 40px; line-height: 20px;
|
273 |
-
padding-bottom: 0px;">
|
274 |
-
<p style="color: #000; font-size: 15px;">
|
275 |
-
|
276 |
-
To stay tuned with LoginRadius updates, we highly recommend you connect with us on: <a target="_blank"
|
277 |
-
href="https://www.facebook.com/pages/LoginRadius/119745918110130">Facebook,
|
278 |
-
</a><a target="_blank" href="https://plus.google.com/114515662991809002122/">Google+</a>,
|
279 |
-
<a target="_blank" href="https://twitter.com/LoginRadius">Twitter</a> and <a
|
280 |
-
target="_blank" href="http://www.linkedin.com/company/2748191?trk=tyah">LinkedIn</a>
|
281 |
-
</p>
|
282 |
-
</td>
|
283 |
-
</tr>
|
284 |
-
<tr>
|
285 |
-
<td bgcolor="#ffffff" style="padding:10px 0;"><table width="520" cellpadding="0" cellspacing="0" border="0" align="center" bgcolor="#ffffff" style="font-size: 13px;">
|
286 |
-
<tr>
|
287 |
-
<td height="20"><p style="color:#000; font-size:14px; text-align: justify; padding-bottom:4px;margin: 0px;">Thank you,</p></td>
|
288 |
-
</tr>
|
289 |
-
<tr>
|
290 |
-
<td height="20"><p style="color:#000; font-size:14px; text-align: justify; padding-bottom: 4px;margin: 0px;"><strong>LoginRadius Team</strong></p></td>
|
291 |
-
</tr>
|
292 |
-
<tr>
|
293 |
-
<td height="20"><p style="color:#6c6c6c; font-size:14px; text-align: justify;margin: 0px; padding: 0px;"><a href="http://www.LoginRadius.com/?utm_source=newsletter&utm_medium=email&utm_campaign=analytics" target="_blank">www.LoginRadius.com</a></p></td>
|
294 |
-
</tr>
|
295 |
-
<tr>
|
296 |
-
|
297 |
-
<td height="20">
|
298 |
-
</td>
|
299 |
-
</tr>
|
300 |
-
</table></td>
|
301 |
-
</tr>
|
302 |
-
<tr>
|
303 |
-
<td bgcolor="#ffffff"><table width="600" cellpadding="0" cellspacing="0" border="0" style="font-size: 11px;">
|
304 |
-
<tr>
|
305 |
-
<td align="center">
|
306 |
-
<p style="line-height: 18px; color: rgb(0, 0, 0); border-top: 1px solid rgb(215, 225, 238); padding-top: 20px; font-size: 12px;margin: 0px;">LoginRadius is among <strong>Canada\'s Top 50 Startup </strong><br/>
|
307 |
-
Partner with<strong> Mozilla, Microsoft, DynDNS, X-Cart </strong></b></p></td>
|
308 |
-
</tr>
|
309 |
-
</table></td>
|
310 |
-
</tr>
|
311 |
-
<tr>
|
312 |
-
<td bgcolor="#ffffff"><table width="600" cellpadding="0" cellspacing="0" border="0" style="font-size: 12px;">
|
313 |
-
<tr>
|
314 |
-
<td align="center" style="padding-top:5px;"><table cellpadding="0" cellspacing="0" border="0">
|
315 |
-
<tr>
|
316 |
-
<td><p style="line-height: 18px; color: rgb(0, 0, 0); font-size: 12px;margin: 0px; padding: 0px;"><strong>Connect to us :</strong> </p></td>
|
317 |
-
<td style="padding-left:5px;"><a href="http://blog.LoginRadius.com" target="_blank"><img src="https://www.loginradius.com/cdn/content/images/blog.png" border="0" alt="Blog" ></a></td>
|
318 |
-
<td style="padding-left:5px;"><a href="https://www.facebook.com/pages/LoginRadius/119745918110130" target="_blank"><img src="https://www.loginradius.com/cdn/content/images/facebook.png" border="0" alt="Facebook" ></a></td>
|
319 |
-
<td style="padding-left:5px;"><a href="https://plus.google.com/114515662991809002122/" target="_blank"><img src="https://www.loginradius.com/cdn/content/images/googleplus.png" border="0" alt="Google Plus" ></a></td>
|
320 |
-
<td style="padding-left:5px;"><a href="https://twitter.com/LoginRadius"> <img src="https://www.loginradius.com/cdn/content/images/twitter.png" border="0" alt="Twitter" ></a></td>
|
321 |
-
<td style="padding-left:5px;"><a href="http://www.linkedin.com/company/2748191?trk=tyah" target="_blank"><img src="https://www.loginradius.com/cdn/content/images/linkedin.png" border="0" alt="Linkedin" ></a></td>
|
322 |
-
</tr>
|
323 |
-
</table></td>
|
324 |
-
</tr>
|
325 |
-
</table></td>
|
326 |
-
</tr>
|
327 |
-
<tr>
|
328 |
-
<td height="6"><img src="https://www.loginradius.com/cdn/content/images/bottom.jpg" width="600" height="80" border="0" /></td>
|
329 |
-
</tr>
|
330 |
-
</table></td>
|
331 |
-
</tr>
|
332 |
-
</table>
|
333 |
-
</body>
|
334 |
-
</html>';
|
335 |
-
$this -> loginRadiusEmail($loginRadiusSubject, $loginRadiusMessage, $email);
|
336 |
-
}
|
337 |
-
/**
|
338 |
-
* Send email
|
339 |
-
*/
|
340 |
-
private function loginRadiusEmail( $subject, $message, $to, $toName = '' ){
|
341 |
-
$mail = new Zend_Mail('UTF-8'); //class for mail
|
342 |
-
$mail->addHeader('MIME-Version', '1.0');
|
343 |
-
$mail->addHeader('Content-Type', 'text/html');
|
344 |
-
$mail->setBodyHtml( $message ); //for sending message containing html code
|
345 |
-
$mail->setFrom( "no-reply@loginradius.com", 'LoginRadius' );
|
346 |
-
$mail->addTo( $to, $toName );
|
347 |
-
$mail->setSubject( $subject );
|
348 |
-
try{
|
349 |
-
$mail->send();
|
350 |
-
}catch(Exception $ex) {
|
351 |
-
}
|
352 |
-
}
|
353 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Loginradius/Sharing/etc/config.xml
CHANGED
@@ -20,12 +20,11 @@
|
|
20 |
<verticalShareSuccess>1</verticalShareSuccess>
|
21 |
<verticalSharingTheme>counter_vertical</verticalSharingTheme>
|
22 |
<verticalAlignment>top_left</verticalAlignment>
|
23 |
-
<offset>150</offset>
|
24 |
<verticalSharingProvidersHidden>Facebook,Twitter,GooglePlus,LinkedIn,Pinterest,Print,Email</verticalSharingProvidersHidden>
|
25 |
<verticalCounterProvidersHidden>Facebook Like,Google+ +1,Twitter Tweet,Pinterest Pin it,Hybridshare</verticalCounterProvidersHidden>
|
26 |
</verticalSharing>
|
27 |
</sharing_options>
|
28 |
-
</default>
|
29 |
<modules>
|
30 |
<Loginradius_Sharing>
|
31 |
<version>1.1.0</version>
|
@@ -56,7 +55,7 @@
|
|
56 |
<frontName>sharing</frontName>
|
57 |
</args>
|
58 |
</sharing>
|
59 |
-
</routers>
|
60 |
</frontend>
|
61 |
<admin>
|
62 |
<routers>
|
@@ -111,7 +110,18 @@
|
|
111 |
</sharing>
|
112 |
</updates>
|
113 |
</layout>
|
114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
<global>
|
116 |
<models>
|
117 |
<sharing>
|
20 |
<verticalShareSuccess>1</verticalShareSuccess>
|
21 |
<verticalSharingTheme>counter_vertical</verticalSharingTheme>
|
22 |
<verticalAlignment>top_left</verticalAlignment>
|
|
|
23 |
<verticalSharingProvidersHidden>Facebook,Twitter,GooglePlus,LinkedIn,Pinterest,Print,Email</verticalSharingProvidersHidden>
|
24 |
<verticalCounterProvidersHidden>Facebook Like,Google+ +1,Twitter Tweet,Pinterest Pin it,Hybridshare</verticalCounterProvidersHidden>
|
25 |
</verticalSharing>
|
26 |
</sharing_options>
|
27 |
+
</default>
|
28 |
<modules>
|
29 |
<Loginradius_Sharing>
|
30 |
<version>1.1.0</version>
|
55 |
<frontName>sharing</frontName>
|
56 |
</args>
|
57 |
</sharing>
|
58 |
+
</routers>
|
59 |
</frontend>
|
60 |
<admin>
|
61 |
<routers>
|
110 |
</sharing>
|
111 |
</updates>
|
112 |
</layout>
|
113 |
+
<events>
|
114 |
+
<model_config_data_save_before>
|
115 |
+
<observers>
|
116 |
+
<sharing>
|
117 |
+
<type>singleton</type>
|
118 |
+
<class>sharing/Observer</class>
|
119 |
+
<method>validateLoginradiusKeys</method>
|
120 |
+
</sharing>
|
121 |
+
</observers>
|
122 |
+
</model_config_data_save_before>
|
123 |
+
</events>
|
124 |
+
</adminhtml>
|
125 |
<global>
|
126 |
<models>
|
127 |
<sharing>
|
app/code/community/Loginradius/Sharing/etc/system.xml
CHANGED
@@ -1,241 +1,232 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
-
|
4 |
-
|
5 |
<label>Login Radius</label>
|
6 |
<sort_order>1</sort_order>
|
7 |
</socialconfig>
|
8 |
</tabs>
|
9 |
<sections>
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
<frontend_type>hidden</frontend_type>
|
231 |
-
<sort_order>55</sort_order>
|
232 |
-
<show_in_default>1</show_in_default>
|
233 |
-
<show_in_website>1</show_in_website>
|
234 |
-
<show_in_store>1</show_in_store>
|
235 |
-
</verticalCounterProvidersHidden>
|
236 |
-
</fields>
|
237 |
-
</verticalSharing>
|
238 |
-
<help translate="label">
|
239 |
<label>Help</label>
|
240 |
<frontend_type>text</frontend_type>
|
241 |
<frontend_model>Loginradius_Sharing_Block_Help</frontend_model>
|
@@ -244,7 +235,7 @@
|
|
244 |
<show_in_website>1</show_in_website>
|
245 |
<show_in_store>1</show_in_store>
|
246 |
</help>
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
</config>
|
1 |
<?xml version="1.0"?>
|
2 |
<config>
|
3 |
+
<tabs>
|
4 |
+
<socialconfig translate="label" module="sharing">
|
5 |
<label>Login Radius</label>
|
6 |
<sort_order>1</sort_order>
|
7 |
</socialconfig>
|
8 |
</tabs>
|
9 |
<sections>
|
10 |
+
<sharing_options translate="label" module="sharing">
|
11 |
+
<label>Simplified Social Share</label>
|
12 |
+
<tab>socialconfig</tab>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>1000</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<show_in_website>1</show_in_website>
|
17 |
+
<show_in_store>1</show_in_store>
|
18 |
+
<groups>
|
19 |
+
<info translate="label">
|
20 |
+
<frontend_model>Loginradius_Sharing_Model_System_Config_Info</frontend_model>
|
21 |
+
<sort_order>0</sort_order>
|
22 |
+
<show_in_default>1</show_in_default>
|
23 |
+
<show_in_website>1</show_in_website>
|
24 |
+
<show_in_store>1</show_in_store>
|
25 |
+
</info>
|
26 |
+
<messages translate="label">
|
27 |
+
<label>Basic Social Sharing Settings</label>
|
28 |
+
<frontend_type>text</frontend_type>
|
29 |
+
<sort_order>1</sort_order>
|
30 |
+
<show_in_default>1</show_in_default>
|
31 |
+
<show_in_website>1</show_in_website>
|
32 |
+
<show_in_store>1</show_in_store>
|
33 |
+
<fields>
|
34 |
+
<appid translate="label">
|
35 |
+
<label>LoginRadius API Key</label>
|
36 |
+
<frontend_type>text</frontend_type>
|
37 |
+
<comment><![CDATA[You can leave it blank if you are Free Customer of LoginRadius and if you are paid customer then fill it to get the Advanced sharing features.]]></comment>
|
38 |
+
<sort_order>15</sort_order>
|
39 |
+
<show_in_default>1</show_in_default>
|
40 |
+
<show_in_website>1</show_in_website>
|
41 |
+
<show_in_store>1</show_in_store>
|
42 |
+
</appid>
|
43 |
+
</fields>
|
44 |
+
</messages>
|
45 |
+
<horizontalSharing translate="label">
|
46 |
+
<label>Horizontal Social Sharing</label>
|
47 |
+
<frontend_type>text</frontend_type>
|
48 |
+
<sort_order>30</sort_order>
|
49 |
+
<show_in_default>1</show_in_default>
|
50 |
+
<show_in_website>1</show_in_website>
|
51 |
+
<show_in_store>1</show_in_store>
|
52 |
+
<fields>
|
53 |
+
<horizontalShareEnable translate="label">
|
54 |
+
<label>Enable Horizontal Social Sharing</label>
|
55 |
+
<frontend_type>select</frontend_type>
|
56 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
57 |
+
<comment><![CDATA[Do you want to enable Horizontal Social Sharing for your website?]]>
|
58 |
+
</comment>
|
59 |
+
<sort_order>31</sort_order>
|
60 |
+
<show_in_default>1</show_in_default>
|
61 |
+
<show_in_website>1</show_in_website>
|
62 |
+
<show_in_store>1</show_in_store>
|
63 |
+
</horizontalShareEnable>
|
64 |
+
<horizontalShareProduct translate="label">
|
65 |
+
<label>Show Social Sharing Interface at Product Pages</label>
|
66 |
+
<frontend_type>select</frontend_type>
|
67 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
68 |
+
<sort_order>32</sort_order>
|
69 |
+
<show_in_default>1</show_in_default>
|
70 |
+
<show_in_website>1</show_in_website>
|
71 |
+
<show_in_store>1</show_in_store>
|
72 |
+
</horizontalShareProduct>
|
73 |
+
<horizontalShareSuccess translate="label">
|
74 |
+
<label>Enable Social Sharing at Checkout Success Page</label>
|
75 |
+
<frontend_type>select</frontend_type>
|
76 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
77 |
+
<sort_order>33</sort_order>
|
78 |
+
<show_in_default>1</show_in_default>
|
79 |
+
<show_in_website>1</show_in_website>
|
80 |
+
<show_in_store>1</show_in_store>
|
81 |
+
</horizontalShareSuccess>
|
82 |
+
<sharingTitle translate="label">
|
83 |
+
<label>Sharing Title</label>
|
84 |
+
<frontend_type>text</frontend_type>
|
85 |
+
<comment><![CDATA[Enter the text that you wish to be displayed above the Social Sharing Interface. Leave the field blank if you don't want any text to be displayed.]]>
|
86 |
+
</comment>
|
87 |
+
<sort_order>34</sort_order>
|
88 |
+
<show_in_default>1</show_in_default>
|
89 |
+
<show_in_website>1</show_in_website>
|
90 |
+
<show_in_store>1</show_in_store>
|
91 |
+
</sharingTitle>
|
92 |
+
<horizontalSharingTheme translate="label">
|
93 |
+
<label>Choose a theme</label>
|
94 |
+
<frontend_type>radios</frontend_type>
|
95 |
+
<source_model>sharing/source_HorizontalSharing</source_model>
|
96 |
+
<sort_order>36</sort_order>
|
97 |
+
<show_in_default>1</show_in_default>
|
98 |
+
<show_in_website>1</show_in_website>
|
99 |
+
<show_in_store>1</show_in_store>
|
100 |
+
</horizontalSharingTheme>
|
101 |
+
<horizontalSharingProviders translate="label">
|
102 |
+
<label>Sharing Providers</label>
|
103 |
+
<frontend_type>checkboxes</frontend_type>
|
104 |
+
<comment><![CDATA[<div style="clear: both !important;"><p class="note"><span>Selected providers will be displayed in the Social Sharing widget</span></p></div>]]></comment>
|
105 |
+
<sort_order>40</sort_order>
|
106 |
+
<show_in_default>1</show_in_default>
|
107 |
+
<show_in_website>1</show_in_website>
|
108 |
+
<show_in_store>1</show_in_store>
|
109 |
+
</horizontalSharingProviders>
|
110 |
+
<horizontalSharingProvidersHidden translate="label">
|
111 |
+
<label>Rearrange Icons</label>
|
112 |
+
<frontend_type>hidden</frontend_type>
|
113 |
+
<sort_order>41</sort_order>
|
114 |
+
<show_in_default>1</show_in_default>
|
115 |
+
<show_in_website>1</show_in_website>
|
116 |
+
<show_in_store>1</show_in_store>
|
117 |
+
</horizontalSharingProvidersHidden>
|
118 |
+
<horizontalCounterProviders translate="label">
|
119 |
+
<label>Sharing Providers</label>
|
120 |
+
<frontend_type>checkboxes</frontend_type>
|
121 |
+
<comment><![CDATA[<div style="clear: both !important;"><p class="note"><span>Selected providers will be displayed in the Social Sharing widget</span></p></div>]]></comment>
|
122 |
+
<sort_order>40</sort_order>
|
123 |
+
<show_in_default>1</show_in_default>
|
124 |
+
<show_in_website>1</show_in_website>
|
125 |
+
<show_in_store>1</show_in_store>
|
126 |
+
</horizontalCounterProviders>
|
127 |
+
<horizontalCounterProvidersHidden translate="label">
|
128 |
+
<label>Rearrange Icons</label>
|
129 |
+
<frontend_type>hidden</frontend_type>
|
130 |
+
<sort_order>41</sort_order>
|
131 |
+
<show_in_default>1</show_in_default>
|
132 |
+
<show_in_website>1</show_in_website>
|
133 |
+
<show_in_store>1</show_in_store>
|
134 |
+
</horizontalCounterProvidersHidden>
|
135 |
+
</fields>
|
136 |
+
</horizontalSharing>
|
137 |
+
<verticalSharing translate="label">
|
138 |
+
<label>Vertical Social Sharing</label>
|
139 |
+
<frontend_type>text</frontend_type>
|
140 |
+
<sort_order>42</sort_order>
|
141 |
+
<show_in_default>1</show_in_default>
|
142 |
+
<show_in_website>1</show_in_website>
|
143 |
+
<show_in_store>1</show_in_store>
|
144 |
+
<fields>
|
145 |
+
<verticalShareEnable translate="label">
|
146 |
+
<label>Enable Vertical Social Sharing</label>
|
147 |
+
<frontend_type>select</frontend_type>
|
148 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
149 |
+
<comment><![CDATA[Do you want to enable Social Counter for your website?]]>
|
150 |
+
</comment>
|
151 |
+
<sort_order>43</sort_order>
|
152 |
+
<show_in_default>1</show_in_default>
|
153 |
+
<show_in_website>1</show_in_website>
|
154 |
+
<show_in_store>1</show_in_store>
|
155 |
+
</verticalShareEnable>
|
156 |
+
<verticalShareProduct translate="label">
|
157 |
+
<label>Show Social Sharing Interface at Product Pages</label>
|
158 |
+
<frontend_type>select</frontend_type>
|
159 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
160 |
+
<sort_order>44</sort_order>
|
161 |
+
<show_in_default>1</show_in_default>
|
162 |
+
<show_in_website>1</show_in_website>
|
163 |
+
<show_in_store>1</show_in_store>
|
164 |
+
</verticalShareProduct>
|
165 |
+
<verticalShareSuccess translate="label">
|
166 |
+
<label>Enable Social Sharing at Checkout Success Page</label>
|
167 |
+
<frontend_type>select</frontend_type>
|
168 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
169 |
+
<sort_order>45</sort_order>
|
170 |
+
<show_in_default>1</show_in_default>
|
171 |
+
<show_in_website>1</show_in_website>
|
172 |
+
<show_in_store>1</show_in_store>
|
173 |
+
</verticalShareSuccess>
|
174 |
+
<verticalSharingTheme translate="label">
|
175 |
+
<label>Choose a theme</label>
|
176 |
+
<frontend_type>radios</frontend_type>
|
177 |
+
<source_model>sharing/source_VerticalSharing</source_model>
|
178 |
+
<sort_order>48</sort_order>
|
179 |
+
<show_in_default>1</show_in_default>
|
180 |
+
<show_in_website>1</show_in_website>
|
181 |
+
<show_in_store>1</show_in_store>
|
182 |
+
</verticalSharingTheme>
|
183 |
+
<verticalAlignment translate="label">
|
184 |
+
<label>Alignment</label>
|
185 |
+
<frontend_type>select</frontend_type>
|
186 |
+
<comment><![CDATA[Select the position of the Social Counter widget with respect to page]]></comment>
|
187 |
+
<source_model>sharing/source_SharingVerticalAlignment</source_model>
|
188 |
+
<sort_order>50</sort_order>
|
189 |
+
<show_in_default>1</show_in_default>
|
190 |
+
<show_in_website>1</show_in_website>
|
191 |
+
<show_in_store>1</show_in_store>
|
192 |
+
</verticalAlignment>
|
193 |
+
<verticalSharingProviders translate="label">
|
194 |
+
<label>Sharing Providers</label>
|
195 |
+
<frontend_type>checkboxes</frontend_type>
|
196 |
+
<comment><![CDATA[<div style="clear: both !important;"><p class="note"><span>Selected providers will be displayed in the Social Counter widget</span></p></div>]]></comment>
|
197 |
+
<sort_order>52</sort_order>
|
198 |
+
<show_in_default>1</show_in_default>
|
199 |
+
<show_in_website>1</show_in_website>
|
200 |
+
<show_in_store>1</show_in_store>
|
201 |
+
</verticalSharingProviders>
|
202 |
+
<verticalSharingProvidersHidden translate="label">
|
203 |
+
<label>Rearrange Icons</label>
|
204 |
+
<frontend_type>hidden</frontend_type>
|
205 |
+
<sort_order>53</sort_order>
|
206 |
+
<show_in_default>1</show_in_default>
|
207 |
+
<show_in_website>1</show_in_website>
|
208 |
+
<show_in_store>1</show_in_store>
|
209 |
+
</verticalSharingProvidersHidden>
|
210 |
+
<verticalCounterProviders translate="label">
|
211 |
+
<label>Sharing Providers</label>
|
212 |
+
<frontend_type>checkboxes</frontend_type>
|
213 |
+
<comment><![CDATA[<div style="clear: both !important;"><p class="note"><span>Selected providers will be displayed in the Social Sharing widget</span></p></div>]]></comment>
|
214 |
+
<sort_order>54</sort_order>
|
215 |
+
<show_in_default>1</show_in_default>
|
216 |
+
<show_in_website>1</show_in_website>
|
217 |
+
<show_in_store>1</show_in_store>
|
218 |
+
</verticalCounterProviders>
|
219 |
+
<verticalCounterProvidersHidden translate="label">
|
220 |
+
<label>Rearrange Icons</label>
|
221 |
+
<frontend_type>hidden</frontend_type>
|
222 |
+
<sort_order>55</sort_order>
|
223 |
+
<show_in_default>1</show_in_default>
|
224 |
+
<show_in_website>1</show_in_website>
|
225 |
+
<show_in_store>1</show_in_store>
|
226 |
+
</verticalCounterProvidersHidden>
|
227 |
+
</fields>
|
228 |
+
</verticalSharing>
|
229 |
+
<help translate="label">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
<label>Help</label>
|
231 |
<frontend_type>text</frontend_type>
|
232 |
<frontend_model>Loginradius_Sharing_Block_Help</frontend_model>
|
235 |
<show_in_website>1</show_in_website>
|
236 |
<show_in_store>1</show_in_store>
|
237 |
</help>
|
238 |
+
</groups>
|
239 |
+
</sharing_options>
|
240 |
+
</sections>
|
241 |
</config>
|
app/design/adminhtml/default/default/layout/loginradius_sharing.xml
CHANGED
@@ -2,10 +2,10 @@
|
|
2 |
<layout version="1.0.0">
|
3 |
<default>
|
4 |
<reference name="head">
|
5 |
-
<action method="addJs"><script>../skin/
|
6 |
-
<action method="addJs"><script>../skin/
|
7 |
-
<action method="addJs"><script>../skin/
|
8 |
-
<action method="addCss"><script>../../../
|
9 |
</reference>
|
10 |
</default>
|
11 |
-
</layout>
|
2 |
<layout version="1.0.0">
|
3 |
<default>
|
4 |
<reference name="head">
|
5 |
+
<action method="addJs"><script>../skin/adminhtml/default/default/Loginradius/Sharing/js/jquery.js</script></action>
|
6 |
+
<action method="addJs"><script>../skin/adminhtml/default/default/Loginradius/Sharing/js/jquery.ui.sortable.min.js</script></action>
|
7 |
+
<action method="addJs"><script>../skin/adminhtml/default/default/Loginradius/Sharing/js/admin-ui.js</script></action>
|
8 |
+
<action method="addCss"><script>../../../adminhtml/default/default/Loginradius/Sharing/css/admin-ui.css</script></action>
|
9 |
</reference>
|
10 |
</default>
|
11 |
+
</layout>
|
app/design/frontend/base/default/layout/sharing.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<layout version="1.0.0">
|
3 |
<default>
|
4 |
-
|
5 |
-
<block type="sharing/
|
6 |
</reference>
|
7 |
-
|
8 |
-
|
9 |
<reference name="alert.urls">
|
10 |
-
<block type="sharing/
|
11 |
</reference>
|
12 |
</catalog_product_view>
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
</layout>
|
1 |
<?xml version="1.0"?>
|
2 |
<layout version="1.0.0">
|
3 |
<default>
|
4 |
+
<reference name="head">
|
5 |
+
<block type="sharing/sharing" name="simplifiedsocialshare_head" template="sharing/socialshare_head.phtml"/>
|
6 |
</reference>
|
7 |
+
</default>
|
8 |
+
<catalog_product_view>
|
9 |
<reference name="alert.urls">
|
10 |
+
<block type="sharing/sharing" name="simplifiedsocialshareproduct" template="sharing/socialshareproduct.phtml" before="-"/>
|
11 |
</reference>
|
12 |
</catalog_product_view>
|
13 |
+
<checkout_onepage_success>
|
14 |
+
<reference name="content">
|
15 |
+
<block type="sharing/sharing" name="simplifiedcheckoutsuccessshare" template="sharing/socialsharesuccess.phtml" before="-"/>
|
16 |
+
</reference>
|
17 |
+
</checkout_onepage_success>
|
18 |
+
</layout>
|
app/design/frontend/base/default/template/sharing/socialshare_head.phtml
CHANGED
@@ -1,141 +1,22 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
$interface = 'horizontal';
|
24 |
-
}
|
25 |
-
// size
|
26 |
-
if($this->horizontalSharingTheme() == "32" || $this->horizontalSharingTheme() == "single_large"){
|
27 |
-
$size = '32';
|
28 |
-
}elseif($this->horizontalSharingTheme() == "16" || $this->horizontalSharingTheme() == "single_small"){
|
29 |
-
$size = '16';
|
30 |
-
}else{
|
31 |
-
$size = '32';
|
32 |
-
}
|
33 |
-
// counter providers
|
34 |
-
if($this->horizontalSharingTheme() == "counter_horizontal" || $this->horizontalSharingTheme() == "counter_vertical"){
|
35 |
-
if($this->horizontalCounterProviders() != ""){
|
36 |
-
$providers = str_replace(',', '","', $this->horizontalCounterProviders());
|
37 |
-
}else{
|
38 |
-
$providers = 'Facebook Like","Google+ +1","Pinterest Pin it","LinkedIn Share","Hybridshare';
|
39 |
-
}
|
40 |
-
// prepare counter script
|
41 |
-
$sharingScript .= 'LoginRadius.util.ready(function () { $SC.Providers.Selected = ["'.$providers.'"]; $S = $SC.Interface.'.$interface.'; $S.isHorizontal = '.$isHorizontal.'; $S.countertype = \''.$type.'\'; $S.show("loginRadiusHorizontalSharing"); });';
|
42 |
-
}else{
|
43 |
-
if($this->horizontalSharingProviders() != ""){
|
44 |
-
$providers = str_replace(',', '","', $this->horizontalSharingProviders());
|
45 |
-
}else{
|
46 |
-
$providers = 'Facebook","Twitter","GooglePlus","LinkedIn","Pinterest","Print","Email';
|
47 |
-
}
|
48 |
-
// prepare sharing script
|
49 |
-
$sharingScript .= 'LoginRadius.util.ready(function() { $i = $SS.Interface.'.$interface.'; $SS.Providers.Top = ["'.$providers.'"]; $u = LoginRadius.user_settings;';
|
50 |
-
if(trim($this->getApikey()) != ""){
|
51 |
-
$sharingScript .= '$u.apikey= \''.trim($this->getApikey()).'\';';
|
52 |
-
}
|
53 |
-
$sharingScript .= '$i.size = '.$size.'; $u.sharecounttype="url"; $i.show("loginRadiusHorizontalSharing"); });';
|
54 |
-
}
|
55 |
-
?>
|
56 |
-
<style type="text/css">
|
57 |
-
div.loginRadiusHorizontalSharing{
|
58 |
-
z-index : 1000000;
|
59 |
-
}
|
60 |
-
</style>
|
61 |
-
<?php
|
62 |
-
}
|
63 |
-
// vertical sharing interface
|
64 |
-
if($this->verticalShareEnable() == "1"){
|
65 |
-
// relative vertical position
|
66 |
-
if($this->verticalAlignment() == 'top_left'){
|
67 |
-
$position1 = 'top';
|
68 |
-
$position2 = 'left';
|
69 |
-
}elseif($this->verticalAlignment() == 'top_right'){
|
70 |
-
$position1 = 'top';
|
71 |
-
$position2 = 'right';
|
72 |
-
}elseif($this->verticalAlignment() == 'bottom_left'){
|
73 |
-
$position1 = 'bottom';
|
74 |
-
$position2 = 'left';
|
75 |
-
}else{
|
76 |
-
$position1 = 'bottom';
|
77 |
-
$position2 = 'right';
|
78 |
-
}
|
79 |
-
// interface top offset
|
80 |
-
if($this->verticalSharingTheme() == "counter_horizontal" || $this->verticalSharingTheme() == "counter_vertical"){
|
81 |
-
$sharingVariable = 'S';
|
82 |
-
}else{
|
83 |
-
$sharingVariable = 'i';
|
84 |
-
}
|
85 |
-
$offset = "";
|
86 |
-
if(trim($this->offset()) != ""){
|
87 |
-
$offset = '$'.$sharingVariable.'.top = \''.trim($this->offset()).'px\'; $'.$sharingVariable.'.'.$position2.' = \'0px\';';
|
88 |
-
}else{
|
89 |
-
$offset = '$'.$sharingVariable.'.'.$position1.' = \'0px\'; $'.$sharingVariable.'.'.$position2.' = \'0px\';';
|
90 |
-
}
|
91 |
-
$interface = 'Simplefloat';
|
92 |
-
if($this->verticalSharingTheme() == "32"){
|
93 |
-
$size = '32';
|
94 |
-
}elseif($this->verticalSharingTheme() == "16"){
|
95 |
-
$size = '16';
|
96 |
-
}elseif($this->verticalSharingTheme() == "counter_horizontal" || $this->verticalSharingTheme() == "counter_vertical"){
|
97 |
-
$interface = 'simple';
|
98 |
-
$isHorizontal = "false";
|
99 |
-
if($this->verticalSharingTheme() == "counter_vertical"){
|
100 |
-
$type = 'vertical';
|
101 |
-
}elseif($this->verticalSharingTheme() == "counter_horizontal"){
|
102 |
-
$type = 'horizontal';
|
103 |
-
}
|
104 |
-
}else{
|
105 |
-
$size = '16';
|
106 |
-
}
|
107 |
-
|
108 |
-
// counter providers
|
109 |
-
if($this->verticalSharingTheme() == "counter_horizontal" || $this->verticalSharingTheme() == "counter_vertical"){
|
110 |
-
if($this->verticalCounterProviders() != ""){
|
111 |
-
$providers = str_replace(',', '","', $this->verticalCounterProviders());
|
112 |
-
}else{
|
113 |
-
$providers = 'Facebook Like","Google+ +1","Pinterest Pin it","LinkedIn Share","Hybridshare';
|
114 |
-
}
|
115 |
-
// prepare counter script
|
116 |
-
$sharingScript .= 'LoginRadius.util.ready(function () { $SC.Providers.Selected = ["'.$providers.'"]; $S = $SC.Interface.'.$interface.'; $S.isHorizontal = '.$isHorizontal.'; $S.countertype = \''.$type.'\'; '.$offset.' $S.show("loginRadiusVerticalSharing"); });';
|
117 |
-
}else{
|
118 |
-
// sharing providers
|
119 |
-
if($this->verticalSharingProviders() != ""){
|
120 |
-
$providers = str_replace(',', '","', $this->verticalSharingProviders());
|
121 |
-
}else{
|
122 |
-
$providers = 'Facebook","Twitter","GooglePlus","LinkedIn","Pinterest","Print","Email';
|
123 |
-
}
|
124 |
-
// prepare sharing script
|
125 |
-
$sharingScript .= 'LoginRadius.util.ready(function() { $i = $SS.Interface.'.$interface.'; $SS.Providers.Top = ["'.$providers.'"]; $u = LoginRadius.user_settings;';
|
126 |
-
if($this->getApikey() != ""){
|
127 |
-
$sharingScript .= '$u.apikey= \''.trim($this->getApikey()).'\';';
|
128 |
-
}
|
129 |
-
$sharingScript .= '$i.size = '.$size.'; '.$offset.' $i.show("loginRadiusVerticalSharing"); });';
|
130 |
-
}
|
131 |
-
?>
|
132 |
-
<style type="text/css">
|
133 |
-
div.loginRadiusVerticalSharing{
|
134 |
-
z-index : 1000000;
|
135 |
-
}
|
136 |
-
</style>
|
137 |
-
<?php
|
138 |
-
}
|
139 |
-
$sharingScript .= '</script>';
|
140 |
-
echo $sharingScript;
|
141 |
-
?>
|
1 |
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* template to add script required for social sharing
|
5 |
+
*/
|
6 |
+
$horizontalShareSettings = $this->getHorizontalSharingSettings();
|
7 |
+
$verticalShareSettings = $this->getVerticalSharingSettings();
|
8 |
+
$apiKey = $this->getApikey();
|
9 |
+
if ($horizontalShareSettings['horizontalShareEnable'] == "1" || $verticalShareSettings['verticalShareEnable'] == "1") {
|
10 |
+
$sharingScript = '<script type="text/javascript">var islrsharing = true; var islrsocialcounter = true;</script> <script type="text/javascript" src="//share.loginradius.com/Content/js/LoginRadius.js" id="lrsharescript"></script><script type="text/javascript">';
|
11 |
+
|
12 |
+
if ($horizontalShareSettings['horizontalShareEnable'] == "1") {
|
13 |
+
// check horizontal sharing enabled
|
14 |
+
$sharingScript .= $this->getHorizontalSharingScript($horizontalShareSettings, $apiKey);
|
15 |
+
}
|
16 |
+
if ($verticalShareSettings['verticalShareEnable'] == '1') {
|
17 |
+
// check vertical sharing enabled
|
18 |
+
$sharingScript .= $this->getVerticalSharingScript($verticalShareSettings, $apiKey);
|
19 |
+
}
|
20 |
+
$sharingScript .= '</script>';
|
21 |
+
echo $sharingScript;
|
22 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/sharing/socialshareproduct.phtml
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
-
if(
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
}
|
8 |
-
if($this->verticalShareEnable() == "1" && $this->verticalShareProduct() == "1"){
|
9 |
-
|
10 |
}
|
11 |
?>
|
1 |
<?php
|
2 |
+
if ($this->horizontalShareEnable() == "1" && $this->horizontalShareProduct() == "1") {
|
3 |
+
if (trim($this->sharingTitle()) != "") {
|
4 |
+
echo '<div style="font-weight:bold;clear: both;">' . trim($this->sharingTitle()) . '</div>';
|
5 |
+
}
|
6 |
+
echo '<div class="loginRadiusHorizontalSharing"></div>';
|
7 |
}
|
8 |
+
if ($this->verticalShareEnable() == "1" && $this->verticalShareProduct() == "1") {
|
9 |
+
echo '<div class="loginRadiusVerticalSharing"></div>';
|
10 |
}
|
11 |
?>
|
app/design/frontend/base/default/template/sharing/socialsharesuccess.phtml
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
-
if($this->horizontalShareEnable() == "1" && $this->horizontalShareSuccess() == "1"){
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
}
|
8 |
-
if($this->verticalShareEnable() == "1" && $this->verticalShareSuccess() == "1"){
|
9 |
-
|
10 |
}
|
11 |
?>
|
1 |
<?php
|
2 |
+
if ($this->horizontalShareEnable() == "1" && $this->horizontalShareSuccess() == "1") {
|
3 |
+
if (trim($this->sharingTitle()) != "") {
|
4 |
+
echo '<div style="font-weight:bold; clear: both;">' . trim($this->sharingTitle()) . '</div>';
|
5 |
+
}
|
6 |
+
echo '<div class="loginRadiusHorizontalSharing"></div>';
|
7 |
}
|
8 |
+
if ($this->verticalShareEnable() == "1" && $this->verticalShareSuccess() == "1") {
|
9 |
+
echo '<div class="loginRadiusVerticalSharing"></div>';
|
10 |
}
|
11 |
?>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>LoginRadiusShare</name>
|
4 |
-
<version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Social Sharing for Magento</summary>
|
10 |
<description>Add Sharing to your Magento website</description>
|
11 |
-
<notes>
|
12 |
<authors><author><name>LoginRadius Team</name><user>LoginRadius</user><email>developers@loginradius.com</email></author></authors>
|
13 |
-
<date>
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Loginradius"><dir name="Sharing"><dir name="Block"><file name="
|
16 |
<compatible/>
|
17 |
-
<dependencies><required><php><min>5.1.0</min><max>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>LoginRadiusShare</name>
|
4 |
+
<version>2.0.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Social Sharing for Magento</summary>
|
10 |
<description>Add Sharing to your Magento website</description>
|
11 |
+
<notes>Fourth release of Simplified Social Share extension</notes>
|
12 |
<authors><author><name>LoginRadius Team</name><user>LoginRadius</user><email>developers@loginradius.com</email></author></authors>
|
13 |
+
<date>2015-04-20</date>
|
14 |
+
<time>11:10:19</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Loginradius"><dir name="Sharing"><dir name="Block"><file name="Help.php" hash="87e64f59a108abfe7f7b7453695e3d8f"/><file name="Horizontalsharing.php" hash="35663b3b6e6f6cef0afe9a98a0755211"/><file name="Sharing.php" hash="5d9c9e2a83770739be0a5b1e55ec3e1a"/><file name="Verticalsharing.php" hash="439fa7142166729a68e7039ca4ff953f"/></dir><dir name="Helper"><file name="Data.php" hash="3872b2366517616d24125dda54462d00"/></dir><dir name="Model"><file name="Observer.php" hash="56343ccd174b420fdc3d54b53eb0ed9f"/><dir name="Source"><file name="HorizontalSharing.php" hash="a7ea2aafaad55d8b472cc9d3374aee45"/><file name="SharingVerticalAlignment.php" hash="905d7e0d4a3878d4bb6a98614095b921"/><file name="VerticalSharing.php" hash="39d47e2500209afab6f3b51a9ca2861a"/></dir><dir name="System"><dir name="Config"><file name="Info.php" hash="6770c79779a42e0391a9800f30cdf911"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="bb4d85ee91d4ebef4e4909e3ffb055a1"/><file name="system.xml" hash="d65a3c444e55f08deb5fbec9e1937754"/><file name="widget.xml" hash="ca111c2e4529d2170aa6efb8bc6b1139"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Loginradius_sharing.xml" hash="0b94fa11070a3a05b1a01a0f3f5d9fc3"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="loginradius_sharing.xml" hash="504877352d2d347d5083ecfa0e17a12e"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="sharing.xml" hash="64a5b0c70a83aa6e6a5dd3e62c8c5b33"/></dir><dir name="template"><dir name="sharing"><file name="socialshare_head.phtml" hash="76dbcd864552844a832bbab35603dc26"/><file name="socialshareproduct.phtml" hash="2f2639165db807c798c1715a758c1cce"/><file name="socialsharesuccess.phtml" hash="6ce81c57c03f8f7157b2b68ee61d33d2"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="Loginradius"><dir name="Sharing"><dir name="css"><file name="admin-ui.css" hash="6fc3050ff18dc4d50d365cc798e0372c"/><file name="lrshare_iconsprite32.png" hash="a016ded3f25653acf2fa9dfab8a38103"/></dir><dir name="images"><dir name="Sharing"><dir name="Horizontal"><file name="horizonSharing16.png" hash="0fad94b8e4a3e44a2e14f81a2ee04041"/><file name="horizonSharing32.png" hash="561208c81d7cd9d3500e3c460a8a5c49"/><file name="horizontal.png" hash="628fb90190ea3ded7b1f384662ce8153"/><file name="responsive-icons.png" hash="f792ba85bf94a6cf05329d5a9a4087b5"/><file name="single-image-theme-large.png" hash="e6ff4a26149b631639b601d95e2dc361"/><file name="single-image-theme-small.png" hash="8c2b20fa0f276e33f3876783eb2cbd74"/><file name="vertical.png" hash="81e8591ec1216ffaa22430e86431bf15"/></dir><dir name="Vertical"><file name="16VerticlewithBox.png" hash="73b3abf54889144e9188ffaa76cbb11f"/><file name="32VerticlewithBox.png" hash="37060e164ca4f7c00f430d5f1ab7eddd"/><file name="verticalhorizontal.png" hash="0f4729083e85894d126a7c5202b18465"/><file name="verticalvertical.png" hash="fbbcf59f5e1c121d34073e4769048ff4"/></dir></dir><dir name="media-pages"><file name="facebook.png" hash="a77fde5f83509192ad6827fc01502855"/><file name="google.png" hash="adaebd65b6f38ed79ef1598c88c30a0d"/><file name="linkedin.png" hash="b17944457a3654f1320d48de9c2fdcdc"/><file name="twitter.png" hash="11150d792156e123d4aace84ce5ab0fd"/><file name="youtube.png" hash="1496547f266f7b3c7634198eecf0e20a"/></dir></dir><dir name="js"><file name="admin-ui.js" hash="9b74430c66d473c482b96a16a996dbaf"/><file name="jquery.js" hash="5654b0561c66ca9c0ad2a1dd75e5d9b8"/><file name="jquery.ui.sortable.min.js" hash="b847eafb05bcc6ef0908ff07dcd2b0f1"/></dir></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.1.0</min><max>7.0.0</max></php></required></dependencies>
|
18 |
</package>
|
skin/adminhtml/default/default/Loginradius/Sharing/css/admin-ui.css
ADDED
@@ -0,0 +1,189 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.loginRadiusFieldset {
|
2 |
+
position: relative;
|
3 |
+
border: #d7d7d7 1px solid;
|
4 |
+
border-radius: 4px;
|
5 |
+
width: 490px;
|
6 |
+
float: left;
|
7 |
+
padding: 3px 10px 0 10px;
|
8 |
+
margin-bottom: 10px;
|
9 |
+
background-color: #FFFFE0;
|
10 |
+
border: 1px solid #E6DB55;
|
11 |
+
}
|
12 |
+
|
13 |
+
.loginRadiusHelpDiv {
|
14 |
+
width: 65%;
|
15 |
+
float: left;
|
16 |
+
border-radius: 4px;
|
17 |
+
margin-right: 10px;
|
18 |
+
background-color: #FFFFE0 !important;
|
19 |
+
border: 1px solid #E6DB55 !important;
|
20 |
+
padding-bottom: 5px !important;
|
21 |
+
}
|
22 |
+
|
23 |
+
.loginRadiusFieldset a, .loginRadiusHelpDiv ul li a {
|
24 |
+
text-decoration: none;
|
25 |
+
}
|
26 |
+
|
27 |
+
.loginRadiusFieldset a:hover, .loginRadiusHelpDiv ul li a:hover {
|
28 |
+
text-decoration: underline !important
|
29 |
+
}
|
30 |
+
|
31 |
+
.loginRadiusHelpDiv ul li {
|
32 |
+
list-style-type: disc;
|
33 |
+
}
|
34 |
+
|
35 |
+
.loginRadiusHelpDiv ul {
|
36 |
+
margin: 0 15px;
|
37 |
+
}
|
38 |
+
|
39 |
+
loginradius_radio {
|
40 |
+
vertical-align: top;
|
41 |
+
margin-left: 7px
|
42 |
+
}
|
43 |
+
|
44 |
+
#row_sharing_options_horizontalSharing_horizontalSharingProviders ul li {
|
45 |
+
width: 149px;
|
46 |
+
float: left
|
47 |
+
}
|
48 |
+
|
49 |
+
#row_sharing_options_messages_redirect td input {
|
50 |
+
margin-right: 2px
|
51 |
+
}
|
52 |
+
|
53 |
+
#row_sharing_options_verticalSharing_verticalSharingProviders ul li {
|
54 |
+
width: 149px;
|
55 |
+
float: left
|
56 |
+
}
|
57 |
+
|
58 |
+
#row_sharing_options_verticalSharing_verticalCounterProviders ul li {
|
59 |
+
width: 149px;
|
60 |
+
float: left
|
61 |
+
}
|
62 |
+
|
63 |
+
#row_sharing_options_horizontalSharing_horizontalCounterProviders ul li {
|
64 |
+
width: 149px;
|
65 |
+
float: left
|
66 |
+
}
|
67 |
+
|
68 |
+
#loginRadiushorizontalRearrangeSharing li, #loginRadiusverticalRearrangeSharing li {
|
69 |
+
float: left
|
70 |
+
}
|
71 |
+
|
72 |
+
#row_sharing_options_verticalSharing_verticalSharingTheme td label {
|
73 |
+
float: left !important
|
74 |
+
}
|
75 |
+
|
76 |
+
#row_sharing_options_messages_iconSize td input {
|
77 |
+
margin-right: 2px
|
78 |
+
}
|
79 |
+
|
80 |
+
#row_sharing_options_verticalSharing_verticalSharingTheme td input {
|
81 |
+
float: left !important;
|
82 |
+
margin-left: 4px
|
83 |
+
}
|
84 |
+
|
85 |
+
#row_sharing_options_horizontalSharing_horizontalSharingTheme td input {
|
86 |
+
vertical-align: top
|
87 |
+
}
|
88 |
+
|
89 |
+
#row_sharing_options_horizontalSharing_horizontalSharingTheme td[class=value] {
|
90 |
+
width: 410px !important
|
91 |
+
}
|
92 |
+
|
93 |
+
#row_sharing_options_verticalSharing_verticalSharingTheme td.value {
|
94 |
+
width: 410px !important;
|
95 |
+
}
|
96 |
+
#row_sharing_options_horizontalSharing_horizontalSharingTheme td[class=value] img{
|
97 |
+
margin-bottom:5px;
|
98 |
+
}
|
99 |
+
|
100 |
+
#row_sharing_options_sharing_verticalSharing td input {
|
101 |
+
vertical-align: top !important;
|
102 |
+
float: left !important;
|
103 |
+
margin-right: 2px
|
104 |
+
}
|
105 |
+
|
106 |
+
#row_sharing_options_sharing_verticalSharing td label, #row_sharing_options_counter_verticalCounter td label {
|
107 |
+
float: left !important
|
108 |
+
}
|
109 |
+
|
110 |
+
#row_sharing_options_sharing_horizontalSharing td input {
|
111 |
+
vertical-align: top !important;
|
112 |
+
margin-right: 2px
|
113 |
+
}
|
114 |
+
|
115 |
+
#row_sharing_options_counter_horizontalCounter td input {
|
116 |
+
vertical-align: top !important;
|
117 |
+
margin-right: 2px
|
118 |
+
}
|
119 |
+
|
120 |
+
#row_sharing_options_counter_verticalCounter td input {
|
121 |
+
vertical-align: top !important;
|
122 |
+
margin-right: 2px;
|
123 |
+
float: left !important
|
124 |
+
}
|
125 |
+
|
126 |
+
.lrshare_iconsprite32 {
|
127 |
+
cursor: pointer !important;
|
128 |
+
height: 32px;
|
129 |
+
margin: 4px !important;
|
130 |
+
width: 32px;
|
131 |
+
padding: 0px !important;
|
132 |
+
border: none !important;
|
133 |
+
background: url("lrshare_iconsprite32.png") no-repeat scroll left top transparent;
|
134 |
+
list-style-type: none !important;
|
135 |
+
}
|
136 |
+
|
137 |
+
#lr_thank_message_container {
|
138 |
+
width: 60%;
|
139 |
+
float: left;
|
140 |
+
height: 195px;
|
141 |
+
Margin-right: 6px;
|
142 |
+
}
|
143 |
+
|
144 |
+
#lr_extension_info_container {
|
145 |
+
width: 27%;
|
146 |
+
}
|
147 |
+
|
148 |
+
.lr_admin_configuration_info_fieldsets {
|
149 |
+
border-radius: 6px;
|
150 |
+
}
|
151 |
+
|
152 |
+
.lr_configuration_info_fieldsets a:hover, .loginRadiusHelpDiv ul li a:hover {
|
153 |
+
text-decoration: underline !important
|
154 |
+
}
|
155 |
+
|
156 |
+
#sharing_options_horizontalSharing_horizontalSharingTheme32 {
|
157 |
+
margin: 10px 10px 0 0;
|
158 |
+
}
|
159 |
+
|
160 |
+
#sharing_options_horizontalSharing_horizontalSharingTheme16 {
|
161 |
+
margin: 2px 12px 0 0;
|
162 |
+
}
|
163 |
+
|
164 |
+
#sharing_options_horizontalSharing_horizontalSharingThemeresponsive {
|
165 |
+
margin: 6px 11px 0 0;
|
166 |
+
}
|
167 |
+
|
168 |
+
#sharing_options_horizontalSharing_horizontalSharingThemesingle_large {
|
169 |
+
margin: 6px 11px 0 0;
|
170 |
+
}
|
171 |
+
|
172 |
+
#sharing_options_horizontalSharing_horizontalSharingThemesingle_small {
|
173 |
+
margin: 3px 11px 0 0;
|
174 |
+
}
|
175 |
+
|
176 |
+
#sharing_options_horizontalSharing_horizontalSharingThemecounter_vertical {
|
177 |
+
margin: 30px 11px 0 0;
|
178 |
+
}
|
179 |
+
|
180 |
+
#sharing_options_horizontalSharing_horizontalSharingThemecounter_horizontal {
|
181 |
+
margin: 4px 11px 0 0;
|
182 |
+
}
|
183 |
+
|
184 |
+
fieldset#sharing_options_help table {
|
185 |
+
width: 60% !important;
|
186 |
+
}
|
187 |
+
|
188 |
+
|
189 |
+
|
skin/{frontend/base → adminhtml/default}/default/Loginradius/Sharing/css/lrshare_iconsprite32.png
RENAMED
File without changes
|
skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Horizontal/horizonSharing16.png
ADDED
Binary file
|
skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Horizontal/horizonSharing32.png
ADDED
Binary file
|
skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Horizontal/horizontal.png
ADDED
Binary file
|
skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Horizontal/responsive-icons.png
ADDED
Binary file
|
skin/{frontend/base → adminhtml/default}/default/Loginradius/Sharing/images/Sharing/Horizontal/single-image-theme-large.png
RENAMED
File without changes
|
skin/{frontend/base → adminhtml/default}/default/Loginradius/Sharing/images/Sharing/Horizontal/single-image-theme-small.png
RENAMED
File without changes
|
skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Horizontal/vertical.png
ADDED
Binary file
|
skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Vertical/16VerticlewithBox.png
ADDED
Binary file
|
skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Vertical/32VerticlewithBox.png
ADDED
Binary file
|
skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Vertical/verticalhorizontal.png
ADDED
Binary file
|
skin/adminhtml/default/default/Loginradius/Sharing/images/Sharing/Vertical/verticalvertical.png
ADDED
Binary file
|
skin/adminhtml/default/default/Loginradius/Sharing/js/admin-ui.js
ADDED
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// get trim() worked in IE
|
2 |
+
if (typeof String.prototype.trim !== 'function') {
|
3 |
+
String.prototype.trim = function () {
|
4 |
+
return this.replace(/^\s+|\s+$/g, '');
|
5 |
+
}
|
6 |
+
}
|
7 |
+
var $loginRadiusSharingJquery = jQuery.noConflict();
|
8 |
+
// prepare admin UI on window load
|
9 |
+
function loginRadiusSharingPrepareAdminUI() {
|
10 |
+
|
11 |
+
var horizontalSharingTheme, verticalSharingTheme;
|
12 |
+
// fetch horizontal and vertical sharing providers dynamically from LoginRadius on window load
|
13 |
+
var sharingType = ['horizontal', 'vertical'];
|
14 |
+
var sharingModes = ['Sharing', 'Counter'];
|
15 |
+
// show the sharing/counter providers according to the selected sharing theme
|
16 |
+
for (var j = 0; j < sharingType.length; j++) {
|
17 |
+
var loginRadiusHorizontalSharingThemes = document.getElementById('row_sharing_options_' + sharingType[j] + 'Sharing_' + sharingType[j] + 'SharingTheme').getElementsByTagName('input');
|
18 |
+
for (var i = 0; i < loginRadiusHorizontalSharingThemes.length; i++) {
|
19 |
+
if (sharingType[j] == 'horizontal') {
|
20 |
+
loginRadiusHorizontalSharingThemes[i].onclick = function () {
|
21 |
+
loginRadiusToggleSharingProviders(this, 'horizontal');
|
22 |
+
}
|
23 |
+
} else if (sharingType[j] == 'vertical') {
|
24 |
+
loginRadiusHorizontalSharingThemes[i].onclick = function () {
|
25 |
+
loginRadiusToggleSharingProviders(this, 'vertical');
|
26 |
+
}
|
27 |
+
}
|
28 |
+
if (loginRadiusHorizontalSharingThemes[i].checked == true) {
|
29 |
+
if (sharingType[j] == 'horizontal') {
|
30 |
+
horizontalSharingTheme = loginRadiusHorizontalSharingThemes[i].value;
|
31 |
+
} else if (sharingType[j] == 'vertical') {
|
32 |
+
verticalSharingTheme = loginRadiusHorizontalSharingThemes[i].value;
|
33 |
+
}
|
34 |
+
loginRadiusToggleSharingProviders(loginRadiusHorizontalSharingThemes[i], sharingType[j]);
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
// set left margin for first radio button in Horizontal counter
|
39 |
+
document.getElementById('sharing_options_horizontalSharing_horizontalSharingTheme32').style.marginLeft = '6px';
|
40 |
+
// if selected sharing theme is worth showing rearrange icons, then show rearrange icons and manage sharing providers in hidden field
|
41 |
+
for (var j = 0; j < sharingType.length; j++) {
|
42 |
+
for (var jj = 0; jj < sharingModes.length; jj++) {
|
43 |
+
// get sharing providers table-row reference
|
44 |
+
var loginRadiusHorizontalSharingProvidersRow = document.getElementById('row_sharing_options_' + sharingType[j] + 'Sharing_' + sharingType[j] + sharingModes[jj] + 'Providers');
|
45 |
+
// get sharing providers checkboxes reference
|
46 |
+
var loginRadiusHorizontalSharingProviders = loginRadiusHorizontalSharingProvidersRow.getElementsByTagName('input');
|
47 |
+
for (var i = 0; i < loginRadiusHorizontalSharingProviders.length; i++) {
|
48 |
+
if (sharingType[j] == 'horizontal') {
|
49 |
+
if (sharingModes[jj] == 'Sharing') {
|
50 |
+
loginRadiusHorizontalSharingProviders[i].onclick = function () {
|
51 |
+
loginRadiusSharingShowIcon(false, this, 'horizontal');
|
52 |
+
}
|
53 |
+
} else {
|
54 |
+
loginRadiusHorizontalSharingProviders[i].onclick = function () {
|
55 |
+
loginRadiusSharingPopulateCounter(this, 'horizontal');
|
56 |
+
}
|
57 |
+
}
|
58 |
+
} else if (sharingType[j] == 'vertical') {
|
59 |
+
if (sharingModes[jj] == 'Sharing') {
|
60 |
+
loginRadiusHorizontalSharingProviders[i].onclick = function () {
|
61 |
+
loginRadiusSharingShowIcon(false, this, 'vertical');
|
62 |
+
}
|
63 |
+
} else {
|
64 |
+
loginRadiusHorizontalSharingProviders[i].onclick = function () {
|
65 |
+
loginRadiusSharingPopulateCounter(this, 'vertical');
|
66 |
+
}
|
67 |
+
}
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
// check the sharing providers that were saved previously in the hidden field
|
72 |
+
var loginRadiusSharingProvidersHidden = document.getElementById('sharing_options_' + sharingType[j] + 'Sharing_' + sharingType[j] + sharingModes[jj] + 'ProvidersHidden').value.trim();
|
73 |
+
if (loginRadiusSharingProvidersHidden != "") {
|
74 |
+
var loginRadiusSharingProviderArray = loginRadiusSharingProvidersHidden.split(',');
|
75 |
+
if (sharingModes[jj] == 'Sharing') {
|
76 |
+
for (var i = 0; i < loginRadiusSharingProviderArray.length; i++) {
|
77 |
+
if (document.getElementById(sharingType[j] + "_" + sharingModes[jj] + "_" + loginRadiusSharingProviderArray[i])) {
|
78 |
+
document.getElementById(sharingType[j] + "_" + sharingModes[jj] + "_" + loginRadiusSharingProviderArray[i]).checked = true;
|
79 |
+
loginRadiusSharingShowIcon(true, document.getElementById(sharingType[j] + "_" + sharingModes[jj] + "_" + loginRadiusSharingProviderArray[i]), sharingType[j]);
|
80 |
+
}
|
81 |
+
}
|
82 |
+
} else {
|
83 |
+
for (var i = 0; i < loginRadiusSharingProviderArray.length; i++) {
|
84 |
+
if (document.getElementById(sharingType[j] + "_" + sharingModes[jj] + "_" + loginRadiusSharingProviderArray[i])) {
|
85 |
+
document.getElementById(sharingType[j] + "_" + sharingModes[jj] + "_" + loginRadiusSharingProviderArray[i]).checked = true;
|
86 |
+
}
|
87 |
+
}
|
88 |
+
}
|
89 |
+
} else {
|
90 |
+
if (sharingModes[jj] == 'Sharing') {
|
91 |
+
var loginRadiusSharingProviderArray = ["Facebook", "GooglePlus", "Twitter", "Pinterest", "Email", "Print"];
|
92 |
+
for (var i = 0; i < loginRadiusSharingProviderArray.length; i++) {
|
93 |
+
if (document.getElementById(sharingType[j] + "_" + sharingModes[jj] + "_" + loginRadiusSharingProviderArray[i])) {
|
94 |
+
document.getElementById(sharingType[j] + "_" + sharingModes[jj] + "_" + loginRadiusSharingProviderArray[i]).checked = true;
|
95 |
+
loginRadiusSharingShowIcon(true, document.getElementById(sharingType[j] + "_" + sharingModes[jj] + "_" + loginRadiusSharingProviderArray[i]), sharingType[j], true);
|
96 |
+
}
|
97 |
+
}
|
98 |
+
} else {
|
99 |
+
var loginRadiusSharingProviderArray = ["Facebook Like", "Google+ +1", "Twitter Tweet", "Pinterest Pin it", "Hybridshare"];
|
100 |
+
for (var i = 0; i < loginRadiusSharingProviderArray.length; i++) {
|
101 |
+
if (document.getElementById(sharingType[j] + "_" + sharingModes[jj] + "_" + loginRadiusSharingProviderArray[i])) {
|
102 |
+
document.getElementById(sharingType[j] + "_" + sharingModes[jj] + "_" + loginRadiusSharingProviderArray[i]).checked = true;
|
103 |
+
loginRadiusSharingPopulateCounter(document.getElementById(sharingType[j] + "_" + sharingModes[jj] + "_" + loginRadiusSharingProviderArray[i]), sharingType[j]);
|
104 |
+
}
|
105 |
+
}
|
106 |
+
}
|
107 |
+
}
|
108 |
+
}
|
109 |
+
}
|
110 |
+
}
|
111 |
+
// limit maximum number of providers selected in sharing
|
112 |
+
function loginRadiusSharingSharingLimit(elem, sharingType) {
|
113 |
+
var checkCount = 0;
|
114 |
+
// get providers table-row reference
|
115 |
+
var loginRadiusSharingProvidersRow = document.getElementById('row_sharing_options_' + sharingType + 'Sharing_' + sharingType + 'SharingProviders');
|
116 |
+
// get sharing providers checkboxes reference
|
117 |
+
var loginRadiusSharingProviders = loginRadiusSharingProvidersRow.getElementsByTagName('input');
|
118 |
+
for (var i = 0; i < loginRadiusSharingProviders.length; i++) {
|
119 |
+
if (loginRadiusSharingProviders[i].checked) {
|
120 |
+
// count checked providers
|
121 |
+
checkCount++;
|
122 |
+
if (checkCount >= 10) {
|
123 |
+
elem.checked = false;
|
124 |
+
if (document.getElementById('loginRadius' + sharingType + 'ErrorDiv') == null) {
|
125 |
+
// create and show div having error message
|
126 |
+
var errorDiv = document.createElement('div');
|
127 |
+
errorDiv.setAttribute('id', 'loginRadius' + sharingType + 'ErrorDiv');
|
128 |
+
errorDiv.innerHTML = "You can select only 9 providers.";
|
129 |
+
errorDiv.style.color = 'red';
|
130 |
+
errorDiv.style.marginBottom = '10px';
|
131 |
+
// append div to the <td> containing sharing provider checkboxes
|
132 |
+
var rearrangeTd = loginRadiusSharingProvidersRow.getElementsByTagName('td');
|
133 |
+
$loginRadiusSharingJquery(rearrangeTd[1]).find('ul').before(errorDiv);
|
134 |
+
}
|
135 |
+
return;
|
136 |
+
}
|
137 |
+
}
|
138 |
+
}
|
139 |
+
}
|
140 |
+
// add/remove icons from counter hidden field
|
141 |
+
function loginRadiusSharingPopulateCounter(elem, sharingType, lrDefault) {
|
142 |
+
// get providers hidden field value
|
143 |
+
var providers = document.getElementById('sharing_options_' + sharingType + 'Sharing_' + sharingType + 'CounterProvidersHidden');
|
144 |
+
if (elem.value != 1) {
|
145 |
+
if (elem.checked) {
|
146 |
+
// add selected providers in the hiddem field value
|
147 |
+
if (typeof elem.checked != "undefined" || lrDefault == true) {
|
148 |
+
if (providers.value == "") {
|
149 |
+
providers.value = elem.value;
|
150 |
+
} else {
|
151 |
+
providers.value += "," + elem.value;
|
152 |
+
}
|
153 |
+
}
|
154 |
+
} else {
|
155 |
+
if (providers.value.indexOf(',') == -1) {
|
156 |
+
providers.value = providers.value.replace(elem.value, "");
|
157 |
+
} else {
|
158 |
+
if (providers.value.indexOf("," + elem.value) == -1) {
|
159 |
+
providers.value = providers.value.replace(elem.value + ",", "");
|
160 |
+
} else {
|
161 |
+
providers.value = providers.value.replace("," + elem.value, "");
|
162 |
+
}
|
163 |
+
}
|
164 |
+
}
|
165 |
+
}
|
166 |
+
}
|
167 |
+
// show selected providers in rearrange option
|
168 |
+
function loginRadiusSharingShowIcon(pageRefresh, elem, sharingType, lrDefault) {
|
169 |
+
loginRadiusSharingSharingLimit(elem, sharingType);
|
170 |
+
// get providers hidden field value
|
171 |
+
var providers = document.getElementById('sharing_options_' + sharingType + 'Sharing_' + sharingType + 'SharingProvidersHidden');
|
172 |
+
if (elem.value != 1) {
|
173 |
+
if (elem.checked) {
|
174 |
+
// get reference to "rearrange providers" <ul> element
|
175 |
+
var ul = document.getElementById('loginRadius' + sharingType + 'RearrangeSharing');
|
176 |
+
// if <ul> is not already created
|
177 |
+
if (ul == null) {
|
178 |
+
// create <ul> element
|
179 |
+
var ul = document.createElement('ul');
|
180 |
+
ul.setAttribute('id', 'loginRadius' + sharingType + 'RearrangeSharing');
|
181 |
+
$loginRadiusSharingJquery(ul).sortable({
|
182 |
+
update: function (e, ui) {
|
183 |
+
var val = $loginRadiusSharingJquery(this).children().map(function () {
|
184 |
+
return $loginRadiusSharingJquery(this).attr('title');
|
185 |
+
}).get().join();
|
186 |
+
$loginRadiusSharingJquery(providers).val(val);
|
187 |
+
},
|
188 |
+
revert: true});
|
189 |
+
}
|
190 |
+
// create list items
|
191 |
+
var listItem = document.createElement('li');
|
192 |
+
listItem.setAttribute('id', 'loginRadius' + sharingType + 'LI' + elem.value);
|
193 |
+
listItem.setAttribute('title', elem.value);
|
194 |
+
listItem.setAttribute('class', 'lrshare_iconsprite32 lrshare_' + elem.value.toLowerCase());
|
195 |
+
ul.appendChild(listItem);
|
196 |
+
// add selected providers in the hiddem field value
|
197 |
+
if (!pageRefresh || lrDefault == true) {
|
198 |
+
if (providers.value == "") {
|
199 |
+
providers.value = elem.value;
|
200 |
+
} else {
|
201 |
+
providers.value += "," + elem.value;
|
202 |
+
}
|
203 |
+
}
|
204 |
+
// append <ul> to the <td>
|
205 |
+
var rearrangeRow = document.getElementById('row_sharing_options_' + sharingType + 'Sharing_' + sharingType + 'SharingProvidersHidden');
|
206 |
+
var rearrangeTd = rearrangeRow.getElementsByTagName('td');
|
207 |
+
rearrangeTd[1].appendChild(ul);
|
208 |
+
} else {
|
209 |
+
var remove = document.getElementById('loginRadius' + sharingType + 'LI' + elem.value);
|
210 |
+
if (remove) {
|
211 |
+
remove.parentNode.removeChild(remove);
|
212 |
+
}
|
213 |
+
if (providers.value.indexOf(',') == -1) {
|
214 |
+
providers.value = providers.value.replace(elem.value, "");
|
215 |
+
} else {
|
216 |
+
if (providers.value.indexOf("," + elem.value) == -1) {
|
217 |
+
providers.value = providers.value.replace(elem.value + ",", "");
|
218 |
+
} else {
|
219 |
+
providers.value = providers.value.replace("," + elem.value, "");
|
220 |
+
}
|
221 |
+
}
|
222 |
+
}
|
223 |
+
}
|
224 |
+
}
|
225 |
+
|
226 |
+
function loginradiusChangeInheritCheckbox(shareId1, shareId2) {
|
227 |
+
if ($loginRadiusSharingJquery("#sharing_options_" + shareId1 + "_" + shareId2 + "Providers_inherit").is(':checked')) {
|
228 |
+
$loginRadiusSharingJquery("#sharing_options_" + shareId1 + "_" + shareId2 + "ProvidersHidden_inherit").attr('checked', true);
|
229 |
+
$loginRadiusSharingJquery("#sharing_options_" + shareId1 + "_" + shareId2 + "ProvidersHidden").attr("disabled", true);
|
230 |
+
} else {
|
231 |
+
$loginRadiusSharingJquery("#sharing_options_" + shareId1 + "_" + shareId2 + "ProvidersHidden_inherit").attr('checked', false);
|
232 |
+
$loginRadiusSharingJquery("#sharing_options_" + shareId1 + "_" + shareId2 + "ProvidersHidden").attr("disabled", false);
|
233 |
+
}
|
234 |
+
}
|
235 |
+
|
236 |
+
function loginradiusChangeInheritCheckboxHidden(shareId1, shareId2) {
|
237 |
+
if ($loginRadiusSharingJquery("#sharing_options_" + shareId1 + "_" + shareId2 + "ProvidersHidden_inherit").is(':checked')) {
|
238 |
+
$loginRadiusSharingJquery("#sharing_options_" + shareId1 + "_" + shareId2 + "Providers_inherit").attr('checked', true);
|
239 |
+
$loginRadiusSharingJquery("#sharing_options_" + shareId1 + "_" + shareId2 + "ProvidersHidden").attr("disabled", true);
|
240 |
+
} else {
|
241 |
+
$loginRadiusSharingJquery("#sharing_options_" + shareId1 + "_" + shareId2 + "Providers_inherit").attr('checked', false);
|
242 |
+
$loginRadiusSharingJquery("#sharing_options_" + shareId1 + "_" + shareId2 + "ProvidersHidden").attr("disabled", false);
|
243 |
+
}
|
244 |
+
}
|
245 |
+
|
246 |
+
$loginRadiusSharingJquery(document).ready(function () {
|
247 |
+
loginradiusChangeInheritCheckboxHidden('horizontalSharing', 'horizontalCounter');
|
248 |
+
loginradiusChangeInheritCheckboxHidden('verticalSharing', 'verticalCounter');
|
249 |
+
loginradiusChangeInheritCheckboxHidden('horizontalSharing', 'horizontalSharing');
|
250 |
+
loginradiusChangeInheritCheckboxHidden('verticalSharing', 'verticalSharing');
|
251 |
+
$loginRadiusSharingJquery("#sharing_options_horizontalSharing_horizontalCounterProviders_inherit").click(function () {
|
252 |
+
loginradiusChangeInheritCheckbox('horizontalSharing', 'horizontalCounter');
|
253 |
+
});
|
254 |
+
$loginRadiusSharingJquery("#sharing_options_verticalSharing_verticalCounterProviders_inherit").click(function () {
|
255 |
+
loginradiusChangeInheritCheckbox('verticalSharing', 'verticalCounter');
|
256 |
+
});
|
257 |
+
$loginRadiusSharingJquery("#sharing_options_horizontalSharing_horizontalSharingProviders_inherit").click(function () {
|
258 |
+
loginradiusChangeInheritCheckbox('horizontalSharing', 'horizontalSharing');
|
259 |
+
});
|
260 |
+
$loginRadiusSharingJquery("#sharing_options_verticalSharing_verticalSharingProviders_inherit").click(function () {
|
261 |
+
loginradiusChangeInheritCheckbox('verticalSharing', 'verticalSharing');
|
262 |
+
});
|
263 |
+
$loginRadiusSharingJquery("#sharing_options_horizontalSharing_horizontalSharingProvidersHidden_inherit").click(function () {
|
264 |
+
loginradiusChangeInheritCheckboxHidden('horizontalSharing', 'horizontalSharing');
|
265 |
+
});
|
266 |
+
$loginRadiusSharingJquery("#sharing_options_verticalSharing_verticalSharingProvidersHidden_inherit").click(function () {
|
267 |
+
loginradiusChangeInheritCheckboxHidden('verticalSharing', 'verticalSharing');
|
268 |
+
});
|
269 |
+
});
|
skin/{frontend/base → adminhtml/default}/default/Loginradius/Sharing/js/jquery.js
RENAMED
File without changes
|
skin/{frontend/base → adminhtml/default}/default/Loginradius/Sharing/js/jquery.ui.sortable.min.js
RENAMED
File without changes
|
skin/frontend/base/default/Loginradius/Sharing/css/admin-ui.css
DELETED
@@ -1,130 +0,0 @@
|
|
1 |
-
.loginRadiusFieldset{
|
2 |
-
position: relative;
|
3 |
-
border: #d7d7d7 1px solid;
|
4 |
-
border-radius: 4px;
|
5 |
-
width: 490px;
|
6 |
-
float: left;
|
7 |
-
padding: 3px 10px 0 10px;
|
8 |
-
margin-bottom: 10px;
|
9 |
-
background-color: #FFFFE0;
|
10 |
-
border: 1px solid #E6DB55;
|
11 |
-
}
|
12 |
-
.loginRadiusHelpDiv {
|
13 |
-
width: 65%;
|
14 |
-
float: left;
|
15 |
-
border-radius: 4px;
|
16 |
-
margin-right: 10px;
|
17 |
-
background-color: #FFFFE0 !important;
|
18 |
-
border: 1px solid #E6DB55 !important;
|
19 |
-
padding-bottom:5px !important;
|
20 |
-
}
|
21 |
-
.loginRadiusFieldset a, .loginRadiusHelpDiv ul li a{
|
22 |
-
text-decoration: none;
|
23 |
-
}
|
24 |
-
.loginRadiusFieldset a:hover, .loginRadiusHelpDiv ul li a:hover{
|
25 |
-
text-decoration:underline !important
|
26 |
-
}
|
27 |
-
.loginRadiusHelpDiv ul li{
|
28 |
-
list-style-type: disc;
|
29 |
-
}
|
30 |
-
.loginRadiusHelpDiv ul{
|
31 |
-
margin: 0 15px;
|
32 |
-
}
|
33 |
-
loginradius_radio{
|
34 |
-
vertical-align:top;
|
35 |
-
margin-left:7px
|
36 |
-
}
|
37 |
-
#row_sharing_options_horizontalSharing_horizontalSharingProviders ul li{
|
38 |
-
width:149px;
|
39 |
-
float:left
|
40 |
-
}
|
41 |
-
#row_sharing_options_messages_redirect td input{
|
42 |
-
margin-right:2px
|
43 |
-
}
|
44 |
-
#row_sharing_options_verticalSharing_verticalSharingProviders ul li{
|
45 |
-
width:149px;
|
46 |
-
float:left
|
47 |
-
}
|
48 |
-
#row_sharing_options_verticalSharing_verticalCounterProviders ul li{
|
49 |
-
width:149px;
|
50 |
-
float:left
|
51 |
-
}
|
52 |
-
#row_sharing_options_horizontalSharing_horizontalCounterProviders ul li{
|
53 |
-
width:149px;
|
54 |
-
float:left
|
55 |
-
}
|
56 |
-
#loginRadiushorizontalRearrangeSharing li, #loginRadiusverticalRearrangeSharing li{
|
57 |
-
float:left
|
58 |
-
}
|
59 |
-
#row_sharing_options_verticalSharing_verticalSharingTheme td label{
|
60 |
-
float:left !important
|
61 |
-
}
|
62 |
-
#row_sharing_options_messages_iconSize td input{
|
63 |
-
margin-right:2px
|
64 |
-
}
|
65 |
-
#row_sharing_options_verticalSharing_verticalSharingTheme td input{
|
66 |
-
float:left !important;
|
67 |
-
margin-left:4px
|
68 |
-
}
|
69 |
-
#row_sharing_options_horizontalSharing_horizontalSharingTheme td input{
|
70 |
-
vertical-align:top
|
71 |
-
}
|
72 |
-
#row_sharing_options_horizontalSharing_horizontalSharingTheme td[class=value]{
|
73 |
-
width: 400px !important
|
74 |
-
}
|
75 |
-
#row_sharing_options_verticalSharing_verticalSharingTheme td.value{
|
76 |
-
width:400px !important;
|
77 |
-
}
|
78 |
-
#row_sharing_options_sharing_verticalSharing td input{
|
79 |
-
vertical-align:top !important;
|
80 |
-
float:left !important;
|
81 |
-
margin-right:2px
|
82 |
-
}
|
83 |
-
#row_sharing_options_sharing_verticalSharing td label, #row_sharing_options_counter_verticalCounter td label{
|
84 |
-
float:left !important
|
85 |
-
}
|
86 |
-
#row_sharing_options_sharing_horizontalSharing td input{
|
87 |
-
vertical-align:top !important;
|
88 |
-
margin-right:2px
|
89 |
-
}
|
90 |
-
#row_sharing_options_counter_horizontalCounter td input{
|
91 |
-
vertical-align:top !important;
|
92 |
-
margin-right:2px
|
93 |
-
}
|
94 |
-
#row_sharing_options_counter_verticalCounter td input{
|
95 |
-
vertical-align:top !important;
|
96 |
-
margin-right:2px;
|
97 |
-
float:left !important
|
98 |
-
}
|
99 |
-
.lrshare_iconsprite32{
|
100 |
-
cursor: pointer !important;
|
101 |
-
height: 32px;
|
102 |
-
margin: 4px !important;
|
103 |
-
width: 32px;
|
104 |
-
padding: 0px !important;
|
105 |
-
border: none !important;
|
106 |
-
background: url("lrshare_iconsprite32.png") no-repeat scroll left top transparent;
|
107 |
-
list-style-type: none !important;
|
108 |
-
}
|
109 |
-
.lrshare_iconsprite32.lrshare_delicious { background-position: 0px 0px; width: 32px; height: 32px; }
|
110 |
-
.lrshare_iconsprite32.lrshare_digg { background-position: -34px 0px; width: 32px; height: 32px; }
|
111 |
-
.lrshare_iconsprite32.lrshare_dotnetkicks { background-position: -68px 0px; width: 32px; height: 32px; }
|
112 |
-
.lrshare_iconsprite32.lrshare_email { background-position: -102px 0px; width: 32px; height: 32px; }
|
113 |
-
.lrshare_iconsprite32.lrshare_evenmore32 { background-position: -138px 0px; width: 32px; height: 32px; }
|
114 |
-
.lrshare_iconsprite32.lrshare_facebook { background-position: -174px 0px; width: 32px; height: 32px; }
|
115 |
-
.lrshare_iconsprite32.lrshare_google { background-position: -208px 0px; width: 32px; height: 32px; }
|
116 |
-
.lrshare_iconsprite32.lrshare_googleplus { background-position: -242px 0px; width: 32px; height: 32px; }
|
117 |
-
.lrshare_iconsprite32.lrshare_hyves { background-position: -276px 0px; width: 32px; height: 32px; }
|
118 |
-
.lrshare_iconsprite32.lrshare_linkedin { background-position: -310px 0px; width: 32px; height: 32px; }
|
119 |
-
.lrshare_iconsprite32.lrshare_live { background-position: -344px 0px; width: 32px; height: 32px; }
|
120 |
-
.lrshare_iconsprite32.lrshare_myspace { background-position: -378px 0px; width: 32px; height: 32px; }
|
121 |
-
.lrshare_iconsprite32.lrshare_pinterest { background-position: -412px 0px; width: 32px; height: 32px; }
|
122 |
-
.lrshare_iconsprite32.lrshare_print { background-position: -446px 0px; width: 32px; height: 32px; }
|
123 |
-
.lrshare_iconsprite32.lrshare_reddit { background-position: -480px 0px; width: 32px; height: 32px; }
|
124 |
-
.lrshare_iconsprite32.lrshare_sharingcounter32 { background-position: -514px 0px; width: 50px; height: 32px; padding-top:4px !important; font-size:18px; }
|
125 |
-
.lrshare_iconsprite32.lrshare_tumblr { background-position: -576px 0px; width: 32px; height: 32px; }
|
126 |
-
.lrshare_iconsprite32.lrshare_twitter { background-position: -610px 0px; width: 32px; height: 32px; }
|
127 |
-
.lrshare_iconsprite32.lrshare_viadeo { background-position: -644px 0px; width: 32px; height: 32px; }
|
128 |
-
.lrshare_iconsprite32.lrshare_vkontakte { background-position: -678px 0px; width: 32px; height: 32px; }
|
129 |
-
.lrshare_iconsprite32.lrshare_wordpress { background-position: -712px 0px; width: 32px; height: 32px; }
|
130 |
-
.lrshare_iconsprite32.lrshare_yahoo { background-position: -746px 0px; width: 32px; height: 32px; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skin/frontend/base/default/Loginradius/Sharing/images/Sharing/Horizontal/horizonSharing16.png
DELETED
Binary file
|
skin/frontend/base/default/Loginradius/Sharing/images/Sharing/Horizontal/horizonSharing32.png
DELETED
Binary file
|
skin/frontend/base/default/Loginradius/Sharing/images/Sharing/Horizontal/horizontal.png
DELETED
Binary file
|
skin/frontend/base/default/Loginradius/Sharing/images/Sharing/Horizontal/vertical.png
DELETED
Binary file
|
skin/frontend/base/default/Loginradius/Sharing/images/Sharing/Vertical/16VerticlewithBox.png
DELETED
Binary file
|
skin/frontend/base/default/Loginradius/Sharing/images/Sharing/Vertical/32VerticlewithBox.png
DELETED
Binary file
|
skin/frontend/base/default/Loginradius/Sharing/images/Sharing/Vertical/verticalhorizontal.png
DELETED
Binary file
|
skin/frontend/base/default/Loginradius/Sharing/images/Sharing/Vertical/verticalvertical.png
DELETED
Binary file
|
skin/frontend/base/default/Loginradius/Sharing/images/loading_icon.gif
DELETED
Binary file
|
skin/frontend/base/default/Loginradius/Sharing/js/admin-ui.js
DELETED
@@ -1,272 +0,0 @@
|
|
1 |
-
// get trim() worked in IE
|
2 |
-
if(typeof String.prototype.trim !== 'function') {
|
3 |
-
String.prototype.trim = function() {
|
4 |
-
return this.replace(/^\s+|\s+$/g, '');
|
5 |
-
}
|
6 |
-
}
|
7 |
-
var $loginRadiusSharingJquery = jQuery.noConflict();
|
8 |
-
// prepare admin UI on window load
|
9 |
-
function loginRadiusSharingPrepareAdminUI(){
|
10 |
-
// highlight API Key and Secret notification
|
11 |
-
if($loginRadiusSharingJquery('#loginRadiusKeySecretNotification')){
|
12 |
-
$loginRadiusSharingJquery('#loginRadiusKeySecretNotification').animate({'backgroundColor' : 'rgb(241, 142, 127)'}, 1000).animate({'backgroundColor' : '#FFFFE0'}, 1000).animate({'backgroundColor' : 'rgb(241, 142, 127)'}, 1000).animate({'backgroundColor' : '#FFFFE0'}, 1000);
|
13 |
-
}
|
14 |
-
var horizontalSharingTheme, verticalSharingTheme;
|
15 |
-
// fetch horizontal and vertical sharing providers dynamically from LoginRadius on window load
|
16 |
-
var sharingType = ['horizontal', 'vertical'];
|
17 |
-
var sharingModes = ['Sharing', 'Counter'];
|
18 |
-
// show the sharing/counter providers according to the selected sharing theme
|
19 |
-
for(var j = 0; j < sharingType.length; j++){
|
20 |
-
var loginRadiusHorizontalSharingThemes = document.getElementById('row_sharing_options_'+sharingType[j]+'Sharing_'+sharingType[j]+'SharingTheme').getElementsByTagName('input');
|
21 |
-
for(var i = 0; i < loginRadiusHorizontalSharingThemes.length; i++){
|
22 |
-
if(sharingType[j] == 'horizontal'){
|
23 |
-
loginRadiusHorizontalSharingThemes[i].onclick = function(){
|
24 |
-
loginRadiusToggleSharingProviders(this, 'horizontal');
|
25 |
-
}
|
26 |
-
}else if(sharingType[j] == 'vertical'){
|
27 |
-
loginRadiusHorizontalSharingThemes[i].onclick = function(){
|
28 |
-
loginRadiusToggleSharingProviders(this, 'vertical');
|
29 |
-
}
|
30 |
-
}
|
31 |
-
if(loginRadiusHorizontalSharingThemes[i].checked == true){
|
32 |
-
if(sharingType[j] == 'horizontal'){
|
33 |
-
horizontalSharingTheme = loginRadiusHorizontalSharingThemes[i].value;
|
34 |
-
}else if(sharingType[j] == 'vertical'){
|
35 |
-
verticalSharingTheme = loginRadiusHorizontalSharingThemes[i].value;
|
36 |
-
}
|
37 |
-
loginRadiusToggleSharingProviders(loginRadiusHorizontalSharingThemes[i], sharingType[j]);
|
38 |
-
}
|
39 |
-
}
|
40 |
-
}
|
41 |
-
// set left margin for first radio button in Horizontal counter
|
42 |
-
document.getElementById('sharing_options_horizontalSharing_horizontalSharingTheme32').style.marginLeft = '6px';
|
43 |
-
// if selected sharing theme is worth showing rearrange icons, then show rearrange icons and manage sharing providers in hidden field
|
44 |
-
for(var j = 0; j < sharingType.length; j++){
|
45 |
-
for(var jj = 0; jj < sharingModes.length; jj++){
|
46 |
-
// get sharing providers table-row reference
|
47 |
-
var loginRadiusHorizontalSharingProvidersRow = document.getElementById('row_sharing_options_'+sharingType[j]+'Sharing_'+sharingType[j]+sharingModes[jj]+'Providers');
|
48 |
-
// get sharing providers checkboxes reference
|
49 |
-
var loginRadiusHorizontalSharingProviders = loginRadiusHorizontalSharingProvidersRow.getElementsByTagName('input');
|
50 |
-
for(var i = 0; i < loginRadiusHorizontalSharingProviders.length; i++){
|
51 |
-
if(sharingType[j] == 'horizontal'){
|
52 |
-
if(sharingModes[jj] == 'Sharing'){
|
53 |
-
loginRadiusHorizontalSharingProviders[i].onclick = function(){
|
54 |
-
loginRadiusSharingShowIcon(false, this, 'horizontal');
|
55 |
-
}
|
56 |
-
}else{
|
57 |
-
loginRadiusHorizontalSharingProviders[i].onclick = function(){
|
58 |
-
loginRadiusSharingPopulateCounter(this, 'horizontal');
|
59 |
-
}
|
60 |
-
}
|
61 |
-
}else if(sharingType[j] == 'vertical'){
|
62 |
-
if(sharingModes[jj] == 'Sharing'){
|
63 |
-
loginRadiusHorizontalSharingProviders[i].onclick = function(){
|
64 |
-
loginRadiusSharingShowIcon(false, this, 'vertical');
|
65 |
-
}
|
66 |
-
}else{
|
67 |
-
loginRadiusHorizontalSharingProviders[i].onclick = function(){
|
68 |
-
loginRadiusSharingPopulateCounter(this, 'vertical');
|
69 |
-
}
|
70 |
-
}
|
71 |
-
}
|
72 |
-
}
|
73 |
-
|
74 |
-
// check the sharing providers that were saved previously in the hidden field
|
75 |
-
var loginRadiusSharingProvidersHidden = document.getElementById('sharing_options_'+sharingType[j]+'Sharing_'+sharingType[j]+sharingModes[jj]+'ProvidersHidden').value.trim();
|
76 |
-
if(loginRadiusSharingProvidersHidden != ""){
|
77 |
-
var loginRadiusSharingProviderArray = loginRadiusSharingProvidersHidden.split(',');
|
78 |
-
if(sharingModes[jj] == 'Sharing'){
|
79 |
-
for(var i = 0; i < loginRadiusSharingProviderArray.length; i++){
|
80 |
-
if(document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i])){
|
81 |
-
document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]).checked = true;
|
82 |
-
loginRadiusSharingShowIcon(true, document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]), sharingType[j]);
|
83 |
-
}
|
84 |
-
}
|
85 |
-
}else{
|
86 |
-
for(var i = 0; i < loginRadiusSharingProviderArray.length; i++){
|
87 |
-
if(document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i])){
|
88 |
-
document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]).checked = true;
|
89 |
-
}
|
90 |
-
}
|
91 |
-
}
|
92 |
-
}else{
|
93 |
-
if(sharingModes[jj] == 'Sharing'){
|
94 |
-
var loginRadiusSharingProviderArray = ["Facebook", "GooglePlus", "Twitter", "Pinterest", "Email", "Print"];
|
95 |
-
for(var i = 0; i < loginRadiusSharingProviderArray.length; i++){
|
96 |
-
if(document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i])){
|
97 |
-
document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]).checked = true;
|
98 |
-
loginRadiusSharingShowIcon(true, document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]), sharingType[j], true);
|
99 |
-
}
|
100 |
-
}
|
101 |
-
}else{
|
102 |
-
var loginRadiusSharingProviderArray = ["Facebook Like", "Google+ +1", "Twitter Tweet", "Pinterest Pin it", "Hybridshare"];
|
103 |
-
for(var i = 0; i < loginRadiusSharingProviderArray.length; i++){
|
104 |
-
if(document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i])){
|
105 |
-
document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]).checked = true;
|
106 |
-
loginRadiusSharingPopulateCounter(document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]), sharingType[j]);
|
107 |
-
}
|
108 |
-
}
|
109 |
-
}
|
110 |
-
}
|
111 |
-
}
|
112 |
-
}
|
113 |
-
}
|
114 |
-
// limit maximum number of providers selected in sharing
|
115 |
-
function loginRadiusSharingSharingLimit(elem, sharingType){
|
116 |
-
var checkCount = 0;
|
117 |
-
// get providers table-row reference
|
118 |
-
var loginRadiusSharingProvidersRow = document.getElementById('row_sharing_options_'+sharingType+'Sharing_'+sharingType+'SharingProviders');
|
119 |
-
// get sharing providers checkboxes reference
|
120 |
-
var loginRadiusSharingProviders = loginRadiusSharingProvidersRow.getElementsByTagName('input');
|
121 |
-
for(var i = 0; i < loginRadiusSharingProviders.length; i++){
|
122 |
-
if(loginRadiusSharingProviders[i].checked){
|
123 |
-
// count checked providers
|
124 |
-
checkCount++;
|
125 |
-
if(checkCount >= 10){
|
126 |
-
elem.checked = false;
|
127 |
-
if(document.getElementById('loginRadius'+sharingType+'ErrorDiv') == null){
|
128 |
-
// create and show div having error message
|
129 |
-
var errorDiv = document.createElement('div');
|
130 |
-
errorDiv.setAttribute('id', 'loginRadius'+sharingType+'ErrorDiv');
|
131 |
-
errorDiv.innerHTML = "You can select only 9 providers.";
|
132 |
-
errorDiv.style.color = 'red';
|
133 |
-
errorDiv.style.marginBottom = '10px';
|
134 |
-
// append div to the <td> containing sharing provider checkboxes
|
135 |
-
var rearrangeTd = loginRadiusSharingProvidersRow.getElementsByTagName('td');
|
136 |
-
$loginRadiusSharingJquery(rearrangeTd[1]).find('ul').before(errorDiv);
|
137 |
-
}
|
138 |
-
return;
|
139 |
-
}
|
140 |
-
}
|
141 |
-
}
|
142 |
-
}
|
143 |
-
// add/remove icons from counter hidden field
|
144 |
-
function loginRadiusSharingPopulateCounter(elem, sharingType, lrDefault){
|
145 |
-
// get providers hidden field value
|
146 |
-
var providers = document.getElementById('sharing_options_'+sharingType+'Sharing_'+sharingType+'CounterProvidersHidden');
|
147 |
-
if(elem.value != 1){
|
148 |
-
if(elem.checked){
|
149 |
-
// add selected providers in the hiddem field value
|
150 |
-
if(typeof elem.checked != "undefined" || lrDefault == true){
|
151 |
-
if(providers.value == ""){
|
152 |
-
providers.value = elem.value;
|
153 |
-
}else{
|
154 |
-
providers.value += ","+elem.value;
|
155 |
-
}
|
156 |
-
}
|
157 |
-
}else{
|
158 |
-
if(providers.value.indexOf(',') == -1){
|
159 |
-
providers.value = providers.value.replace(elem.value, "");
|
160 |
-
}else{
|
161 |
-
if(providers.value.indexOf(","+elem.value) == -1){
|
162 |
-
providers.value = providers.value.replace(elem.value+",", "");
|
163 |
-
}else{
|
164 |
-
providers.value = providers.value.replace(","+elem.value, "");
|
165 |
-
}
|
166 |
-
}
|
167 |
-
}
|
168 |
-
}
|
169 |
-
}
|
170 |
-
// show selected providers in rearrange option
|
171 |
-
function loginRadiusSharingShowIcon(pageRefresh, elem, sharingType, lrDefault){
|
172 |
-
loginRadiusSharingSharingLimit(elem, sharingType);
|
173 |
-
// get providers hidden field value
|
174 |
-
var providers = document.getElementById('sharing_options_'+sharingType+'Sharing_'+sharingType+'SharingProvidersHidden');
|
175 |
-
if(elem.value != 1){
|
176 |
-
if(elem.checked){
|
177 |
-
// get reference to "rearrange providers" <ul> element
|
178 |
-
var ul = document.getElementById('loginRadius'+sharingType+'RearrangeSharing');
|
179 |
-
// if <ul> is not already created
|
180 |
-
if(ul == null){
|
181 |
-
// create <ul> element
|
182 |
-
var ul = document.createElement('ul');
|
183 |
-
ul.setAttribute('id', 'loginRadius'+sharingType+'RearrangeSharing');
|
184 |
-
$loginRadiusSharingJquery(ul).sortable({
|
185 |
-
update: function(e, ui) {
|
186 |
-
var val = $loginRadiusSharingJquery(this).children().map(function() {
|
187 |
-
return $loginRadiusSharingJquery(this).attr('title');
|
188 |
-
}).get().join();
|
189 |
-
$loginRadiusSharingJquery(providers).val(val);
|
190 |
-
},
|
191 |
-
revert: true});
|
192 |
-
}
|
193 |
-
// create list items
|
194 |
-
var listItem = document.createElement('li');
|
195 |
-
listItem.setAttribute('id', 'loginRadius'+sharingType+'LI'+elem.value);
|
196 |
-
listItem.setAttribute('title', elem.value);
|
197 |
-
listItem.setAttribute('class', 'lrshare_iconsprite32 lrshare_'+elem.value.toLowerCase());
|
198 |
-
ul.appendChild(listItem);
|
199 |
-
// add selected providers in the hiddem field value
|
200 |
-
if(!pageRefresh || lrDefault == true){
|
201 |
-
if(providers.value == ""){
|
202 |
-
providers.value = elem.value;
|
203 |
-
}else{
|
204 |
-
providers.value += ","+elem.value;
|
205 |
-
}
|
206 |
-
}
|
207 |
-
// append <ul> to the <td>
|
208 |
-
var rearrangeRow = document.getElementById('row_sharing_options_'+sharingType+'Sharing_'+sharingType+'SharingProvidersHidden');
|
209 |
-
var rearrangeTd = rearrangeRow.getElementsByTagName('td');
|
210 |
-
rearrangeTd[1].appendChild(ul);
|
211 |
-
}else{
|
212 |
-
var remove = document.getElementById('loginRadius'+sharingType+'LI'+elem.value);
|
213 |
-
if(remove){
|
214 |
-
remove.parentNode.removeChild(remove);
|
215 |
-
}
|
216 |
-
if(providers.value.indexOf(',') == -1){
|
217 |
-
providers.value = providers.value.replace(elem.value, "");
|
218 |
-
}else{
|
219 |
-
if(providers.value.indexOf(","+elem.value) == -1){
|
220 |
-
providers.value = providers.value.replace(elem.value+",", "");
|
221 |
-
}else{
|
222 |
-
providers.value = providers.value.replace(","+elem.value, "");
|
223 |
-
}
|
224 |
-
}
|
225 |
-
}
|
226 |
-
}
|
227 |
-
}
|
228 |
-
|
229 |
-
function loginradiusChangeInheritCheckbox(shareId1,shareId2){
|
230 |
-
if($loginRadiusSharingJquery("#sharing_options_"+shareId1+"_"+shareId2+"Providers_inherit").is(':checked')){
|
231 |
-
$loginRadiusSharingJquery("#sharing_options_"+shareId1+"_"+shareId2+"ProvidersHidden_inherit").attr('checked',true);
|
232 |
-
$loginRadiusSharingJquery("#sharing_options_"+shareId1+"_"+shareId2+"ProvidersHidden").attr("disabled", true);
|
233 |
-
}else{
|
234 |
-
$loginRadiusSharingJquery("#sharing_options_"+shareId1+"_"+shareId2+"ProvidersHidden_inherit").attr('checked',false);
|
235 |
-
$loginRadiusSharingJquery("#sharing_options_"+shareId1+"_"+shareId2+"ProvidersHidden").attr("disabled", false);
|
236 |
-
}
|
237 |
-
}
|
238 |
-
|
239 |
-
function loginradiusChangeInheritCheckboxHidden(shareId1,shareId2){
|
240 |
-
if($loginRadiusSharingJquery("#sharing_options_"+shareId1+"_"+shareId2+"ProvidersHidden_inherit").is(':checked')){
|
241 |
-
$loginRadiusSharingJquery("#sharing_options_"+shareId1+"_"+shareId2+"Providers_inherit").attr('checked',true);
|
242 |
-
$loginRadiusSharingJquery("#sharing_options_"+shareId1+"_"+shareId2+"ProvidersHidden").attr("disabled", true);
|
243 |
-
}else{
|
244 |
-
$loginRadiusSharingJquery("#sharing_options_"+shareId1+"_"+shareId2+"Providers_inherit").attr('checked',false);
|
245 |
-
$loginRadiusSharingJquery("#sharing_options_"+shareId1+"_"+shareId2+"ProvidersHidden").attr("disabled", false);
|
246 |
-
}
|
247 |
-
}
|
248 |
-
|
249 |
-
$loginRadiusSharingJquery(document).ready(function(){
|
250 |
-
loginradiusChangeInheritCheckboxHidden('horizontalSharing','horizontalCounter');
|
251 |
-
loginradiusChangeInheritCheckboxHidden('verticalSharing','verticalCounter');
|
252 |
-
loginradiusChangeInheritCheckboxHidden('horizontalSharing','horizontalSharing');
|
253 |
-
loginradiusChangeInheritCheckboxHidden('verticalSharing','verticalSharing');
|
254 |
-
$loginRadiusSharingJquery("#sharing_options_horizontalSharing_horizontalCounterProviders_inherit").click(function(){
|
255 |
-
loginradiusChangeInheritCheckbox('horizontalSharing','horizontalCounter');
|
256 |
-
});
|
257 |
-
$loginRadiusSharingJquery("#sharing_options_verticalSharing_verticalCounterProviders_inherit").click(function(){
|
258 |
-
loginradiusChangeInheritCheckbox('verticalSharing','verticalCounter');
|
259 |
-
});
|
260 |
-
$loginRadiusSharingJquery("#sharing_options_horizontalSharing_horizontalSharingProviders_inherit").click(function(){
|
261 |
-
loginradiusChangeInheritCheckbox('horizontalSharing','horizontalSharing');
|
262 |
-
});
|
263 |
-
$loginRadiusSharingJquery("#sharing_options_verticalSharing_verticalSharingProviders_inherit").click(function(){
|
264 |
-
loginradiusChangeInheritCheckbox('verticalSharing','verticalSharing');
|
265 |
-
});
|
266 |
-
$loginRadiusSharingJquery("#sharing_options_horizontalSharing_horizontalSharingProvidersHidden_inherit").click(function(){
|
267 |
-
loginradiusChangeInheritCheckboxHidden('horizontalSharing','horizontalSharing');
|
268 |
-
});
|
269 |
-
$loginRadiusSharingJquery("#sharing_options_verticalSharing_verticalSharingProvidersHidden_inherit").click(function(){
|
270 |
-
loginradiusChangeInheritCheckboxHidden('verticalSharing','verticalSharing');
|
271 |
-
});
|
272 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|