LoginRadius - Version 4.0.0

Version Notes

Sixteenth release of social login

Download this release

Release Info

Developer LoginRadius Team
Extension LoginRadius
Version 4.0.0
Comparing to
See all releases


Code changes from version 3.7.1 to 4.0.0

Files changed (117) hide show
  1. app/code/community/Loginradius/Sociallogin/Block/Auth.php +48 -41
  2. app/code/community/Loginradius/Sociallogin/Block/Emailpopup.php +5 -0
  3. app/code/community/Loginradius/Sociallogin/Block/Sociallogin.php +259 -238
  4. app/code/community/Loginradius/Sociallogin/Block/Socialsharing.php +207 -0
  5. app/code/community/Loginradius/Sociallogin/Block/horizontalsharing.php +20 -17
  6. app/code/community/Loginradius/Sociallogin/Block/verticalsharing.php +16 -9
  7. app/code/community/Loginradius/Sociallogin/Helper/Adminhelper.php +67 -0
  8. app/code/community/Loginradius/Sociallogin/Helper/Data.php +20 -4
  9. app/code/community/Loginradius/Sociallogin/Helper/LoginRadiusSDK.php +125 -0
  10. app/code/community/Loginradius/Sociallogin/Helper/Loginhelper.php +269 -0
  11. app/code/community/Loginradius/Sociallogin/Model/Backend/Validator.php +17 -0
  12. app/code/community/Loginradius/Sociallogin/Model/Mysql4/Sociallogin.php +0 -8
  13. app/code/community/Loginradius/Sociallogin/Model/Mysql4/Sociallogin/Collection.php +0 -9
  14. app/code/community/Loginradius/Sociallogin/Model/Observer.php +126 -0
  15. app/code/community/Loginradius/Sociallogin/Model/Sociallogin.php +0 -9
  16. app/code/community/Loginradius/Sociallogin/Model/Source/HorizontalSharing.php +12 -12
  17. app/code/community/Loginradius/Sociallogin/Model/Source/Iconsize.php +7 -6
  18. app/code/community/Loginradius/Sociallogin/Model/Source/LoginPopup.php +7 -6
  19. app/code/community/Loginradius/Sociallogin/Model/Source/SharingVerticalAlignment.php +10 -10
  20. app/code/community/Loginradius/Sociallogin/Model/Source/TwitterRecipients.php +11 -0
  21. app/code/community/Loginradius/Sociallogin/Model/Source/Uihover.php +12 -11
  22. app/code/community/Loginradius/Sociallogin/Model/Source/Uihover2.php +9 -9
  23. app/code/community/Loginradius/Sociallogin/Model/Source/VerticalSharing.php +10 -10
  24. app/code/community/Loginradius/Sociallogin/Model/System/Config/Info.php +188 -108
  25. app/code/community/Loginradius/Sociallogin/controllers/IndexController.php +506 -760
  26. app/code/community/Loginradius/Sociallogin/controllers/Popup.php +0 -280
  27. app/code/community/Loginradius/Sociallogin/etc/config.xml +111 -93
  28. app/code/community/Loginradius/Sociallogin/etc/system.xml +534 -488
  29. app/code/community/Loginradius/Sociallogin/sql/sociallogin_setup/{mysql4-install-3.7.1.php → mysql4-install-4.0.0.php} +4 -2
  30. app/code/community/Loginradius/Sociallogin/sql/sociallogin_setup/mysql4-upgrade-3.7.1-4.0.0.php +16 -0
  31. app/code/community/Loginradius/Sociallogin/sql/sociallogin_setup/mysql4-upgrade-3.7.2-4.0.0.php +16 -0
  32. app/design/adminhtml/default/default/layout/loginradius_sociallogin.xml +10 -10
  33. app/design/frontend/base/default/layout/sociallogin.xml +46 -0
  34. app/design/frontend/base/default/template/sociallogin/abovelogin.phtml +6 -0
  35. app/design/frontend/base/default/template/sociallogin/aboveregister.phtml +5 -0
  36. app/design/frontend/base/default/template/sociallogin/belowlogin.phtml +5 -0
  37. app/design/frontend/base/default/template/sociallogin/belowregister.phtml +5 -0
  38. app/design/frontend/base/default/template/sociallogin/linking.phtml +78 -0
  39. app/design/frontend/base/default/template/sociallogin/popup.phtml +117 -0
  40. app/design/frontend/base/default/template/sociallogin/popupscript.phtml +3 -0
  41. app/design/frontend/base/default/template/sociallogin/sociallogin.phtml +24 -0
  42. app/design/frontend/base/default/template/sociallogin/sociallogin_head.phtml +53 -0
  43. app/design/frontend/base/default/template/sociallogin/sociallogincustom.phtml +15 -0
  44. app/design/frontend/base/default/template/sociallogin/socialshare_head.phtml +18 -0
  45. app/design/frontend/base/default/template/sociallogin/socialshareproduct.phtml +10 -0
  46. app/design/frontend/base/default/template/sociallogin/socialsharesuccess.phtml +9 -0
  47. app/design/frontend/default/default/layout/sociallogin.xml +0 -38
  48. app/design/frontend/default/default/template/sociallogin/abovelogin.phtml +0 -21
  49. app/design/frontend/default/default/template/sociallogin/aboveregister.phtml +0 -21
  50. app/design/frontend/default/default/template/sociallogin/belowlogin.phtml +0 -21
  51. app/design/frontend/default/default/template/sociallogin/belowregister.phtml +0 -21
  52. app/design/frontend/default/default/template/sociallogin/linking.phtml +0 -98
  53. app/design/frontend/default/default/template/sociallogin/linkingscript.phtml +0 -9
  54. app/design/frontend/default/default/template/sociallogin/sociallogin.phtml +0 -30
  55. app/design/frontend/default/default/template/sociallogin/sociallogincustom.phtml +0 -19
  56. app/design/frontend/default/default/template/sociallogin/socialshare_head.phtml +0 -156
  57. app/design/frontend/default/default/template/sociallogin/socialshareproduct.phtml +0 -11
  58. app/design/frontend/default/default/template/sociallogin/socialsharesuccess.phtml +0 -11
  59. app/etc/modules/Loginradius_Sociallogin.xml +1 -2
  60. package.xml +5 -5
  61. skin/adminhtml/default/default/Loginradius/Sociallogin/css/Thumbs.db +0 -0
  62. skin/adminhtml/default/default/Loginradius/Sociallogin/css/admin-ui.css +185 -0
  63. skin/adminhtml/default/default/Loginradius/Sociallogin/css/lrshare_iconsprite32.png +0 -0
  64. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/amazon.png +0 -0
  65. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/aol.png +0 -0
  66. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/facebook.png +0 -0
  67. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/foursquare.png +0 -0
  68. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/github.png +0 -0
  69. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/google.png +0 -0
  70. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/hyves.png +0 -0
  71. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/kaixin.png +0 -0
  72. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/linkedin.png +0 -0
  73. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/live.png +0 -0
  74. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/livejournal.png +0 -0
  75. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/mixi.png +0 -0
  76. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/myopenid.png +0 -0
  77. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/myspace.png +0 -0
  78. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/odnoklassniki.png +0 -0
  79. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/openid.png +0 -0
  80. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/orange.png +0 -0
  81. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/paypal.png +0 -0
  82. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/persona.png +0 -0
  83. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/qq.png +0 -0
  84. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/renren.png +0 -0
  85. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/salesforce.png +0 -0
  86. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/stackexchange.png +0 -0
  87. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/steamcommunity.png +0 -0
  88. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/twitter.png +0 -0
  89. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/verisign.png +0 -0
  90. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/virgilio.png +0 -0
  91. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/vkontakte.png +0 -0
  92. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/wordpress.png +0 -0
  93. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/yahoo.png +0 -0
  94. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Horizontal/horizonSharing16.png +0 -0
  95. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Horizontal/horizonSharing32.png +0 -0
  96. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Horizontal/horizontal.png +0 -0
  97. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Horizontal/single-image-theme-large.png +0 -0
  98. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Horizontal/single-image-theme-small.png +0 -0
  99. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Horizontal/vertical.png +0 -0
  100. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Vertical/16VerticlewithBox.png +0 -0
  101. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Vertical/32VerticlewithBox.png +0 -0
  102. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Vertical/verticalhorizontal.png +0 -0
  103. skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Vertical/verticalvertical.png +0 -0
  104. skin/adminhtml/default/default/Loginradius/Sociallogin/images/media-pages/Thumbs.db +0 -0
  105. skin/adminhtml/default/default/Loginradius/Sociallogin/images/media-pages/facebook.png +0 -0
  106. skin/adminhtml/default/default/Loginradius/Sociallogin/images/media-pages/google.png +0 -0
  107. skin/adminhtml/default/default/Loginradius/Sociallogin/images/media-pages/linkedin.png +0 -0
  108. skin/adminhtml/default/default/Loginradius/Sociallogin/images/media-pages/twitter.png +0 -0
  109. skin/adminhtml/default/default/Loginradius/Sociallogin/images/media-pages/youtube.png +0 -0
  110. skin/adminhtml/default/default/Loginradius/Sociallogin/js/admin-ui.js +364 -0
  111. skin/adminhtml/default/default/Loginradius/Sociallogin/js/jquery.js +0 -0
  112. skin/adminhtml/default/default/Loginradius/Sociallogin/js/jquery.ui.sortable.min.js +5 -0
  113. skin/frontend/base/default/Loginradius/Sociallogin/css/admin-ui.css +0 -134
  114. skin/frontend/base/default/Loginradius/Sociallogin/css/popup.css +162 -0
  115. skin/frontend/base/default/Loginradius/Sociallogin/js/LoginRadiusSDK.2.0.0.js +313 -0
  116. skin/frontend/base/default/Loginradius/Sociallogin/js/admin-ui.js +0 -303
  117. skin/frontend/base/default/Loginradius/Sociallogin/js/popup.js +49 -0
app/code/community/Loginradius/Sociallogin/Block/Auth.php CHANGED
@@ -1,46 +1,53 @@
1
  <?php
2
  class Loginradius_Sociallogin_Block_Auth extends Mage_Core_Block_Template implements Mage_Widget_Block_Interface {
3
- private $block_anyplace;
4
- public function __construct(){
5
- $this->block_anyplace = new Loginradius_Sociallogin_Block_Sociallogin();
6
- }
7
- function loginradius_buttons() {
8
- $ApiKey = trim($this->block_anyplace->getApikey());
9
- $ApiSecrete = trim($this->block_anyplace->getApiSecret());
10
- $UserAuth = $this->block_anyplace->getApiResult($ApiKey, $ApiSecrete);
11
- $titleText = $this->getLabelText();
12
- $errormsg = '<p style ="color:red;">'. $this -> __('To activate your plugin, please log in to LoginRadius and get API Key & Secret. Web') .': <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
13
- if ($this->block_anyplace->user_is_already_login()) {
14
- $userName = Mage::getSingleton('customer/session')->getCustomer()->getName();
15
- return '<span>'.__('Welcome').'!'.' '.$userName .'</span>';
16
- }else{
17
- if( $ApiKey == "" && $ApiSecrete == "" ){
18
- return $errormsg;
19
- }elseif( $UserAuth == false ){
20
- return '<p style ="color:red;">'. $this -> __('Your LoginRadius API Key and Secret is not valid, please correct it or contact LoginRadius support at') .' <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
21
- }else {
22
- $IsHttps = (!empty($UserAuth->IsHttps)) ? $UserAuth->IsHttps : '';
23
- $iframeHeight = (!empty($UserAuth->height)) ? $UserAuth->height : 50;
24
- $iframeWidth = (!empty($UserAuth->width)) ? $UserAuth->width : 138;
25
- $http = ($IsHttps == 1) ? "https://" : "http://";
26
- $loc = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."sociallogin/";
27
- if (empty($titleText)) {
28
- $titleText = __('Social Login');
29
- }
30
- $label = '<span ><b>' . __($titleText) . '</b></span>';
31
- $iframe = '<div class="interfacecontainerdiv" style="margin-left:10px"></div>';
32
- return $label.$iframe;
33
- }
34
- }
35
- }
36
- protected function _toHtml() {
37
- $content = '';
38
- if (Mage::getSingleton('customer/session')->isLoggedIn() == false && $this->block_anyplace->loginEnable() == "1" ){
39
- $content = $this->loginradius_buttons();
40
- }
41
- return $content;
42
  }
43
- protected function _prepareLayout() {
44
- parent::_prepareLayout();
 
 
 
 
 
 
 
 
 
 
45
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  }
1
  <?php
2
  class Loginradius_Sociallogin_Block_Auth extends Mage_Core_Block_Template implements Mage_Widget_Block_Interface {
3
+ private $block_anyplace;
4
+
5
+ public function __construct() {
6
+ $this->block_anyplace = new Loginradius_Sociallogin_Block_Sociallogin();
7
+ }
8
+
9
+ protected function _toHtml() {
10
+ $content = '';
11
+ if (Mage::getSingleton('customer/session')->isLoggedIn() == FALSE) {
12
+ $content = $this->loginradius_buttons();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  }
14
+ return $content;
15
+ }
16
+
17
+ function loginradius_buttons() {
18
+ $ApiKey = trim($this->block_anyplace->getApikey());
19
+ $ApiSecrete = trim($this->block_anyplace->getApiSecret());
20
+ $UserAuth = $this->block_anyplace->getApiValidation($ApiKey, $ApiSecrete);
21
+ $titleText = $this->getLabelText();
22
+ $errormsg = '<p style ="color:red;">' . $this->__('To activate your plugin, please log in to LoginRadius and get API Key & Secret. Web') . ': <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
23
+ if ($this->block_anyplace->user_is_already_login()) {
24
+ $userName = Mage::getSingleton('customer/session')->getCustomer()->getName();
25
+ return '<span>' . __('Welcome') . '!' . ' ' . $userName . '</span>';
26
  }
27
+ else {
28
+ if ($ApiKey == "" && $ApiSecrete == "") {
29
+ return $errormsg;
30
+ }
31
+ elseif ($UserAuth == FALSE) {
32
+ return '<p style ="color:red;">' . $this->__('Your LoginRadius API Key and Secret is not valid, please correct it or contact LoginRadius support at') . ' <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
33
+ }
34
+ else {
35
+ $IsHttps = (!empty($UserAuth->IsHttps)) ? $UserAuth->IsHttps : '';
36
+ $iframeHeight = (!empty($UserAuth->height)) ? $UserAuth->height : 50;
37
+ $iframeWidth = (!empty($UserAuth->width)) ? $UserAuth->width : 138;
38
+ $http = ($IsHttps == 1) ? "https://" : "http://";
39
+ $loc = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) . "sociallogin/";
40
+ if (empty($titleText)) {
41
+ $titleText = __('Social Login');
42
+ }
43
+ $label = '<span ><b>' . __($titleText) . '</b></span>';
44
+ $iframe = '<div class="interfacecontainerdiv" style="margin-left:10px"></div>';
45
+ return $label . $iframe;
46
+ }
47
+ }
48
+ }
49
+
50
+ protected function _prepareLayout() {
51
+ parent::_prepareLayout();
52
+ }
53
  }
app/code/community/Loginradius/Sociallogin/Block/Emailpopup.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Loginradius_Sociallogin_Block_Emailpopup extends Mage_Core_Block_Template
3
+ {
4
+
5
+ }
app/code/community/Loginradius/Sociallogin/Block/Sociallogin.php CHANGED
@@ -1,243 +1,264 @@
1
  <?php
2
- class Loginradius_Sociallogin_Block_Sociallogin extends Mage_Core_Block_Template
3
- {
4
- protected function _construct(){
5
- parent::_construct();
6
- if( $this->horizontalShareEnable() == "1" || $this->verticalShareEnable() == "1" ){
7
- $this->setTemplate('sociallogin/socialshare.phtml');
8
- }
9
- }
10
- public function _prepareLayout(){
11
- return parent::_prepareLayout();
 
 
 
 
 
 
 
12
  }
13
- public function getSociallogin(){
14
- if (!$this->hasData('sociallogin')) {
15
- $this->setData('sociallogin', Mage::registry('sociallogin'));
16
- }
17
- return $this->getData('sociallogin');
 
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 loginEnable(){
26
- return Mage::getStoreConfig('sociallogin_options/messages/loginEnable');
27
- }
28
- public function getApikey(){
29
- return Mage::getStoreConfig('sociallogin_options/messages/appid');
30
- }
31
- public function getAvatar( $id ){
32
- $socialLoginConn = Mage::getSingleton('core/resource')
33
- ->getConnection('core_read');
34
- $SocialLoginTbl = Mage::getSingleton('core/resource')->getTableName("sociallogin");
35
- $select = $socialLoginConn->query("select avatar from $SocialLoginTbl where entity_id = '$id' limit 1");
36
- if( $rowArray = $select->fetch() ) {
37
- if( ($avatar = trim($rowArray['avatar'])) != "" ){
38
- return $avatar;
39
- }
40
- }
41
- return false;
42
- }
43
- public function getShowDefault()
44
- {
45
- return Mage::getStoreConfig('sociallogin_options/messages/showdefault');
46
- }
47
- public function getAboveLogin()
48
- {
49
- return Mage::getStoreConfig('sociallogin_options/messages/aboveLogin');
50
- }
51
- public function getBelowLogin()
52
- {
53
- return Mage::getStoreConfig('sociallogin_options/messages/belowLogin');
54
- }
55
- public function getAboveRegister()
56
- {
57
- return Mage::getStoreConfig('sociallogin_options/messages/aboveRegister');
58
- }
59
- public function getBelowRegister()
60
- {
61
- return Mage::getStoreConfig('sociallogin_options/messages/belowRegister');
62
- }
63
- public function getApiSecret()
64
- {
65
- return Mage::getStoreConfig('sociallogin_options/messages/appkey');
66
- }
67
- public function getLoginRadiusTitle()
68
- {
69
- return Mage::getStoreConfig('sociallogin_options/messages/loginradius_title');
70
- }
71
- public function getLoginWindow()
72
- {
73
- return Mage::getStoreConfig('sociallogin_options/messages/sameWindow');
74
- }
75
- public function iconSize()
76
- {
77
- return Mage::getStoreConfig('sociallogin_options/messages/iconSize');
78
- }
79
- public function iconsPerRow()
80
- {
81
- return Mage::getStoreConfig('sociallogin_options/messages/iconsPerRow');
82
- }
83
- public function backgroundColor()
84
- {
85
- return Mage::getStoreConfig('sociallogin_options/messages/backgroundColor');
86
- }
87
- public function getRedirectOption(){
88
- return Mage::getStoreConfig('sociallogin_options/messages/redirect');
89
- }
90
- public function getApiOption(){
91
- return Mage::getStoreConfig('sociallogin_options/messages/api');
92
- }
93
- public function getProfileFieldsRequired(){
94
- return Mage::getStoreConfig('sociallogin_options/email_settings/profileFieldsRequired');
95
- }
96
- public function updateProfileData(){
97
- return Mage::getStoreConfig('sociallogin_options/email_settings/updateProfileData');
98
- }
99
- public function getEmailRequired(){
100
- return Mage::getStoreConfig('sociallogin_options/email_settings/emailrequired');
101
- }
102
- public function verificationText(){
103
- return Mage::getStoreConfig('sociallogin_options/email_settings/verificationText');
104
- }
105
- public function getPopupText(){
106
- return Mage::getStoreConfig('sociallogin_options/email_settings/popupText');
107
- }
108
- public function getPopupError(){
109
- return Mage::getStoreConfig('sociallogin_options/email_settings/popupError');
110
- }
111
- public function getLinking(){
112
- return Mage::getStoreConfig('sociallogin_options/messages/socialLinking');
113
- }
114
- public function notifyUser(){
115
- return Mage::getStoreConfig('sociallogin_options/email_settings/notifyUser');
116
- }
117
- public function notifyUserText(){
118
- return Mage::getStoreConfig('sociallogin_options/email_settings/notifyUserText');
119
- }
120
- public function notifyAdmin(){
121
- return Mage::getStoreConfig('sociallogin_options/email_settings/notifyAdmin');
122
- }
123
- public function notifyAdminText(){
124
- return Mage::getStoreConfig('sociallogin_options/email_settings/notifyAdminText');
125
- }
126
- public function horizontalShareEnable(){
127
- return Mage::getStoreConfig('sociallogin_options/horizontalSharing/horizontalShareEnable');
128
- }
129
- public function verticalShareEnable(){
130
- return Mage::getStoreConfig('sociallogin_options/verticalSharing/verticalShareEnable');
131
- }
132
- public function horizontalShareProduct(){
133
- return Mage::getStoreConfig('sociallogin_options/horizontalSharing/horizontalShareProduct');
134
- }
135
- public function verticalShareProduct(){
136
- return Mage::getStoreConfig('sociallogin_options/verticalSharing/verticalShareProduct');
137
- }
138
- public function horizontalShareSuccess(){
139
- return Mage::getStoreConfig('sociallogin_options/horizontalSharing/horizontalShareSuccess');
140
- }
141
- public function verticalShareSuccess(){
142
- return Mage::getStoreConfig('sociallogin_options/verticalSharing/verticalShareSuccess');
143
- }
144
- public function sharingTitle(){
145
- return Mage::getStoreConfig('sociallogin_options/horizontalSharing/sharingTitle');
146
- }
147
- public function horizontalSharingTheme(){
148
- return Mage::getStoreConfig('sociallogin_options/horizontalSharing/horizontalSharingTheme');
149
- }
150
- public function verticalSharingTheme(){
151
- return Mage::getStoreConfig('sociallogin_options/verticalSharing/verticalSharingTheme');
152
- }
153
- public function verticalAlignment(){
154
- return Mage::getStoreConfig('sociallogin_options/verticalSharing/verticalAlignment');
155
- }
156
- public function offset(){
157
- return Mage::getStoreConfig('sociallogin_options/verticalSharing/offset');
158
- }
159
- public function horizontalSharingProviders(){
160
- return Mage::getStoreConfig('sociallogin_options/horizontalSharing/horizontalSharingProvidersHidden');
161
- }
162
- public function verticalSharingProviders(){
163
- return Mage::getStoreConfig('sociallogin_options/verticalSharing/verticalSharingProvidersHidden');
164
- }
165
- public function horizontalCounterProviders(){
166
- return Mage::getStoreConfig('sociallogin_options/horizontalSharing/horizontalCounterProvidersHidden');
167
- }
168
- public function verticalCounterProviders(){
169
- return Mage::getStoreConfig('sociallogin_options/verticalSharing/verticalCounterProvidersHidden');
170
- }
171
- public function getCallBack(){
172
- return Mage::getStoreConfig('sociallogin_options/messages/call');
173
- }
174
- public function getProfileResult($ApiSecrete)
175
- {
176
- if(isset($_REQUEST['token'])) {
177
- $ValidateUrl = "http://hub.loginradius.com/userprofile.ashx?token=".$_REQUEST['token']."&apisecrete=".trim($ApiSecrete);
178
- return $this->getApiCall($ValidateUrl);
179
- }
180
- }
181
- public function getApiResult($ApiKey, $ApiSecrete)
182
- {
183
- 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) ) {
184
- return true;
185
- }
186
- else {
187
- return false;
188
- }
189
- }
190
- public function getApiCall($url)
191
- {
192
- $JsonResponse = "";
193
- if ( $this->getApiOption() == 'curl' ){
194
- $curl_handle = curl_init();
195
- curl_setopt($curl_handle, CURLOPT_URL, $url);
196
- curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 5);
197
- curl_setopt($curl_handle, CURLOPT_TIMEOUT, 5);
198
- curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);
199
- if (ini_get('open_basedir') == '' && (ini_get('safe_mode') == 'Off' or !ini_get('safe_mode'))) {
200
- curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, 1);
201
- curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
202
- }else {
203
- curl_setopt($curl_handle, CURLOPT_HEADER, 1);
204
- $url = curl_getinfo($curl_handle, CURLINFO_EFFECTIVE_URL);
205
- curl_close($curl_handle);
206
- $curl_handle = curl_init();
207
- $url = str_replace('?','/?',$url);
208
- curl_setopt($curl_handle, CURLOPT_URL, $url);
209
- curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
210
- }
211
- $JsonResponse = curl_exec($curl_handle);
212
- $httpCode = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE);
213
- if(in_array($httpCode, array(400, 401, 403, 404, 500, 503)) && $httpCode != 200){
214
- return "service connection timeout";
215
- }else{
216
- if(curl_errno($curl_handle) == 28){
217
- return "timeout";
218
- }
219
- }
220
- curl_close($curl_handle);
221
- }
222
- elseif($this->getApiOption() == 'fopen') {
223
- $JsonResponse = @file_get_contents($url);
224
- if(strpos(@$http_response_header[0], "400") !== false || strpos(@$http_response_header[0], "401") !== false || strpos(@$http_response_header[0], "403") !== false || strpos(@$http_response_header[0], "404") !== false || strpos(@$http_response_header[0], "500") !== false || strpos(@$http_response_header[0], "503") !== false){
225
- return "service connection timeout";
226
- }
227
- }else {
228
- $method = 'GET';
229
- try{
230
- $client = new Varien_Http_Client($url);
231
- $response = $client->request($method);
232
- $JsonResponse = $response->getBody();
233
- }catch(Exception $e){
234
- }
235
- }
236
- if ($JsonResponse) {
237
- return json_decode($JsonResponse);
238
- }
239
- else {
240
- return "something went wrong, Can not get api response.";
241
- }
242
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  }
1
  <?php
2
+ class Loginradius_Sociallogin_Block_Sociallogin extends Mage_Core_Block_Template {
3
+ public function getPopusScriptUrl() {
4
+ $jsPath = Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/js/popup.js', array('_area' => 'frontend'));
5
+ $cssPath = Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/css/popup.css', array('_area' => 'frontend'));
6
+
7
+ echo '<script src="' . $jsPath . '"></script>';
8
+ echo '<link rel = "stylesheet" href="' . $cssPath . '" media = "all" />';
9
+
10
+ }
11
+
12
+ public function _prepareLayout() {
13
+ return parent::_prepareLayout();
14
+ }
15
+
16
+ public function getSociallogin() {
17
+ if (!$this->hasData('sociallogin')) {
18
+ $this->setData('sociallogin', Mage::registry('sociallogin'));
19
  }
20
+ return $this->getData('sociallogin');
21
+ }
22
+
23
+ public function user_is_already_login() {
24
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
25
+ return TRUE;
26
  }
27
+ return FALSE;
28
+ }
29
+
30
+ public function getApikey() {
31
+ return trim(Mage::getStoreConfig('sociallogin_options/apiSettings/apikey'));
32
+ }
33
+
34
+ public function getApiSecret() {
35
+ return trim(Mage::getStoreConfig('sociallogin_options/apiSettings/apisecret'));
36
+ }
37
+
38
+ public function getLoginRedirectOption() {
39
+ return Mage::getStoreConfig('sociallogin_options/basicSettings/redirectAfterLogin');
40
+ }
41
+
42
+ public function getRegistrationRedirectOption() {
43
+ return Mage::getStoreConfig('sociallogin_options/basicSettings/redirectAfterRegistration');
44
+ }
45
+
46
+ public function getCustomLoginRedirectOption() {
47
+ return Mage::getStoreConfig('sociallogin_options/basicSettings/customUrlLogin');
48
+ }
49
+
50
+ public function getCustomRegistrationRedirectOption() {
51
+ return Mage::getStoreConfig('sociallogin_options/basicSettings/customUrlLogin');
52
+ }
53
+
54
+ public function getRegistrationCallBack() {
55
+ return Mage::getStoreConfig('sociallogin_options/basicSettings/customUrlRegistration');
56
+ }
57
+
58
+ public function iconSize() {
59
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/iconSize');
60
+ }
61
+
62
+ public function iconsPerRow() {
63
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/iconsPerRow');
64
+ }
65
+
66
+ public function backgroundColor() {
67
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/backgroundColor');
68
+ }
69
+
70
+ public function getShowDefault() {
71
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/showdefault');
72
+ }
73
+
74
+ public function getAboveLogin() {
75
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/aboveLogin');
76
+ }
77
+
78
+ public function getBelowLogin() {
79
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/belowLogin');
80
+ }
81
+
82
+ public function getAboveRegister() {
83
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/aboveRegister');
84
+ }
85
+
86
+ public function getBelowRegister() {
87
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/belowRegister');
88
+ }
89
+
90
+ public function getEmailRequired() {
91
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/emailrequired');
92
+ }
93
+
94
+ public function verificationText() {
95
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/verificationText');
96
+ }
97
+
98
+ public function getPopupText() {
99
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/popupText');
100
+ }
101
+
102
+ public function getPopupError() {
103
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/popupError');
104
+ }
105
+
106
+ public function notifyUser() {
107
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/notifyUser');
108
+ }
109
+
110
+ public function notifyUserText() {
111
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/notifyUserText');
112
+ }
113
+
114
+ public function notifyAdmin() {
115
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/notifyAdmin');
116
+ }
117
+
118
+ public function notifyAdminText() {
119
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/notifyAdminText');
120
+ }
121
+
122
+ public function getAvatar($id) {
123
+ $socialLoginConn = Mage::getSingleton('core/resource')->getConnection('core_read');
124
+ $SocialLoginTbl = Mage::getSingleton('core/resource')->getTableName("sociallogin");
125
+ $select = $socialLoginConn->query("select avatar from $SocialLoginTbl where entity_id = '$id' limit 1");
126
+ if ($rowArray = $select->fetch()) {
127
+ if (($avatar = trim($rowArray['avatar'])) != "") {
128
+ return $avatar;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  }
130
+ }
131
+ return FALSE;
132
+ }
133
+
134
+ public function getProfileFieldsRequired() {
135
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/profileFieldsRequired');
136
+ }
137
+
138
+ public function updateProfileData() {
139
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/updateProfileData');
140
+ }
141
+
142
+ public function getLinking() {
143
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/socialLinking');
144
+ }
145
+
146
+ public function isDebuggingOn() {
147
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/debugMode');
148
+ }
149
+
150
+ public function horizontalSharingTheme() {
151
+ return Mage::getStoreConfig('sociallogin_options/horizontalSharing/horizontalSharingTheme');
152
+ }
153
+
154
+ public function horizontalShareSuccess() {
155
+ return Mage::getStoreConfig('sociallogin_options/horizontalSharing/horizontalShareSuccess');
156
+ }
157
+
158
+ public function horizontalSharingProviders() {
159
+ return Mage::getStoreConfig('sociallogin_options/horizontalSharing/horizontalSharingProvidersHidden');
160
+ }
161
+
162
+ public function horizontalShareProduct() {
163
+ return Mage::getStoreConfig('sociallogin_options/horizontalSharing/horizontalShareProduct');
164
+ }
165
+
166
+ /* Get horizontal sharing optionS */
167
+
168
+ public function horizontalCounterProviders() {
169
+ return Mage::getStoreConfig('sociallogin_options/horizontalSharing/horizontalCounterProvidersHidden');
170
+ }
171
+
172
+ public function verticalSharingTheme() {
173
+ return Mage::getStoreConfig('sociallogin_options/verticalSharing/verticalSharingTheme');
174
+ }
175
+
176
+ public function verticalAlignment() {
177
+ return Mage::getStoreConfig('sociallogin_options/verticalSharing/verticalAlignment');
178
+ }
179
+
180
+ public function verticalSharingProviders() {
181
+ return Mage::getStoreConfig('sociallogin_options/verticalSharing/verticalSharingProvidersHidden');
182
+ }
183
+
184
+ public function verticalCounterProviders() {
185
+ return Mage::getStoreConfig('sociallogin_options/verticalSharing/verticalCounterProvidersHidden');
186
+ }
187
+
188
+ public function verticalShareProduct() {
189
+ return Mage::getStoreConfig('sociallogin_options/verticalSharing/verticalShareProduct');
190
+ }
191
+
192
+ public function verticalShareSuccess() {
193
+ return Mage::getStoreConfig('sociallogin_options/verticalSharing/verticalShareSuccess');
194
+ }
195
+
196
+ public function offset() {
197
+ return 100;
198
+ }
199
+
200
+ public function getProfileResult($ApiSecrete) {
201
+ if (isset($_REQUEST['token'])) {
202
+ $ValidateUrl = "http://hub.loginradius.com/userprofile.ashx?token=" . $_REQUEST['token'] . "&apisecrete=" . trim($ApiSecrete);
203
+ return $this->getApiCall($ValidateUrl);
204
+ }
205
+ }
206
+
207
+ public function getSocialLoginContainer() {
208
+ $lrKeys = $this->getApiKeys();
209
+ $AdvancedSettings = $this->getAdvancedSettings();
210
+ $lrSettings = array_merge($lrKeys, $AdvancedSettings);
211
+ $UserAuth = $this->getApiValidation(trim($lrSettings['apikey']), trim($lrSettings['apisecret']));
212
+ echo '<div class="block" style="margin-top:15px"><div class="block-title"><strong><span>' . __('Social Login') . '</span></strong></div><div class="block-content"><p class="empty">';
213
+ if ($lrKeys['apikey'] == "" && $lrKeys['apikey'] == "apisecret") {
214
+ echo '<p style ="color:red;">' . $this->__('To activate your plugin, please log in to LoginRadius and get API Key & Secret. Web') . ': <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
215
+ }
216
+ elseif ($UserAuth == FALSE) {
217
+ echo '<p style ="color:red;">' . $this->__('Your LoginRadius API Key and Secret is not valid, please correct it or contact LoginRadius support at') . ' <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
218
+ }
219
+ else {
220
+ echo '<div style="margin:5px"><div style="margin-bottom:5px">' . trim($this->getLoginRadiusTitle()) . '</div><div class="interfacecontainerdiv"></div></div>';
221
+ }
222
+ echo '</p></div></div>';
223
+ }
224
+
225
+ public function getApiKeys() {
226
+ return Mage::getStoreConfig('sociallogin_options/apiSettings');
227
+ }
228
+
229
+ public function getAdvancedSettings() {
230
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings');
231
+ }
232
+
233
+ public function getApiValidation($ApiKey, $ApiSecrete) {
234
+ 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)) {
235
+ return TRUE;
236
+ }
237
+ else {
238
+ return FALSE;
239
+ }
240
+ }
241
+
242
+
243
+ // Extra methods to remove
244
+
245
+ public function getLoginRadiusTitle() {
246
+ return Mage::getStoreConfig('sociallogin_options/advancedSettings/loginradius_title');
247
+ }
248
+
249
+ protected function _construct() {
250
+ parent::_construct();
251
+ if ($this->horizontalShareEnable() == "1" || $this->verticalShareEnable() == "1") {
252
+ $this->setTemplate('sociallogin/socialshare.phtml');
253
+ }
254
+ }
255
+
256
+ public function horizontalShareEnable() {
257
+ return Mage::getStoreConfig('sociallogin_options/horizontalSharing/horizontalShareEnable');
258
+ }
259
+
260
+ public function verticalShareEnable() {
261
+ return Mage::getStoreConfig('sociallogin_options/verticalSharing/verticalShareEnable');
262
+ }
263
+
264
  }
app/code/community/Loginradius/Sociallogin/Block/Socialsharing.php ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Loginradius_Sociallogin_Block_Socialsharing extends Mage_Core_Block_Template
3
+ {
4
+ /**
5
+ * function returns script required for vertical sharing.
6
+ *
7
+ * global $loginRadiusSettings;
8
+ */
9
+ public static function login_radius_sharing_get_sharing_script_vertical($loginRadiusSettings, $apiKey)
10
+ {
11
+ $sharingScript = '';
12
+ $verticalThemvalue = isset($loginRadiusSettings['verticalSharingTheme']) ? $loginRadiusSettings['verticalSharingTheme'] : '';
13
+
14
+ switch ($verticalThemvalue) {
15
+ case '32':
16
+ $size = '32';
17
+ $interface = 'Simplefloat';
18
+ $sharingVariable = 'i';
19
+ break;
20
+
21
+ case '16':
22
+ $size = '16';
23
+ $interface = 'Simplefloat';
24
+ $sharingVariable = 'i';
25
+ break;
26
+
27
+ case 'counter_vertical':
28
+ $sharingVariable = 'S';
29
+ $ishorizontal = 'false';
30
+ $interface = 'simple';
31
+ $type = 'vertical';
32
+ break;
33
+
34
+ case 'counter_horizontal':
35
+ $sharingVariable = 'S';
36
+ $ishorizontal = 'false';
37
+ $interface = 'simple';
38
+ $type = 'horizontal';
39
+ break;
40
+
41
+ default:
42
+ $size = '32';
43
+ $interface = 'Simplefloat';
44
+ $sharingVariable = 'i';
45
+ break;
46
+ }
47
+
48
+ $verticalPosition = isset($loginRadiusSettings['verticalAlignment']) ? $loginRadiusSettings['verticalAlignment'] : '';
49
+ switch ($verticalPosition) {
50
+ case "top_left":
51
+ $position1 = 'top';
52
+ $position2 = 'left';
53
+ break;
54
+
55
+ case "top_right":
56
+ $position1 = 'top';
57
+ $position2 = 'right';
58
+ break;
59
+
60
+ case "bottom_left":
61
+ $position1 = 'bottom';
62
+ $position2 = 'left';
63
+ break;
64
+
65
+ case "bottom_right":
66
+ $position1 = 'bottom';
67
+ $position2 = 'right';
68
+ break;
69
+
70
+ default:
71
+ $position1 = 'top';
72
+ $position2 = 'left';
73
+ break;
74
+ }
75
+
76
+ $offset = '$' . $sharingVariable . '.' . $position1 . ' = \'0px\'; $' . $sharingVariable . '.' . $position2 . ' = \'0px\';';
77
+
78
+ if (empty($size)) {
79
+ $providers = self:: get_counter_providers('vertical', $loginRadiusSettings);
80
+ $sharingScript .= 'LoginRadius.util.ready( function() { $SC.Providers.Selected = ["' . $providers . '"]; $S = $SC.Interface.' . $interface . '; $S.isHorizontal = ' . $ishorizontal . '; $S.countertype = \'' . $type . '\'; ' . $offset . ' $u = LoginRadius.user_settings; $u.isMobileFriendly = true; $S.show( "loginRadiusVerticalSharing" ); } );';
81
+ } else {
82
+ $providers = self:: get_sharing_providers('vertical', $loginRadiusSettings);
83
+ // prepare sharing script
84
+ $sharingScript .= 'LoginRadius.util.ready( function() { $i = $SS.Interface.' . $interface . '; $SS.Providers.Top = ["' . $providers . '"]; $u = LoginRadius.user_settings;';
85
+ $sharingScript .= '$u.apikey= \'' . trim($apiKey) . '\';';
86
+ $sharingScript .= '$i.size = ' . $size . '; ' . $offset . ' $u.isMobileFriendly=true; $i.show( "loginRadiusVerticalSharing" ); } );';
87
+ }
88
+ return $sharingScript;
89
+ }
90
+
91
+ /**
92
+ * function returns comma seperated counters lists
93
+ *
94
+ * global $loginRadiusSettings;
95
+ */
96
+ public function get_counter_providers($themeType, $loginRadiusSettings)
97
+ {
98
+ $searchOption = $themeType . 'CounterProvidersHidden';
99
+ if (!empty($loginRadiusSettings[$searchOption])) {
100
+ return str_replace(',', '","', $loginRadiusSettings[$searchOption]);
101
+ } else {
102
+ return 'Facebook Like","Google+ +1","Pinterest Pin it","LinkedIn Share","Hybridshare';
103
+ }
104
+ }
105
+
106
+ /**
107
+ * function returns comma seperated sharing providers lists
108
+ *
109
+ * global $loginRadiusSettings;
110
+ */
111
+ public static function get_sharing_providers($themeType, $loginRadiusSettings)
112
+ {
113
+ $searchOption = $themeType . 'SharingProvidersHidden';
114
+ if (!empty($loginRadiusSettings[$searchOption])) {
115
+ return str_replace(',', '","', $loginRadiusSettings[$searchOption]);
116
+ } else {
117
+ return 'Facebook","Twitter","Pinterest","Print","Email';
118
+ }
119
+ }
120
+
121
+ public function _prepareLayout()
122
+ {
123
+ return parent::_prepareLayout();
124
+ }
125
+
126
+ public function getHorizontalSharingSettings()
127
+ {
128
+ return Mage::getStoreConfig('sociallogin_options/horizontalSharing');
129
+ }
130
+
131
+ public function getVerticalSharingSettings()
132
+ {
133
+ return Mage::getStoreConfig('sociallogin_options/verticalSharing');
134
+ }
135
+
136
+ /**
137
+ * function returns script required for horizontal sharing.
138
+ *
139
+ * global $loginRadiusSettings;
140
+ */
141
+ public function login_radius_sharing_get_sharing_script_horizontal($loginRadiusSettings, $apikey)
142
+ {
143
+ $size = '';
144
+ $sharingScript = '';
145
+ $horizontalThemvalue = isset($loginRadiusSettings['horizontalSharingTheme']) ? $loginRadiusSettings['horizontalSharingTheme'] : '';
146
+
147
+ switch ($horizontalThemvalue) {
148
+ case '32':
149
+ $size = '32';
150
+ $interface = 'horizontal';
151
+ break;
152
+
153
+ case '16':
154
+ $size = '16';
155
+ $interface = 'horizontal';
156
+ break;
157
+
158
+ case 'single_large':
159
+ $size = '32';
160
+ $interface = 'simpleimage';
161
+ break;
162
+
163
+ case 'single_small':
164
+ $size = '16';
165
+ $interface = 'simpleimage';
166
+ break;
167
+
168
+ case 'counter_vertical':
169
+ $ishorizontal = 'true';
170
+ $interface = 'simple';
171
+ $countertype = 'vertical';
172
+ break;
173
+
174
+ case 'counter_horizontal':
175
+ $ishorizontal = 'true';
176
+ $interface = 'simple';
177
+ $countertype = 'horizontal';
178
+ break;
179
+
180
+ default:
181
+ $size = '32';
182
+ $interface = 'horizontal';
183
+ break;
184
+ }
185
+ if (!empty($ishorizontal)) {
186
+ $providers = $this->get_counter_providers('horizontal', $loginRadiusSettings);
187
+
188
+ // prepare counter script
189
+ $sharingScript .= 'LoginRadius.util.ready( function() { $SC.Providers.Selected = ["' . $providers . '"]; $S = $SC.Interface.' . $interface . '; $S.isHorizontal = ' . $ishorizontal . '; $S.countertype = \'' . $countertype . '\'; $u = LoginRadius.user_settings; $u.isMobileFriendly = true; $S.show( "loginRadiusHorizontalSharing" ); } );';
190
+ } else {
191
+ $providers = $this->get_sharing_providers('horizontal', $loginRadiusSettings);
192
+
193
+ // prepare sharing script
194
+ $sharingScript .= 'LoginRadius.util.ready( function() { $i = $SS.Interface.' . $interface . '; $SS.Providers.Top = ["' . $providers . '"]; $u = LoginRadius.user_settings;';
195
+ if (isset($apikey) && !empty($apikey)) {
196
+ $sharingScript .= '$u.apikey= \'' . trim($apikey) . '\';';
197
+ }
198
+ $sharingScript .= '$i.size = ' . $size . '; $u.sharecounttype="url"; $u.isMobileFriendly=true; $i.show( "loginRadiusHorizontalSharing" ); } );';
199
+ }
200
+ return $sharingScript;
201
+ }
202
+
203
+ protected function _construct()
204
+ {
205
+ parent::_construct();
206
+ }
207
+ }
app/code/community/Loginradius/Sociallogin/Block/horizontalsharing.php CHANGED
@@ -1,21 +1,24 @@
1
  <?php
2
  class Loginradius_Sociallogin_Block_Horizontalsharing extends Mage_Core_Block_Template implements Mage_Widget_Block_Interface {
3
- private $loginRadiusHorizontalSharing;
4
- public function __construct(){
5
- $this->loginRadiusHorizontalSharing = new Loginradius_Sociallogin_Block_Sociallogin();
6
- }
7
- protected function _toHtml() {
8
- $content = "";
9
- if ($this->loginRadiusHorizontalSharing->horizontalShareEnable() == "1" ){
10
- $content = "<div class='loginRadiusHorizontalSharing'></div>";
11
- $titleText = trim($this->getLabelText());
12
- if($titleText != ""){
13
- $content = "<div style='font-weight:bold'>" . __($titleText) . "</div>" . $content;
14
- }
15
- }
16
- return $content;
17
- }
18
- protected function _prepareLayout() {
19
- parent::_prepareLayout();
20
  }
 
 
 
 
 
 
21
  }
1
  <?php
2
  class Loginradius_Sociallogin_Block_Horizontalsharing extends Mage_Core_Block_Template implements Mage_Widget_Block_Interface {
3
+ private $loginRadiusHorizontalSharing;
4
+
5
+ public function __construct() {
6
+ $this->loginRadiusHorizontalSharing = new Loginradius_Sociallogin_Block_Sociallogin();
7
+ }
8
+
9
+ protected function _toHtml() {
10
+ $content = "";
11
+ if ($this->loginRadiusHorizontalSharing->horizontalShareEnable() == "1") {
12
+ $content = "<div class='loginRadiusHorizontalSharing'></div>";
13
+ $titleText = trim($this->getLabelText());
14
+ if ($titleText != "") {
15
+ $content = "<div style='font-weight:bold'>" . __($titleText) . "</div>" . $content;
16
+ }
 
 
 
17
  }
18
+ return $content;
19
+ }
20
+
21
+ protected function _prepareLayout() {
22
+ parent::_prepareLayout();
23
+ }
24
  }
app/code/community/Loginradius/Sociallogin/Block/verticalsharing.php CHANGED
@@ -1,17 +1,24 @@
1
  <?php
2
- class Loginradius_Sociallogin_Block_Verticalsharing extends Mage_Core_Block_Template implements Mage_Widget_Block_Interface {
3
- private $loginRadiusVerticalSharing;
4
- public function __construct(){
5
- $this->loginRadiusVerticalSharing = new Loginradius_Sociallogin_Block_Sociallogin();
6
- }
7
- protected function _toHtml() {
 
 
 
 
 
8
  $content = "";
9
- if ($this->loginRadiusVerticalSharing->verticalShareEnable() == "1" ){
10
  $content = "<div class='loginRadiusVerticalSharing'></div>";
11
- }
12
  return $content;
13
  }
14
- protected function _prepareLayout() {
 
 
15
  parent::_prepareLayout();
16
  }
17
  }
1
  <?php
2
+ class Loginradius_Sociallogin_Block_Verticalsharing extends Mage_Core_Block_Template implements Mage_Widget_Block_Interface
3
+ {
4
+ private $loginRadiusVerticalSharing;
5
+
6
+ public function __construct()
7
+ {
8
+ $this->loginRadiusVerticalSharing = new Loginradius_Sociallogin_Block_Sociallogin();
9
+ }
10
+
11
+ protected function _toHtml()
12
+ {
13
  $content = "";
14
+ if ($this->loginRadiusVerticalSharing->verticalShareEnable() == "1") {
15
  $content = "<div class='loginRadiusVerticalSharing'></div>";
16
+ }
17
  return $content;
18
  }
19
+
20
+ protected function _prepareLayout()
21
+ {
22
  parent::_prepareLayout();
23
  }
24
  }
app/code/community/Loginradius/Sociallogin/Helper/Adminhelper.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: nyaconcept
5
+ * Date: 11/17/14
6
+ * Time: 12:33 PM
7
+ */
8
+
9
+ class Loginradius_Sociallogin_Helper_AdminHelper extends Mage_Core_Helper_Abstract
10
+ {
11
+ public function loginRadiusApiClient($ValidateUrl, $data)
12
+ {
13
+ if ($this->getApiMethod()) {
14
+ $response = $this->curlApiMethod($ValidateUrl, $data);
15
+ } else {
16
+ $response = $this->fsockopenApiMethod($ValidateUrl, $data);
17
+ }
18
+ $message = isset($response->Messages[0]) ? trim($response->Messages[0]) : '';
19
+ switch ($message) {
20
+ case 'API_KEY_NOT_VALID':
21
+ $results['status'] = "error";
22
+ $results['message'] = JText::_('COM_SOCIALLOGIN_SAVE_SETTING_ERROR_ONE') . " <a href='http://www.loginradius.com' target='_blank'>LoginRadius</a>";
23
+ break;
24
+ case 'API_SECRET_NOT_VALID':
25
+ $results['status'] = "error";
26
+ $results['message'] = JText::_('COM_SOCIALLOGIN_SAVE_SETTING_ERROR_TWO') . " <a href='http://www.loginradius.com' target='_blank'>LoginRadius</a>";
27
+ break;
28
+ case 'API_KEY_NOT_FORMATED':
29
+ $results['status'] = "error";
30
+ $results['message'] = JText::_('COM_SOCIALLOGIN_SAVE_SETTING_ERROR_THREE');
31
+ break;
32
+ case 'API_SECRET_NOT_FORMATED':
33
+ $results['status'] = "error";
34
+ $results['message'] = JText::_('COM_SOCIALLOGIN_SAVE_SETTING_ERROR_FOUR');
35
+ break;
36
+ default:
37
+ $results['status'] = "message";
38
+ $results['message'] = JText::_('COM_SOCIALLOGIN_SETTING_SAVED');
39
+ break;
40
+ }
41
+ return $results;
42
+ }
43
+
44
+ private function fsockopenApiMethod($ValidateUrl, $data)
45
+ {
46
+ if (!empty($data)) {
47
+ $options = array('http' => array('method' => 'POST', 'timeout' => 15, 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $data));
48
+ $context = stream_context_create($options);
49
+ } else {
50
+ $context = null;
51
+ }
52
+ $jsonResponse = @file_get_contents($ValidateUrl, false, $context);
53
+
54
+ if (strpos(@$http_response_header[0], "400") !== false
55
+ || strpos(@$http_response_header[0], "401") !== false
56
+ || strpos(@$http_response_header[0], "403") !== false
57
+ || strpos(@$http_response_header[0], "404") !== false
58
+ || strpos(@$http_response_header[0], "500") !== false
59
+ || strpos(@$http_response_header[0], "503") !== false
60
+ ) {
61
+ return JTEXT::_('COM_SOCIALLOGIN_SERVICE_AND_TIMEOUT_ERROR');
62
+ } else {
63
+ return json_decode($jsonResponse);
64
+ }
65
+ }
66
+
67
+ }
app/code/community/Loginradius/Sociallogin/Helper/Data.php CHANGED
@@ -1,14 +1,30 @@
1
  <?php
2
- class Loginradius_Sociallogin_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 isSocialloginEnabled() {
9
- if (Mage::getStoreConfig('sociallogin_options/messages/enabled') == '1'){
 
10
  return true;
11
- }
12
  return false;
13
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  }
1
  <?php
2
+ class Loginradius_Sociallogin_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
  /**
5
  * Returns whether the Enabled config variable is set to true
6
  *
7
  * @return bool
8
  */
9
+ public function isSocialloginEnabled()
10
+ {
11
+ if (Mage::getStoreConfig('sociallogin_options/messages/enabled') == '1') {
12
  return true;
13
+ }
14
  return false;
15
  }
16
+
17
+ public function isCurlEnabled()
18
+ {
19
+ return function_exists('curl_version') ? '1' : '0';
20
+ }
21
+
22
+ public function isCustomerAlreadyLoggedIn()
23
+ {
24
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
25
+ return true;
26
+ }
27
+ return false;
28
+ }
29
+
30
  }
app/code/community/Loginradius/Sociallogin/Helper/LoginRadiusSDK.php ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Define LoginRadius domain
4
+ define('LR_DOMAIN', 'api.loginradius.com');
5
+
6
+ class Loginradius_Sociallogin_Helper_LoginRadiusSDK extends Mage_Core_Helper_Abstract
7
+ {
8
+ /**
9
+ * LoginRadius function - It validate against GUID format of keys.
10
+ *
11
+ * @param string $key data to validate.
12
+ *
13
+ * @return boolean. If valid - true, else - false.
14
+ */
15
+ public function loginradiusValidateKey($key)
16
+ {
17
+ if (empty($key) || !preg_match('/^\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\}?$/i', $key)) {
18
+ return false;
19
+ } else {
20
+ return true;
21
+ }
22
+ }
23
+
24
+ /**
25
+ * LoginRadius function - To fetch social profile data from the user's social account after authentication. The social profile will be retrieved via oAuth and OpenID protocols. The data is normalized into LoginRadius' standard data format.
26
+ *
27
+ * @param string $accessToken LoginRadius access token
28
+ * @param boolean $raw If true, raw data is fetched
29
+ *
30
+ * @return object User profile data.
31
+ */
32
+ public function fetchUserProfile($accessToken, $raw = false)
33
+ {
34
+ $ValidateUrl = 'https://' . LR_DOMAIN . '/api/v2/userprofile?access_token=' . $accessToken;
35
+ if ($raw) {
36
+ $ValidateUrl = 'https://' . LR_DOMAIN . '/api/v2/userprofile/raw?access_token=' . $accessToken;
37
+ return $this->accessLoginradiusApi($ValidateUrl);
38
+ }
39
+ return $this->accessLoginradiusApi($ValidateUrl);
40
+ }
41
+
42
+ public function accessLoginradiusApi($url, $data = array(), $isPost = false)
43
+ {
44
+
45
+ if (Mage::helper('sociallogin')->isCurlEnabled()) {
46
+ $JsonResponse = $this->curlApiMethod($url, $data, $isPost );
47
+ } else {
48
+ $JsonResponse = $this->fsockopenApiMethod($url, $data, $isPost);
49
+ }
50
+ $result = json_decode($JsonResponse);
51
+ if (is_object($result) && isset($result->customError)) {
52
+ $method = 'GET';
53
+
54
+ $client = new Varien_Http_Client($url);
55
+ $response = $client->request($method);
56
+ $Response = $response->getBody();
57
+ return $Response;
58
+
59
+ }
60
+ return $JsonResponse;
61
+
62
+ }
63
+
64
+ public function curlApiMethod($url, $data, $post = false)
65
+ {
66
+ $curl_handle = curl_init();
67
+ curl_setopt($curl_handle, CURLOPT_URL, $url);
68
+ curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 50);
69
+ curl_setopt($curl_handle, CURLOPT_TIMEOUT, 50);
70
+ curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);
71
+ if ($post) {
72
+ curl_setopt($curlHandle, CURLOPT_POST, 1);
73
+ curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
74
+ curl_setopt($curlHandle, CURLOPT_POSTFIELDS, http_build_query($data));
75
+ }
76
+ if (ini_get('open_basedir') == '' && (ini_get('safe_mode') == 'Off' or !ini_get('safe_mode'))) {
77
+ curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, 1);
78
+ curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
79
+ } else {
80
+ curl_setopt($curl_handle, CURLOPT_HEADER, 1);
81
+ $url = curl_getinfo($curl_handle, CURLINFO_EFFECTIVE_URL);
82
+ curl_close($curl_handle);
83
+ $curl_handle = curl_init();
84
+ $url = str_replace('?', '/?', $url);
85
+ curl_setopt($curl_handle, CURLOPT_URL, $url);
86
+ curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
87
+ }
88
+ $JsonResponse = curl_exec($curl_handle);
89
+ $httpCode = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE);
90
+ if (in_array($httpCode, array(400, 401, 403, 404, 500, 503))) {
91
+ $JsonResponse = json_encode(array("customError" => true, "Messages" => "Error in using curl connection ,Service connection error occurred"));
92
+ } else {
93
+ if (curl_errno($curl_handle) == 28) {
94
+ $JsonResponse = json_encode(array("customError" => true, "Messages" => "Connection timeout"));
95
+ }
96
+ }
97
+ curl_close($curl_handle);
98
+ return $JsonResponse;
99
+ }
100
+
101
+ public function fsockopenApiMethod($ValidateUrl, $data, $post = false)
102
+ {
103
+ if (!empty($data)) {
104
+ $options = array('http' => array('method' => 'POST', 'timeout' => 15, 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $data));
105
+ $context = stream_context_create($options);
106
+ } else {
107
+ $context = null;
108
+ }
109
+ $jsonResponse = @file_get_contents($ValidateUrl, false, $context);
110
+ if (strpos(@$http_response_header[0], "400") !== false
111
+ || strpos(@$http_response_header[0], "401") !== false
112
+ || strpos(@$http_response_header[0], "403") !== false
113
+ || strpos(@$http_response_header[0], "404") !== false
114
+ || strpos(@$http_response_header[0], "500") !== false
115
+ || strpos(@$http_response_header[0], "503") !== false
116
+ ) {
117
+ $jsonResponse = json_encode(array("customError" => true, "Messages" => "Error in using FSOCKOPEN connection method, Service connection timeout occurred"));
118
+ }
119
+ if (!$jsonResponse) {
120
+ $jsonResponse = json_encode(array("customError" => true, "Messages" => "FSOCKOPEN not working"));
121
+ }
122
+ return $jsonResponse;
123
+ }
124
+
125
+ }
app/code/community/Loginradius/Sociallogin/Helper/Loginhelper.php ADDED
@@ -0,0 +1,269 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class Loginradius_Sociallogin_Helper_Loginhelper extends Mage_Core_Helper_Abstract {
5
+ public function loginRadiusRead($table, $handle, $params, $result = FALSE) {
6
+ $socialLoginConn = Mage::getSingleton('core/resource')->getConnection('core_read');
7
+ $Tbl = $this->getMazeTable($table);
8
+ $customerTable = $this->getMazeTable('customer_entity');
9
+ $websiteId = Mage::app()->getWebsite()->getId();
10
+ $storeId = Mage::app()->getStore()->getId();
11
+ $query = "";
12
+ switch ($handle) {
13
+ case "email exists pop1":
14
+ $query = "select entity_id from $Tbl where email = '" . $params[0] . "' and website_id = $websiteId and store_id = $storeId";
15
+ break;
16
+ case "get_user_by_social_id":
17
+ $query = "SELECT $Tbl.entity_id, verified from $Tbl JOIN $customerTable ON $customerTable.entity_id = $Tbl.entity_id WHERE $Tbl.sociallogin_id = '" . $params[0] . "'";
18
+ break;
19
+ case "get_user_from_customer_entity":
20
+ $query = "select entity_id from $Tbl where entity_id = " . $params[0] . " and website_id = $websiteId";
21
+ break;
22
+ case "email_already_exists":
23
+ $query = "select * from $Tbl where email = '" . $params[0] . "' and website_id = $websiteId";
24
+ break;
25
+ case "email exists sl":
26
+ $query = "select verified,sociallogin_id from $Tbl where entity_id = '" . $params[0] . "' and provider = '" . $params[1] . "'";
27
+ break;
28
+ case "provider exists in sociallogin":
29
+ $query = "select entity_id from $Tbl where entity_id = '" . $params[0] . "' and provider = '" . $params[1] . "'";
30
+ break;
31
+ case "verification":
32
+ $query = "select entity_id, provider from $Tbl where vkey = '" . $params[0] . "'";
33
+ break;
34
+ case "verification2":
35
+ $query = "select entity_id from $Tbl where entity_id = " . $params[0] . " and provider = '" . $params[1] . "' and vkey != '' ";
36
+ break;
37
+ }
38
+ $select = $socialLoginConn->query($query);
39
+ if ($result) {
40
+ return $select;
41
+ }
42
+ if ($select->fetch()) {
43
+ return TRUE;
44
+ }
45
+ return FALSE;
46
+ }
47
+
48
+ public function getMazeTable($tbl) {
49
+ $tableName = Mage::getSingleton('core/resource')->getTableName($tbl);
50
+ return ($tableName);
51
+ }
52
+
53
+ /**
54
+ * Validate url.
55
+ */
56
+ public function loginRadiusValidateUrl($url) {
57
+ $validUrlExpression = "/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|)?[a-z0-9_\-]+[a-z0-9_\-\.]+\.[a-z]{2,4}(\/+[a-z0-9_\.\-\/]*)?$/i";
58
+ return (bool) preg_match($validUrlExpression, $url);
59
+ }
60
+
61
+ public function generateRandomEmail($userObject) {
62
+ switch ($userObject->Provider) {
63
+ case 'twitter':
64
+ case 'linkedin':
65
+ $email = $userObject->ID . '@' . $userObject->Provider . '.com';
66
+ break;
67
+ default:
68
+ $Email_id = substr($userObject->ID, 7);
69
+ $Email_id2 = str_replace("/", "_", $Email_id);
70
+ $email = str_replace(".", "_", $Email_id2) . '@' . $userObject->Provider . '.com';
71
+ break;
72
+ }
73
+ return $email;
74
+ }
75
+
76
+ public function verifyUser($slId, $entityId, $avatar, $provider, $email,$sendAdminEmail = false,$loginRadiusUsername = '') {
77
+
78
+ $this->blockObj = new Loginradius_Sociallogin_Block_Sociallogin();
79
+ $vKey = md5(uniqid(rand(), TRUE));
80
+ $data = array();
81
+ $data['sociallogin_id'] = $slId;
82
+ $data['entity_id'] = $entityId;
83
+ $data['avatar'] = $avatar;
84
+ $data['verified'] = "0";
85
+ $data['vkey'] = $vKey;
86
+ $data['provider'] = $provider;
87
+ // insert details in sociallogin table
88
+ $this->SocialLoginInsert("sociallogin", $data);
89
+ // send verification mail
90
+ $message = __(Mage::helper('core')->htmlEscape(trim($this->blockObj->verificationText())));
91
+ if ($message == "") {
92
+ $message = __("Please click on the following link or paste it in browser to verify your email");
93
+ }
94
+ $message .= "<br/>" . Mage::getBaseUrl() . "sociallogin/?loginRadiusKey=" . $vKey;
95
+ $this->loginRadiusEmail(__("Email verification"), $message, $email, $email);
96
+ if($sendAdminEmail){
97
+ $loginRadiusAdminEmail = Mage::getStoreConfig('trans_email/ident_general/email');
98
+ $loginRadiusAdminName = Mage::getStoreConfig('trans_email/ident_general/name');
99
+ $loginRadiusMessage = trim($this->blockObj->notifyAdminText());
100
+ if ($loginRadiusMessage == "") {
101
+ $loginRadiusMessage = __("New customer has been registered to your store with following details");
102
+ }
103
+ $loginRadiusMessage .= "<br/>" . __("Name") . " : " . $loginRadiusUsername . "<br/>" . __("Email") . " : " . $email;
104
+ Mage::helper('sociallogin/loginhelper')->loginRadiusEmail(__("New User Registration"), $loginRadiusMessage, $loginRadiusAdminEmail, $loginRadiusAdminName);
105
+
106
+ }
107
+ $session = Mage::getSingleton('customer/session');
108
+ $session->addSuccess(__('Confirmation link has been sent to your email address. Please verify your email by clicking on confirmation link.'));
109
+
110
+ header("Location:" . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK));
111
+ die;
112
+ }
113
+
114
+ public function SocialLoginInsert($lrTable, $lrInsertData, $update = FALSE, $value = '') {
115
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
116
+ $connection->beginTransaction();
117
+ $sociallogin = $this->getMazeTable($lrTable);
118
+ if (!$update) {
119
+ $connection->insert($sociallogin, $lrInsertData);
120
+ }
121
+ else {
122
+ // update query magento way
123
+ $connection->update(
124
+ $sociallogin, $lrInsertData, $value
125
+ );
126
+ }
127
+ $connection->commit();
128
+ }
129
+
130
+ public function loginRadiusEmail($subject, $message, $to, $toName) {
131
+ $storeName = Mage::app()->getStore()->getGroup()->getName();
132
+ $mail = new Zend_Mail('UTF-8'); //class for mail
133
+ $mail->setBodyHtml($message); //for sending message containing html code
134
+ $mail->setFrom("Owner", $storeName);
135
+ $mail->addTo($to, $toName);
136
+ $mail->setSubject($subject);
137
+ try {
138
+ $mail->send();
139
+ } catch (Exception $ex) {
140
+ }
141
+ }
142
+
143
+ public function setTmpSession($loginRadiusPopupTxt = '', $socialLoginMsg = "", $loginRadiusShowForm = TRUE, $profileData = array(), $emailRequired = TRUE, $hideZipcode = FALSE) {
144
+ Mage::getSingleton('core/session')->setTmpPopupTxt($loginRadiusPopupTxt);
145
+ Mage::getSingleton('core/session')->setTmpPopupMsg($socialLoginMsg);
146
+ Mage::getSingleton('core/session')->setTmpShowForm($loginRadiusShowForm);
147
+ Mage::getSingleton('core/session')->setTmpProfileData($profileData);
148
+ Mage::getSingleton('core/session')->setTmpEmailRequired($emailRequired);
149
+ Mage::getSingleton('core/session')->setTmpHideZipcode($hideZipcode);
150
+ }
151
+
152
+ function setInSession($id, $socialloginProfileData) {
153
+ $socialloginProfileData['lrId'] = $id;
154
+ Mage::getSingleton('core/session')->setSocialLoginData($socialloginProfileData);
155
+ }
156
+
157
+ public function socialLoginFilterData($userObject) {
158
+ //My code ends
159
+ $profileDataFiltered = array();
160
+ $profileDataFiltered['Email'] = isset($userObject->Email[0]->Value) ? $userObject->Email[0]->Value : '';
161
+ $profileDataFiltered['Provider'] = empty($userObject->Provider) ? "" : $userObject->Provider;
162
+ $profileDataFiltered['FirstName'] = empty($userObject->FirstName) ? "" : $userObject->FirstName;
163
+ $profileDataFiltered['FullName'] = empty($userObject->FullName) ? "" : $userObject->FullName;
164
+ $profileDataFiltered['NickName'] = empty($userObject->NickName) ? "" : $userObject->NickName;
165
+ $profileDataFiltered['LastName'] = empty($userObject->LastName) ? "" : $userObject->LastName;
166
+ if (isset($userObject->Addresses) && is_array($userObject->Addresses)) {
167
+ foreach ($userObject->Addresses as $address) {
168
+ if (isset($address->Address1) && !empty($address->Address1)) {
169
+ $profileDataFiltered['Address'] = $address->Address1;
170
+ break;
171
+ }
172
+ }
173
+ }
174
+ elseif (isset($userObject->Addresses) && is_string($userObject->Addresses)) {
175
+ $profileDataFiltered['Address'] = isset($userObject->Addresses) && $userObject->Addresses != "" ? $userObject->Addresses : "";
176
+ }
177
+ else {
178
+ $profileDataFiltered['Address'] = "";
179
+ }
180
+ $profileDataFiltered['PhoneNumber'] = empty($userObject->PhoneNumbers['0']->PhoneNumber) ? "" : $userObject->PhoneNumbers['0']->PhoneNumber;
181
+ $profileDataFiltered['State'] = empty($userObject->State) ? "" : $userObject->State;
182
+ $profileDataFiltered['City'] = empty($userObject->City) || $userObject->City == "unknown" ? "" : $userObject->City;
183
+ $profileDataFiltered['Industry'] = empty($userObject->Positions['0']->Comapny->Name) ? "" : $userObject->Positions['0']->Comapny->Name;
184
+ if (isset($userObject->Country->Code) && is_string($userObject->Country->Code)) {
185
+ $profileDataFiltered['Country'] = $userObject->Country->Code;
186
+ }
187
+ else {
188
+ $profileDataFiltered['Country'] = "";
189
+ }
190
+ $profileDataFiltered['thumbnail'] = $this->socialLoginFilterAvatar($userObject->ID, $userObject->ThumbnailImageUrl, $profileDataFiltered['Provider']);
191
+
192
+
193
+ if (empty($profileDataFiltered['FirstName'])) {
194
+ if (!empty($profileDataFiltered['FullName'])) {
195
+ $profileDataFiltered['FirstName'] = $profileDataFiltered['FullName'];
196
+ }
197
+ elseif (!empty($profileDataFiltered['ProfileName'])) {
198
+ $profileDataFiltered['FirstName'] = $profileDataFiltered['ProfileName'];
199
+ }
200
+ elseif (!empty($profileDataFiltered['NickName'])) {
201
+ $profileDataFiltered['FirstName'] = $profileDataFiltered['NickName'];
202
+ }
203
+ elseif (!empty($email)) {
204
+ $user_name = explode('@', $email);
205
+ $profileDataFiltered['FirstName'] = str_replace("_", " ", $user_name[0]);
206
+ }
207
+ else {
208
+ $profileDataFiltered['FirstName'] = $userObject->ID;
209
+ }
210
+ }
211
+
212
+ $profileDataFiltered['Gender'] = (!empty($userObject->Gender) ? $userObject->Gender : '');
213
+ if (strtolower(substr($profileDataFiltered['Gender'], 0, 1)) == 'm') {
214
+ $profileDataFiltered['Gender'] = '1';
215
+ }
216
+ elseif (strtolower(substr($profileDataFiltered['Gender'], 0, 1)) == 'f') {
217
+ $profileDataFiltered['Gender'] = '2';
218
+ }
219
+ else {
220
+ $profileDataFiltered['Gender'] = '';
221
+ }
222
+ $profileDataFiltered['BirthDate'] = (!empty($userObject->BirthDate) ? $userObject->BirthDate : '');
223
+ if ($profileDataFiltered['BirthDate'] != "") {
224
+ switch ($profileDataFiltered['Provider']) {
225
+ case 'facebook':
226
+ case 'foursquare':
227
+ case 'yahoo':
228
+ case 'openid':
229
+ break;
230
+
231
+ case 'google':
232
+ $temp = explode('/', $profileDataFiltered['BirthDate']); // yy/mm/dd
233
+ $profileDataFiltered['BirthDate'] = $temp[1] . "/" . $temp[2] . "/" . $temp[0];
234
+ break;
235
+
236
+ case 'twitter':
237
+ case 'linkedin':
238
+ case 'vkontakte':
239
+ case 'live';
240
+ $temp = explode('/', $profileDataFiltered['BirthDate']); // dd/mm/yy
241
+ $profileDataFiltered['BirthDate'] = $temp[1] . "/" . $temp[0] . "/" . $temp[2];
242
+ break;
243
+ }
244
+ }
245
+ return $profileDataFiltered;
246
+ }
247
+
248
+ public function socialLoginFilterAvatar($id, $ImgUrl, $provider) {
249
+ $thumbnail = (!empty($ImgUrl) ? trim($ImgUrl) : '');
250
+ if (empty($thumbnail) && ($provider == 'facebook')) {
251
+ $thumbnail = "http://graph.facebook.com/" . $id . "/picture?type=large";
252
+ }
253
+ return $thumbnail;
254
+ }
255
+
256
+ public function loginRadiusRedirect($url) {
257
+ ?>
258
+ <script>
259
+ if (window.opener) {
260
+ window.opener.location.href = "<?php echo $url; ?>";
261
+ window.close();
262
+ } else {
263
+ window.location.href = "<?php echo $url; ?>";
264
+ }
265
+ </script>
266
+ <?php
267
+ die;
268
+ }
269
+ }
app/code/community/Loginradius/Sociallogin/Model/Backend/Validator.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Loginradius_Sociallogin_Model_Backend_Validator extends Mage_Core_Model_Config_Data
4
+ {
5
+ protected function _beforeSave()
6
+ {
7
+ echo "hello";die;
8
+ $value = $this->getValue();
9
+ if (!Zend_Validate::is($value, 'EmailAddress')) {
10
+ Mage::throwException(Mage::helper('adminhtml')->__('Invalid email address "%s".', $value));
11
+ }
12
+ return $this;
13
+ }
14
+ protected function _afterLoad(){
15
+ echo "hello";die;
16
+ }
17
+ }
app/code/community/Loginradius/Sociallogin/Model/Mysql4/Sociallogin.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
- class Loginradius_Sociallogin_Model_Mysql4_Sociallogin extends Mage_Core_Model_Mysql4_Abstract
3
- {
4
- public function _construct()
5
- {
6
- $this->_init('socialogin/socialogin', 'socialogin_id');
7
- }
8
- }
 
 
 
 
 
 
 
 
app/code/community/Loginradius/Sociallogin/Model/Mysql4/Sociallogin/Collection.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- class Loginradius_Sociallogin_Model_Mysql4_Sociallogin_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
- {
4
- public function _construct()
5
- {
6
- //parent::__construct();
7
- $this->_init('sociallogin/sociallogin');
8
- }
9
- }
 
 
 
 
 
 
 
 
 
app/code/community/Loginradius/Sociallogin/Model/Observer.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: nyaconcept
5
+ * Date: 11/17/14
6
+ * Time: 10:53 AM
7
+ */
8
+ class Loginradius_Sociallogin_Model_Observer extends Mage_Core_Helper_Abstract {
9
+ public function adminSystemConfigChangedSection() {
10
+ $post = Mage::app()->getRequest()->getPost();
11
+ foreach ($post['groups']['apiSettings']['fields'] as $apis) {
12
+ if (isset($apis['inherit']) && $apis['inherit']) {
13
+ $result['message'] = '';
14
+ $result['status'] = 'Success';
15
+ return $result;
16
+ }
17
+ }
18
+ $this->getAllVariables('basic');
19
+
20
+ }
21
+
22
+ public function getAllVariables($action) {
23
+ $function = 'loginradius_' . $action . '_setting_array';
24
+ $settings = $this->$function();
25
+ $responce = $this->getval($settings, $action);
26
+ $session = Mage::getSingleton('adminhtml/session');
27
+ $session->getMessages(TRUE);
28
+ if ($responce['status'] != 'Success') {
29
+ throw new Exception($responce['message']);
30
+ }
31
+ }
32
+
33
+ public function getval($fieldArrays, $action) {
34
+ $post = Mage::app()->getRequest()->getPost();
35
+ $count = 1;
36
+ $string = '';
37
+ foreach ($fieldArrays as $fieldId => $fieldArray) {
38
+ foreach ($fieldArray as $fieldValue) {
39
+ $settings[$fieldValue] = isset($post['groups'][$fieldId]['fields'][$fieldValue]['value']) ? $post['groups'][$fieldId]['fields'][$fieldValue]['value'] : '';
40
+ }
41
+
42
+ $string .= $this->loginradius_get_string_format($count, $fieldArray, $settings);
43
+ $count++;
44
+ }
45
+
46
+ $result['message'] = '';
47
+ $result['status'] = 'Success';
48
+ $validateUrl = 'https://api.loginradius.com/api/v2/app/validate?apikey=' . rawurlencode($settings['apikey']) . '&apisecret=' . rawurlencode($settings['apisecret']);
49
+
50
+ $data = array(
51
+ 'addon' => 'Magento: ' . Mage::getVersion(),
52
+ 'version' => '4.0.0',
53
+ 'agentstring' => $_SERVER["HTTP_USER_AGENT"],
54
+ 'clientip' => $_SERVER["REMOTE_ADDR"],
55
+ 'configuration' => $string
56
+ );
57
+
58
+ return $this->loginradius_save_setting_on_server($validateUrl, $data);
59
+ }
60
+
61
+ function loginradius_get_string_format($tabNo, $array, $settings) {
62
+ $string = "~" . $tabNo . "#";
63
+ for ($i = 0; $i < count($array); $i++) {
64
+ if (in_array($array[$i], array('appid', 'appkey'))) {
65
+ continue;
66
+ }
67
+ elseif (is_numeric($settings[$array[$i]])) {
68
+ $string .= '|' . $settings[$array[$i]];
69
+ }
70
+ elseif (@unserialize($settings[$array[$i]])) {
71
+ $string .= '|' . json_encode(@unserialize($settings[$array[$i]]));
72
+ }
73
+ elseif (is_string($settings[$array[$i]])) {
74
+ $string .= '|"' . $settings[$array[$i]] . '"';
75
+ }
76
+ }
77
+ return $string . '|';
78
+ }
79
+
80
+ function loginradius_save_setting_on_server($url, $data) {
81
+ $result['status'] = 'Error';
82
+ $loginradiusObgect = new Loginradius_Sociallogin_Helper_LoginRadiusSDK();
83
+ $responce = json_decode($loginradiusObgect->accessLoginradiusApi($url, http_build_query($data)));
84
+ $status = isset($responce->Status) ? $responce->Status : FALSE;
85
+ $result['message'] = isset($responce->Messages[0]) ? $responce->Messages[0] : 'An error ocCureD';
86
+ if ($status) {
87
+ $result['message'] = '';
88
+ $result['status'] = 'Success';
89
+ }
90
+ else {
91
+ if ($result['message'] == 'API_KEY_NOT_FORMATED') {
92
+ $result['message'] = 'LoginRadius API key is not correct.';
93
+ }
94
+ elseif ($result['message'] == 'API_SECRET_NOT_FORMATED') {
95
+ $result['message'] = 'LoginRadius API Secret key is not correct.';
96
+ }
97
+ elseif ($result['message'] == 'API_KEY_NOT_VALID') {
98
+ $result['message'] = 'LoginRadius API key is not valid.';
99
+ }
100
+ elseif ($result['message'] == 'API_SECRET_NOT_VALID') {
101
+ $result['message'] = 'LoginRadius API Secret key is not valid.';
102
+ }
103
+ }
104
+ return $result;
105
+ }
106
+
107
+ public function loginradius_basic_setting_array() {
108
+ return array(
109
+ 'apiSettings' => array('apikey', 'apisecret'),
110
+ 'basicSettings' => array('redirectAfterLogin', 'customLogin', 'redirectAfterRegistration', 'customRegistration'),
111
+ 'advancedSettings' => array('loginradius_title', 'iconSize', 'iconsPerRow', 'backgroundColor', 'showdefault', 'aboveLogin', 'belowLogin', 'aboveRegister', 'belowRegister', 'emailrequired', 'verificationText', 'popupText', 'popupError', 'notifyUser', 'notifyUserText', 'notifyAdmin', 'notifyAdminText', 'profileFieldsRequired', 'updateProfileData', 'socialLinking', 'debugMode'),
112
+ 'horizontalSharing' => array('horizontalShareEnable', 'horizontalSharingTheme', 'horizontalAlignment', 'horizontalSharingProvidersHidden', 'horizontalCounterProvidersHidden', 'horizontalShareProduct', 'horizontalShareSuccess'),
113
+ 'verticalSharing' => array('verticalShareEnable', 'verticalSharingTheme', 'verticalAlignment', 'verticalSharingProvidersHidden', 'verticalCounterProvidersHidden', 'verticalShareProduct', 'verticalShareSuccess')
114
+ );
115
+ }
116
+
117
+ function loginradius_get_array($fieldArray) {
118
+ $settings = array();
119
+ foreach ($fieldArray as $fieldKey => $fieldValues) {
120
+ foreach ($fieldValues as $fieldValue) {
121
+ $settings[] = $fieldValue;
122
+ }
123
+ }
124
+ return $settings;
125
+ }
126
+ }
app/code/community/Loginradius/Sociallogin/Model/Sociallogin.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- class Loginradius_Sociallogin_Model_Sociallogin extends Mage_Core_Model_Abstract
3
- {
4
- public function _construct()
5
- {
6
- parent::_construct();
7
- $this->_init('sociallogin/sociallogin');
8
- }
9
- }
 
 
 
 
 
 
 
 
 
app/code/community/Loginradius/Sociallogin/Model/Source/HorizontalSharing.php CHANGED
@@ -1,15 +1,15 @@
1
  <?php
2
- class Loginradius_Sociallogin_Model_Source_HorizontalSharing
3
- {
4
  public function toOptionArray()
5
  {
6
- $result = array();
7
- $result[] = array('value' => '32', 'label'=>'<img width="274" src="'.Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Horizontal/horizonSharing32.png',array('_area'=>'frontend')).'" /><div style="clear:both"></div>');
8
- $result[] = array('value' => '16', 'label'=>'<img src="'.Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Horizontal/horizonSharing16.png',array('_area'=>'frontend')).'" /><div style="clear:both"></div>');
9
- $result[] = array('value' => 'single_large', 'label'=>'<img src="'.Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Horizontal/single-image-theme-large.png',array('_area'=>'frontend')).'" /><div style="clear:both"></div>');
10
- $result[] = array('value' => 'single_small', 'label'=>'<img src="'.Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Horizontal/single-image-theme-small.png',array('_area'=>'frontend')).'" /><div style="clear:both"></div>');
11
- $result[] = array('value' => 'counter_vertical', 'label'=>'<img src="'.Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Horizontal/vertical.png',array('_area'=>'frontend')).'" /><div style="clear:both"></div>');
12
- $result[] = array('value' => 'counter_horizontal', 'label'=>'<img src="'.Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Horizontal/horizontal.png',array('_area'=>'frontend')).'" />');
13
- return $result;
14
- }
15
- }
1
  <?php
2
+ class Loginradius_Sociallogin_Model_Source_HorizontalSharing
3
+ {
4
  public function toOptionArray()
5
  {
6
+ $result = array();
7
+ $result[] = array('value' => '32', 'label' => '<img src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Horizontal/horizonSharing32.png', array('_area' => 'adminhtml')) . '" /><div style="clear:both"></div>');
8
+ $result[] = array('value' => '16', 'label' => '<img src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Horizontal/horizonSharing16.png', array('_area' => 'adminhtml')) . '" /><div style="clear:both"></div>');
9
+ $result[] = array('value' => 'single_large', 'label' => '<img src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Horizontal/single-image-theme-large.png', array('_area' => 'adminhtml')) . '" /><div style="clear:both"></div>');
10
+ $result[] = array('value' => 'single_small', 'label' => '<img src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Horizontal/single-image-theme-small.png', array('_area' => 'adminhtml')) . '" /><div style="clear:both"></div>');
11
+ $result[] = array('value' => 'counter_vertical', 'label' => '<img src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Horizontal/vertical.png', array('_area' => 'adminhtml')) . '" /><div style="clear:both"></div>');
12
+ $result[] = array('value' => 'counter_horizontal', 'label' => '<img style="width:375px;" src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Horizontal/horizontal.png', array('_area' => 'adminhtml')) . '" /><div style="clear:both"></div>');
13
+ return $result;
14
+ }
15
+ }
app/code/community/Loginradius/Sociallogin/Model/Source/Iconsize.php CHANGED
@@ -1,10 +1,11 @@
1
  <?php
2
  class Loginradius_Sociallogin_Model_Source_Iconsize
3
  {
4
- public function toOptionArray(){
5
- $result = array();
6
- $result[] = array('value' => 'medium', 'label'=>__('Medium').'<br/>');
7
- $result[] = array('value' => 'small', 'label'=>__('Small').'<br/>');
8
- return $result;
9
- }
 
10
  }
1
  <?php
2
  class Loginradius_Sociallogin_Model_Source_Iconsize
3
  {
4
+ public function toOptionArray()
5
+ {
6
+ $result = array();
7
+ $result[] = array('value' => 'medium', 'label' => __('Medium'));
8
+ $result[] = array('value' => 'small', 'label' => __('Small'));
9
+ return $result;
10
+ }
11
  }
app/code/community/Loginradius/Sociallogin/Model/Source/LoginPopup.php CHANGED
@@ -1,10 +1,11 @@
1
  <?php
2
  class Loginradius_Sociallogin_Model_Source_Loginpopup
3
  {
4
- public function toOptionArray(){
5
- $result = array();
6
- $result[] = array('value' => '1', 'label'=>__('Yes').'<br/>');
7
- $result[] = array('value' => '0', 'label'=>__('No').'<br/>');
8
- return $result;
9
- }
 
10
  }
1
  <?php
2
  class Loginradius_Sociallogin_Model_Source_Loginpopup
3
  {
4
+ public function toOptionArray()
5
+ {
6
+ $result = array();
7
+ $result[] = array('value' => '1', 'label' => __('Yes') . '<br/>');
8
+ $result[] = array('value' => '0', 'label' => __('No') . '<br/>');
9
+ return $result;
10
+ }
11
  }
app/code/community/Loginradius/Sociallogin/Model/Source/SharingVerticalAlignment.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
- class Loginradius_Sociallogin_Model_Source_SharingVerticalAlignment
3
- {
4
  public function toOptionArray()
5
  {
6
- $result = array();
7
- $result[] = array('value' => 'top_left', 'label'=>__('Top Left'));
8
- $result[] = array('value' => 'top_right', 'label'=>__('Top Right'));
9
- $result[] = array('value' => 'bottom_left', 'label'=>__('Bottom Left'));
10
- $result[] = array('value' => 'bottom_right', 'label'=>__('Bottom Right'));
11
- return $result;
12
- }
13
- }
1
  <?php
2
+ class Loginradius_Sociallogin_Model_Source_SharingVerticalAlignment
3
+ {
4
  public function toOptionArray()
5
  {
6
+ $result = array();
7
+ $result[] = array('value' => 'top_left', 'label' => __('Top Left'));
8
+ $result[] = array('value' => 'top_right', 'label' => __('Top Right'));
9
+ $result[] = array('value' => 'bottom_left', 'label' => __('Bottom Left'));
10
+ $result[] = array('value' => 'bottom_right', 'label' => __('Bottom Right'));
11
+ return $result;
12
+ }
13
+ }
app/code/community/Loginradius/Sociallogin/Model/Source/TwitterRecipients.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Loginradius_Sociallogin_Model_Source_twitterRecipients
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ $result = array();
7
+ $result[] = array('value' => 'selected', 'label' => 'Let the user pick<br/>');
8
+ $result[] = array('value' => 'all', 'label' => 'All contacts');
9
+ return $result;
10
+ }
11
+ }
app/code/community/Loginradius/Sociallogin/Model/Source/Uihover.php CHANGED
@@ -1,12 +1,13 @@
1
  <?php
2
- class Loginradius_Sociallogin_Model_Source_Uihover
3
- {
4
- public function toOptionArray(){
5
- $result = array();
6
- $result[] = array('value' => 'same', 'label'=>__('Redirect to same page where the user logged in').'<br/>');
7
- $result[] = array('value' => 'account', 'label'=>__('Redirect to account page').'<br/>');
8
- $result[] = array('value' => 'index', 'label'=>__('Redirect to home page').'<br/>');
9
- $result[] = array('value' => 'custom', 'label'=>__('Redirect to following url') );
10
- return $result;
11
- }
12
- }
 
1
  <?php
2
+ class Loginradius_Sociallogin_Model_Source_Uihover
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ $result = array();
7
+ $result[] = array('value' => 'same', 'label' => __('Same Page'));
8
+ $result[] = array('value' => 'account', 'label' => __('Account Page'));
9
+ $result[] = array('value' => 'index', 'label' => __('Home Page'));
10
+ $result[] = array('value' => 'custom', 'label' => __('Custom URL'));
11
+ return $result;
12
+ }
13
+ }
app/code/community/Loginradius/Sociallogin/Model/Source/Uihover2.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
- class Loginradius_Sociallogin_Model_Source_Uihover2
3
- {
4
  public function toOptionArray()
5
  {
6
- $result = array();
7
- $result[] = array('value' => 'varien', 'label'=>__('Use').' "http_varien_client"');
8
- $result[] = array('value' => 'curl', 'label'=>__('Use').' cURL');
9
- $result[] = array('value' => 'fopen', 'label'=>__('Use').' FSOCKOPEN' );
10
- return $result;
11
- }
12
- }
1
  <?php
2
+ class Loginradius_Sociallogin_Model_Source_Uihover2
3
+ {
4
  public function toOptionArray()
5
  {
6
+ $result = array();
7
+ $result[] = array('value' => 'varien', 'label' => __('Use') . ' "http_varien_client"');
8
+ $result[] = array('value' => 'curl', 'label' => __('Use') . ' cURL');
9
+ $result[] = array('value' => 'fopen', 'label' => __('Use') . ' FSOCKOPEN');
10
+ return $result;
11
+ }
12
+ }
app/code/community/Loginradius/Sociallogin/Model/Source/VerticalSharing.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
- class Loginradius_Sociallogin_Model_Source_VerticalSharing
3
- {
4
  public function toOptionArray()
5
  {
6
- $result = array();
7
- $result[] = array('value' => '32', 'label'=>'<img style="margin-right:5px" src="'.Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Vertical/32VerticlewithBox.png',array('_area'=>'frontend')).'" /><br />');
8
- $result[] = array('value' => '16', 'label'=>'<img src="'.Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Vertical/16VerticlewithBox.png',array('_area'=>'frontend')).'" /><br />');
9
- $result[] = array('value' => 'counter_vertical', 'label'=>'<img src="'.Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Vertical/verticalvertical.png',array('_area'=>'frontend')).'" /><br />');
10
- $result[] = array('value' => 'counter_horizontal', 'label'=>'<img src="'.Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Vertical/verticalhorizontal.png',array('_area'=>'frontend')).'" /><br />');
11
- return $result;
12
- }
13
- }
1
  <?php
2
+ class Loginradius_Sociallogin_Model_Source_VerticalSharing
3
+ {
4
  public function toOptionArray()
5
  {
6
+ $result = array();
7
+ $result[] = array('value' => '32', 'label' => '<img style="margin-right:5px" src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Vertical/32VerticlewithBox.png', array('_area' => 'adminhtml')) . '" /><br />');
8
+ $result[] = array('value' => '16', 'label' => '<img src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Vertical/16VerticlewithBox.png', array('_area' => 'adminhtml')) . '" /><br />');
9
+ $result[] = array('value' => 'counter_vertical', 'label' => '<img src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Vertical/verticalvertical.png', array('_area' => 'adminhtml')) . '" /><br />');
10
+ $result[] = array('value' => 'counter_horizontal', 'label' => '<img src="' . Mage::getDesign()->getSkinUrl('Loginradius/Sociallogin/images/Sharing/Vertical/verticalhorizontal.png', array('_area' => 'adminhtml')) . '" /><br />');
11
+ return $result;
12
+ }
13
+ }
app/code/community/Loginradius/Sociallogin/Model/System/Config/Info.php CHANGED
@@ -1,117 +1,197 @@
1
  <?php
 
2
  class Loginradius_Sociallogin_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
- $html = $element->getComment();
12
- if(!$html){
13
- $html = $element->getText();
14
- }
15
- ?>
16
-
17
- <fieldset class="loginRadiusFieldset" style="margin-right:13px; background-color:#EAF7FF; border-color:rgb(195, 239, 250); padding-bottom:25px; width:65%">
18
- <h4 style="color:#000"><strong><?php echo $this -> __('Thank you for installing the LoginRadius Social Plugin!') ?></strong></h4>
19
- <p><?php echo $this -> __('To activate the extension, you will need to first configure it (manage your desired social networks, etc.) from your LoginRadius account. If you do not have an account, click') ?> <a target="_blank" href="http://www.loginradius.com/"><?php echo $this -> __('here') ?></a> <?php echo $this -> __('and create one for FREE!') ?></p>
20
- <p>
21
- <?php echo $this -> __('We also offer Social Plugins for') ?> <a href="https://www.loginradius.com/loginradius-for-developers/loginRadius-cms#wordpress-plugin" target="_blank">Wordpress</a>, <a href="https://www.loginradius.com/loginradius-for-developers/loginRadius-cms#joomla-extension" target="_blank">Joomla</a>, <a href="https://www.loginradius.com/loginradius-for-developers/loginRadius-cms#drupal-module" target="_blank">Drupal</a>, <a href="https://www.loginradius.com/loginradius-for-developers/loginRadius-cms#vbullentin-plugin" target="_blank">vBulletin</a>, <a href="https://www.loginradius.com/loginradius-for-developers/loginRadius-cms#vanilla-add-ons" target="_blank">VanillaForum</a>, <a href="https://www.loginradius.com/loginradius-for-developers/loginRadius-cms#oscommerce-add-ons" target="_blank">osCommerce</a>, <a href="https://www.loginradius.com/loginradius-for-developers/loginRadius-cms#prestashop-module" target="_blank">PrestaShop</a>, <a href="https://www.loginradius.com/loginradius-for-developers/loginRadius-cms#xcart-extension" target="_blank">X-Cart</a>, <a href="https://www.loginradius.com/loginradius-for-developers/loginRadius-cms#zencart-plugin" target="_blank">Zen-Cart</a>, <a href="https://www.loginradius.com/loginradius-for-developers/loginRadius-cms#dotnetnuke-module" target="_blank">DotNetNuke</a>, <a href="https://www.loginradius.com/loginradius-for-developers/loginRadius-cms/#smf" target="_blank">SMF</a> <?php echo $this -> __('and') ?> <a href="https://www.loginradius.com/loginradius-for-developers/loginRadius-cms/#phpbb" target="_blank">phpBB</a> !
22
- </p>
23
- <div style="margin-top:10px">
24
- <a style="text-decoration:none;" href="https://www.loginradius.com/" target="_blank">
25
- <input class="form-button" type="button" value="<?php echo $this -> __('Set up my FREE account!') ?>">
26
- </a>
27
- <a class="loginRadiusHow" target="_blank" href="http://support.loginradius.com/customer/portal/articles/593954">(<?php echo $this -> __('How to set up an account?') ?>)</a>
28
- </div>
29
- </fieldset>
30
- <!-- Get Updates -->
31
- <fieldset class="loginRadiusFieldset" style="width:26%; background-color: rgb(231, 255, 224); border: 1px solid rgb(191, 231, 176); padding-bottom:6px;">
32
- <h4 style="border-bottom:#d7d7d7 1px solid;"><strong><?php echo $this -> __('Get Updates') ?></strong></h4>
33
- <p><?php echo $this -> __('To receive updates on new features, future releases, etc, please connect with us via Facebook') ?></p>
34
- <div>
35
- <div style="float:left">
36
- <iframe rel="tooltip" scrolling="no" frameborder="0" allowtransparency="true" style="border: none; overflow: hidden; width: 46px;
37
- height: 61px; margin-right:10px" src="//www.facebook.com/plugins/like.php?app_id=194112853990900&amp;href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FLoginRadius%2F119745918110130&amp;send=false&amp;layout=box_count&amp;width=90&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=90" data-original-title="Like us on Facebook"></iframe>
38
- </div>
39
- <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
40
- </div>
41
- </fieldset>
42
- <!-- Help & Documentation -->
43
- <fieldset class="loginRadiusHelpDiv" style="margin-right:13px; width:65%">
44
- <h4 style="border-bottom:#d7d7d7 1px solid;"><strong><?php echo $this -> __('Help & Documentations') ?></strong></h4>
45
- <ul style="float:left; margin-right:43px">
46
- <li><a target="_blank" href="http://support.loginradius.com/customer/portal/articles/1056696-magento-social-login-installation-configuration-and-troubleshooting"><?php echo $this -> __('Extension Installation, Configuration and Troubleshooting') ?></a></li>
47
- <li><a target="_blank" href="http://support.loginradius.com/customer/portal/articles/677100-how-to-get-loginradius-api-key-and-secret"><?php echo $this -> __('How to get LoginRadius API Key & Secret') ?></a></li>
48
- <li><a target="_blank" href="http://support.loginradius.com/customer/portal/articles/1056696-magento-social-login-installation-configuration-and-troubleshooting#multisite"><?php echo $this -> __('Magento Multisite Feature') ?></a></li>
49
- <li><a target="_blank" href="https://www.loginradius.com/loginradius/product-overview"><?php echo $this -> __('LoginRadius Products') ?></a></li>
50
- </ul>
51
- <ul style="float:left; margin-right:43px">
52
- <li><a target="_blank" href="http://community.loginradius.com/"><?php echo $this -> __('Discussion Forum') ?></a></li>
53
- <li><a target="_blank" href="https://www.loginradius.com/loginradius/team"><?php echo $this -> __('About LoginRadius') ?></a></li>
54
- <li><a target="_blank" href="https://www.loginradius.com/loginradius-for-developers/loginRadius-cms"><?php echo $this -> __('Social Plugins') ?></a></li>
55
- <li><a target="_blank" href="https://www.loginradius.com/loginradius-for-developers/loginRadius-sdks"><?php echo $this -> __('Social SDKs') ?></a></li>
56
- </ul>
57
- </fieldset>
58
- <!-- Support Us -->
59
- <fieldset class="loginRadiusFieldset" style="margin-right:5px; background-color: rgb(231, 255, 224); border: 1px solid rgb(191, 231, 176); width:26%; height:112px">
60
- <h4 style="border-bottom:#d7d7d7 1px solid;"><strong><?php echo $this -> __('Support Us') ?></strong></h4>
61
- <p>
62
- <?php echo $this -> __('If you liked our FREE open-source plugin, please send your feedback/testimonial to') ?> <a href="mailto:feedback@loginradius.com">feedback@loginradius.com</a> !</p>
63
- </fieldset>
64
- <div style='clear:both'></div>
65
- <div id="loginRadiusKeySecretNotification" style="background-color: rgb(255, 255, 224); border: 1px solid rgb(230, 219, 85); padding: 5px; margin-bottom: 11px; display:none"><?php echo $this -> __('To activate the <strong>Social Login</strong>, insert LoginRadius API Key and Secret in the <strong>Social Login Basic Settings</strong> section below. <strong>Social Sharing does not require API Key and Secret</strong>') ?>.</div>
66
- <div style='clear:both'></div>
67
- <script type="text/javascript">var islrsharing = true; var islrsocialcounter = true;</script>
68
- <script type="text/javascript" src="//share.loginradius.com/Content/js/LoginRadius.js" id="lrsharescript"></script>
69
- <script type="text/javascript">
70
- window.onload = function(){
71
- if(document.getElementById('sociallogin_options_messages_appid').value.trim() == "" || document.getElementById('sociallogin_options_messages_appkey').value.trim() == ""){
72
- document.getElementById('loginRadiusKeySecretNotification').style.display = 'block';
73
- }
74
- var sharingType = ['horizontal', 'vertical'];
75
- var sharingModes = ['Sharing', 'Counter'];
76
- for(var i = 0; i < sharingType.length; i++){
77
- for(var j = 0; j < sharingModes.length; j++){
78
- if(sharingModes[j] == 'Counter'){
79
- var providers = $SC.Providers.All;
80
- }else{
81
- var providers = $SS.Providers.More;
82
- }
83
- // populate sharing providers checkbox
84
- loginRadiusCounterHtml = "<ul class='checkboxes'>";
85
- // prepare HTML to be shown as Vertical Counter Providers
86
- for(var ii = 0; ii < providers.length; ii++){
87
- loginRadiusCounterHtml += '<li><input type="checkbox" id="'+sharingType[i]+'_'+sharingModes[j]+'_'+providers[ii]+'" ';
88
- loginRadiusCounterHtml += 'value="'+providers[ii]+'"> <label for="'+sharingType[i]+'_'+sharingModes[j]+'_'+providers[ii]+'">'+providers[ii]+'</label></li>';
89
- }
90
- loginRadiusCounterHtml += "</ul>";
91
- var tds = document.getElementById('row_sociallogin_options_'+sharingType[i]+'Sharing_'+sharingType[i]+sharingModes[j]+'Providers').getElementsByTagName('td');
92
- tds[1].innerHTML = loginRadiusCounterHtml;
93
- }
94
- document.getElementById('row_sociallogin_options_'+sharingType[i]+'Sharing_'+sharingType[i]+'CounterProvidersHidden').style.display = 'none';
95
- }
96
- loginRadiusPrepareAdminUI();
97
- }
98
- // toggle sharing/counter providers according to the theme and sharing type
99
- function loginRadiusToggleSharingProviders(element, sharingType){
100
- if(element.value == '32' || element.value == '16'){
101
- document.getElementById('row_sociallogin_options_'+sharingType+'Sharing_'+sharingType+'SharingProviders').style.display = 'table-row';
102
- document.getElementById('row_sociallogin_options_'+sharingType+'Sharing_'+sharingType+'CounterProviders').style.display = 'none';
103
- document.getElementById('row_sociallogin_options_'+sharingType+'Sharing_'+sharingType+'SharingProvidersHidden').style.display = 'table-row';
104
- }else if(element.value == 'single_large' || element.value == 'single_small'){
105
- document.getElementById('row_sociallogin_options_'+sharingType+'Sharing_'+sharingType+'SharingProviders').style.display = 'none';
106
- document.getElementById('row_sociallogin_options_'+sharingType+'Sharing_'+sharingType+'CounterProviders').style.display = 'none';
107
- document.getElementById('row_sociallogin_options_'+sharingType+'Sharing_'+sharingType+'SharingProvidersHidden').style.display = 'none';
108
- }else{
109
- document.getElementById('row_sociallogin_options_'+sharingType+'Sharing_'+sharingType+'SharingProviders').style.display = 'none';
110
- document.getElementById('row_sociallogin_options_'+sharingType+'Sharing_'+sharingType+'CounterProviders').style.display = 'table-row';
111
- document.getElementById('row_sociallogin_options_'+sharingType+'Sharing_'+sharingType+'SharingProvidersHidden').style.display = 'none';
112
- }
113
- }
114
- </script>
115
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  }
117
- }
 
1
  <?php
2
+
3
  class Loginradius_Sociallogin_Model_System_Config_Info extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
4
  {
5
+
6
+ /**
7
  * Render fieldset html
8
  *
9
  * @param Varien_Data_Form_Element_Abstract $element
10
+ *
11
  * @return string
12
  */
13
+ public function render(Varien_Data_Form_Element_Abstract $element)
14
+ {
15
+
16
+ // Get LoginRadius Module Thanks message container..
17
+ $this->render_module_thanks_message_container();
18
+
19
+ // Get LoginRadius Module information container..
20
+ $this->render_module_info_container();
21
+
22
+ // Get LoginRadius Module Help & Documentations container..
23
+ $this->render_module_help_and_documentations_container();
24
+
25
+ // Get LoginRadius Module Support Us container..
26
+ $this->render_module_support_us_container();
27
+
28
+ // Get LoginRadius Module Support Us container..
29
+ $this->render_module_admin_script_container();
30
+ }
31
+
32
+ public function render_module_thanks_message_container()
33
+ {
34
+ ?>
35
+ <fieldset class="lr_admin_configuration_info_fieldsets lr_configuration_info_fieldsets_left" id="lr_thank_message_container">
36
+ <h4 class="lr_admin_fieldset_title"><strong><?php echo $this->__('Thank you for installing LoginRadius Extension!') ?></strong></h4>
37
+
38
+ <p>
39
+ <?php echo $this->__('To activate the extension, you will need to first configure it (manage your desired social networks, etc.) from your LoginRadius account. If you do not have an account, click') ?>
40
+ <a target="_blank" href="http://www.loginradius.com/"><?php echo $this->__('here') ?></a> <?php echo $this->__('and create one for FREE!') ?>
41
+ </p>
42
+
43
+ <p>
44
+ <?php echo $this->__('We also offer Social Plugins for') ?>
45
+ <a href="http://ish.re/ADDT" target="_blank">Wordpress</a>,
46
+ <a href="http://ish.re/8PE6" target="_blank">Joomla</a>,
47
+ <a href="http://ish.re/8PE9" target="_blank">Drupal</a>,
48
+ <a href="http://ish.re/8PED" target="_blank">vBulletin</a>,
49
+ <a href="http://ish.re/8PEE" target="_blank">VanillaForum</a>,
50
+ <a href="http://ish.re/8PEG" target="_blank">osCommerce</a>,
51
+ <a href="http://ish.re/8PEH" target="_blank">PrestaShop</a>,
52
+ <a href="http://ish.re/8PFQ" target="_blank">X-Cart</a>,
53
+ <a href="http://ish.re/8PFR" target="_blank">Zen-Cart</a>,
54
+ <a href="http://ish.re/8PFS" target="_blank">DotNetNuke</a>,
55
+ <a href="http://ish.re/8PFT" target="_blank">SMF</a><?php echo $this->__('and') ?>
56
+ <a href="http://ish.re/8PFV" target="_blank">phpBB</a> !
57
+ </p>
58
+ </br>
59
+ <div style="margin-top:10px">
60
+ <a style="text-decoration:none;margin-right:10px;" href="https://www.loginradius.com/" target="_blank">
61
+ <input class="form-button" type="button" value="<?php echo $this->__('Set up my FREE account!') ?>">
62
+ </a>
63
+ <a class="loginRadiusHow" target="_blank"
64
+ href="http://ish.re/ATM4">(<?php echo $this->__('How to set up an account?') ?>)</a>
65
+ </div>
66
+ </fieldset>
67
+ <?php
68
+ }
69
+
70
+ public function render_module_info_container()
71
+ {
72
+ ?>
73
+ <fieldset class="lr_admin_configuration_info_fieldsets lr_configuration_info_fieldsets_right" id="lr_extension_info_container">
74
+ <h4 class="lr_admin_fieldset_title"><strong><?php echo $this->__('Extension Information!') ?></strong></h4>
75
+
76
+ <div style="margin:5px 0">
77
+ <strong>Version: </strong>4.0.0 <br/>
78
+ <strong>Author:</strong> LoginRadius<br/>
79
+ <strong>Website:</strong> <a href="https://www.loginradius.com" target="_blank">www.loginradius.com</a>
80
+ <br/>
81
+ <strong>Community:</strong> <a href="http://community.loginradius.com" target="_blank">community.loginradius.com</a>
82
+ <br/>
83
+
84
+ <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
85
+ </div>
86
+ <div id="lr_media_pages_container">
87
+ <a target="_blank" href="https://www.facebook.com/loginradius"><img
88
+ src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'adminhtml/default/default/Loginradius/Sociallogin/images/media-pages/facebook.png'; ?>"></a>
89
+ <a target="_blank" href="https://twitter.com/LoginRadius"><img
90
+ src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'adminhtml/default/default/Loginradius/Sociallogin/images/media-pages/twitter.png'; ?>"></a>
91
+ <a target="_blank" href="https://plus.google.com/+Loginradius"> <img
92
+ src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'adminhtml/default/default/Loginradius/Sociallogin/images/media-pages/google.png'; ?>"></a>
93
+ <a target="_blank" href="http://www.linkedin.com/company/loginradius"> <img
94
+ src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'adminhtml/default/default/Loginradius/Sociallogin/images/media-pages/linkedin.png'; ?>"></a>
95
+ <a target="_blank" href="https://www.youtube.com/user/LoginRadius"> <img
96
+ src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'adminhtml/default/default/Loginradius/Sociallogin/images/media-pages/youtube.png'; ?>"></a>
97
+ </div>
98
+ </div>
99
+ </fieldset>
100
+ <?php
101
+ }
102
+
103
+ public function render_module_help_and_documentations_container()
104
+ {
105
+ ?>
106
+ <fieldset class="lr_admin_configuration_info_fieldsets lr_configuration_info_fieldsets_left" id="lr_extension_help_container">
107
+ <h4 class="lr_admin_fieldset_title"><strong><?php echo $this->__('Help & Documentations') ?></strong></h4>
108
+ <ul style="float:left; margin-right:43px">
109
+ <li><a target="_blank" href="http://ish.re/9WC9">Extension Installation, Configuration and
110
+ Troubleshooting</a></li>
111
+ <li><a target="_blank" href="http://ish.re/9VBI">How to get LoginRadius API Key &amp; Secret</a></li>
112
+ <li><a target="_blank" href="http://ish.re/9Z34">Magento Multisite Feature</a></li>
113
+ <li><a target="_blank" href="http://ish.re/96M9">LoginRadius Products</a></li>
114
+ </ul>
115
+ <ul style="float:left; margin-right:43px">
116
+ <li><a target="_blank" href="http://ish.re/8PG2">Discussion Forum</a></li>
117
+ <li><a target="_blank" href="http://ish.re/96M7">About LoginRadius</a></li>
118
+ <li><a target="_blank" href="http://ish.re/8PG8">Social Plugins</a></li>
119
+ <li><a target="_blank" href="http://ish.re/6JMW">Social SDKs</a></li>
120
+ </ul>
121
+ </fieldset>
122
+ <?php
123
+ }
124
+
125
+ public function render_module_support_us_container()
126
+ {
127
+ ?>
128
+ <fieldset class="lr_admin_configuration_info_fieldsets lr_configuration_info_fieldsets_right" id="lr_extension_support_container">
129
+ <h4 class="lr_admin_fieldset_title"><strong><?php echo $this->__('Support Us') ?></strong></h4>
130
+
131
+ <p>
132
+ <?php echo $this->__('If you liked our FREE open-source extension, please send your feedback/testimonial to') ?>
133
+ <a href="mailto:feedback@loginradius.com">feedback@loginradius.com</a> !</p>
134
+ </fieldset>
135
+ <div style='clear:both'></div>
136
+ <div id="loginRadiusKeySecretNotification" style="background-color: rgb(255, 255, 224); border: 1px solid rgb(230, 219, 85); padding: 5px; margin-bottom: 11px; display:none"><?php echo $this->__('To activate the <strong>Social Login</strong>, insert LoginRadius API Key and Secret in the <strong>Social Login Basic Settings</strong> section below. <strong>Social Sharing does not require API Key and Secret</strong>') ?>
137
+ </div>
138
+ <div style='clear:both'></div>
139
+ <?php
140
+ }
141
+
142
+ public function render_module_admin_script_container()
143
+ {
144
+ ?>
145
+ <script type="text/javascript">var islrsharing = true;
146
+ var islrsocialcounter = true;</script>
147
+ <script type="text/javascript" src='//share.loginradius.com/Content/js/LoginRadius.js'></script>
148
+ <script type="text/javascript">
149
+ jQuery(document).ready(function () {
150
+ if (jQuery('#sociallogin_options_apisettings_apikey').val() == "" || jQuery('#sociallogin_options_apisettings_apisecret').val() == "") {
151
+ jQuery('#loginRadiusKeySecretNotification').style.display = 'block';
152
+ }
153
+ var sharingType = ['horizontal', 'vertical'];
154
+ var sharingModes = ['Sharing', 'Counter'];
155
+ for (var i = 0; i < sharingType.length; i++) {
156
+ for (var j = 0; j < sharingModes.length; j++) {
157
+ if (sharingModes[j] == 'Counter') {
158
+ var providers = $SC.Providers.All;
159
+ } else {
160
+ var providers = $SS.Providers.More;
161
+ }
162
+ //populate sharing providers checkbox
163
+ loginRadiusCounterHtml = "<ul class='checkboxes'>";
164
+ // prepare HTML to be shown as Vertical Counter Providers
165
+ for (var ii = 0; ii < providers.length; ii++) {
166
+ loginRadiusCounterHtml += '<li><input type="checkbox" id="' + sharingType[i] + '_' + sharingModes[j] + '_' + providers[ii] + '" ';
167
+ loginRadiusCounterHtml += 'value="' + providers[ii] + '"> <label for="' + sharingType[i] + '_' + sharingModes[j] + '_' + providers[ii] + '">' + providers[ii] + '</label></li>';
168
+ }
169
+ loginRadiusCounterHtml += "</ul>";
170
+ var tds = document.getElementById('row_sociallogin_options_' + sharingType[i] + 'Sharing_' + sharingType[i] + sharingModes[j] + 'Providers').getElementsByTagName('td');
171
+ tds[1].innerHTML = loginRadiusCounterHtml;
172
+ }
173
+ jQuery('#row_sociallogin_options_' + sharingType[i] + 'Sharing_' + sharingType[i] + 'CounterProvidersHidden').hide();
174
+ }
175
+ loginRadiusPrepareAdminUI();
176
+ });
177
+ // toggle sharing/counter providers according to the theme and sharing type
178
+ function loginRadiusToggleSharingProviders(element, sharingType) {
179
+ if (element.value == '32' || element.value == '16') {
180
+ document.getElementById('row_sociallogin_options_' + sharingType + 'Sharing_' + sharingType + 'SharingProviders').style.display = 'table-row';
181
+ document.getElementById('row_sociallogin_options_' + sharingType + 'Sharing_' + sharingType + 'CounterProviders').style.display = 'none';
182
+ document.getElementById('row_sociallogin_options_' + sharingType + 'Sharing_' + sharingType + 'SharingProvidersHidden').style.display = 'table-row';
183
+ } else if (element.value == 'single_large' || element.value == 'single_small') {
184
+ document.getElementById('row_sociallogin_options_' + sharingType + 'Sharing_' + sharingType + 'SharingProviders').style.display = 'none';
185
+ document.getElementById('row_sociallogin_options_' + sharingType + 'Sharing_' + sharingType + 'CounterProviders').style.display = 'none';
186
+ document.getElementById('row_sociallogin_options_' + sharingType + 'Sharing_' + sharingType + 'SharingProvidersHidden').style.display = 'none';
187
+ } else {
188
+ document.getElementById('row_sociallogin_options_' + sharingType + 'Sharing_' + sharingType + 'SharingProviders').style.display = 'none';
189
+ document.getElementById('row_sociallogin_options_' + sharingType + 'Sharing_' + sharingType + 'CounterProviders').style.display = 'table-row';
190
+ document.getElementById('row_sociallogin_options_' + sharingType + 'Sharing_' + sharingType + 'SharingProvidersHidden').style.display = 'none';
191
+ }
192
+ }
193
+ </script>
194
+ <?php
195
  }
196
+
197
+ }
app/code/community/Loginradius/Sociallogin/controllers/IndexController.php CHANGED
@@ -1,779 +1,525 @@
1
  <?php
2
  Mage::app('default');
3
- include 'Popup.php';
4
- function getMazeTable($tbl){
5
- $tableName = Mage::getSingleton('core/resource')->getTableName($tbl);
6
- return($tableName);
7
  }
 
8
  //customer will be re-directed to this file. this file handle all token, email etc things.
9
  class Loginradius_Sociallogin_IndexController extends Mage_Core_Controller_Front_Action
10
  {
11
- var $blockObj;
12
- private $loginRadiusPopMsg;
13
- private $loginRadiusPopErr;
14
-
15
- function redirect($url){
16
- ?>
17
- <script>
18
- if(window.opener){
19
- window.opener.location.href = "<?php echo $url; ?>";
20
- window.close();
21
- }else{
22
- window.location.href = "<?php echo $url; ?>";
23
- }
24
- </script>
25
- <?php
26
- die;
27
- }
28
-
29
- protected function _getSession(){
30
- return Mage::getSingleton('sociallogin/session');
31
- }
32
- // if token is posted then this function will be called. It will login user if already in database. else if email is provided by api, it will insert data and login user. It will handle all after token.
33
- function tokenHandle() {
34
- $ApiSecrete = $this->blockObj->getApiSecret();
35
- $user_obj = $this->blockObj->getProfileResult($ApiSecrete);
36
- // validate the object
37
- if(is_object($user_obj) && isset($user_obj->ID)){
38
- $id = $user_obj->ID;
39
- }else{
40
- $this -> redirect(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK));
41
- }
42
- if(empty($id)){
43
- //invalid user
44
- $this -> redirect(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK));
45
- exit();
46
- }
47
- // social linking variable
48
- $socialLinking = false;
49
- // social linking
50
- if(isset($_GET['loginRadiusLinking']) && trim($_GET['loginRadiusLinking']) == 1){
51
- $socialLinking = true;
52
- }
53
- //valid user, checking if user in sociallogin table
54
- $socialLoginIdResult = $this->loginRadiusRead( "sociallogin", "get user", array($id), true );
55
- $socialLoginIds = $socialLoginIdResult->fetchAll();
56
-
57
- // variable to hold user id of the logged in user
58
- $sociallogin_id = '';
59
- foreach( $socialLoginIds as $socialLoginId ){
60
- // check if the user exists in the customer_entity table for this social id
61
- $select = $this->loginRadiusRead( "customer_entity", "get user2", array($socialLoginId['entity_id']), true );
62
- if($rowArray = $select->fetch()){
63
- if( $socialLoginId['verified'] == "0" ){
64
- if(!$socialLinking){
65
- $this -> setTmpSession("Please verify your email to login.", "", false);
66
- $this -> redirect(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."sociallogin?loginradiuspopup=1");
67
- }else{
68
- // link account
69
- $this->loginRadiusSocialLinking(Mage::getSingleton("customer/session")->getCustomer()->getId(), $user_obj->ID, $user_obj->Provider, $user_obj->ThumbnailImageUrl);
70
- $this -> redirect(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."customer/account/?LoginRadiusLinked=1");
71
- die;
72
- }
73
- }
74
- $sociallogin_id = $rowArray['entity_id'];
75
- break;
76
- }
77
- }
78
-
79
- if(!empty($sociallogin_id)){ //user is in database
80
- if(!$socialLinking){
81
- if($this->blockObj->updateProfileData() != '1'){
82
- $this->socialLoginUserLogin( $sociallogin_id, $id );
83
- return;
84
- }else{
85
- $socialloginProfileData = $this->socialLoginFilterData( '', $user_obj );
86
- $socialloginProfileData['lrId'] = $user_obj->ID;
87
- $this->socialLoginAddNewUser( $socialloginProfileData, $verify = false, true, $sociallogin_id );
88
- return;
89
- }
90
- }else{
91
- // account already exists
92
- $this -> redirect(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."customer/account/?LoginRadiusLinked=0");
93
- die;
94
- }
95
- }
96
- // social linking
97
- if($socialLinking){
98
- $this->loginRadiusSocialLinking(Mage::getSingleton("customer/session")->getCustomer()->getId(), $user_obj->ID, $user_obj->Provider, $user_obj->ThumbnailImageUrl, true);
99
- $this -> redirect(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."customer/account/?LoginRadiusLinked=1");
100
- die;
101
- }
102
- // initialize email
103
- $email = '';
104
- if( !empty($user_obj->Email[0]->Value) ){
105
- //if email is provided by provider then check if it's in table
106
- $email = $user_obj->Email['0']->Value;
107
- $select = $this->loginRadiusRead( "customer_entity", "email exists login", array($email), true );
108
- if( $rowArray = $select->fetch() ) {
109
- $sociallogin_id = $rowArray['entity_id'];
110
- if(!empty($sociallogin_id)) {
111
- //user is in customer table
112
- if( $this->blockObj->getLinking() == "1" ){ // Social Linking
113
- $this->loginRadiusSocialLinking($sociallogin_id, $user_obj->ID, $user_obj->Provider, $user_obj->ThumbnailImageUrl);
114
- }
115
- if($this->blockObj->updateProfileData() != '1'){
116
- $this->socialLoginUserLogin( $sociallogin_id, $user_obj->ID );
117
- return;
118
- }else{
119
- $socialloginProfileData = $this->socialLoginFilterData( '', $user_obj );
120
- $socialloginProfileData['lrId'] = $user_obj->ID;
121
- $this->socialLoginAddNewUser( $socialloginProfileData, $verify = false, true, $sociallogin_id );
122
- return;
123
- }
124
- }
125
- }
126
- $socialloginProfileData = $this->socialLoginFilterData( $email, $user_obj );
127
- $socialloginProfileData['lrId'] = $user_obj->ID;
128
- if($this->blockObj->getProfileFieldsRequired() == 1){
129
- $id = $user_obj->ID;
130
- $this->setInSession($id, $socialloginProfileData);
131
- $this -> setTmpSession("Please provide following details", "", true, $socialloginProfileData, false);
132
- // show a popup to fill required profile fields
133
- $this -> redirect(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."sociallogin?loginradiuspopup=1");
134
- return;
135
- }
136
- $this->socialLoginAddNewUser( $socialloginProfileData );
137
- return;
138
- }
139
 
140
- // empty email
141
- if( $this->blockObj->getEmailRequired() == 0 ) { // dummy email
142
- $email = $this->loginradius_get_randomEmail( $user_obj );
143
- $socialloginProfileData = $this->socialLoginFilterData( $email, $user_obj );
144
- $socialloginProfileData['lrId'] = $user_obj->ID;
145
- if($this->blockObj->getProfileFieldsRequired() == 1){
146
- $id = $user_obj->ID;
147
- //$socialloginProfileData = $this->socialLoginFilterData( $email, $user_obj );
148
- $this->setInSession($id, $socialloginProfileData);
149
- $this -> setTmpSession("Please provide following details", "", true, $socialloginProfileData, false);
150
- // show a popup to fill required profile fields
151
- $this -> redirect(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."sociallogin?loginradiuspopup=1");
152
- return;
153
- }
154
- // create new user
155
- $this->socialLoginAddNewUser( $socialloginProfileData );
156
- return;
157
- }else { // show popup
158
- $id = $user_obj->ID;
159
- $socialloginProfileData = $this->socialLoginFilterData( $email, $user_obj );
160
- $this->setInSession($id, $socialloginProfileData);
161
- if($this->blockObj->getProfileFieldsRequired() == 1){
162
- // show a popup to fill required profile fields
163
- $this -> setTmpSession("Please provide following details", "", true, $socialloginProfileData, true);
164
- $this -> redirect(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."sociallogin?loginradiuspopup=1");
165
- }else{
166
- $this -> setTmpSession($this->loginRadiusPopMsg, "", true, array(), true, true);
167
- $this -> redirect(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."sociallogin?loginradiuspopup=1");
168
- }
169
- return;
170
- }
171
- }
172
-
173
- function loginradius_get_randomEmail( $user_obj ) {
174
- switch ( $user_obj->Provider ) {
175
- case 'twitter':
176
- $email = $user_obj->ID. '@' . $user_obj->Provider . '.com';
177
- break;
178
- case 'linkedin':
179
- $email = $user_obj->ID. '@' . $user_obj->Provider . '.com';
180
- break;
181
- default:
182
- $Email_id = substr( $user_obj->ID, 7 );
183
- $Email_id2 = str_replace("/", "_", $Email_id);
184
- $email = str_replace(".", "_", $Email_id2) . '@' . $user_obj->Provider . '.com';
185
- break;
186
  }
187
- return $email;
188
  }
189
- // social linking
190
- function loginRadiusSocialLinking($entityId, $socialId, $provider, $thumbnail, $unique = false){
191
- // check if any account from this provider is already linked
192
- if($unique && $this->loginRadiusRead( "sociallogin", "provider exists in sociallogin", array($entityId, $provider))){
193
- $this -> redirect(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."customer/account/?LoginRadiusLinked=2");
194
- die;
195
- }
196
- $socialLoginLinkData = array();
197
- $socialLoginLinkData['sociallogin_id'] = $socialId;
198
- $socialLoginLinkData['entity_id'] = $entityId;
199
- $socialLoginLinkData['provider'] = empty($provider) ? "" : $provider;
200
- $socialLoginLinkData['avatar'] = $this->socialLoginFilterAvatar( $socialId, $thumbnail, $provider );
201
- $socialLoginLinkData['avatar'] = ($socialLoginLinkData['avatar'] == "") ? NULL : $socialLoginLinkData['avatar'] ;
202
- $this->SocialLoginInsert( "sociallogin", $socialLoginLinkData );
203
- }
204
- function socialLoginFilterData( $email, $user_obj ) {
205
- $socialloginProfileData = array();
206
- $socialloginProfileData['Email'] = $email;
207
- $socialloginProfileData['Provider'] = empty($user_obj->Provider) ? "" : $user_obj->Provider;
208
- $socialloginProfileData['FirstName'] = empty($user_obj->FirstName) ? "" : $user_obj->FirstName;
209
- $socialloginProfileData['FullName'] = empty($user_obj->FullName) ? "" : $user_obj->FullName;
210
- $socialloginProfileData['NickName'] = empty($user_obj->NickName) ? "" : $user_obj->NickName;
211
- $socialloginProfileData['LastName'] = empty($user_obj->LastName) ? "" : $user_obj->LastName;
212
- if(isset($user_obj->Addresses) && is_array($user_obj->Addresses)){
213
- foreach($user_obj->Addresses as $address){
214
- if(isset($address->Address1) && !empty($address->Address1)){
215
- $socialloginProfileData['Address'] = $address->Address1;
216
- break;
217
- }
218
- }
219
- }elseif(isset($user_obj->Addresses) && is_string($user_obj->Addresses)){
220
- $socialloginProfileData['Address'] = isset($user_obj->Addresses) && $user_obj->Addresses != "" ? $user_obj->Addresses : "";
221
- }else{
222
- $socialloginProfileData['Address'] = "";
223
- }
224
- $socialloginProfileData['PhoneNumber'] = empty( $user_obj->PhoneNumbers['0']->PhoneNumber ) ? "" : $user_obj->PhoneNumbers['0']->PhoneNumber;
225
- $socialloginProfileData['State'] = empty($user_obj->State) ? "" : $user_obj->State;
226
- $socialloginProfileData['City'] = empty($user_obj->City) || $user_obj->City == "unknown" ? "" : $user_obj->City;
227
- $socialloginProfileData['Industry'] = empty($user_obj->Positions['0']->Comapny->Name) ? "" : $user_obj->Positions['0']->Comapny->Name;
228
- if(isset($user_obj->Country->Code) && is_string($user_obj->Country->Code)){
229
- $socialloginProfileData['Country'] = $user_obj->Country->Code;
230
- }else{
231
- $socialloginProfileData['Country'] = "";
232
- }
233
- $socialloginProfileData['thumbnail'] = $this->socialLoginFilterAvatar( $user_obj->ID, $user_obj->ThumbnailImageUrl, $socialloginProfileData['Provider'] );
234
-
235
-
236
- if(empty($socialloginProfileData['FirstName'])){
237
- if(!empty($socialloginProfileData['FullName'])){
238
- $socialloginProfileData['FirstName'] = $socialloginProfileData['FullName'];
239
- }
240
- elseif(!empty($socialloginProfileData['ProfileName'])){
241
- $socialloginProfileData['FirstName'] = $socialloginProfileData['ProfileName'];
242
- }
243
- elseif(!empty($socialloginProfileData['NickName'])){
244
- $socialloginProfileData['FirstName'] = $socialloginProfileData['NickName'];
245
- }elseif(!empty($email)){
246
- $user_name = explode('@', $email);
247
- $username = $user_name[0];
248
- $socialloginProfileData['FirstName'] = str_replace("_", " ", $user_name[0]);
249
- }else{
250
- $socialloginProfileData['FirstName'] = $user_obj->ID;
251
- }
252
- }
253
-
254
- $socialloginProfileData['Gender'] = (!empty($user_obj->Gender) ? $user_obj->Gender : '');
255
- if( strtolower(substr($socialloginProfileData['Gender'], 0, 1)) == 'm' ){
256
- $socialloginProfileData['Gender'] = '1';
257
- }elseif( strtolower(substr($socialloginProfileData['Gender'], 0, 1)) == 'f' ){
258
- $socialloginProfileData['Gender'] = '2';
259
- }else{
260
- $socialloginProfileData['Gender'] = '';
261
- }
262
- $socialloginProfileData['BirthDate'] = (!empty($user_obj->BirthDate) ? $user_obj->BirthDate : '');
263
- if( $socialloginProfileData['BirthDate'] != "" ){
264
- switch( $socialloginProfileData['Provider'] ){
265
- case 'facebook':
266
- case 'foursquare':
267
- case 'yahoo':
268
- case 'openid':
269
- break;
270
-
271
- case 'google':
272
- $temp = explode( '/', $socialloginProfileData['BirthDate'] ); // yy/mm/dd
273
- $socialloginProfileData['BirthDate'] = $temp[1]."/".$temp[2]."/".$temp[0];
274
- break;
275
-
276
- case 'twitter':
277
- case 'linkedin':
278
- case 'vkontakte':
279
- case 'live';
280
- $temp = explode( '/', $socialloginProfileData['BirthDate'] ); // dd/mm/yy
281
- $socialloginProfileData['BirthDate'] = $temp[1]."/".$temp[0]."/".$temp[2];
282
- break;
283
- }
284
- }
285
- return $socialloginProfileData;
286
- }
287
 
288
- function socialLoginFilterAvatar( $id, $ImgUrl, $provider ){
289
- $thumbnail = (!empty($ImgUrl) ? trim($ImgUrl) : '');
290
- if (empty($thumbnail) && ( $provider == 'facebook' ) ) {
291
- $thumbnail = "http://graph.facebook.com/" . $id . "/picture?type=large";
292
- }
293
- return $thumbnail;
294
- }
295
- /**
296
- * Validate url.
297
- */
298
- function login_radius_validate_url($url){
299
- $validUrlExpression = "/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|)?[a-z0-9_\-]+[a-z0-9_\-\.]+\.[a-z]{2,4}(\/+[a-z0-9_\.\-\/]*)?$/i";
300
- return (bool)preg_match($validUrlExpression, $url);
301
- }
302
- function socialLoginUserLogin( $entityId, $socialId ) {
303
- $session = Mage::getSingleton("customer/session");
304
- $session->loginById($entityId);
305
- $session->setLoginRadiusId($socialId);
306
- $write_url = $this->blockObj->getCallBack();
307
- $Hover = $this->blockObj->getRedirectOption();
308
- $url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
309
- // check if logged in from callback page
310
- if(isset($_GET['loginradiuscheckout'])){
311
- $this -> redirect( Mage::helper('checkout/url')->getCheckoutUrl() );
312
- exit();
313
- return;
314
- }
315
- if($Hover == 'account'){
316
- $this -> redirect( $url.'customer/account' );
317
- exit();
318
- return;
319
- }elseif($Hover == 'index' ){
320
- $this -> redirect( $url.'') ;
321
- exit();
322
- return;
323
- }elseif( $Hover == 'custom' && $write_url != '' ) {
324
- $this -> redirect( $write_url.'' );
325
- exit();
326
- return;
327
- }else{
328
- if(isset($_GET['redirect_to'])){
329
- $currentUrl = trim($_GET['redirect_to']);
330
- }else{
331
- $currentUrl = $url;
332
- }
333
- $this -> redirect( $currentUrl);
334
- exit();
335
- return;
336
- }
337
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
338
 
339
- function setInSession( $id, $socialloginProfileData ){
340
- $socialloginProfileData['lrId'] = $id;
341
- Mage::getSingleton('core/session')->setSocialLoginData( $socialloginProfileData );
342
- }
 
 
343
 
344
- function setTmpSession($loginRadiusPopupTxt = '', $socialLoginMsg = "", $loginRadiusShowForm = true, $profileData = array(), $emailRequired = true, $hideZipcode = false){
345
- Mage::getSingleton('core/session')->setTmpPopupTxt( $loginRadiusPopupTxt );
346
- Mage::getSingleton('core/session')->setTmpPopupMsg( $socialLoginMsg );
347
- Mage::getSingleton('core/session')->setTmpShowForm( $loginRadiusShowForm );
348
- Mage::getSingleton('core/session')->setTmpProfileData( $profileData );
349
- Mage::getSingleton('core/session')->setTmpEmailRequired( $emailRequired );
350
- Mage::getSingleton('core/session')->setTmpHideZipcode( $hideZipcode );
351
- }
352
-
353
- function loginRadiusEmail( $subject, $message, $to, $toName ){
354
- $storeName = Mage::app()->getStore()->getGroup()->getName();
355
- $mail = new Zend_Mail('UTF-8'); //class for mail
356
- $mail->setBodyHtml( $message ); //for sending message containing html code
357
- $mail->setFrom( "Owner", $storeName );
358
- $mail->addTo( $to, $toName );
359
- //$mail->addCc($cc, $ccname); //can set cc
360
- //$mail->addBCc($bcc, $bccname); //can set bcc
361
- $mail->setSubject( $subject );
362
- try{
363
- $mail->send();
364
- }catch(Exception $ex) {
365
- }
366
- }
367
 
368
- function socialLoginAddNewUser( $socialloginProfileData, $verify = false, $update = false, $customerId = '' ) {
369
- $websiteId = Mage::app()->getWebsite()->getId();
370
- $store = Mage::app()->getStore();
371
- if(!$update){
372
- // add new user magento way
373
- $customer = Mage::getModel("customer/customer");
374
- }else{
375
- $customer = Mage::getModel('customer/customer') -> load($customerId);
376
- }
377
- $customer->website_id = $websiteId;
378
- $customer->setStore($store);
379
- if($socialloginProfileData['FirstName'] != ""){
380
- $customer->firstname = $socialloginProfileData['FirstName'];
381
- }
382
- if(!$update){
383
- $customer->lastname = $socialloginProfileData['LastName'] == "" ? $socialloginProfileData['FirstName'] : $socialloginProfileData['LastName'];
384
- }elseif($update && $socialloginProfileData['LastName'] != ""){
385
- $customer->lastname = $socialloginProfileData['LastName'];
386
- }
387
- if(!$update){
388
- $customer->email = $socialloginProfileData['Email'];
389
- $loginRadiusPwd = $customer->generatePassword(10);
390
- $customer->password_hash = md5( $loginRadiusPwd );
391
- }
392
- if($socialloginProfileData['BirthDate'] != ""){
393
- $customer->dob = $socialloginProfileData['BirthDate'];
394
- }
395
- if($socialloginProfileData['Gender'] != ""){
396
- $customer->gender = $socialloginProfileData['Gender'];
397
- }
398
- $customer->setConfirmation(null);
399
- $customer->save();
400
-
401
- // if updating user profile
402
- if($update){
403
- $addresses = $customer->getAddressesCollection();
404
- $matched = false;
405
- foreach($addresses as $address){
406
- $address = $address->toArray();
407
- if($address['firstname'] == $socialloginProfileData['FirstName']
408
- && $address['lastname'] == $socialloginProfileData['LastName']
409
- && $address['country_id'] == ucfirst($socialloginProfileData['Country'])
410
- && $address['city'] == ucfirst($socialloginProfileData['City'])
411
- && $address['telephone'] == $socialloginProfileData['PhoneNumber']
412
- && $address['company'] == ucfirst($socialloginProfileData['Industry'])
413
- && $address['street'] == ucfirst($socialloginProfileData['Address'])){
414
- $matched = true;
415
- // if profile data contains zipcode then match it with that in the address
416
- if(isset($socialloginProfileData['Zipcode']) && $address['postcode'] != $socialloginProfileData['Zipcode']){
417
- $matched = false;
418
- }
419
- // if profile data contains province then match it with that in the address
420
- if(isset($socialloginProfileData['Province']) && $address['region'] != $socialloginProfileData['Province']){
421
- $matched = false;
422
- }
423
- }
424
- if($matched){
425
- break;
426
- }
427
- }
428
- }
429
- $address = Mage::getModel("customer/address");
430
- if(!$update){
431
- $address->setCustomerId($customer->getId());
432
- }else{
433
- $address->setCustomerId($customerId);
434
- }
435
- if(($update && !$matched) || !$update){
436
- $address->firstname = $customer->firstname;
437
- $address->lastname = $customer->lastname;
438
- $address->country_id = isset($socialloginProfileData['Country']) ? ucfirst($socialloginProfileData['Country']) : '';
439
- if(isset($socialloginProfileData['Zipcode'])){
440
- $address->postcode = $socialloginProfileData['Zipcode'];
441
- }
442
- $address->city = isset($socialloginProfileData['City']) ? ucfirst($socialloginProfileData['City']) : '';
443
- // If country is USA, set up province
444
- if(isset($socialloginProfileData['Province'])){
445
- $address->region = $socialloginProfileData['Province'];
446
- }
447
- $address->telephone = isset($socialloginProfileData['PhoneNumber']) ? ucfirst($socialloginProfileData['PhoneNumber']) : '';
448
- $address->company = isset($socialloginProfileData['Industry']) ? ucfirst($socialloginProfileData['Industry']) : '';
449
- $address->street = isset($socialloginProfileData['Address']) ? ucfirst($socialloginProfileData['Address']) : '';
450
- // set default billing, shipping address and save in address book
451
- $address -> setIsDefaultShipping('1') -> setIsDefaultBilling('1') -> setSaveInAddressBook('1');
452
- $address->save();
453
- }
454
- // add info in sociallogin table
455
- if( !$verify ){
456
- $fields = array();
457
- $fields['sociallogin_id'] = $socialloginProfileData['lrId'] ;
458
- $fields['entity_id'] = $customer->getId();
459
- $fields['avatar'] = $socialloginProfileData['thumbnail'] ;
460
- $fields['provider'] = $socialloginProfileData['Provider'] ;
461
- if(!$update){
462
- $this->SocialLoginInsert( "sociallogin", $fields );
463
- }else{
464
- $this->SocialLoginInsert( "sociallogin", array('avatar' => $socialloginProfileData['thumbnail']), true, array('entity_id = ?' => $customerId) );
465
- }
466
- if(!$update){
467
- $loginRadiusUsername = $socialloginProfileData['FirstName']." ".$socialloginProfileData['LastName'];
468
- // email notification to user
469
- if( $this->blockObj->notifyUser() == "1" ){
470
- $loginRadiusMessage = $this->blockObj->notifyUserText();
471
- if( $loginRadiusMessage == "" ){
472
- $loginRadiusMessage = __("Welcome to ").$store->getGroup()->getName().". ".__("You can login to the store using following e-mail address and password");
473
- }
474
- $loginRadiusMessage .= "<br/>".
475
- "Email : ".$socialloginProfileData['Email'].
476
- "<br/>".__("Password")." : ".$loginRadiusPwd;
477
-
478
- $this->loginRadiusEmail( __("Welcome")." ".$loginRadiusUsername."!", $loginRadiusMessage, $socialloginProfileData['Email'], $loginRadiusUsername );
479
- }
480
- // new user notification to admin
481
- if( $this->blockObj->notifyAdmin() == "1" ){
482
- $loginRadiusAdminEmail = Mage::getStoreConfig('trans_email/ident_general/email');
483
- $loginRadiusAdminName = Mage::getStoreConfig('trans_email/ident_general/name');
484
- $loginRadiusMessage = trim($this->blockObj->notifyAdminText());
485
- if( $loginRadiusMessage == "" ){
486
- $loginRadiusMessage = __("New customer has been registered to your store with following details");
487
- }
488
- $loginRadiusMessage .= "<br/>".
489
- __("Name")." : ".$loginRadiusUsername."<br/>".
490
- __("Email")." : ".$socialloginProfileData['Email'];
491
- $this->loginRadiusEmail( __("New User Registration"), $loginRadiusMessage, $loginRadiusAdminEmail, $loginRadiusAdminName );
492
- }
493
- }
494
- //login and redirect user
495
- $this->socialLoginUserLogin( $customer->getId(), $fields['sociallogin_id'] );
496
- }
497
- if( $verify ){
498
- $this->verifyUser( $socialloginProfileData['lrId'], $customer->getId(), $socialloginProfileData['thumbnail'], $socialloginProfileData['Provider'], $socialloginProfileData['Email'] );
499
- }
500
- }
501
 
502
- private function SocialLoginInsert( $lrTable, $lrInsertData, $update = false, $value = '' ){
503
- $connection = Mage::getSingleton('core/resource')
504
- ->getConnection('core_write');
505
- $connection->beginTransaction();
506
- $sociallogin = getMazeTable($lrTable);
507
- if( !$update ){
508
- $connection->insert($sociallogin, $lrInsertData);
509
- }else{
510
- // update query magento way
511
- $connection->update(
512
- $sociallogin,
513
- $lrInsertData,
514
- $value
515
- );
516
- }
517
- $connection->commit();
518
- }
519
 
520
- private function SocialLoginShowLayout() {
521
- $this->loadLayout();
522
- $this->renderLayout();
523
- }
 
 
524
 
525
- private function loginRadiusRead( $table, $handle, $params, $result = false ){
526
- $socialLoginConn = Mage::getSingleton('core/resource')
527
- ->getConnection('core_read');
528
- $Tbl = getMazeTable($table);
529
- $websiteId = Mage::app()->getWebsite()->getId();
530
- $storeId = Mage::app()->getStore()->getId();
531
- $query = "";
532
- switch( $handle ){
533
- case "email exists pop1":
534
- $query = "select entity_id from $Tbl where email = '".$params[0]."' and website_id = $websiteId and store_id = $storeId";
535
- break;
536
- case "get user":
537
- $query = "select entity_id, verified from $Tbl where sociallogin_id= '".$params[0]."'";
538
- break;
539
- case "get user2":
540
- $query = "select entity_id from $Tbl where entity_id = ".$params[0]." and website_id = $websiteId and store_id = $storeId";
541
- break;
542
- case "email exists login":
543
- $query = "select * from $Tbl where email = '".$params[0]."' and website_id = $websiteId and store_id = $storeId";
544
- break;
545
- case "email exists sl":
546
- $query = "select verified,sociallogin_id from $Tbl where entity_id = '".$params[0]."' and provider = '".$params[1]."'";
547
- break;
548
- case "provider exists in sociallogin":
549
- $query = "select entity_id from $Tbl where entity_id = '".$params[0]."' and provider = '".$params[1]."'";
550
- break;
551
- case "verification":
552
- $query = "select entity_id, provider from $Tbl where vkey = '".$params[0]."'";
553
- break;
554
- case "verification2":
555
- $query = "select entity_id from $Tbl where entity_id = ".$params[0]." and provider = '".$params[1]."' and vkey != '' ";
556
- break;
557
- }
558
- $select = $socialLoginConn->query($query);
559
- if( $result ){
560
- return $select;
561
- }
562
- if( $rowArray = $select->fetch() ) {
563
- return true;
564
- }
565
- return false;
566
- }
567
-
568
- private function verifyUser( $slId, $entityId, $avatar, $provider, $email ){
569
- $vKey = md5(uniqid(rand(), TRUE));
570
- $data = array();
571
- $data['sociallogin_id'] = $slId;
572
- $data['entity_id'] = $entityId;
573
- $data['avatar'] = $avatar;
574
- $data['verified'] = "0";
575
- $data['vkey'] = $vKey;
576
- $data['provider'] = $provider;
577
- // insert details in sociallogin table
578
- $this->SocialLoginInsert( "sociallogin", $data );
579
- // send verification mail
580
- $message = __(Mage::helper('core')->htmlEscape(trim($this->blockObj->verificationText())));
581
- if( $message == "" ){
582
- $message = __("Please click on the following link or paste it in browser to verify your email");
583
- }
584
- $message .= "<br/>".Mage::getBaseUrl()."sociallogin/?loginRadiusKey=".$vKey;
585
- $this->loginRadiusEmail( __("Email verification"), $message, $email, $email);
586
- $this -> setTmpSession( "Confirmation link has been sent to your email address. Please verify your email by clicking on confirmation link.", "", false );
587
- // show popup message
588
- $this -> redirect(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."sociallogin?loginradiuspopup=1");
589
- $this->SocialLoginShowLayout();
590
- return;
591
- }
592
-
593
- public function indexAction() {
594
- $this->blockObj = new Loginradius_Sociallogin_Block_Sociallogin();
595
- $this->loginRadiusPopMsg = trim($this->blockObj->getPopupText() );
596
- $this->loginRadiusPopMsg = $this->loginRadiusPopMsg == "" ? __("Please enter your email to proceed") : $this->loginRadiusPopMsg;
597
- $this->loginRadiusPopErr = trim($this->blockObj->getPopupError() );
598
- $this->loginRadiusPopErr = $this->loginRadiusPopErr == "" ? __("Email you entered is either invalid or already registered. Please enter a valid email.") : $this->loginRadiusPopErr;
599
- if(isset($_REQUEST['token'])) {
600
- $this->tokenHandle();
601
- $this->loadLayout();
602
- $this->renderLayout();
603
- return;
604
- }
605
-
606
- // email verification
607
- if( isset($_GET['loginRadiusKey']) && !empty($_GET['loginRadiusKey']) ){
608
- $loginRadiusVkey = trim( $_GET['loginRadiusKey'] );
609
- // get entity_id and provider of the vKey
610
- $result = $this->loginRadiusRead( "sociallogin", "verification", array( $loginRadiusVkey ), true );
611
- if( $temp = $result->fetch() ){
612
- // set verified status true at this verification key
613
- $tempUpdate = array("verified" => '1', "vkey" => '');
614
- $tempUpdate2 = array("vkey = ?" => $loginRadiusVkey);
615
- $this->SocialLoginInsert( "sociallogin", $tempUpdate, true, $tempUpdate2 );
616
- $this -> setTmpSession("Your email has been verified. Now you can login to your account.", "", false );
617
- $this -> redirect(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."sociallogin?loginradiuspopup=1");
618
-
619
- // check if verification for same provider is still pending on this entity_id
620
- if( $this->loginRadiusRead( "sociallogin", "verification2", array( $temp['entity_id'], $temp['provider'] ) ) ){
621
- $tempUpdate = array("vkey" => '');
622
- $tempUpdate2 = array("entity_id = ?" => $temp['entity_id'], "provider = ?" => $temp['provider']);
623
- $this->SocialLoginInsert( "sociallogin", $tempUpdate, true, $tempUpdate2 );
624
- }
625
- }
626
- }
627
 
628
- $socialLoginProfileData = Mage::getSingleton('core/session')->getSocialLoginData();
629
- $session_user_id = $socialLoginProfileData['lrId'];
630
- $loginRadiusPopProvider = $socialLoginProfileData['Provider'];
631
- $loginRadiusAvatar = $socialLoginProfileData['thumbnail'];
632
- // popup check
633
- if(isset($_GET['loginradiuspopup'])){
634
- SL_popUpWindow( Mage::getSingleton('core/session')->getTmpPopupTxt(), Mage::getSingleton('core/session')->getTmpPopupMsg(), Mage::getSingleton('core/session')->getTmpShowForm(), Mage::getSingleton('core/session')->getTmpProfileData(), Mage::getSingleton('core/session')->getTmpEmailRequired(), Mage::getSingleton('core/session')->getTmpHideZipcode());
635
- $this -> SocialLoginShowLayout();
636
- return;
637
- }
638
- if(isset($_POST['LoginRadiusRedSliderClick'])) {
639
- if(!empty($session_user_id) ){
640
- $loginRadiusProfileData = array();
641
- // address
642
- if(isset($_POST['loginRadiusAddress'])){
643
- $loginRadiusProfileData['Address'] = "";
644
- $profileAddress = trim($_POST['loginRadiusAddress']);
645
- }
646
- // city
647
- if(isset($_POST['loginRadiusCity'])){
648
- $loginRadiusProfileData['City'] = "";
649
- $profileCity = trim($_POST['loginRadiusCity']);
650
- }
651
- // country
652
- if(isset($_POST['loginRadiusCountry'])){
653
- $loginRadiusProfileData['Country'] = "";
654
- $profileCountry = trim($_POST['loginRadiusCountry']);
655
- }
656
- // phone number
657
- if(isset($_POST['loginRadiusPhone'])){
658
- $loginRadiusProfileData['PhoneNumber'] = "";
659
- $profilePhone = trim($_POST['loginRadiusPhone']);
660
- }
661
- // email
662
- if(isset($_POST['loginRadiusEmail'])){
663
- $email = trim($_POST['loginRadiusEmail']);
664
- if( !preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/", $email) ){
665
- if($this->blockObj->getProfileFieldsRequired() == 1){
666
- $hideZipCountry = false;
667
- }else{
668
- $hideZipCountry = true;
669
- }
670
- $this -> setTmpSession($this->loginRadiusPopMsg, $this->loginRadiusPopErr, true, $loginRadiusProfileData, true, $hideZipCountry);
671
- $this -> redirect(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."sociallogin?loginradiuspopup=1");
672
- $this->SocialLoginShowLayout();
673
- return false;
674
- }
675
- // check if email already exists
676
- $userId = $this->loginRadiusRead( "customer_entity", "email exists pop1", array($email), true );
677
- if( $rowArray = $userId->fetch() ) { // email exists
678
- //check if entry exists on same provider in sociallogin table
679
- $verified = $this->loginRadiusRead( "sociallogin", "email exists sl", array( $rowArray['entity_id'], $loginRadiusPopProvider ), true );
680
- if( $rowArray2 = $verified->fetch() ){
681
- // check verified field
682
- if( $rowArray2['verified'] == "1" ){
683
- // check sociallogin id
684
- if( $rowArray2['sociallogin_id'] == $session_user_id ){
685
- $this->socialLoginUserLogin( $rowArray['entity_id'], $rowArray2['sociallogin_id'] );
686
- return;
687
- }else{
688
- $this -> setTmpSession($this->loginRadiusPopMsg, $this->loginRadiusPopErr, true, array(), true, true);
689
- $this -> redirect(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."sociallogin?loginradiuspopup=1");
690
- $this->SocialLoginShowLayout();
691
- return;
692
- }
693
- }else{
694
- // check sociallogin id
695
- if( $rowArray2['sociallogin_id'] == $session_user_id ){
696
- $this -> setTmpSession("Please provide following details", "", true, $socialloginProfileData, false);
697
- $this -> redirect(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."sociallogin?loginradiuspopup=1");
698
- $this->SocialLoginShowLayout();
699
- return;
700
- }else{
701
- // send verification email
702
- $this->verifyUser( $session_user_id, $rowArray['entity_id'], $loginRadiusAvatar, $loginRadiusPopProvider, $email );
703
- return;
704
- }
705
- }
706
- }else{
707
- // send verification email
708
- $this->verifyUser( $session_user_id, $rowArray['entity_id'], $loginRadiusAvatar, $loginRadiusPopProvider, $email );
709
- return;
710
- }
711
- }
712
- }
713
- // validate other profile fields
714
- if((isset($profileAddress) && $profileAddress == "") || (isset($profileCity) && $profileCity == "") || (isset($profileCountry) && $profileCountry == "") || (isset($profilePhone) && $profilePhone == "")){
715
- $this -> setTmpSession("", "Please fill all the fields", true, $loginRadiusProfileData, true);
716
- $this -> redirect(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."sociallogin?loginradiuspopup=1");
717
- $this->SocialLoginShowLayout();
718
- return false;
719
- }
720
- $socialloginProfileData = Mage::getSingleton('core/session')->getSocialLoginData();
721
- // assign submitted profile fields to array
722
- // address
723
- if(isset($profileAddress)){
724
- $socialloginProfileData['Address'] = $profileAddress;
725
- }
726
- // city
727
- if(isset($profileCity)){
728
- $socialloginProfileData['City'] = $profileCity;
729
- }
730
- // Country
731
- if(isset($profileCountry)){
732
- $socialloginProfileData['Country'] = $profileCountry;
733
- }
734
- // Phone Number
735
- if(isset($profilePhone)){
736
- $socialloginProfileData['PhoneNumber'] = $profilePhone;
737
- }
738
- // Zipcode
739
- if(isset($_POST['loginRadiusZipcode'])){
740
- $socialloginProfileData['Zipcode'] = trim($_POST['loginRadiusZipcode']);
741
- }
742
- // Province
743
- if(isset($_POST['loginRadiusProvince'])){
744
- $socialloginProfileData['Province'] = trim($_POST['loginRadiusProvince']);
745
- }
746
- // Email
747
- if(isset($email)){
748
- $socialloginProfileData['Email'] = $email;
749
- $verify = true;
750
- }else{
751
- $verify = false;
752
- }
753
- Mage::getSingleton('core/session')->unsSocialLoginData(); // unset session
754
- $this->socialLoginAddNewUser( $socialloginProfileData, $verify );
755
- }
756
- }elseif( isset($_POST['LoginRadiusPopupCancel']) ) { // popup cancelled
757
- Mage::getSingleton('core/session')->unsSocialLoginData(); // unset session
758
-
759
- Mage::getSingleton('core/session')->unsTmpPopupTxt();
760
- Mage::getSingleton('core/session')->unsTmpPopupMsg();
761
- Mage::getSingleton('core/session')->unsTmpShowForm();
762
- Mage::getSingleton('core/session')->unsTmpProfileData();
763
- Mage::getSingleton('core/session')->unsTmpEmailRequired();
764
- Mage::getSingleton('core/session')->unsTmpHideZipcode();
765
-
766
- $url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
767
- $this -> redirect($url); // redirect to index page
768
- }
769
- $this->SocialLoginShowLayout();
770
  }
771
-
772
- /**
773
- * Action for AJAX
774
- */
775
- public function ajaxAction(){
776
- $this->loadLayout();
777
- $this->renderLayout();
778
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
779
  }
1
  <?php
2
  Mage::app('default');
3
+ function getMazeTable($tbl)
4
+ {
5
+ $tableName = Mage::getSingleton('core/resource')->getTableName($tbl);
6
+ return ($tableName);
7
  }
8
+
9
  //customer will be re-directed to this file. this file handle all token, email etc things.
10
  class Loginradius_Sociallogin_IndexController extends Mage_Core_Controller_Front_Action
11
  {
12
+ public $socialloginProfileData;
13
+ public $blockObj;
14
+ private $loginRadiusPopMsg;
15
+ private $loginRadiusPopErr;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
+ public function indexAction()
18
+ {
19
+ $this->blockObj = new Loginradius_Sociallogin_Block_Sociallogin();
20
+ $token = isset($_REQUEST['token']) ? trim($_REQUEST['token']) : '';
21
+ if (!empty($token)) {
22
+ $this->tokenHandle($token);
23
+ return;
24
+ }
25
+
26
+ // email verification
27
+ if (isset($_GET['loginRadiusKey']) && !empty($_GET['loginRadiusKey'])) {
28
+ $loginRadiusVkey = trim($_GET['loginRadiusKey']);
29
+ // get entity_id and provider of the vKey
30
+ $result = Mage::helper('sociallogin/loginhelper')->loginRadiusRead("sociallogin", "verification", array($loginRadiusVkey), true);
31
+ if ($temp = $result->fetch()) {
32
+ // set verified status true at this verification key
33
+ $tempUpdate = array("verified" => '1', "vkey" => '');
34
+ $tempUpdate2 = array("vkey = ?" => $loginRadiusVkey);
35
+ Mage::helper('sociallogin/loginhelper')->SocialLoginInsert("sociallogin", $tempUpdate, true, $tempUpdate2);
36
+
37
+ $session = Mage::getSingleton('customer/session');
38
+ $session->addSuccess(__('Your email has been verified. Now you can login to your account.'));
39
+ // check if verification for same provider is still pending on this entity_id
40
+ if (Mage::helper('sociallogin/loginhelper')->loginRadiusRead("sociallogin", "verification2", array($temp['entity_id'], $temp['provider']))) {
41
+ $tempUpdate = array("vkey" => '');
42
+ $tempUpdate2 = array("entity_id = ?" => $temp['entity_id'], "provider = ?" => $temp['provider']);
43
+ Mage::helper('sociallogin/loginhelper')->SocialLoginInsert("sociallogin", $tempUpdate, true, $tempUpdate2);
44
+ }
45
+ header("Location:" . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK));
46
+ die;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
 
48
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
+ if (isset($_POST['LoginRadiusRedSliderClick'])) {
51
+ $loginhelper = Mage::helper('sociallogin/loginhelper');
52
+ $socialLoginProfileData = Mage::getSingleton('core/session')->getSocialLoginData();
53
+ $session_user_id = $socialLoginProfileData['lrId'];
54
+ $loginRadiusPopProvider = $socialLoginProfileData['Provider'];
55
+ $loginRadiusAvatar = $socialLoginProfileData['thumbnail'];
56
+ if (!empty($session_user_id)) {
57
+ $loginRadiusProfileData = array();
58
+ // address
59
+ if (isset($_POST['loginRadiusAddress'])) {
60
+ $loginRadiusProfileData['Address'] = "";
61
+ $profileAddress = trim($_POST['loginRadiusAddress']);
62
+ }
63
+ // city
64
+ if (isset($_POST['loginRadiusCity'])) {
65
+ $loginRadiusProfileData['City'] = "";
66
+ $profileCity = trim($_POST['loginRadiusCity']);
67
+ }
68
+ // country
69
+ if (isset($_POST['loginRadiusCountry'])) {
70
+ $loginRadiusProfileData['Country'] = "";
71
+ $profileCountry = trim($_POST['loginRadiusCountry']);
72
+ }
73
+ // phone number
74
+ if (isset($_POST['loginRadiusPhone'])) {
75
+ $loginRadiusProfileData['PhoneNumber'] = "";
76
+ $profilePhone = trim($_POST['loginRadiusPhone']);
77
+ }
78
+ // email
79
+ if (isset($_POST['loginRadiusEmail'])) {
80
+ $email = trim($_POST['loginRadiusEmail']);
81
+ $select = $loginhelper->loginRadiusRead("customer_entity", "email_already_exists", array($email), true);
82
+ if ($rowArray = $select->fetch()) {
83
+ $errorMessage = $this->blockObj->getPopupError();
84
+ if($this->blockObj->getProfileFieldsRequired() == 1){
85
+ $loginhelper->setTmpSession("", $errorMessage, true, $socialLoginProfileData, true);
86
+ }else{
87
+ $loginhelper->setTmpSession("", $errorMessage, true, array(), true,true);
88
+ }
89
+ $this->popupHandle();
90
+ return;
91
+ }
92
+
93
+ if (!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/", $email)) {
94
+ if ($this->blockObj->getProfileFieldsRequired() == 1) {
95
+ $hideZipCountry = false;
96
+ } else {
97
+ $hideZipCountry = true;
98
+ }
99
+ Mage::helper('sociallogin/loginhelper')->setTmpSession($this->blockObj->getPopupText(), $this->blockObj->getPopupError(), true, $loginRadiusProfileData, true, $hideZipCountry);
100
+ $this->popupHandle();
101
+ return;
102
+ }
103
+ // check if email already exists
104
+ $userId = Mage::helper('sociallogin/loginhelper')->loginRadiusRead("customer_entity", "email exists pop1", array($email), true);
105
+ if ($rowArray = $userId->fetch()) { // email exists
106
+ //check if entry exists on same provider in sociallogin table
107
+ $verified = Mage::helper('sociallogin/loginhelper')->loginRadiusRead("sociallogin", "email exists sl", array($rowArray['entity_id'], $loginRadiusPopProvider), true);
108
+ if ($rowArray2 = $verified->fetch()) {
109
+ // check verified field
110
+ if ($rowArray2['verified'] == "1") {
111
+ // check sociallogin id
112
+ if ($rowArray2['sociallogin_id'] == $session_user_id) {
113
+ $this->socialLoginUserLogin($rowArray['entity_id'], $rowArray2['sociallogin_id']);
114
+ } else {
115
+ Mage::helper('sociallogin/loginhelper')->setTmpSession($this->loginRadiusPopMsg, $this->loginRadiusPopErr, true, array(), true, true);
116
+ $this->popupHandle();
117
+ }
118
+ return;
119
+ } else {
120
+ // check sociallogin id
121
+ if ($rowArray2['sociallogin_id'] == $session_user_id) {
122
+ Mage::helper('sociallogin/loginhelper')->setTmpSession("Please provide following details", "", true, $this->socialloginProfileData, false);
123
+ $this->popupHandle();
124
+ } else {
125
+ // send verification email
126
+ Mage::helper('sociallogin/loginhelper')->verifyUser($session_user_id, $rowArray['entity_id'], $loginRadiusAvatar, $loginRadiusPopProvider, $email);
127
+ }
128
+ return;
129
+ }
130
+ } else {
131
+ // send verification email
132
+ Mage::helper('sociallogin/loginhelper')->verifyUser($session_user_id, $rowArray['entity_id'], $loginRadiusAvatar, $loginRadiusPopProvider, $email);
133
+ return;
134
+ }
135
+ }
136
+ }
137
+ // validate other profile fields
138
+ if ((isset($profileAddress) && $profileAddress == "") || (isset($profileCity) && $profileCity == "") || (isset($profileCountry) && $profileCountry == "") || (isset($profilePhone) && $profilePhone == "")) {
139
+ Mage::helper('sociallogin/loginhelper')->setTmpSession("", "Please fill all the fields", true, $loginRadiusProfileData, true);
140
+ $this->popupHandle();
141
+ return;
142
+ }
143
+ $this->socialloginProfileData = Mage::getSingleton('core/session')->getSocialLoginData();
144
+ // assign submitted profile fields to array
145
+ // address
146
+ if (isset($profileAddress)) {
147
+ $this->socialloginProfileData['Address'] = $profileAddress;
148
+ }
149
+ // city
150
+ if (isset($profileCity)) {
151
+ $this->socialloginProfileData['City'] = $profileCity;
152
+ }
153
+ // Country
154
+ if (isset($profileCountry)) {
155
+ $this->socialloginProfileData['Country'] = $profileCountry;
156
+ }
157
+ // Phone Number
158
+ if (isset($profilePhone)) {
159
+ $this->socialloginProfileData['PhoneNumber'] = $profilePhone;
160
+ }
161
+ // Zipcode
162
+ if (isset($_POST['loginRadiusZipcode'])) {
163
+ $this->socialloginProfileData['Zipcode'] = trim($_POST['loginRadiusZipcode']);
164
+ }
165
+ // Province
166
+ if (isset($_POST['loginRadiusProvince'])) {
167
+ $this->socialloginProfileData['Province'] = trim($_POST['loginRadiusProvince']);
168
+ }
169
+ // Email
170
+ if (isset($email)) {
171
+ $this->socialloginProfileData['Email'] = $email;
172
+ $verify = true;
173
+ } else {
174
+ $verify = false;
175
+ }
176
+ Mage::getSingleton('core/session')->unsSocialLoginData(); // unset session
177
+ $this->socialLoginAddNewUser($this->socialloginProfileData, $verify);
178
+ }
179
+ } elseif (isset($_POST['LoginRadiusPopupCancel'])) { // popup cancelled
180
+ Mage::getSingleton('core/session')->unsSocialLoginData(); // unset session
181
 
182
+ Mage::getSingleton('core/session')->unsTmpPopupTxt();
183
+ Mage::getSingleton('core/session')->unsTmpPopupMsg();
184
+ Mage::getSingleton('core/session')->unsTmpShowForm();
185
+ Mage::getSingleton('core/session')->unsTmpProfileData();
186
+ Mage::getSingleton('core/session')->unsTmpEmailRequired();
187
+ Mage::getSingleton('core/session')->unsTmpHideZipcode();
188
 
189
+ header("Location:" . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK));
190
+ die;
191
+ }
192
+ $this->SocialLoginShowLayout();
193
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
 
195
+ public function popupHandle(){
196
+ $this->loadLayout();
197
+ $this->getLayout()->getBlock('content')->append(
198
+ $this->getLayout()->createBlock('Mage_Core_Block_Template', 'emailpopup', array('template' => 'sociallogin/popup.phtml'))
199
+ );
200
+ $this->renderLayout();
201
+ return $this;
202
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
 
204
+ public function tokenHandle($token)
205
+ {
206
+ $loginhelper = Mage::helper('sociallogin/loginhelper');
207
+ $loginRadiusSDK = Mage::helper('sociallogin/LoginRadiusSDK');
208
+ // Fetch user profile using access token ......
209
+ $responseFromLoginRadius = $loginRadiusSDK->fetchUserProfile($token);
210
+ $userObj = json_decode($responseFromLoginRadius);
 
 
 
 
 
 
 
 
 
 
211
 
212
+ if (isset($userObj->ID) && !empty($userObj->ID)) {
213
+ // If linking variable is available then link account
214
+ if ($this->blockObj->user_is_already_login()) {
215
+ $this->loginRadiusSocialLinking(Mage::getSingleton("customer/session")->getCustomer()->getId(), $userObj->ID, $userObj->Provider, $userObj->ThumbnailImageUrl, true);
216
+ }
217
+ $this->socialloginProfileData = $loginhelper->socialLoginFilterData($userObj);
218
 
219
+ //valid user, checking if user in sociallogin and customer entity tabel
220
+ $queryResult = $loginhelper->loginRadiusRead("sociallogin", "get_user_by_social_id", array($userObj->ID), true);
221
+ //Social Id Exist in Local DB
222
+ if ($result = $queryResult->fetch()) {
223
+ if ($result['verified'] == "0") {
224
+ $session = Mage::getSingleton('customer/session');
225
+ $session->addError(__('Please verify your email to login.'));
226
+ header("Location:" . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK));
227
+ die;
228
+ } else {
229
+ if ($this->blockObj->updateProfileData() != '1') {
230
+ $this->socialLoginUserLogin($result['entity_id'], $userObj->ID);
231
+ } else {
232
+ $this->socialloginProfileData['lrId'] = $userObj->ID;
233
+ $this->socialLoginAddNewUser($this->socialloginProfileData, false, true, $result['entity_id']);
234
+ }
235
+ return;
236
+ }
237
+ }
238
+ //Social Id not Exist in Local DB and email not empty
239
+ elseif (isset($userObj->Email[0]->Value) && !empty($userObj->Email[0]->Value)) {
240
+ //if email is provided by provider then check if it's in table
241
+ $email = $userObj->Email[0]->Value;
242
+ $select = $loginhelper->loginRadiusRead("customer_entity", "email_already_exists", array($email), true);
243
+ if ($rowArray = $select->fetch()) {
244
+ //user is in customer table
245
+ if ($this->blockObj->getLinking() == "1") { // Social Linking
246
+ $this->loginRadiusSocialLinking($rowArray['entity_id'], $userObj->ID, $userObj->Provider, $userObj->ThumbnailImageUrl);
247
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
 
249
+ if ($this->blockObj->updateProfileData() != '1') {
250
+ $this->socialLoginUserLogin($rowArray['entity_id'], $userObj->ID);
251
+ } else {
252
+ $this->socialloginProfileData = $loginhelper->socialLoginFilterData($userObj);
253
+ $this->socialloginProfileData['lrId'] = $userObj->ID;
254
+ $this->socialLoginAddNewUser($this->socialloginProfileData, false, true, $rowArray['entity_id']);
255
+ }
256
+ }else{
257
+ $this->socialloginProfileData['lrId'] = $userObj->ID;
258
+ if ($this->blockObj->getProfileFieldsRequired() == 1) {
259
+ $loginhelper->setInSession($userObj->ID, $this->socialloginProfileData);
260
+ $loginhelper->setTmpSession($this->blockObj->getPopupText(), "", true, $this->socialloginProfileData, false);
261
+ // show a popup to fill required profile fields
262
+ $this->popupHandle();
263
+ return;
264
+ }
265
+ $this->socialLoginAddNewUser($this->socialloginProfileData);
266
+ }
267
+ } else {
268
+ $emailRequired= true;
269
+ if ($this->blockObj->getEmailRequired() == 0) { // dummy email
270
+ $email = $loginhelper->generateRandomEmail($userObj);
271
+ $this->socialloginProfileData['Email'] = $email;
272
+ $this->socialloginProfileData['lrId'] = $userObj->ID;
273
+ $emailRequired = false;
274
+ }
275
+ //
276
+ $this->socialloginProfileData['lrToken'] = $this->loginRadiusAccessToken;
277
+ //show required fields popup
278
+ $loginhelper->setInSession($userObj->ID, $this->socialloginProfileData);
279
+ if ($this->blockObj->getProfileFieldsRequired() == 1) {
280
+ // show a popup to fill required profile fields
281
+ $loginhelper->setTmpSession($this->loginRadiusPopMsg, "", true, $this->socialloginProfileData, $emailRequired);
282
+ $this->popupHandle();
283
+ } elseif($this->blockObj->getEmailRequired() == 1){
284
+ $loginhelper->setTmpSession($this->loginRadiusPopMsg, "", true, array(), $emailRequired, true);
285
+ $this->popupHandle();
286
+ }else{
287
+ //create new user without showing popup
288
+ $this->socialLoginAddNewUser($this->socialloginProfileData);
289
+ }
290
+ }
291
+ } else {
292
+ if ($this->blockObj->isDebuggingOn()) {
293
+ Mage::getSingleton('core/session')->addNotice($userObj->description);
294
+ session_write_close();
295
+ }
296
+ $refererUrl = $this->_getRefererUrl();
297
+ if(empty($refererUrl)){
298
+ $refererUrl = Mage::getBaseUrl();
299
+ }
300
+ $this->getResponse()->setRedirect($refererUrl);
301
+ return;
302
+ }
303
+ }
304
+
305
+ function loginRadiusSocialLinking($entityId, $socialId, $provider, $thumbnail, $unique = false)
306
+ {
307
+ $session = Mage::getSingleton('customer/session');
308
+ // check if any account from this provider is already linked
309
+ if($this->blockObj->user_is_already_login()){
310
+ if(Mage::helper('sociallogin/loginhelper')->loginRadiusRead("sociallogin", "get_user_by_social_id", array($socialId))){
311
+ $session->addError(__('This accounts is already linked with an account.'));
312
+ header("Location:" . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) . "customer/account");
313
+ die;
314
+ }elseif($unique && Mage::helper('sociallogin/loginhelper')->loginRadiusRead("sociallogin", "provider exists in sociallogin", array($entityId, $provider))){
315
+ $session->addError(__('Multiple accounts cannot be linked from the same Social ID Provider.'));
316
+ header("Location:" . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) . "customer/account");
317
+ die;
318
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319
  }
320
+ $socialLoginLinkData = array();
321
+ $socialLoginLinkData['sociallogin_id'] = $socialId;
322
+ $socialLoginLinkData['entity_id'] = $entityId;
323
+ $socialLoginLinkData['provider'] = empty($provider) ? "" : $provider;
324
+ $socialLoginLinkData['avatar'] = Mage::helper('sociallogin/loginHelper')->socialLoginFilterAvatar($socialId, $thumbnail, $provider);
325
+ $socialLoginLinkData['avatar'] = ($socialLoginLinkData['avatar'] == "") ? null : $socialLoginLinkData['avatar'];
326
+ Mage::helper('sociallogin/loginhelper')->SocialLoginInsert("sociallogin", $socialLoginLinkData);
327
+ if($this->blockObj->user_is_already_login()){
328
+ $session->addSuccess(__('Account linked successfully.'));
329
+ header("Location:" . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) . "customer/account");
330
+ die;
331
+ }
332
+ }
333
+
334
+ // if token is posted then this function will be called. It will login user if already in database. else if email is provided by api, it will insert data and login user. It will handle all after token.
335
+
336
+ function socialLoginUserLogin($entityId, $socialId, $loginOrRegister = 'Login')
337
+ {
338
+ $session = Mage::getSingleton("customer/session");
339
+ $customer = Mage::getModel('customer/customer')->load($entityId);
340
+ $customer->setWebsiteId(Mage::app()->getWebsite()->getId());
341
+ $session->setCustomerAsLoggedIn($customer);
342
+ $functionForRedirectOption = 'get' . $loginOrRegister . 'RedirectOption';
343
+ $Hover = $this->blockObj->$functionForRedirectOption();
344
+ $functionForCustomRedirectOption = 'getCustom' . $loginOrRegister . 'RedirectOption';
345
+ $write_url = $this->blockObj->$functionForCustomRedirectOption();
346
+ $url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
347
+ // check if logged in from callback page
348
+ if (isset($_GET['loginradiuscheckout'])) {
349
+ $currentUrl = Mage::helper('checkout/url')->getCheckoutUrl();
350
+ Mage::app()->getResponse()->setRedirect($currentUrl)->sendResponse();
351
+ }
352
+ if ($Hover == 'account') {
353
+ $currentUrl = $url . 'customer/account';
354
+ } elseif ($Hover == 'index') {
355
+ $currentUrl = $url;
356
+ } elseif ($Hover == 'custom' && $write_url != '') {
357
+ $currentUrl = $write_url;
358
+ } elseif ($Hover == 'same') {
359
+ $currentUrl = Mage::helper('core/http')->getHttpReferer() ? Mage::helper('core/http')->getHttpReferer() : Mage::getUrl();
360
+ } else {
361
+ if (isset($_GET['redirect_to'])) {
362
+ $currentUrl = trim($_GET['redirect_to']);
363
+ } else {
364
+ $currentUrl = $url;
365
+ }
366
+
367
+ }
368
+ Mage::app()->getResponse()->setRedirect($currentUrl)->sendResponse();
369
+ }
370
+
371
+ function socialLoginAddNewUser($socialloginProfileData, $verify = false, $update = false, $customerId = '')
372
+ {
373
+ $websiteId = Mage::app()->getWebsite()->getId();
374
+ $store = Mage::app()->getStore();
375
+ if (!$update) {
376
+ $redirectionTo = 'Registration';
377
+ // add new user magento way
378
+ $customer = Mage::getModel("customer/customer");
379
+ } else {
380
+ $redirectionTo = 'Login';
381
+ $customer = Mage::getModel('customer/customer')->load($customerId);
382
+ }
383
+ $customer->website_id = $websiteId;
384
+ $customer->setStore($store);
385
+ if ($socialloginProfileData['FirstName'] != "") {
386
+ $customer->firstname = $socialloginProfileData['FirstName'];
387
+ }
388
+ if (!$update) {
389
+ $customer->lastname = $socialloginProfileData['LastName'] == "" ? $socialloginProfileData['FirstName'] : $socialloginProfileData['LastName'];
390
+ } elseif ($update && $socialloginProfileData['LastName'] != "") {
391
+ $customer->lastname = $socialloginProfileData['LastName'];
392
+ }
393
+ if (!$update) {
394
+ $customer->email = $socialloginProfileData['Email'];
395
+ $loginRadiusPwd = $customer->generatePassword(10);
396
+ $customer->password_hash = md5($loginRadiusPwd);
397
+ }
398
+ if ($socialloginProfileData['BirthDate'] != "") {
399
+ $customer->dob = $socialloginProfileData['BirthDate'];
400
+ }
401
+ if ($socialloginProfileData['Gender'] != "") {
402
+ $customer->gender = $socialloginProfileData['Gender'];
403
+ }
404
+ $customer->setConfirmation(null);
405
+ $customer->save();
406
+
407
+ // if updating user profile
408
+ if ($update) {
409
+ $addresses = $customer->getAddressesCollection();
410
+ $matched = false;
411
+ foreach ($addresses as $address) {
412
+ $address = $address->toArray();
413
+ if ($address['firstname'] == $socialloginProfileData['FirstName']
414
+ && $address['lastname'] == $socialloginProfileData['LastName']
415
+ && $address['country_id'] == ucfirst($socialloginProfileData['Country'])
416
+ && $address['city'] == ucfirst($socialloginProfileData['City'])
417
+ && $address['telephone'] == $socialloginProfileData['PhoneNumber']
418
+ && $address['company'] == ucfirst($socialloginProfileData['Industry'])
419
+ && $address['street'] == ucfirst($socialloginProfileData['Address'])
420
+ ) {
421
+ $matched = true;
422
+ // if profile data contains zipcode then match it with that in the address
423
+ if (isset($socialloginProfileData['Zipcode']) && $address['postcode'] != $socialloginProfileData['Zipcode']) {
424
+ $matched = false;
425
+ }
426
+ // if profile data contains province then match it with that in the address
427
+ if (isset($socialloginProfileData['Province']) && $address['region'] != $socialloginProfileData['Province']) {
428
+ $matched = false;
429
+ }
430
+ }
431
+ if ($matched) {
432
+ break;
433
+ }
434
+ }
435
+ }
436
+ $address = Mage::getModel("customer/address");
437
+ if (!$update) {
438
+ $address->setCustomerId($customer->getId());
439
+ } else {
440
+ $address->setCustomerId($customerId);
441
+ }
442
+ if (($update && !$matched) || !$update) {
443
+ $address->firstname = $customer->firstname;
444
+ $address->lastname = $customer->lastname;
445
+ $address->country_id = isset($socialloginProfileData['Country']) ? ucfirst($socialloginProfileData['Country']) : '';
446
+ if (isset($socialloginProfileData['Zipcode'])) {
447
+ $address->postcode = $socialloginProfileData['Zipcode'];
448
+ }
449
+ $address->city = isset($socialloginProfileData['City']) ? ucfirst($socialloginProfileData['City']) : '';
450
+ // If country is USA, set up province
451
+ if (isset($socialloginProfileData['Province'])) {
452
+ $address->region = $socialloginProfileData['Province'];
453
+ }
454
+ $address->telephone = isset($socialloginProfileData['PhoneNumber']) ? ucfirst($socialloginProfileData['PhoneNumber']) : '';
455
+ $address->company = isset($socialloginProfileData['Industry']) ? ucfirst($socialloginProfileData['Industry']) : '';
456
+ $address->street = isset($socialloginProfileData['Address']) ? ucfirst($socialloginProfileData['Address']) : '';
457
+ // set default billing, shipping address and save in address book
458
+ $address->setIsDefaultShipping('1')->setIsDefaultBilling('1')->setSaveInAddressBook('1');
459
+ $address->save();
460
+ }
461
+ // add info in sociallogin table
462
+ if (!$verify) {
463
+ $fields = array();
464
+ $fields['sociallogin_id'] = $socialloginProfileData['lrId'];
465
+ $fields['entity_id'] = $customer->getId();
466
+ $fields['avatar'] = $socialloginProfileData['thumbnail'];
467
+ $fields['provider'] = $socialloginProfileData['Provider'];
468
+ if (!$update) {
469
+ Mage::helper('sociallogin/loginhelper')->SocialLoginInsert("sociallogin", $fields);
470
+ } else {
471
+ Mage::helper('sociallogin/loginhelper')->SocialLoginInsert("sociallogin", array('avatar' => $socialloginProfileData['thumbnail']), true, array('entity_id = ?' => $customerId));
472
+ }
473
+ if (!$update) {
474
+ $loginRadiusUsername = $socialloginProfileData['FirstName'] . " " . $socialloginProfileData['LastName'];
475
+ // email notification to user
476
+ if ($this->blockObj->notifyUser() == "1") {
477
+ $loginRadiusMessage = $this->blockObj->notifyUserText();
478
+ if ($loginRadiusMessage == "") {
479
+ $loginRadiusMessage = __("Welcome to ") . $store->getGroup()->getName() . ". " . __("You can login to the store using following e-mail address and password");
480
+ }
481
+ $loginRadiusMessage .= "<br/>" . "Email : " . $socialloginProfileData['Email'] . "<br/>" . __("Password") . " : " . $loginRadiusPwd;
482
+
483
+ Mage::helper('sociallogin/loginhelper')->loginRadiusEmail(__("Welcome") . " " . $loginRadiusUsername . "!", $loginRadiusMessage, $socialloginProfileData['Email'], $loginRadiusUsername);
484
+ }
485
+ // new user notification to admin
486
+ if ($this->blockObj->notifyAdmin() == "1") {
487
+ $loginRadiusAdminEmail = Mage::getStoreConfig('trans_email/ident_general/email');
488
+ $loginRadiusAdminName = Mage::getStoreConfig('trans_email/ident_general/name');
489
+ $loginRadiusMessage = trim($this->blockObj->notifyAdminText());
490
+ if ($loginRadiusMessage == "") {
491
+ $loginRadiusMessage = __("New customer has been registered to your store with following details");
492
+ }
493
+ $loginRadiusMessage .= "<br/>" . __("Name") . " : " . $loginRadiusUsername . "<br/>" . __("Email") . " : " . $socialloginProfileData['Email'];
494
+ Mage::helper('sociallogin/loginhelper')->loginRadiusEmail(__("New User Registration"), $loginRadiusMessage, $loginRadiusAdminEmail, $loginRadiusAdminName);
495
+ }
496
+ }
497
+ //login and redirect user
498
+ $this->socialLoginUserLogin($customer->getId(), $fields['sociallogin_id'], $redirectionTo);
499
+ }
500
+ if ($verify) {
501
+ $loginRadiusUsername = $socialloginProfileData['FirstName'] . " " . $socialloginProfileData['LastName'];
502
+ Mage::helper('sociallogin/loginhelper')->verifyUser($socialloginProfileData['lrId'], $customer->getId(), $socialloginProfileData['thumbnail'], $socialloginProfileData['Provider'], $socialloginProfileData['Email'], true, $loginRadiusUsername);
503
+ }
504
+ }
505
+
506
+ public function SocialLoginShowLayout()
507
+ {
508
+ $this->loadLayout();
509
+ $this->renderLayout();
510
+ }
511
+
512
+ /**
513
+ * Action for AJAX
514
+ */
515
+ function ajaxAction()
516
+ {
517
+ $this->loadLayout();
518
+ $this->renderLayout();
519
+ }
520
+
521
+ protected function _getSession()
522
+ {
523
+ return Mage::getSingleton('sociallogin/session');
524
+ }
525
  }
app/code/community/Loginradius/Sociallogin/controllers/Popup.php DELETED
@@ -1,280 +0,0 @@
1
- <?php
2
- function SL_popUpWindow( $loginRadiusPopupTxt, $socialLoginMsg = "", $loginRadiusShowForm = true, $profileData = array(), $emailRequired = true, $hideZipcode = false){
3
- $blockObj = new Loginradius_Sociallogin_Block_Sociallogin();
4
- ?>
5
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
6
- <!--css of email block -->
7
- <style type="text/css">
8
- .LoginRadius_overlay {
9
- background: none no-repeat scroll 0 0 rgba(127, 127, 127, 0.6);
10
- height: 100%;
11
- left: 0;
12
- overflow: auto;
13
- padding: 0px 20px 130px;
14
- position: fixed;
15
- top: 0;
16
- width: 100%;
17
- z-index: 100001;
18
- }
19
- #popupouter{
20
- -moz-border-radius:4px;
21
- -webkit-border-radius:4px;
22
- border-radius:4px;
23
- margin-left:-185px;
24
- left:45%;
25
- background:#f3f3f3;
26
- padding:1px 0px 1px 0px;
27
- width:432px;
28
- position: absolute;
29
- top:35%;
30
- z-index:9999;
31
- margin-top:-96px;
32
- }
33
- #popupinner {
34
- background: none repeat scroll 0 0 #FFFFFF;
35
- border-radius: 4px 4px 4px 4px;
36
- margin: 10px;
37
- overflow: auto;
38
- padding: 10px 8px 4px;
39
- }
40
- #textmatter {
41
- color: #666666;
42
- font-family: Arial,Helvetica,sans-serif;
43
- font-size: 14px;
44
- margin: 10px 0;
45
- float:left
46
- }
47
- .loginRadiusText{
48
- font-family:Arial, Helvetica, sans-serif;
49
- color:#a8a8a8;
50
- font-size:11px;
51
- border:#e5e5e5 1px solid;
52
- width:280px;
53
- height:27px;
54
- margin:5px 0px 15px 0px;
55
- float:left
56
- }
57
- .inputbutton{
58
- border:#dcdcdc 1px solid;
59
- -moz-border-radius:2px;
60
- -webkit-border-radius:2px;
61
- border-radius:2px;
62
- text-decoration:none;
63
- color:#6e6e6e;
64
- font-family:Arial, Helvetica, sans-serif;
65
- font-size:13px;
66
- cursor:pointer;
67
- background:#f3f3f3;
68
- padding:6px 7px 6px 8px;
69
- margin:0px 8px 0px 0px;
70
- float:left
71
- }
72
- .inputbutton:hover{
73
- border:#00ccff 1px solid;
74
- -moz-border-radius:2px;
75
- -webkit-border-radius:2px;
76
- border-radius:2px;
77
- khtml-border-radius:2px;
78
- text-decoration:none;
79
- color:#000000;
80
- font-family:Arial, Helvetica, sans-serif;
81
- font-size:13px;
82
- cursor:pointer;
83
- padding:6px 7px 6px 8px;
84
- -moz-box-shadow: 0px 0px 4px #8a8a8a;
85
- -webkit-box-shadow: 0px 0px 4px #8a8a8a;
86
- box-shadow: 0px 0px 4px #8a8a8a;
87
- background:#f3f3f3;
88
- margin:0px 8px 0px 0px;
89
- }
90
- #textdivpopup{
91
- text-align:right;
92
- font-family:Arial, Helvetica, sans-serif;
93
- font-size:11px;
94
- color:#000000;
95
- }
96
- .spanpopup{
97
- font-family:Arial, Helvetica, sans-serif;
98
- font-size:11px;
99
- color:#00ccff;
100
- }
101
- .span1{
102
- font-family:Arial, Helvetica, sans-serif;
103
- font-size:11px;
104
- color:#333333;
105
- }
106
- <!--[if IE]>
107
- .LoginRadius_content_IE
108
- {background:black;
109
- -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=90)";
110
- filter: alpha(opacity=90);
111
- }
112
- .loginRadiusDiv{
113
- float:left;
114
- margin: 0 0 4px 2px;
115
- }
116
- .loginRadiusDiv label{
117
- width: 94px;
118
- float: left;
119
- margin: 5px 10px 10px 0;
120
- display: block;
121
- text-align: left;
122
- }
123
- <![endif]-->
124
- </style>
125
- <script type="text/javascript">
126
- // variable to check if submit button of popup is clicked
127
- var loginRadiusPopupSubmit = true;
128
- // get trim() worked in IE
129
- if(typeof String.prototype.trim !== 'function') {
130
- String.prototype.trim = function() {
131
- return this.replace(/^\s+|\s+$/g, '');
132
- }
133
- }
134
- // validate numeric data
135
- function isNumber(n) {
136
- return !isNaN(parseFloat(n)) && isFinite(n);
137
- }
138
- // validate required fields form
139
- function loginRadiusValidateForm(){
140
- var loginRadiusForm = document.getElementById('loginRadiusForm');
141
- if(!loginRadiusPopupSubmit){
142
- loginRadiusForm.setAttribute('action', '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK); ?>');
143
- return true;
144
- }
145
- var loginRadiusErrorDiv = document.getElementById('textmatter');
146
- if(document.getElementById('loginRadiusCountry').value.trim() == "US"){
147
- var validateProvince = true;
148
- }else{
149
- var validateProvince = false;
150
- }
151
- for(var i = 0; i < loginRadiusForm.elements.length; i++){
152
- if(!validateProvince && loginRadiusForm.elements[i].id == "loginRadiusProvince"){
153
- continue;
154
- }
155
- if(loginRadiusForm.elements[i].value.trim() == ""){
156
- loginRadiusErrorDiv.innerHTML = "<?php echo __("Please fill all the fields."); ?>";
157
- loginRadiusErrorDiv.style.backgroundColor = "rgb(255, 235, 232)";
158
- loginRadiusErrorDiv.style.border = "1px solid rgb(204, 0, 0)";
159
- loginRadiusErrorDiv.style.padding = "2px 5px";
160
- loginRadiusErrorDiv.style.width = "94%";
161
- loginRadiusErrorDiv.style.textAlign = "left";
162
- return false;
163
- }
164
- if(loginRadiusForm.elements[i].id == "loginRadiusEmail"){
165
- var email = loginRadiusForm.elements[i].value.trim();
166
- var atPosition = email.indexOf("@");
167
- var dotPosition = email.lastIndexOf(".");
168
- if(atPosition < 1 || dotPosition < atPosition+2 || dotPosition+2>=email.length){
169
- loginRadiusErrorDiv.innerHTML = "<?php echo trim($blockObj -> getPopupError()) != "" ? trim($blockObj -> getPopupError()) : __('Please enter a valid email address'); ?>";
170
- loginRadiusErrorDiv.style.backgroundColor = "rgb(255, 235, 232)";
171
- loginRadiusErrorDiv.style.border = "1px solid rgb(204, 0, 0)";
172
- loginRadiusErrorDiv.style.padding = "2px 5px";
173
- loginRadiusErrorDiv.style.width = "94%";
174
- loginRadiusErrorDiv.style.textAlign = "left";
175
- return false;
176
- }
177
- }
178
- }
179
- return true;
180
- }
181
- </script>
182
- </head>
183
- <body>
184
- <div id="fade" class="LoginRadius_overlay">
185
- <div id="popupouter">
186
- <div id="popupinner">
187
- <div id="textmatter"><strong><?php echo __(Mage::helper('core')->htmlEscape($loginRadiusPopupTxt)); ?></strong></div>
188
- <div style="clear:both;"></div>
189
- <div style="color:red; text-align:justify"><?php echo __(Mage::helper('core')->htmlEscape($socialLoginMsg)); ?></div>
190
- <?php
191
- if( $loginRadiusShowForm ){
192
- ?>
193
- <form id="loginRadiusForm" method="post" action="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) . 'sociallogin' ?>" onSubmit="return loginRadiusValidateForm()">
194
- <?php
195
- if($emailRequired){
196
- ?>
197
- <div class="loginRadiusDiv">
198
- <label for="loginRadiusEmail"><?php echo __("Email"); ?> *</label>
199
- <input type="text" name="loginRadiusEmail" id="loginRadiusEmail" class="loginRadiusText" />
200
- </div>
201
- <?php
202
- }
203
- if(isset($profileData['Address']) && $profileData['Address'] == ""){
204
- ?>
205
- <div class="loginRadiusDiv">
206
- <label for="loginRadiusAddress"><?php echo __("Address"); ?> *</label>
207
- <input type="text" name="loginRadiusAddress" id="loginRadiusAddress" class="loginRadiusText" />
208
- </div>
209
- <?php
210
- }
211
- if(isset($profileData['City']) && $profileData['City'] == ""){
212
- ?>
213
- <div class="loginRadiusDiv">
214
- <label for="loginRadiusCity"><?php echo __("City") ?> *</label>
215
- <input type="text" name="loginRadiusCity" id="loginRadiusCity" class="loginRadiusText" />
216
- </div>
217
- <?php
218
- }
219
- if(!$hideZipcode){
220
- ?>
221
- <div class="loginRadiusDiv">
222
- <label for="loginRadiusCountry"><?php echo __("Country"); ?> *</label>
223
- <?php
224
- $countries = Mage::getResourceModel('directory/country_collection')
225
- ->loadData()
226
- ->toOptionArray(false);
227
- if(count($countries) > 0){ ?>
228
- <select onChange="if(this.value == 'US'){ document.getElementById('loginRadiusProvinceContainer').style.display = 'block' }else{ document.getElementById('loginRadiusProvinceContainer').style.display = 'none' }" name="loginRadiusCountry" id="loginRadiusCountry" class="loginRadiusText">
229
- <option value="">-- <?php echo __("Please Select"); ?> --</option>
230
- <?php foreach($countries as $country): ?>
231
- <option value="<?php echo $country['value'] ?>">
232
- <?php echo $country['label'] ?>
233
- </option>
234
- <?php endforeach; ?>
235
- </select>
236
- </div>
237
- <!-- United States province -->
238
- <div style="display:none" id="loginRadiusProvinceContainer" class="loginRadiusDiv">
239
- <label for="loginRadiusCountry"><?php echo __("State/Province") ?> *</label>
240
- <select id="loginRadiusProvince" name="loginRadiusProvince" class="loginRadiusText">
241
- <option value="" selected="selected">-- <?php echo __("Please select") ?> --</option><option value="1">Alabama</option><option value="2">Alaska</option><option value="3">American Samoa</option><option value="4">Arizona</option><option value="5">Arkansas</option><option value="6">Armed Forces Africa</option><option value="7">Armed Forces Americas</option><option value="8">Armed Forces Canada</option><option value="9">Armed Forces Europe</option><option value="10">Armed Forces Middle East</option><option value="11">Armed Forces Pacific</option><option value="12">California</option><option value="13">Colorado</option><option value="14">Connecticut</option><option value="15">Delaware</option><option value="16">District of Columbia</option><option value="17">Federated States Of Micronesia</option><option value="18">Florida</option><option value="19">Georgia</option><option value="20">Guam</option><option value="21">Hawaii</option><option value="22">Idaho</option><option value="23">Illinois</option><option value="24">Indiana</option><option value="25">Iowa</option><option value="26">Kansas</option><option value="27">Kentucky</option><option value="28">Louisiana</option><option value="29">Maine</option><option value="30">Marshall Islands</option><option value="31">Maryland</option><option value="32">Massachusetts</option><option value="33">Michigan</option><option value="34">Minnesota</option><option value="35">Mississippi</option><option value="36">Missouri</option><option value="37">Montana</option><option value="38">Nebraska</option><option value="39">Nevada</option><option value="40">New Hampshire</option><option value="41">New Jersey</option><option value="42">New Mexico</option><option value="43">New York</option><option value="44">North Carolina</option><option value="45">North Dakota</option><option value="46">Northern Mariana Islands</option><option value="47">Ohio</option><option value="48">Oklahoma</option><option value="49">Oregon</option><option value="50">Palau</option><option value="51">Pennsylvania</option><option value="52">Puerto Rico</option><option value="53">Rhode Island</option><option value="54">South Carolina</option><option value="55">South Dakota</option><option value="56">Tennessee</option><option value="57">Texas</option><option value="58">Utah</option><option value="59">Vermont</option><option value="60">Virgin Islands</option><option value="61">Virginia</option><option value="62">Washington</option><option value="63">West Virginia</option><option value="64">Wisconsin</option><option value="65">Wyoming</option></select>
242
- <?php }else{
243
- ?>
244
- <input type="text" name="loginRadiusCountry" id="loginRadiusCountry" class="loginRadiusText" />
245
- <?php
246
- }
247
- ?>
248
- </div>
249
- <div class="loginRadiusDiv">
250
- <label for="loginRadiusZipcode"><?php echo __("Zipcode") ?> *</label>
251
- <input type="text" name="loginRadiusZipcode" id="loginRadiusZipcode" class="loginRadiusText" />
252
- </div>
253
- <?php
254
- }
255
- if(isset($profileData['PhoneNumber']) && $profileData['PhoneNumber'] == ""){
256
- ?>
257
- <div class="loginRadiusDiv">
258
- <label for="loginRadiusPhone"><?php echo __("Phone Number") ?> *</label>
259
- <input type="text" name="loginRadiusPhone" id="loginRadiusPhone" class="loginRadiusText" />
260
- </div>
261
- <?php
262
- }
263
- ?>
264
- <div class="loginRadiusDiv">
265
- <input type="submit" id="LoginRadiusRedSliderClick" name="LoginRadiusRedSliderClick" value="<?php echo __("Submit") ?>" onClick="loginRadiusPopupSubmit = true" class="inputbutton" />
266
- <input type="submit" value="<?php echo __("Cancel") ?>" class="inputbutton" name="LoginRadiusPopupCancel" onClick="loginRadiusPopupSubmit = false" />
267
- </div>
268
- </form>
269
- <?php
270
- }else{
271
- ?>
272
- <input type="button" value="<?php echo __("Okay") ?>" class="inputbutton" onClick="location.href = '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK); ?>'" />
273
- <?php
274
- }
275
- ?>
276
- </div>
277
- </div>
278
- </div>
279
- <?php
280
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Loginradius/Sociallogin/etc/config.xml CHANGED
@@ -1,57 +1,12 @@
1
  <?xml version="1.0"?>
2
  <config>
3
- <default>
4
- <sociallogin_options>
5
- <messages>
6
- <loginEnable>0</loginEnable>
7
- <loginradius_title>Login with your social account</loginradius_title>
8
- <iconSize>small</iconSize>
9
- <showdefault>1</showdefault>
10
- <socialLinking>1</socialLinking>
11
- <redirect>account</redirect>
12
- <aboveLogin>1</aboveLogin>
13
- <aboveRegister>1</aboveRegister>
14
- <sameWindow>1</sameWindow>
15
- </messages>
16
- <email_settings>
17
- <profileFieldsRequired>0</profileFieldsRequired>
18
- <updateProfileData>1</updateProfileData>
19
- <emailrequired>1</emailrequired>
20
- <verificationText>Please click on the following link or paste it in browser to verify your email:-</verificationText>
21
- <popupText>Please enter your email to proceed</popupText>
22
- <popupError>The email you entered is already registered or invalid. Please enter a valid email.</popupError>
23
- <notifyUser>1</notifyUser>
24
- <notifyAdmin>0</notifyAdmin>
25
- <notifyAdminText>New customer has been registered to your store with following details:-</notifyAdminText>
26
- </email_settings>
27
- <horizontalSharing>
28
- <horizontalShareEnable>1</horizontalShareEnable>
29
- <horizontalShareProduct>1</horizontalShareProduct>
30
- <horizontalShareSuccess>1</horizontalShareSuccess>
31
- <sharingTitle>Share it now!</sharingTitle>
32
- <horizontalSharingTheme>32</horizontalSharingTheme>
33
- <horizontalSharingProvidersHidden>Facebook,Twitter,GooglePlus,LinkedIn,Pinterest,Print,Email</horizontalSharingProvidersHidden>
34
- <horizontalCounterProvidersHidden>Facebook Like,Google+ +1,Twitter Tweet,Pinterest Pin it,Hybridshare</horizontalCounterProvidersHidden>
35
- </horizontalSharing>
36
- <verticalSharing>
37
- <verticalShareEnable>1</verticalShareEnable>
38
- <verticalShareProduct>1</verticalShareProduct>
39
- <verticalShareSuccess>1</verticalShareSuccess>
40
- <verticalSharingTheme>counter_vertical</verticalSharingTheme>
41
- <verticalAlignment>top_left</verticalAlignment>
42
- <offset>150</offset>
43
- <verticalSharingProvidersHidden>Facebook,Twitter,GooglePlus,LinkedIn,Pinterest,Print,Email</verticalSharingProvidersHidden>
44
- <verticalCounterProvidersHidden>Facebook Like,Google+ +1,Twitter Tweet,Pinterest Pin it,Hybridshare</verticalCounterProvidersHidden>
45
- </verticalSharing>
46
- </sociallogin_options>
47
- </default>
48
  <modules>
49
  <Loginradius_Sociallogin>
50
- <version>3.7.1</version>
51
  </Loginradius_Sociallogin>
52
  </modules>
53
- <frontend>
54
- <layout>
55
  <updates>
56
  <sociallogin>
57
  <file>sociallogin.xml</file>
@@ -75,21 +30,21 @@
75
  <frontName>sociallogin</frontName>
76
  </args>
77
  </sociallogin>
78
- </routers>
79
  </frontend>
80
- <admin>
81
  <routers>
82
- <sociallogin>
83
- <use>admin</use>
84
- <args>
85
- <module>Loginradius_Sociallogin</module>
86
- <frontName>sociallogin admin</frontName>
87
- </args>
88
- </sociallogin>
89
  </routers>
90
  </admin>
91
- <adminhtml>
92
- <acl>
93
  <resources>
94
  <admin>
95
  <children>
@@ -108,30 +63,30 @@
108
  </admin>
109
  </resources>
110
  </acl>
111
-
112
- <acl>
113
- <resources>
114
- <all>
115
- <title>Allow Everything</title>
116
- </all>
117
- <admin>
118
- <children>
119
- <Loginradius_Sociallogin>
120
- <title>Sociallogin Module</title>
121
- <sort_order>10</sort_order>
122
- </Loginradius_Sociallogin>
123
- </children>
124
- </admin>
125
- </resources>
126
- </acl>
127
- <layout>
128
- <updates>
129
- <sociallogin>
130
- <file>loginradius_sociallogin.xml</file>
131
- </sociallogin>
132
- </updates>
133
- </layout>
134
- <translate>
135
  <modules>
136
  <Loginradius_Sociallogin>
137
  <files>
@@ -140,9 +95,25 @@
140
  </Loginradius_Sociallogin>
141
  </modules>
142
  </translate>
143
- </adminhtml>
144
- <global>
145
- <models>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  <sociallogin>
147
  <class>Loginradius_Sociallogin_Model</class>
148
  <resourceModel>sociallogin_mysql4</resourceModel>
@@ -176,16 +147,63 @@
176
  </connection>
177
  </sociallogin_read>
178
  </resources>
179
-
180
- <blocks>
181
  <sociallogin>
182
  <class>Loginradius_Sociallogin_Block</class>
183
  </sociallogin>
184
- </blocks>
185
- <helpers>
 
186
  <sociallogin>
187
  <class>Loginradius_Sociallogin_Helper</class>
188
  </sociallogin>
189
- </helpers>
190
- </global>
191
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?xml version="1.0"?>
2
  <config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  <modules>
4
  <Loginradius_Sociallogin>
5
+ <version>4.0.0</version>
6
  </Loginradius_Sociallogin>
7
  </modules>
8
+ <frontend>
9
+ <layout>
10
  <updates>
11
  <sociallogin>
12
  <file>sociallogin.xml</file>
30
  <frontName>sociallogin</frontName>
31
  </args>
32
  </sociallogin>
33
+ </routers>
34
  </frontend>
35
+ <admin>
36
  <routers>
37
+ <sociallogin>
38
+ <use>admin</use>
39
+ <args>
40
+ <module>Loginradius_Sociallogin</module>
41
+ <frontName>sociallogin admin</frontName>
42
+ </args>
43
+ </sociallogin>
44
  </routers>
45
  </admin>
46
+ <adminhtml>
47
+ <acl>
48
  <resources>
49
  <admin>
50
  <children>
63
  </admin>
64
  </resources>
65
  </acl>
66
+
67
+ <acl>
68
+ <resources>
69
+ <all>
70
+ <title>Allow Everything</title>
71
+ </all>
72
+ <admin>
73
+ <children>
74
+ <Loginradius_Sociallogin>
75
+ <title>Sociallogin Module</title>
76
+ <sort_order>10</sort_order>
77
+ </Loginradius_Sociallogin>
78
+ </children>
79
+ </admin>
80
+ </resources>
81
+ </acl>
82
+ <layout>
83
+ <updates>
84
+ <sociallogin>
85
+ <file>loginradius_sociallogin.xml</file>
86
+ </sociallogin>
87
+ </updates>
88
+ </layout>
89
+ <translate>
90
  <modules>
91
  <Loginradius_Sociallogin>
92
  <files>
95
  </Loginradius_Sociallogin>
96
  </modules>
97
  </translate>
98
+ <events>
99
+ <admin_system_config_changed_section_sociallogin_options>
100
+ <observers>
101
+ <sociallogin>
102
+ <type>singleton</type>
103
+ <class>sociallogin/Observer</class>
104
+ <method>adminSystemConfigChangedSection</method>
105
+ </sociallogin>
106
+ </observers>
107
+ </admin_system_config_changed_section_sociallogin_options>
108
+ </events>
109
+ <helpers>
110
+ <sociallogin>
111
+ <class>Loginradius_Sociallogin_Helper_admin_Adminhelper</class>
112
+ </sociallogin>
113
+ </helpers>
114
+ </adminhtml>
115
+ <global>
116
+ <models>
117
  <sociallogin>
118
  <class>Loginradius_Sociallogin_Model</class>
119
  <resourceModel>sociallogin_mysql4</resourceModel>
147
  </connection>
148
  </sociallogin_read>
149
  </resources>
150
+ <blocks>
 
151
  <sociallogin>
152
  <class>Loginradius_Sociallogin_Block</class>
153
  </sociallogin>
154
+ </blocks>
155
+
156
+ <helpers>
157
  <sociallogin>
158
  <class>Loginradius_Sociallogin_Helper</class>
159
  </sociallogin>
160
+ </helpers>
161
+ </global>
162
+ <default>
163
+ <sociallogin_options>
164
+ <basicSettings>
165
+ <redirectAfterLogin>account</redirectAfterLogin>
166
+ <redirectAfterRegistration>account</redirectAfterRegistration>
167
+ </basicSettings>
168
+ <advancedSettings>
169
+ <loginradius_title>Login with your social account</loginradius_title>
170
+ <iconSize>small</iconSize>
171
+ <iconsPerRow>4</iconsPerRow>
172
+ <showdefault>1</showdefault>
173
+ <socialLinking>1</socialLinking>
174
+ <redirect>account</redirect>
175
+ <aboveLogin>1</aboveLogin>
176
+ <aboveRegister>1</aboveRegister>
177
+ <emailrequired>1</emailrequired>
178
+ <updateProfileData>1</updateProfileData>
179
+ <profileFieldsRequired>0</profileFieldsRequired>
180
+ <verificationText>Please click on the following link or paste it in browser to verify your email:-</verificationText>
181
+ <popupText>Please provide following details</popupText>
182
+ <popupError>The email you entered is already registered or invalid. Please enter a valid email.</popupError>
183
+ <notifyUser>1</notifyUser>
184
+ <notifyAdmin>0</notifyAdmin>
185
+ <notifyAdminText>New customer has been registered to your store with following details:-</notifyAdminText>
186
+ <debugMode>0</debugMode>
187
+ </advancedSettings>
188
+ <horizontalSharing>
189
+ <horizontalShareEnable>1</horizontalShareEnable>
190
+ <horizontalShareProduct>1</horizontalShareProduct>
191
+ <horizontalShareSuccess>1</horizontalShareSuccess>
192
+ <sharingTitle>Share it now!</sharingTitle>
193
+ <horizontalSharingTheme>32</horizontalSharingTheme>
194
+ <horizontalSharingProvidersHidden>Facebook,Twitter,GooglePlus,LinkedIn,Pinterest,Print,Email</horizontalSharingProvidersHidden>
195
+ <horizontalCounterProvidersHidden>Facebook Like,Google+ +1,Twitter Tweet,Pinterest Pin it,Hybridshare</horizontalCounterProvidersHidden>
196
+ </horizontalSharing>
197
+ <verticalSharing>
198
+ <verticalShareEnable>1</verticalShareEnable>
199
+ <verticalShareProduct>1</verticalShareProduct>
200
+ <verticalShareSuccess>1</verticalShareSuccess>
201
+ <verticalSharingTheme>counter_vertical</verticalSharingTheme>
202
+ <verticalAlignment>top_left</verticalAlignment>
203
+ <offset>150</offset>
204
+ <verticalSharingProvidersHidden>Facebook,Twitter,GooglePlus,LinkedIn,Pinterest,Print,Email</verticalSharingProvidersHidden>
205
+ <verticalCounterProvidersHidden>Facebook Like,Google+ +1,Twitter Tweet,Pinterest Pin it,Hybridshare</verticalCounterProvidersHidden>
206
+ </verticalSharing>
207
+ </sociallogin_options>
208
+ </default>
209
+ </config>
app/code/community/Loginradius/Sociallogin/etc/system.xml CHANGED
@@ -1,496 +1,542 @@
1
  <?xml version="1.0"?>
2
  <config>
3
- <tabs>
4
- <socialconfig translate="label" module="sociallogin">
5
  <label>Login Radius</label>
6
  <sort_order>1</sort_order>
7
  </socialconfig>
8
  </tabs>
9
  <sections>
10
- <sociallogin_options translate="label" module="sociallogin">
11
- <label>Social Login and 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_Sociallogin_Model_System_Config_Info</frontend_model>
21
- <comment><![CDATA[]]></comment>
22
- <sort_order>0</sort_order>
23
- <show_in_default>1</show_in_default>
24
- <show_in_website>1</show_in_website>
25
- <show_in_store>1</show_in_store>
26
- </info>
27
- <messages translate="label">
28
- <label>Social Login Basic Settings</label>
29
- <frontend_type>text</frontend_type>
30
- <sort_order>1</sort_order>
31
- <show_in_default>1</show_in_default>
32
- <show_in_website>1</show_in_website>
33
- <show_in_store>1</show_in_store>
34
- <fields>
35
- <loginEnable translate="label">
36
- <label>Enable Social Login</label>
37
- <frontend_type>select</frontend_type>
38
- <source_model>adminhtml/system_config_source_yesno</source_model>
39
- <sort_order>14</sort_order>
40
- <show_in_default>1</show_in_default>
41
- <show_in_website>1</show_in_website>
42
- <show_in_store>1</show_in_store>
43
- </loginEnable>
44
- <appid translate="label">
45
- <label>LoginRadius API Key</label>
46
- <frontend_type>text</frontend_type>
47
- <comment><![CDATA[Paste LoginRadius API Key here. To get the API Key, login to <a href="http://www.loginradius.com" target="_blank">LoginRadius</a>]]></comment>
48
- <sort_order>15</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
- </appid>
53
- <appkey translate="label">
54
- <label>LoginRadius API Secret</label>
55
- <frontend_type>text</frontend_type>
56
- <comment><![CDATA[Paste LoginRadius API Secret here. To get the API Secret, login to <a href="http://www.loginradius.com" target="_blank">LoginRadius</a>]]></comment>
57
- <sort_order>16</sort_order>
58
- <show_in_default>1</show_in_default>
59
- <show_in_website>1</show_in_website>
60
- <show_in_store>1</show_in_store>
61
- </appkey>
62
- <loginradius_title translate="label">
63
- <label>Title</label>
64
- <frontend_type>text</frontend_type>
65
- <comment><![CDATA[Text displayed above Social login Interface]]></comment>
66
- <sort_order>17</sort_order>
67
- <show_in_default>1</show_in_default>
68
- <show_in_website>1</show_in_website>
69
- <show_in_store>1</show_in_store>
70
- </loginradius_title>
71
- <sameWindow translate="label">
72
- <label>Release authentication response in ID provider pop-up?</label>
73
- <frontend_type>radios</frontend_type>
74
- <comment><![CDATA[This is used for better user experience.]]></comment>
75
- <source_model>sociallogin/source_loginPopup</source_model>
76
- <sort_order>18</sort_order>
77
- <show_in_default>1</show_in_default>
78
- <show_in_website>1</show_in_website>
79
- <show_in_store>1</show_in_store>
80
- </sameWindow>
81
- <iconSize translate="label">
82
- <label>Social Login icons size</label>
83
- <frontend_type>radios</frontend_type>
84
- <comment><![CDATA[Select the icon size to use in the Social Login interface.]]></comment>
85
- <source_model>sociallogin/source_iconsize</source_model>
86
- <sort_order>18</sort_order>
87
- <show_in_default>1</show_in_default>
88
- <show_in_website>1</show_in_website>
89
- <show_in_store>1</show_in_store>
90
- </iconSize>
91
- <iconsPerRow translate="label">
92
- <label>Social Login icons per row</label>
93
- <frontend_type>text</frontend_type>
94
- <comment><![CDATA[How many social icons would you like to be displayed per row?]]></comment>
95
- <sort_order>19</sort_order>
96
- <show_in_default>1</show_in_default>
97
- <show_in_website>1</show_in_website>
98
- <show_in_store>1</show_in_store>
99
- </iconsPerRow>
100
- <backgroundColor translate="label">
101
- <label>Background Color</label>
102
- <frontend_type>text</frontend_type>
103
- <comment><![CDATA[What background color would you like to use for the Social Login interface? (Leave empty for transparent. You can enter hexa-decimal code of the color as well as name of the color (in English language and small letters).)]]></comment>
104
- <sort_order>20</sort_order>
105
- <show_in_default>1</show_in_default>
106
- <show_in_website>1</show_in_website>
107
- <show_in_store>1</show_in_store>
108
- </backgroundColor>
109
- <showdefault translate="label">
110
- <label>Show Social Login interface in right side panel</label>
111
- <frontend_type>select</frontend_type>
112
- <comment><![CDATA[Select No, if you don't want to display module in right panel. You can also set widget in pages or any area of your site.]]></comment>
113
- <source_model>adminhtml/system_config_source_yesno</source_model>
114
- <sort_order>23</sort_order>
115
- <show_in_default>1</show_in_default>
116
- <show_in_website>1</show_in_website>
117
- <show_in_store>1</show_in_store>
118
- </showdefault>
119
- <aboveLogin translate="label">
120
- <label>Show Social Login interface above login form</label>
121
- <frontend_type>select</frontend_type>
122
- <comment><![CDATA[Select 'Yes' to enable Social Login interface above login form.]]></comment>
123
- <source_model>adminhtml/system_config_source_yesno</source_model>
124
- <sort_order>24</sort_order>
125
- <show_in_default>1</show_in_default>
126
- <show_in_website>1</show_in_website>
127
- <show_in_store>1</show_in_store>
128
- </aboveLogin>
129
- <belowLogin translate="label">
130
- <label>Show Social Login interface below login form</label>
131
- <frontend_type>select</frontend_type>
132
- <comment><![CDATA[Select 'Yes' to enable Social Login interface below login form.]]></comment>
133
- <source_model>adminhtml/system_config_source_yesno</source_model>
134
- <sort_order>25</sort_order>
135
- <show_in_default>1</show_in_default>
136
- <show_in_website>1</show_in_website>
137
- <show_in_store>1</show_in_store>
138
- </belowLogin>
139
- <aboveRegister translate="label">
140
- <label>Show Social Login interface above registration form</label>
141
- <frontend_type>select</frontend_type>
142
- <comment><![CDATA[Select 'Yes' to enable Social Login interface above registration form.]]></comment>
143
- <source_model>adminhtml/system_config_source_yesno</source_model>
144
- <sort_order>26</sort_order>
145
- <show_in_default>1</show_in_default>
146
- <show_in_website>1</show_in_website>
147
- <show_in_store>1</show_in_store>
148
- </aboveRegister>
149
- <belowRegister translate="label">
150
- <label>Show Social Login interface below registration form</label>
151
- <frontend_type>select</frontend_type>
152
- <comment><![CDATA[Select 'Yes' to enable Social Login interface below registration form.]]></comment>
153
- <source_model>adminhtml/system_config_source_yesno</source_model>
154
- <sort_order>27</sort_order>
155
- <show_in_default>1</show_in_default>
156
- <show_in_website>1</show_in_website>
157
- <show_in_store>1</show_in_store>
158
- </belowRegister>
159
- <socialLinking translate="label">
160
- <label>Social Linking</label>
161
- <frontend_type>select</frontend_type>
162
- <comment><![CDATA[Link existing user accounts with Social Login.]]></comment>
163
- <source_model>adminhtml/system_config_source_yesno</source_model>
164
- <sort_order>29</sort_order>
165
- <show_in_default>1</show_in_default>
166
- <show_in_website>1</show_in_website>
167
- <show_in_store>1</show_in_store>
168
- </socialLinking>
169
- <redirect translate="label">
170
- <label>Redirect After Login</label>
171
- <frontend_type>radios</frontend_type>
172
- <source_model>sociallogin/source_uihover</source_model>
173
- <sort_order>34</sort_order>
174
- <show_in_default>1</show_in_default>
175
- <show_in_website>1</show_in_website>
176
- <show_in_store>1</show_in_store>
177
- </redirect>
178
- <call translate="label">
179
- <label></label>
180
- <frontend_type>text</frontend_type>
181
- <sort_order>40</sort_order>
182
- <show_in_default>1</show_in_default>
183
- <show_in_website>1</show_in_website>
184
- <show_in_store>1</show_in_store>
185
- </call>
186
- <api translate="label">
187
- <label>API Connection Method</label>
188
- <frontend_type>select</frontend_type>
189
- <comment><![CDATA[cURL require 'cURL support = enabled' in your php.ini settings, FSOCKOPEN require 'allow_url_fopen = On' and 'safemode = off' in your php.ini settings]]></comment>
190
- <source_model>sociallogin/source_uihover2</source_model>
191
- <sort_order>45</sort_order>
192
- <show_in_default>1</show_in_default>
193
- <show_in_website>1</show_in_website>
194
- <show_in_store>1</show_in_store>
195
- </api>
196
- </fields>
197
- </messages>
198
- <email_settings>
199
- <label>Social Login Advanced Settings</label>
200
- <frontend_type>text</frontend_type>
201
- <sort_order>19</sort_order>
202
- <show_in_default>1</show_in_default>
203
- <show_in_website>1</show_in_website>
204
- <show_in_store>1</show_in_store>
205
- <fields>
206
- <profileFieldsRequired translate="label">
207
- <label>Profile Fields Required</label>
208
- <frontend_type>select</frontend_type>
209
- <comment><![CDATA[Ask the required Magento User Profile fields in a popup when user registers through Social Login.]]></comment>
210
- <source_model>adminhtml/system_config_source_yesno</source_model>
211
- <sort_order>20</sort_order>
212
- <show_in_default>1</show_in_default>
213
- <show_in_website>1</show_in_website>
214
- <show_in_store>1</show_in_store>
215
- </profileFieldsRequired>
216
- <updateProfileData translate="label">
217
- <label>Update Profile Data</label>
218
- <frontend_type>select</frontend_type>
219
- <comment><![CDATA[Select yes to update user profile details in your Magento website, every time user logs into your website.]]></comment>
220
- <source_model>adminhtml/system_config_source_yesno</source_model>
221
- <sort_order>21</sort_order>
222
- <show_in_default>1</show_in_default>
223
- <show_in_website>1</show_in_website>
224
- <show_in_store>1</show_in_store>
225
- </updateProfileData>
226
- <emailrequired translate="label">
227
- <label>Email Required</label>
228
- <frontend_type>select</frontend_type>
229
- <comment><![CDATA[A few ID providers do not provide user's Email ID. Select YES if you would like an email pop-up after login or select NO if you would like to auto-generate the email address.]]></comment>
230
- <source_model>adminhtml/system_config_source_yesno</source_model>
231
- <sort_order>22</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
- </emailrequired>
236
- <verificationText translate="label">
237
- <label>Email verification message</label>
238
- <frontend_type>text</frontend_type>
239
- <comment><![CDATA[This message will be used in verification email.]]></comment>
240
- <sort_order>23</sort_order>
241
- <show_in_default>1</show_in_default>
242
- <show_in_website>1</show_in_website>
243
- <show_in_store>1</show_in_store>
244
- </verificationText>
245
- <popupText translate="label">
246
- <label>"Email required" - Popup title</label>
247
- <frontend_type>text</frontend_type>
248
- <comment><![CDATA[This text will be displayed on "Email required" popup.]]></comment>
249
- <sort_order>24</sort_order>
250
- <show_in_default>1</show_in_default>
251
- <show_in_website>1</show_in_website>
252
- <show_in_store>1</show_in_store>
253
- </popupText>
254
- <popupError translate="label">
255
- <label>Error message</label>
256
- <frontend_type>text</frontend_type>
257
- <comment><![CDATA[This text will be displayed on the popup if the entered email is already registered or invalid.]]></comment>
258
- <sort_order>25</sort_order>
259
- <show_in_default>1</show_in_default>
260
- <show_in_website>1</show_in_website>
261
- <show_in_store>1</show_in_store>
262
- </popupError>
263
- <notifyUser translate="label">
264
- <label>Enable registration notification to user</label>
265
- <frontend_type>select</frontend_type>
266
- <comment><![CDATA[Send email to newly registered customer regarding login credentials.]]></comment>
267
- <source_model>adminhtml/system_config_source_yesno</source_model>
268
- <sort_order>26</sort_order>
269
- <show_in_default>1</show_in_default>
270
- <show_in_website>1</show_in_website>
271
- <show_in_store>1</show_in_store>
272
- </notifyUser>
273
- <notifyUserText translate="label">
274
- <label>User notification email message</label>
275
- <frontend_type>textarea</frontend_type>
276
- <comment><![CDATA[This message will be sent to user in notification email along with login credentials. If left empty, default message will be sent.]]></comment>
277
- <sort_order>27</sort_order>
278
- <show_in_default>1</show_in_default>
279
- <show_in_website>1</show_in_website>
280
- <show_in_store>1</show_in_store>
281
- </notifyUserText>
282
- <notifyAdmin translate="label">
283
- <label>Enable registration notification to owner</label>
284
- <frontend_type>select</frontend_type>
285
- <comment><![CDATA[Send email to store owner on new customer registration regarding customer details.]]></comment>
286
- <source_model>adminhtml/system_config_source_yesno</source_model>
287
- <sort_order>28</sort_order>
288
- <show_in_default>1</show_in_default>
289
- <show_in_website>1</show_in_website>
290
- <show_in_store>1</show_in_store>
291
- </notifyAdmin>
292
- <notifyAdminText translate="label">
293
- <label>Owner notification email message</label>
294
- <frontend_type>textarea</frontend_type>
295
- <comment><![CDATA[This message will be sent to admin in notification email.]]></comment>
296
- <sort_order>29</sort_order>
297
- <show_in_default>1</show_in_default>
298
- <show_in_website>1</show_in_website>
299
- <show_in_store>1</show_in_store>
300
- </notifyAdminText>
301
- </fields>
302
- </email_settings>
303
- <horizontalSharing translate="label">
304
- <label>Horizontal Social Sharing</label>
305
- <frontend_type>text</frontend_type>
306
- <sort_order>30</sort_order>
307
- <show_in_default>1</show_in_default>
308
- <show_in_website>1</show_in_website>
309
- <show_in_store>1</show_in_store>
310
- <fields>
311
- <horizontalShareEnable translate="label">
312
- <label>Enable Horizontal Social Sharing</label>
313
- <frontend_type>select</frontend_type>
314
- <source_model>adminhtml/system_config_source_yesno</source_model>
315
- <comment><![CDATA[Do you want to enable Horizontal Social Sharing for your website?]]></comment>
316
- <sort_order>31</sort_order>
317
- <show_in_default>1</show_in_default>
318
- <show_in_website>1</show_in_website>
319
- <show_in_store>1</show_in_store>
320
- </horizontalShareEnable>
321
- <horizontalShareProduct translate="label">
322
- <label>Show Social Sharing Interface at Product Pages</label>
323
- <frontend_type>select</frontend_type>
324
- <source_model>adminhtml/system_config_source_yesno</source_model>
325
- <sort_order>32</sort_order>
326
- <show_in_default>1</show_in_default>
327
- <show_in_website>1</show_in_website>
328
- <show_in_store>1</show_in_store>
329
- </horizontalShareProduct>
330
- <horizontalShareSuccess translate="label">
331
- <label>Enable Social Sharing at Checkout Success Page</label>
332
- <frontend_type>select</frontend_type>
333
- <source_model>adminhtml/system_config_source_yesno</source_model>
334
- <sort_order>33</sort_order>
335
- <show_in_default>1</show_in_default>
336
- <show_in_website>1</show_in_website>
337
- <show_in_store>1</show_in_store>
338
- </horizontalShareSuccess>
339
- <sharingTitle translate="label">
340
- <label>Sharing Title</label>
341
- <frontend_type>text</frontend_type>
342
- <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.]]></comment>
343
- <sort_order>34</sort_order>
344
- <show_in_default>1</show_in_default>
345
- <show_in_website>1</show_in_website>
346
- <show_in_store>1</show_in_store>
347
- </sharingTitle>
348
- <horizontalSharingTheme translate="label">
349
- <label>Choose a theme</label>
350
- <frontend_type>radios</frontend_type>
351
- <source_model>sociallogin/source_HorizontalSharing</source_model>
352
- <sort_order>36</sort_order>
353
- <show_in_default>1</show_in_default>
354
- <show_in_website>1</show_in_website>
355
- <show_in_store>1</show_in_store>
356
- </horizontalSharingTheme>
357
- <horizontalSharingProviders translate="label">
358
- <label>Sharing Providers</label>
359
- <frontend_type>checkboxes</frontend_type>
360
- <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>
361
- <sort_order>40</sort_order>
362
- <show_in_default>1</show_in_default>
363
- <show_in_website>1</show_in_website>
364
- <show_in_store>1</show_in_store>
365
- </horizontalSharingProviders>
366
- <horizontalSharingProvidersHidden translate="label">
367
- <label>Rearrange Icons</label>
368
- <frontend_type>hidden</frontend_type>
369
- <sort_order>41</sort_order>
370
- <show_in_default>1</show_in_default>
371
- <show_in_website>1</show_in_website>
372
- <show_in_store>1</show_in_store>
373
- </horizontalSharingProvidersHidden>
374
- <horizontalCounterProviders translate="label">
375
- <label>Sharing Providers</label>
376
- <frontend_type>checkboxes</frontend_type>
377
- <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>
378
- <sort_order>40</sort_order>
379
- <show_in_default>1</show_in_default>
380
- <show_in_website>1</show_in_website>
381
- <show_in_store>1</show_in_store>
382
- </horizontalCounterProviders>
383
- <horizontalCounterProvidersHidden translate="label">
384
- <label>Rearrange Icons</label>
385
- <frontend_type>hidden</frontend_type>
386
- <sort_order>41</sort_order>
387
- <show_in_default>1</show_in_default>
388
- <show_in_website>1</show_in_website>
389
- <show_in_store>1</show_in_store>
390
- </horizontalCounterProvidersHidden>
391
- </fields>
392
- </horizontalSharing>
393
- <verticalSharing translate="label">
394
- <label>Vertical Social Sharing</label>
395
- <frontend_type>text</frontend_type>
396
- <sort_order>42</sort_order>
397
- <show_in_default>1</show_in_default>
398
- <show_in_website>1</show_in_website>
399
- <show_in_store>1</show_in_store>
400
- <fields>
401
- <verticalShareEnable translate="label">
402
- <label>Enable Vertical Social Sharing</label>
403
- <frontend_type>select</frontend_type>
404
- <source_model>adminhtml/system_config_source_yesno</source_model>
405
- <comment><![CDATA[Do you want to enable Social Counter for your website?]]></comment>
406
- <sort_order>43</sort_order>
407
- <show_in_default>1</show_in_default>
408
- <show_in_website>1</show_in_website>
409
- <show_in_store>1</show_in_store>
410
- </verticalShareEnable>
411
- <verticalShareProduct translate="label">
412
- <label>Show Social Sharing Interface at Product Pages</label>
413
- <frontend_type>select</frontend_type>
414
- <source_model>adminhtml/system_config_source_yesno</source_model>
415
- <sort_order>44</sort_order>
416
- <show_in_default>1</show_in_default>
417
- <show_in_website>1</show_in_website>
418
- <show_in_store>1</show_in_store>
419
- </verticalShareProduct>
420
- <verticalShareSuccess translate="label">
421
- <label>Enable Social Sharing at Checkout Success Page</label>
422
- <frontend_type>select</frontend_type>
423
- <source_model>adminhtml/system_config_source_yesno</source_model>
424
- <sort_order>45</sort_order>
425
- <show_in_default>1</show_in_default>
426
- <show_in_website>1</show_in_website>
427
- <show_in_store>1</show_in_store>
428
- </verticalShareSuccess>
429
- <verticalSharingTheme translate="label">
430
- <label>Choose a theme</label>
431
- <frontend_type>radios</frontend_type>
432
- <source_model>sociallogin/source_VerticalSharing</source_model>
433
- <sort_order>48</sort_order>
434
- <show_in_default>1</show_in_default>
435
- <show_in_website>1</show_in_website>
436
- <show_in_store>1</show_in_store>
437
- </verticalSharingTheme>
438
- <verticalAlignment translate="label">
439
- <label>Alignment</label>
440
- <frontend_type>select</frontend_type>
441
- <comment><![CDATA[Select the position of the Social Counter widget with respect to page]]></comment>
442
- <source_model>sociallogin/source_SharingVerticalAlignment</source_model>
443
- <sort_order>50</sort_order>
444
- <show_in_default>1</show_in_default>
445
- <show_in_website>1</show_in_website>
446
- <show_in_store>1</show_in_store>
447
- </verticalAlignment>
448
- <offset translate="label">
449
- <label>Offset</label>
450
- <frontend_type>text</frontend_type>
451
- <comment><![CDATA[Specify distance of vertical counter interface from top (Leave empty for default behaviour) <a style="text-decoration:none" href="javascript:void(0)" title="Enter a number (For example - 200). It will set the 'top' CSS attribute of the interface to the value specified. Increase in the number pushes interface towards bottom.">(?)</a>]]></comment>
452
- <sort_order>51</sort_order>
453
- <show_in_default>1</show_in_default>
454
- <show_in_website>1</show_in_website>
455
- <show_in_store>1</show_in_store>
456
- </offset>
457
- <verticalSharingProviders translate="label">
458
- <label>Sharing Providers</label>
459
- <frontend_type>checkboxes</frontend_type>
460
- <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>
461
- <sort_order>52</sort_order>
462
- <show_in_default>1</show_in_default>
463
- <show_in_website>1</show_in_website>
464
- <show_in_store>1</show_in_store>
465
- </verticalSharingProviders>
466
- <verticalSharingProvidersHidden translate="label">
467
- <label>Rearrange Icons</label>
468
- <frontend_type>hidden</frontend_type>
469
- <sort_order>53</sort_order>
470
- <show_in_default>1</show_in_default>
471
- <show_in_website>1</show_in_website>
472
- <show_in_store>1</show_in_store>
473
- </verticalSharingProvidersHidden>
474
- <verticalCounterProviders translate="label">
475
- <label>Sharing Providers</label>
476
- <frontend_type>checkboxes</frontend_type>
477
- <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>
478
- <sort_order>54</sort_order>
479
- <show_in_default>1</show_in_default>
480
- <show_in_website>1</show_in_website>
481
- <show_in_store>1</show_in_store>
482
- </verticalCounterProviders>
483
- <verticalCounterProvidersHidden translate="label">
484
- <label>Rearrange Icons</label>
485
- <frontend_type>hidden</frontend_type>
486
- <sort_order>55</sort_order>
487
- <show_in_default>1</show_in_default>
488
- <show_in_website>1</show_in_website>
489
- <show_in_store>1</show_in_store>
490
- </verticalCounterProvidersHidden>
491
- </fields>
492
- </verticalSharing>
493
- </groups>
494
- </sociallogin_options>
495
- </sections>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
496
  </config>
1
  <?xml version="1.0"?>
2
  <config>
3
+ <tabs>
4
+ <socialconfig translate="label" module="sociallogin">
5
  <label>Login Radius</label>
6
  <sort_order>1</sort_order>
7
  </socialconfig>
8
  </tabs>
9
  <sections>
10
+ <sociallogin_options translate="label" module="sociallogin">
11
+ <label>Social Login and 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_Sociallogin_Model_System_Config_Info</frontend_model>
21
+ <comment><![CDATA[]]></comment>
22
+ <sort_order>1</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ </info>
27
+ <apiSettings translate="label">
28
+ <label>API Settings</label>
29
+ <frontend_type>text</frontend_type>
30
+ <expanded>false</expanded>
31
+ <sort_order>2</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ <fields>
36
+ <apikey translate="label">
37
+ <label>API Key</label>
38
+ <frontend_type>text</frontend_type>
39
+ <comment><![CDATA[Paste LoginRadius API Key here. To get the API Key, login to <a href="http://www.loginradius.com" target="_blank">LoginRadius</a>]]></comment>
40
+ <sort_order>3</sort_order>
41
+ <show_in_default>14</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>1</show_in_store>
44
+ </apikey>
45
+ <apisecret translate="label">
46
+ <label>API Secret</label>
47
+ <frontend_type>text</frontend_type>
48
+ <comment><![CDATA[Paste LoginRadius API Secret here. To get the API Secret, login to <a href="http://www.loginradius.com" target="_blank">LoginRadius</a>]]></comment>
49
+ <sort_order>15</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>1</show_in_website>
52
+ <show_in_store>1</show_in_store>
53
+ </apisecret>
54
+ </fields>
55
+ </apiSettings>
56
+ <basicSettings translate="label">
57
+ <label>Social Login Basic Settings</label>
58
+ <frontend_type>text</frontend_type>
59
+ <sort_order>3</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
+ <expanded>false</expanded>
64
+ <fields>
65
+ <heading_example translate="label">
66
+ <label>Redirection Settings</label>
67
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
68
+ <sort_order>14</sort_order>
69
+ <show_in_default>1</show_in_default>
70
+ <show_in_website>1</show_in_website>
71
+ <show_in_store>0</show_in_store>
72
+ </heading_example>
73
+
74
+ <redirectAfterLogin translate="label">
75
+ <label>Redirection settings after login</label>
76
+ <frontend_type>select</frontend_type>
77
+ <source_model>sociallogin/source_uihover</source_model>
78
+ <sort_order>15</sort_order>
79
+ <show_in_default>1</show_in_default>
80
+ <show_in_website>1</show_in_website>
81
+ <show_in_store>1</show_in_store>
82
+ </redirectAfterLogin>
83
+ <customUrlLogin translate="label">
84
+ <label></label>
85
+ <frontend_type>text</frontend_type>
86
+ <sort_order>16</sort_order>
87
+ <show_in_default>1</show_in_default>
88
+ <show_in_website>1</show_in_website>
89
+ <show_in_store>1</show_in_store>
90
+ </customUrlLogin>
91
+
92
+ <redirectAfterRegistration translate="label">
93
+ <label>Redirection settings after registration</label>
94
+ <frontend_type>select</frontend_type>
95
+ <source_model>sociallogin/source_uihover</source_model>
96
+ <sort_order>17</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
+ </redirectAfterRegistration>
101
+
102
+ <customUrlRegistration translate="label">
103
+ <label></label>
104
+ <frontend_type>text</frontend_type>
105
+ <sort_order>18</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
+ </customUrlRegistration>
110
+
111
+ </fields>
112
+ </basicSettings>
113
+ <advancedSettings translate="label">
114
+ <label>Social Login Advanced Settings</label>
115
+ <frontend_type>text</frontend_type>
116
+ <sort_order>4</sort_order>
117
+ <show_in_default>1</show_in_default>
118
+ <show_in_website>1</show_in_website>
119
+ <show_in_store>1</show_in_store>
120
+ <fields>
121
+ <interface_customization translate="label">
122
+ <label>Social Login Interface Customization</label>
123
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
124
+ <sort_order>14</sort_order>
125
+ <show_in_default>1</show_in_default>
126
+ <show_in_website>1</show_in_website>
127
+ <show_in_store>0</show_in_store>
128
+ </interface_customization>
129
+ <loginradius_title translate="label">
130
+ <label>Title</label>
131
+ <frontend_type>text</frontend_type>
132
+ <comment><![CDATA[Text displayed above Social login Interface]]></comment>
133
+ <sort_order>15</sort_order>
134
+ <show_in_default>1</show_in_default>
135
+ <show_in_website>1</show_in_website>
136
+ <show_in_store>1</show_in_store>
137
+ </loginradius_title>
138
+
139
+ <iconSize translate="label">
140
+ <label>Social Login icons size</label>
141
+ <frontend_type>select</frontend_type>
142
+ <comment><![CDATA[Select the icon size to use in the Social Login interface.]]></comment>
143
+ <source_model>sociallogin/source_iconsize</source_model>
144
+ <sort_order>16</sort_order>
145
+ <show_in_default>1</show_in_default>
146
+ <show_in_website>1</show_in_website>
147
+ <show_in_store>1</show_in_store>
148
+ </iconSize>
149
+ <iconsPerRow translate="label">
150
+ <label>Social Login icons per row</label>
151
+ <frontend_type>text</frontend_type>
152
+ <comment><![CDATA[How many social icons would you like to be displayed per row?]]></comment>
153
+ <sort_order>17</sort_order>
154
+ <show_in_default>1</show_in_default>
155
+ <show_in_website>1</show_in_website>
156
+ <show_in_store>1</show_in_store>
157
+ </iconsPerRow>
158
+ <backgroundColor translate="label">
159
+ <label>Background Color</label>
160
+ <frontend_type>text</frontend_type>
161
+ <comment><![CDATA[What background color would you like to use for the Social Login interface? (Leave empty for transparent. You can enter hexa-decimal code of the color as well as name of the color (in English language and small letters).)]]></comment>
162
+ <sort_order>18</sort_order>
163
+ <show_in_default>1</show_in_default>
164
+ <show_in_website>1</show_in_website>
165
+ <show_in_store>1</show_in_store>
166
+ </backgroundColor>
167
+
168
+ <interface_display translate="label">
169
+ <label>Social Login Interface Display Settings</label>
170
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
171
+ <sort_order>19</sort_order>
172
+ <show_in_default>1</show_in_default>
173
+ <show_in_website>1</show_in_website>
174
+ <show_in_store>0</show_in_store>
175
+ </interface_display>
176
+
177
+ <showdefault translate="label">
178
+ <label>Show Social Login interface in right side panel</label>
179
+ <frontend_type>select</frontend_type>
180
+ <comment><![CDATA[Select No, if you don't want to display module in right panel. You can also set widget in pages or any area of your site.]]></comment>
181
+ <source_model>adminhtml/system_config_source_yesno</source_model>
182
+ <sort_order>20</sort_order>
183
+ <show_in_default>1</show_in_default>
184
+ <show_in_website>1</show_in_website>
185
+ <show_in_store>1</show_in_store>
186
+ </showdefault>
187
+ <aboveLogin translate="label comment">
188
+ <label>Show Social Login interface above login form</label>
189
+ <frontend_type>select</frontend_type>
190
+ <comment><![CDATA[Select 'Yes' to enable Social Login interface above login form.]]></comment>
191
+ <source_model>adminhtml/system_config_source_yesno</source_model>
192
+ <sort_order>21</sort_order>
193
+ <show_in_default>1</show_in_default>
194
+ <show_in_website>1</show_in_website>
195
+ <show_in_store>1</show_in_store>
196
+ </aboveLogin>
197
+ <belowLogin translate="label comment">
198
+ <label>Show Social Login interface below login form</label>
199
+ <frontend_type>select</frontend_type>
200
+ <comment><![CDATA[Select 'Yes' to enable Social Login interface below login form.]]></comment>
201
+ <source_model>adminhtml/system_config_source_yesno</source_model>
202
+ <sort_order>22</sort_order>
203
+ <show_in_default>1</show_in_default>
204
+ <show_in_website>1</show_in_website>
205
+ <show_in_store>1</show_in_store>
206
+ </belowLogin>
207
+ <aboveRegister translate="label comment">
208
+ <label>Show Social Login interface above registration form</label>
209
+ <frontend_type>select</frontend_type>
210
+ <comment><![CDATA[Select 'Yes' to enable Social Login interface above registration form.]]></comment>
211
+ <source_model>adminhtml/system_config_source_yesno</source_model>
212
+ <sort_order>23</sort_order>
213
+ <show_in_default>1</show_in_default>
214
+ <show_in_website>1</show_in_website>
215
+ <show_in_store>1</show_in_store>
216
+ </aboveRegister>
217
+ <belowRegister translate="label">
218
+ <label>Show Social Login interface below registration form</label>
219
+ <frontend_type>select</frontend_type>
220
+ <comment><![CDATA[Select 'Yes' to enable Social Login interface below registration form.]]></comment>
221
+ <source_model>adminhtml/system_config_source_yesno</source_model>
222
+ <sort_order>24</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
+ </belowRegister>
227
+
228
+ <email_settings translate="label">
229
+ <label>Social Login Email Settings</label>
230
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
231
+ <sort_order>25</sort_order>
232
+ <show_in_default>1</show_in_default>
233
+ <show_in_website>1</show_in_website>
234
+ <show_in_store>0</show_in_store>
235
+ </email_settings>
236
+
237
+ <emailrequired translate="label">
238
+ <label>Email Required</label>
239
+ <frontend_type>select</frontend_type>
240
+ <comment><![CDATA[A few Social Networks do not supply user email address as part of user profile data. Do you want users to provide their email before completing the registration process?]]></comment>
241
+ <source_model>adminhtml/system_config_source_yesno</source_model>
242
+ <sort_order>26</sort_order>
243
+ <show_in_default>1</show_in_default>
244
+ <show_in_website>1</show_in_website>
245
+ <show_in_store>1</show_in_store>
246
+ </emailrequired>
247
+ <verificationText translate="label">
248
+ <label>Email verification message</label>
249
+ <frontend_type>textarea</frontend_type>
250
+ <comment><![CDATA[This message will be used in verification email.]]></comment>
251
+ <sort_order>27</sort_order>
252
+ <show_in_default>1</show_in_default>
253
+ <show_in_website>1</show_in_website>
254
+ <show_in_store>1</show_in_store>
255
+ </verificationText>
256
+ <popupText translate="label">
257
+ <label>"Email required" - Popup title</label>
258
+ <frontend_type>text</frontend_type>
259
+ <comment><![CDATA[This text will be displayed on "Email required" popup.]]></comment>
260
+ <sort_order>28</sort_order>
261
+ <show_in_default>1</show_in_default>
262
+ <show_in_website>1</show_in_website>
263
+ <show_in_store>1</show_in_store>
264
+ </popupText>
265
+ <popupError translate="label">
266
+ <label>Error message</label>
267
+ <frontend_type>text</frontend_type>
268
+ <comment><![CDATA[This text will be displayed on the popup if the entered email is already registered or invalid.]]></comment>
269
+ <sort_order>29</sort_order>
270
+ <show_in_default>1</show_in_default>
271
+ <show_in_website>1</show_in_website>
272
+ <show_in_store>1</show_in_store>
273
+ </popupError>
274
+ <notifyUser translate="label">
275
+ <label>Enable registration notification to user</label>
276
+ <frontend_type>select</frontend_type>
277
+ <comment><![CDATA[Send email to newly registered customer regarding login credentials.]]></comment>
278
+ <source_model>adminhtml/system_config_source_yesno</source_model>
279
+ <sort_order>30</sort_order>
280
+ <show_in_default>1</show_in_default>
281
+ <show_in_website>1</show_in_website>
282
+ <show_in_store>1</show_in_store>
283
+ </notifyUser>
284
+ <notifyUserText translate="label">
285
+ <label>User notification email message</label>
286
+ <frontend_type>textarea</frontend_type>
287
+ <comment><![CDATA[This message will be sent to user in notification email along with login credentials. If left empty, default message will be sent.]]></comment>
288
+ <sort_order>31</sort_order>
289
+ <show_in_default>1</show_in_default>
290
+ <show_in_website>1</show_in_website>
291
+ <show_in_store>1</show_in_store>
292
+ </notifyUserText>
293
+ <notifyAdmin translate="label">
294
+ <label>Enable registration notification to owner</label>
295
+ <frontend_type>select</frontend_type>
296
+ <comment><![CDATA[Send email to store owner on new customer registration regarding customer details.]]></comment>
297
+ <source_model>adminhtml/system_config_source_yesno</source_model>
298
+ <sort_order>32</sort_order>
299
+ <show_in_default>1</show_in_default>
300
+ <show_in_website>1</show_in_website>
301
+ <show_in_store>1</show_in_store>
302
+ </notifyAdmin>
303
+ <notifyAdminText translate="label">
304
+ <label>Owner notification email message</label>
305
+ <frontend_type>textarea</frontend_type>
306
+ <comment><![CDATA[This message will be sent to admin in notification email.]]></comment>
307
+ <sort_order>33</sort_order>
308
+ <show_in_default>1</show_in_default>
309
+ <show_in_website>1</show_in_website>
310
+ <show_in_store>1</show_in_store>
311
+ </notifyAdminText>
312
+
313
+ <user_settings translate="label">
314
+ <label>Social Login User Settings</label>
315
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
316
+ <sort_order>34</sort_order>
317
+ <show_in_default>1</show_in_default>
318
+ <show_in_website>1</show_in_website>
319
+ <show_in_store>0</show_in_store>
320
+ </user_settings>
321
+
322
+ <profileFieldsRequired translate="label">
323
+ <label>Profile Fields Required</label>
324
+ <frontend_type>select</frontend_type>
325
+ <comment><![CDATA[Ask the required Magento User Profile fields in a popup when user registers through Social Login.]]></comment>
326
+ <source_model>adminhtml/system_config_source_yesno</source_model>
327
+ <sort_order>35</sort_order>
328
+ <show_in_default>1</show_in_default>
329
+ <show_in_website>1</show_in_website>
330
+ <show_in_store>1</show_in_store>
331
+ </profileFieldsRequired>
332
+ <updateProfileData translate="label">
333
+ <label>Update Profile Data</label>
334
+ <frontend_type>select</frontend_type>
335
+ <comment><![CDATA[Select yes to update user profile details in your Magento website, every time user logs into your website.]]></comment>
336
+ <source_model>adminhtml/system_config_source_yesno</source_model>
337
+ <sort_order>36</sort_order>
338
+ <show_in_default>1</show_in_default>
339
+ <show_in_website>1</show_in_website>
340
+ <show_in_store>1</show_in_store>
341
+ </updateProfileData>
342
+
343
+ <socialLinking translate="label">
344
+ <label>Social Linking</label>
345
+ <frontend_type>select</frontend_type>
346
+ <comment><![CDATA[Link existing user accounts with Social Login.]]></comment>
347
+ <source_model>adminhtml/system_config_source_yesno</source_model>
348
+ <sort_order>37</sort_order>
349
+ <show_in_default>1</show_in_default>
350
+ <show_in_website>1</show_in_website>
351
+ <show_in_store>1</show_in_store>
352
+ </socialLinking>
353
+ <debugMode translate="label">
354
+ <label>Enable Debugging</label>
355
+ <frontend_type>select</frontend_type>
356
+ <comment><![CDATA[If your customers are not able to login, Please enable debug mode to display errors.]]></comment>
357
+ <source_model>adminhtml/system_config_source_yesno</source_model>
358
+ <sort_order>38</sort_order>
359
+ <show_in_default>1</show_in_default>
360
+ <show_in_website>1</show_in_website>
361
+ <show_in_store>1</show_in_store>
362
+ </debugMode>
363
+ </fields>
364
+ </advancedSettings>
365
+ <horizontalSharing translate="label">
366
+ <label>Horizontal Social Sharing</label>
367
+ <frontend_type>text</frontend_type>
368
+ <sort_order>5</sort_order>
369
+ <show_in_default>1</show_in_default>
370
+ <show_in_website>1</show_in_website>
371
+ <show_in_store>1</show_in_store>
372
+ <fields>
373
+ <horizontalShareEnable translate="label">
374
+ <label>Enable Horizontal Social Sharing</label>
375
+ <frontend_type>select</frontend_type>
376
+ <source_model>adminhtml/system_config_source_yesno</source_model>
377
+ <sort_order>14</sort_order>
378
+ <show_in_default>1</show_in_default>
379
+ <show_in_website>1</show_in_website>
380
+ <show_in_store>1</show_in_store>
381
+ </horizontalShareEnable>
382
+
383
+
384
+ <horizontalSharingTheme translate="label">
385
+ <label>Choose a theme</label>
386
+ <frontend_type>radios</frontend_type>
387
+ <source_model>sociallogin/source_HorizontalSharing</source_model>
388
+ <sort_order>15</sort_order>
389
+ <show_in_default>1</show_in_default>
390
+ <show_in_website>1</show_in_website>
391
+ <show_in_store>1</show_in_store>
392
+ </horizontalSharingTheme>
393
+ <horizontalSharingProviders translate="label">
394
+ <label>Sharing Providers</label>
395
+ <frontend_type>checkboxes</frontend_type>
396
+ <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>
397
+ <sort_order>16</sort_order>
398
+ <show_in_default>1</show_in_default>
399
+ <show_in_website>1</show_in_website>
400
+ <show_in_store>1</show_in_store>
401
+ </horizontalSharingProviders>
402
+ <horizontalSharingProvidersHidden translate="label">
403
+ <label>Rearrange Icons</label>
404
+ <frontend_type>hidden</frontend_type>
405
+ <sort_order>17</sort_order>
406
+ <show_in_default>1</show_in_default>
407
+ <show_in_website>1</show_in_website>
408
+ <show_in_store>1</show_in_store>
409
+ </horizontalSharingProvidersHidden>
410
+ <horizontalCounterProviders translate="label">
411
+ <label>Sharing Providers</label>
412
+ <frontend_type>checkboxes</frontend_type>
413
+ <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>
414
+ <sort_order>18</sort_order>
415
+ <show_in_default>1</show_in_default>
416
+ <show_in_website>1</show_in_website>
417
+ <show_in_store>1</show_in_store>
418
+ </horizontalCounterProviders>
419
+ <horizontalCounterProvidersHidden translate="label">
420
+ <label>Rearrange Icons</label>
421
+ <frontend_type>hidden</frontend_type>
422
+ <sort_order>19</sort_order>
423
+ <show_in_default>1</show_in_default>
424
+ <show_in_website>1</show_in_website>
425
+ <show_in_store>1</show_in_store>
426
+ </horizontalCounterProvidersHidden>
427
+ <horizontalShareProduct translate="label">
428
+ <label>Show Social Sharing Interface at Product Pages</label>
429
+ <frontend_type>select</frontend_type>
430
+ <source_model>adminhtml/system_config_source_yesno</source_model>
431
+ <sort_order>20</sort_order>
432
+ <show_in_default>1</show_in_default>
433
+ <show_in_website>1</show_in_website>
434
+ <show_in_store>1</show_in_store>
435
+ </horizontalShareProduct>
436
+ <horizontalShareSuccess translate="label">
437
+ <label>Enable Social Sharing at Checkout Success Page</label>
438
+ <frontend_type>select</frontend_type>
439
+ <source_model>adminhtml/system_config_source_yesno</source_model>
440
+ <sort_order>21</sort_order>
441
+ <show_in_default>1</show_in_default>
442
+ <show_in_website>1</show_in_website>
443
+ <show_in_store>1</show_in_store>
444
+ </horizontalShareSuccess>
445
+ </fields>
446
+ </horizontalSharing>
447
+ <verticalSharing translate="label">
448
+ <label>Vertical Social Sharing</label>
449
+ <frontend_type>text</frontend_type>
450
+ <sort_order>6</sort_order>
451
+ <show_in_default>1</show_in_default>
452
+ <show_in_website>1</show_in_website>
453
+ <show_in_store>1</show_in_store>
454
+ <fields>
455
+ <verticalShareEnable translate="label">
456
+ <label>Enable Vertical Social Sharing</label>
457
+ <frontend_type>select</frontend_type>
458
+ <source_model>adminhtml/system_config_source_yesno</source_model>
459
+ <sort_order>14</sort_order>
460
+ <show_in_default>1</show_in_default>
461
+ <show_in_website>1</show_in_website>
462
+ <show_in_store>1</show_in_store>
463
+ </verticalShareEnable>
464
+
465
+ <verticalSharingTheme translate="label">
466
+ <label>Choose a theme</label>
467
+ <frontend_type>radios</frontend_type>
468
+ <source_model>sociallogin/source_VerticalSharing</source_model>
469
+ <sort_order>15</sort_order>
470
+ <show_in_default>1</show_in_default>
471
+ <show_in_website>1</show_in_website>
472
+ <show_in_store>1</show_in_store>
473
+ </verticalSharingTheme>
474
+ <verticalAlignment translate="label">
475
+ <label>Alignment</label>
476
+ <frontend_type>select</frontend_type>
477
+ <comment><![CDATA[Select the position of the Social Counter widget with respect to page]]></comment>
478
+ <source_model>sociallogin/source_SharingVerticalAlignment</source_model>
479
+ <sort_order>16</sort_order>
480
+ <show_in_default>1</show_in_default>
481
+ <show_in_website>1</show_in_website>
482
+ <show_in_store>1</show_in_store>
483
+ </verticalAlignment>
484
+
485
+ <verticalSharingProviders translate="label">
486
+ <label>Sharing Providers</label>
487
+ <frontend_type>checkboxes</frontend_type>
488
+ <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>
489
+ <sort_order>17</sort_order>
490
+ <show_in_default>1</show_in_default>
491
+ <show_in_website>1</show_in_website>
492
+ <show_in_store>1</show_in_store>
493
+ </verticalSharingProviders>
494
+ <verticalSharingProvidersHidden translate="label">
495
+ <label>Rearrange Icons</label>
496
+ <frontend_type>hidden</frontend_type>
497
+ <sort_order>18</sort_order>
498
+ <show_in_default>1</show_in_default>
499
+ <show_in_website>1</show_in_website>
500
+ <show_in_store>1</show_in_store>
501
+ </verticalSharingProvidersHidden>
502
+ <verticalCounterProviders translate="label">
503
+ <label>Sharing Providers</label>
504
+ <frontend_type>checkboxes</frontend_type>
505
+ <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>
506
+ <sort_order>19</sort_order>
507
+ <show_in_default>1</show_in_default>
508
+ <show_in_website>1</show_in_website>
509
+ <show_in_store>1</show_in_store>
510
+ </verticalCounterProviders>
511
+ <verticalCounterProvidersHidden translate="label">
512
+ <label>Rearrange Icons</label>
513
+ <frontend_type>hidden</frontend_type>
514
+ <sort_order>20</sort_order>
515
+ <show_in_default>1</show_in_default>
516
+ <show_in_website>1</show_in_website>
517
+ <show_in_store>1</show_in_store>
518
+ </verticalCounterProvidersHidden>
519
+ <verticalShareProduct translate="label">
520
+ <label>Show Social Sharing Interface at Product Pages</label>
521
+ <frontend_type>select</frontend_type>
522
+ <source_model>adminhtml/system_config_source_yesno</source_model>
523
+ <sort_order>21</sort_order>
524
+ <show_in_default>1</show_in_default>
525
+ <show_in_website>1</show_in_website>
526
+ <show_in_store>1</show_in_store>
527
+ </verticalShareProduct>
528
+ <verticalShareSuccess translate="label">
529
+ <label>Enable Social Sharing at Checkout Success Page</label>
530
+ <frontend_type>select</frontend_type>
531
+ <source_model>adminhtml/system_config_source_yesno</source_model>
532
+ <sort_order>22</sort_order>
533
+ <show_in_default>1</show_in_default>
534
+ <show_in_website>1</show_in_website>
535
+ <show_in_store>1</show_in_store>
536
+ </verticalShareSuccess>
537
+ </fields>
538
+ </verticalSharing>
539
+ </groups>
540
+ </sociallogin_options>
541
+ </sections>
542
  </config>
app/code/community/Loginradius/Sociallogin/sql/sociallogin_setup/{mysql4-install-3.7.1.php → mysql4-install-4.0.0.php} RENAMED
@@ -1,7 +1,8 @@
1
  <?php
2
  $installer = $this;
3
  $installer->startSetup();
4
- $installer->run("
 
5
  DROP TABLE IF EXISTS {$this->getTable('sociallogin')};
6
  CREATE TABLE IF NOT EXISTS {$this->getTable('sociallogin')} (
7
  `sociallogin_id` varchar(200) default NULL,
@@ -11,5 +12,6 @@ CREATE TABLE IF NOT EXISTS {$this->getTable('sociallogin')} (
11
  `vkey` varchar(40) default NULL,
12
  `provider` varchar(20) default NULL
13
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
14
- ");
 
15
  $installer->endSetup();
1
  <?php
2
  $installer = $this;
3
  $installer->startSetup();
4
+ $installer->run(
5
+ "
6
  DROP TABLE IF EXISTS {$this->getTable('sociallogin')};
7
  CREATE TABLE IF NOT EXISTS {$this->getTable('sociallogin')} (
8
  `sociallogin_id` varchar(200) default NULL,
12
  `vkey` varchar(40) default NULL,
13
  `provider` varchar(20) default NULL
14
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
15
+ "
16
+ );
17
  $installer->endSetup();
app/code/community/Loginradius/Sociallogin/sql/sociallogin_setup/mysql4-upgrade-3.7.1-4.0.0.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run(
5
+ "
6
+ CREATE TABLE IF NOT EXISTS {$this->getTable('sociallogin')} (
7
+ `sociallogin_id` varchar(200) default NULL,
8
+ `entity_id` int(11) default NULL,
9
+ `avatar` varchar(1000) default NULL,
10
+ `verified` enum('0','1') default NULL,
11
+ `vkey` varchar(40) default NULL,
12
+ `provider` varchar(20) default NULL
13
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
14
+ "
15
+ );
16
+ $installer->endSetup();
app/code/community/Loginradius/Sociallogin/sql/sociallogin_setup/mysql4-upgrade-3.7.2-4.0.0.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+ $installer->run(
5
+ "
6
+ CREATE TABLE IF NOT EXISTS {$this->getTable('sociallogin')} (
7
+ `sociallogin_id` varchar(200) default NULL,
8
+ `entity_id` int(11) default NULL,
9
+ `avatar` varchar(1000) default NULL,
10
+ `verified` enum('0','1') default NULL,
11
+ `vkey` varchar(40) default NULL,
12
+ `provider` varchar(20) default NULL
13
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
14
+ "
15
+ );
16
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/loginradius_sociallogin.xml CHANGED
@@ -1,11 +1,11 @@
1
  <?xml version="1.0"?>
2
- <layout version="3.7.1">
3
- <default>
4
- <reference name="head">
5
- <action method="addJs"><script>../skin/frontend/base/default/Loginradius/Sociallogin/js/jquery.js</script></action>
6
- <action method="addJs"><script>../skin/frontend/base/default/Loginradius/Sociallogin/js/jquery.ui.sortable.min.js</script></action>
7
- <action method="addJs"><script>../skin/frontend/base/default/Loginradius/Sociallogin/js/admin-ui.js</script></action>
8
- <action method="addCss"><script>../../../frontend/base/default/Loginradius/Sociallogin/css/admin-ui.css</script></action>
9
- </reference>
10
- </default>
11
- </layout>
1
  <?xml version="1.0"?>
2
+ <layout version="4.0.0">
3
+ <adminhtml_system_config_edit>
4
+ <reference name="head">
5
+ <action method="addJs"><script>../skin/adminhtml/default/default/Loginradius/Sociallogin/js/jquery.js</script></action>
6
+ <action method="addJs"><script>../skin/adminhtml/default/default/Loginradius/Sociallogin/js/jquery.ui.sortable.min.js</script></action>
7
+ <action method="addJs"><script>../skin/adminhtml/default/default/Loginradius/Sociallogin/js/admin-ui.js</script></action>
8
+ <action method="addCss"><script>../../../adminhtml/default/default/Loginradius/Sociallogin/css/admin-ui.css</script></action>
9
+ </reference>
10
+ </adminhtml_system_config_edit>
11
+ </layout>
app/design/frontend/base/default/layout/sociallogin.xml ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="4.0.0">
3
+ <default>
4
+ <reference name="right">
5
+ <block type="sociallogin/sociallogin" name="sociallogin" template="sociallogin/sociallogin.phtml" before="-"/>
6
+ </reference>
7
+ <reference name="head">
8
+ <block type="sociallogin/socialsharing" name="socialshare_head" template="sociallogin/socialshare_head.phtml"/>
9
+ <block type="sociallogin/sociallogin" name="sociallogin_head" template="sociallogin/sociallogin_head.phtml"/>
10
+ </reference>
11
+
12
+ <reference name="content">
13
+ <block type="sociallogin/sociallogin" name="sociallogin_popup" template="sociallogin/popupscript.phtml" before="-"/>
14
+
15
+ </reference>
16
+
17
+ </default>
18
+ <catalog_product_view>
19
+ <reference name="alert.urls">
20
+ <block type="sociallogin/sociallogin" name="socialshareproduct" template="sociallogin/socialshareproduct.phtml" before="-"/>
21
+ </reference>
22
+ </catalog_product_view>
23
+ <customer_account_login>
24
+ <reference name="content">
25
+ <block type="sociallogin/sociallogin" name="lrabovelogin" template="sociallogin/abovelogin.phtml" before="-"/>
26
+ <block type="sociallogin/sociallogin" name="lrbelowlogin" template="sociallogin/belowlogin.phtml"/>
27
+ </reference>
28
+ </customer_account_login>
29
+ <customer_account_create>
30
+ <reference name="content">
31
+ <block type="sociallogin/sociallogin" name="lrbelowregister" template="sociallogin/belowregister.phtml"/>
32
+ <block type="sociallogin/sociallogin" name="lraboveregister" template="sociallogin/aboveregister.phtml" before="-"/>
33
+ </reference>
34
+
35
+ </customer_account_create>
36
+ <customer_account_index>
37
+ <reference name="content">
38
+ <block type="sociallogin/sociallogin" name="sociallinking" after="-" template="sociallogin/linking.phtml"/>
39
+ </reference>
40
+ </customer_account_index>
41
+ <checkout_onepage_success>
42
+ <reference name="content">
43
+ <block type="sociallogin/sociallogin" name="checkoutsuccessshare" template="sociallogin/socialsharesuccess.phtml" before="-"/>
44
+ </reference>
45
+ </checkout_onepage_success>
46
+ </layout>
app/design/frontend/base/default/template/sociallogin/abovelogin.phtml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ if (!$this->user_is_already_login() && $this->getAboveLogin() == '1') {
3
+ $this->getSocialLoginContainer();
4
+ }
5
+ ?>
6
+
app/design/frontend/base/default/template/sociallogin/aboveregister.phtml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ if( !$this->user_is_already_login() && $this->getAboveRegister() == '1' ){
3
+ $this->getSocialLoginContainer();
4
+ }
5
+ ?>
app/design/frontend/base/default/template/sociallogin/belowlogin.phtml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ if( !$this->user_is_already_login() && $this->getBelowLogin() == '1' ){
3
+ $this->getSocialLoginContainer();
4
+ }
5
+ ?>
app/design/frontend/base/default/template/sociallogin/belowregister.phtml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ if( !$this->user_is_already_login() && $this->getBelowRegister() == '1' ){
3
+ $this->getSocialLoginContainer();
4
+ }
5
+ ?>
app/design/frontend/base/default/template/sociallogin/linking.phtml ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="dashboard">
2
+ <div class="box-account box-info">
3
+ <div class="box-head">
4
+ <h2>Login Radius</h2>
5
+ </div>
6
+ <div class="col2-set">
7
+ <div class="col-1">
8
+ <div class="box">
9
+ <div class="box-title">
10
+ <h3><?php echo __('Linked Accounts') ?></h3>
11
+ </div>
12
+ <div class="box-content">
13
+ <?php
14
+
15
+ // get logged in user's id
16
+ $loginRadiusUserId = Mage::getSingleton("customer/session")->getCustomer()->getId();
17
+
18
+ // list the linked accounts
19
+ $loginRadiusConn = Mage::getSingleton('core/resource')->getConnection('core_read');
20
+ $loginRadiusQuery = "select sociallogin_id, entity_id, provider from " . Mage::getSingleton('core/resource')->getTableName('sociallogin') . " where entity_id = " . $loginRadiusUserId;
21
+ $loginRadiusQueryHandle = $loginRadiusConn->query($loginRadiusQuery);
22
+ $loginRadiusResult = $loginRadiusQueryHandle->fetchAll();
23
+
24
+ // unlink account
25
+ if (isset($_GET['LoginRadiusUnlink']) && trim($_GET['LoginRadiusUnlink']) != "") {
26
+ $session = Mage::getSingleton('customer/session');
27
+ if(count($loginRadiusResult) == 1){
28
+ $session->addError(__('This Account can\'t be removed.'));
29
+ header("Location:" . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) . "customer/account");
30
+ die;
31
+ }
32
+ $loginRadiusConn = Mage::getSingleton('core/resource')->getConnection('core_write');
33
+ try {
34
+ // delete query magento way
35
+ $loginRadiusConn->delete(
36
+ Mage::getSingleton('core/resource')->getTableName('sociallogin'), array('entity_id = ?' => $loginRadiusUserId, 'sociallogin_id = ?' => trim($_GET['LoginRadiusUnlink']))
37
+ );
38
+ } catch (Exception $e) {
39
+
40
+ }
41
+ $session->addSuccess(__('Account removed successfully.'));
42
+ header("Location:" . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) . "customer/account");
43
+ die;
44
+ }
45
+ if (count($loginRadiusResult) > 0) {
46
+ $loginRadiusSessionSocialId = Mage::getSingleton("customer/session")->getloginRadiusId();
47
+ foreach ($loginRadiusResult as $result) {
48
+ if ($result["provider"] != null || $result["provider"] != "") {
49
+ echo '<div style="float:left">';
50
+ if (Mage::getSingleton("customer/session")->getloginRadiusId() == $result["sociallogin_id"]) {
51
+ echo '<div style="float:left"><span style="color:green; padding-right:4px;">' . __("Currently") . ' </span></div>';
52
+ }
53
+ echo '<div style="float:left;"><span>';
54
+ echo __('Connected with') . '</span></div><div style="float:left; padding-left:4px;"><img alt="' . ucfirst($result['provider']) . '" title="' . ucfirst($result['provider']) . '" src="' . Mage::getDesign()->getSkinUrl("Loginradius" . DS . "Sociallogin" . DS . "images" . DS . "Linking" . DS . $result["provider"] . '.png', array('_area' => 'frontend')) . '" /></div>' . '</div>';
55
+ if(count($loginRadiusResult) != 1){
56
+ echo '<div style="float:right"><a href="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) . 'customer/account/?LoginRadiusUnlink=' . $result["sociallogin_id"] . '" title="' . __('Unlink this ID from your account') . '">' . __('Remove') . '</a></div>';
57
+ }
58
+ echo '<br /><div style="clear:both"></div>';
59
+ }
60
+ }
61
+ }
62
+ ?>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ <div class="col-2">
67
+ <div class="box">
68
+ <div class="box-title">
69
+ <h3><?php echo __('Link Social IDs to your Magento Account') ?></h3>
70
+ </div>
71
+ <div class="box-content">
72
+ <div class="interfacecontainerdiv" style="margin-left:10px"></div>
73
+ </div>
74
+ </div>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </div>
app/design/frontend/base/default/template/sociallogin/popup.phtml ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // instantiate your controller, using the `Mage:app()` object to grab the required request and response
3
+ $controller = new Loginradius_Sociallogin_IndexController();
4
+ $socialLoginMsg = Mage::getSingleton('core/session')->getTmpPopupMsg();
5
+ $loginRadiusShowForm = Mage::getSingleton('core/session')->getTmpShowForm();
6
+ $profileData = Mage::getSingleton('core/session')->getTmpProfileData();
7
+ var_dump($profileData);
8
+ $emailRequired = Mage::getSingleton('core/session')->getTmpEmailRequired();
9
+ var_dump($emailRequired);
10
+ $hideZipcode = Mage::getSingleton('core/session')->getTmpHideZipcode();
11
+ $provider = isset($profileData['Provider'])?trim($profileData['Provider']):'';
12
+ $loginRadiusPopupTxt = str_replace('@provider', $provider, Mage::getSingleton('core/session')->getTmpPopupTxt());
13
+ $blockObj = new Loginradius_Sociallogin_Block_Sociallogin();
14
+ $popupTitle = $blockObj->getPopupText()
15
+ ?>
16
+ <div id="fade" class="LoginRadius_overlay">
17
+ <div id="popupouter">
18
+ <div id="popupinner">
19
+ <div style="width:100%; border-bottom: 1px solid #ccc;">
20
+ <div class="lr-popupheading" style="margin-bottom:5px;"><?php echo __(Mage::helper('core')->htmlEscape($popupTitle)); ?></div></div>
21
+ <?php if(!empty($socialLoginMsg)){?>
22
+ <div class="lr-error"><?php echo __(Mage::helper('core')->htmlEscape($socialLoginMsg)); ?></div>
23
+ <?php }
24
+ if ($loginRadiusShowForm) {
25
+ ?>
26
+ <form id="loginRadiusForm" method="post" action="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) . 'sociallogin' ?>" onSubmit="return loginRadiusValidateForm()">
27
+ <?php
28
+ if((!$blockObj->getProfileFieldsRequired() && $emailRequired) || isset($_POST[loginRadiusEmail]) || ($emailRequired && (isset($profileData['Email']) && empty($profileData['Email']))) || ($emailRequired && $blockObj->getEmailRequired() && isset($_POST['Email']))){
29
+ ?>
30
+ <div class="loginRadiusDiv">
31
+ <label for="loginRadiusEmail"><?php echo __("Email"); ?> *</label>
32
+ <input type="text" name="loginRadiusEmail" id="loginRadiusEmail" class="loginRadiusText"/>
33
+ </div>
34
+ <?php
35
+ }
36
+ if (isset($profileData['Address']) && $profileData['Address'] == "") {
37
+ ?>
38
+ <div class="loginRadiusDiv">
39
+ <label for="loginRadiusAddress"><?php echo __("Address"); ?> *</label>
40
+ <input type="text" name="loginRadiusAddress" id="loginRadiusAddress" class="loginRadiusText"/>
41
+ </div>
42
+ <?php
43
+ }
44
+ if (isset($profileData['City']) && $profileData['City'] == "") {
45
+ ?>
46
+ <div class="loginRadiusDiv">
47
+ <label for="loginRadiusCity"><?php echo __("City") ?> *</label>
48
+ <input type="text" name="loginRadiusCity" id="loginRadiusCity" class="loginRadiusText"/>
49
+ </div>
50
+ <?php
51
+ }
52
+ if (!$hideZipcode) {
53
+ ?>
54
+ <div class="loginRadiusDiv">
55
+ <label for="loginRadiusCountry"><?php echo __("Country"); ?> *</label>
56
+ <?php
57
+ $countries = Mage::getResourceModel('directory/country_collection')->loadData()->toOptionArray(false);
58
+ if (count($countries) > 0) {
59
+ ?>
60
+ <select onChange="if(this.value == 'US'){ document.getElementById('loginRadiusProvinceContainer').style.display = 'block' }else{ document.getElementById('loginRadiusProvinceContainer').style.display = 'none' }" name="loginRadiusCountry" id="loginRadiusCountry" class="loginRadiusText">
61
+ <option value="">-- <?php echo __("Please Select"); ?> --</option>
62
+ <?php foreach ($countries as $country): ?>
63
+ <option value="<?php echo $country['value'] ?>">
64
+ <?php echo $country['label'] ?>
65
+ </option>
66
+ <?php endforeach; ?>
67
+ </select>
68
+ </div>
69
+ <!-- United States province -->
70
+ <div style="display:none" id="loginRadiusProvinceContainer" class="loginRadiusDiv">
71
+ <label for="loginRadiusCountry"><?php echo __("State/Province") ?> *</label>
72
+ <select id="loginRadiusProvince" name="loginRadiusProvince" class="loginRadiusText">
73
+ <option value="" selected="selected">-- <?php echo __("Please Select"); ?>--</option>
74
+ <?php $states = array("Alabama","Alaska","American Samoa","Arizona","Arkansas","Armed Forces Africa","Armed Forces Americas","Armed Forces Canada","Armed Forces Europe","Armed Forces Middle East","Armed Forces Pacific","California","Colorado","Connecticut","Delaware","District of Columbia","Federated States Of Micronesia","Florida","Georgia","Guam","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Marshall Islands","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Northern Mariana Islands","Ohio","Oklahoma","Oregon","Palau","Pennsylvania","Puerto Rico","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virgin Islands","Virginia","Washington","West Virginia","Wisconsin","Wyoming");
75
+ foreach ($states as $key=>$value){
76
+ echo '<option value="'.$key.'">'.__($value).'</option>';
77
+ }
78
+ ?>
79
+ </select>
80
+ <?php
81
+ } else {
82
+ ?>
83
+ <input type="text" name="loginRadiusCountry" id="loginRadiusCountry" class="loginRadiusText"/>
84
+ <?php
85
+ }
86
+ ?>
87
+ </div>
88
+ <div class="loginRadiusDiv">
89
+ <label for="loginRadiusZipcode"><?php echo __("Zipcode") ?> *</label>
90
+ <input type="text" name="loginRadiusZipcode" id="loginRadiusZipcode" class="loginRadiusText"/>
91
+ </div>
92
+ <?php
93
+ }
94
+ if (isset($profileData['PhoneNumber']) && $profileData['PhoneNumber'] == "") {
95
+ ?>
96
+ <div class="loginRadiusDiv">
97
+ <label for="loginRadiusPhone"><?php echo __("Phone Number") ?> *</label>
98
+ <input type="text" name="loginRadiusPhone" id="loginRadiusPhone" class="loginRadiusText"/>
99
+ </div>
100
+ <?php
101
+ }
102
+ ?>
103
+ <div class="loginRadiusDiv">
104
+ <input type="submit" id="LoginRadiusRedSliderClick" name="LoginRadiusRedSliderClick" value="<?php echo __("Submit") ?>" onClick="loginRadiusPopupSubmit = true" class="inputbutton"/>
105
+ <input type="submit" value="<?php echo __("Cancel") ?>" class="inputbutton" name="LoginRadiusPopupCancel" onClick="loginRadiusPopupSubmit = false"/>
106
+ </div>
107
+ </form>
108
+ <?php
109
+ } else {
110
+ ?>
111
+ <input type="button" value="<?php echo __("Okay") ?>" class="inputbutton" onClick="location.href = '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK); ?>'"/>
112
+ <?php
113
+ }
114
+ ?>
115
+ </div>
116
+ </div>
117
+ </div>
app/design/frontend/base/default/template/sociallogin/popupscript.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ $this->getPopusScriptUrl();
3
+ ?>
app/design/frontend/base/default/template/sociallogin/sociallogin.phtml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $showdefault = $this->getShowDefault();
3
+ $ApiKey = trim($this->getApikey());
4
+ $ApiSecrete = trim($this->getApiSecret());
5
+ $loginRadiusTitle = trim($this->getLoginRadiusTitle());
6
+ $UserAuth = $this->getApiResult($ApiKey, $ApiSecrete);
7
+ if ($showdefault == 1) {
8
+ if ($this->user_is_already_login()) {
9
+ echo '<div class="block"><div class="block-title"><strong><span>' . __('Social Login') . '</span></strong></div><div class="block-content"><p class="empty">';
10
+
11
+ $userName = Mage::getSingleton('customer/session')->getCustomer()->getName();
12
+ if ($loginRadiusAvatar = trim($this->getAvatar(Mage::getSingleton('customer/session')->getCustomer()->getId()))
13
+ ) {
14
+ echo "<img style='float:left' width='50' height='50' src='" . $loginRadiusAvatar . "' />";
15
+ }
16
+ echo "<span style='clear:both; float:left'>" . __("Welcome") . "! $userName </span>";
17
+ echo '</p></div></div>';
18
+
19
+ } else {
20
+ $this->getSocialLoginContainer();
21
+ }
22
+
23
+ }
24
+ ?>
app/design/frontend/base/default/template/sociallogin/sociallogin_head.phtml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: nyaconcept
5
+ * Date: 11/18/14
6
+ * Time: 7:05 PM
7
+ */
8
+ $loc = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) . "sociallogin/";
9
+ if ($this->getLayout()->getBlock('head')->getTitle() == "Checkout") {
10
+ $loginRadiusCallback = $loc . "?loginradiuscheckout=1";
11
+ }
12
+ elseif ($this->getLayout()->getBlock('head')->getTitle() == "My Account") {
13
+ $loginRadiusCallback = $loc . "?loginRadiusLinking=1";
14
+ }
15
+ else {
16
+ $loginRadiusCallback = $loc . "?redirect_to=" . Mage::helper('core/url')->getCurrentUrl();
17
+ }
18
+ $scriptUrl = $this->getSkinUrl('Loginradius/Sociallogin/js/LoginRadiusSDK.2.0.0.js');
19
+ ?>
20
+ <script src="http://cdn.loginradius.com/hub/prod/v1/js/LoginRadius.1.0.js"></script>
21
+ <script src="<?php echo $scriptUrl; ?>"></script>
22
+
23
+ <script type="text/javascript">
24
+ var loginRadiusOptions = {};
25
+ loginRadiusOptions.login = true;
26
+ LoginRadius_SocialLogin.util.ready(function () {
27
+ $ui = LoginRadius_SocialLogin.lr_login_settings;
28
+ $ui.interfacesize = "<?php echo $this->iconSize() == 'small' ? 'small' : '' ?>";
29
+ <?php if (trim($this->iconsPerRow()) != '' && is_numeric($this->iconsPerRow())) {
30
+ echo '$ui.noofcolumns = ' . trim($this->iconsPerRow()) . ';';
31
+ } ?>
32
+ <?php if (trim($this->backgroundColor()) != '') {
33
+ echo '$ui.lrinterfacebackground = "' . trim($this->backgroundColor()) . '";';
34
+ } ?>
35
+ $ui.apikey = "<?php echo trim($this->getApikey()) ?>";
36
+ $ui.callback = "<?php echo $loginRadiusCallback ?>";
37
+ $ui.lrinterfacecontainer = "interfacecontainerdiv";
38
+ $ui.is_access_token = true;
39
+ LoginRadius_SocialLogin.init(loginRadiusOptions);
40
+ });
41
+ LoginRadiusSDK.setLoginCallback(function () {
42
+ var form = document.createElement('form');
43
+ form.action = "<?php echo urldecode($loginRadiusCallback); ?>";
44
+ form.method = 'POST';
45
+ var hiddenToken = document.createElement('input');
46
+ hiddenToken.type = 'hidden';
47
+ hiddenToken.value = LoginRadiusSDK.getToken();
48
+ hiddenToken.name = "token";
49
+ form.appendChild(hiddenToken);
50
+ document.body.appendChild(form);
51
+ form.submit();
52
+ });
53
+ </script>
app/design/frontend/base/default/template/sociallogin/sociallogincustom.phtml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ($this->user_is_already_login()) {
3
+ echo '<div class="block"><div class="block-title"><strong><span>' . __('Social Login') . '</span></strong></div><div class="block-content"><p class="empty">';
4
+
5
+ $userName = Mage::getSingleton('customer/session')->getCustomer()->getName();
6
+ if ($loginRadiusAvatar = trim($this->getAvatar(Mage::getSingleton('customer/session')->getCustomer()->getId()))
7
+ ) {
8
+ echo "<img style='float:left' width='50' height='50' src='" . $loginRadiusAvatar . "' />";
9
+ }
10
+ echo "<span style='clear:both; float:left'>" . __("Welcome") . "! $userName </span>";
11
+ echo '</p></div></div>';
12
+
13
+ } else {
14
+ $this->getSocialLoginContainer();
15
+ }
app/design/frontend/base/default/template/sociallogin/socialshare_head.phtml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $horizontalShareSettings = $this->getHorizontalSharingSettings();
3
+ $verticalShareSettings = $this->getVerticalSharingSettings();
4
+ $apiKey = Mage::getStoreConfig('sociallogin_options/apiSettings/apikey');
5
+ if ($horizontalShareSettings['horizontalShareEnable'] == "1" || $verticalShareSettings['verticalShareEnable'] == "1") {
6
+ $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">';
7
+
8
+ if ($horizontalShareSettings['horizontalShareEnable'] == "1") {
9
+ // check horizontal sharing enabled
10
+ $sharingScript .= $this->login_radius_sharing_get_sharing_script_horizontal($horizontalShareSettings, $apiKey);
11
+ }
12
+ if ($verticalShareSettings['verticalShareEnable'] == '1') {
13
+ // check vertical sharing enabled
14
+ $sharingScript .= $this->login_radius_sharing_get_sharing_script_vertical($verticalShareSettings, $apiKey);
15
+ }
16
+ $sharingScript .= '</script>';
17
+ echo $sharingScript;
18
+ }
app/design/frontend/base/default/template/sociallogin/socialshareproduct.phtml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ($this->horizontalShareEnable() == "1" && $this->horizontalShareProduct() == "1") {
4
+
5
+ echo '<div class="loginRadiusHorizontalSharing"></div>';
6
+ }
7
+ if ($this->verticalShareEnable() == "1" && $this->verticalShareProduct() == "1") {
8
+ echo '<div class="loginRadiusVerticalSharing"></div>';
9
+ }
10
+ ?>
app/design/frontend/base/default/template/sociallogin/socialsharesuccess.phtml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ($this->horizontalShareEnable() == "1" && $this->horizontalShareSuccess() == "1") {
3
+
4
+ echo '<div class="loginRadiusHorizontalSharing"></div>';
5
+ }
6
+ if ($this->verticalShareEnable() == "1" && $this->verticalShareSuccess() == "1") {
7
+ echo '<div class="loginRadiusVerticalSharing"></div>';
8
+ }
9
+ ?>
app/design/frontend/default/default/layout/sociallogin.xml DELETED
@@ -1,38 +0,0 @@
1
- <?xml version="1.0"?>
2
- <layout version="3.7.1">
3
- <default>
4
- <reference name="right">
5
- <block type="sociallogin/sociallogin" name="sociallogin" template="sociallogin/sociallogin.phtml" before="-" />
6
- </reference>
7
- <reference name="head">
8
- <block type="sociallogin/sociallogin" name="socialshare_head" template="sociallogin/socialshare_head.phtml" />
9
- </reference>
10
- </default>
11
- <catalog_product_view>
12
- <reference name="alert.urls">
13
- <block type="sociallogin/sociallogin" name="socialshareproduct" template="sociallogin/socialshareproduct.phtml" before="-" />
14
- </reference>
15
- </catalog_product_view>
16
- <customer_account_login>
17
- <reference name="content">
18
- <block type="sociallogin/sociallogin" name="lrabovelogin" template="sociallogin/abovelogin.phtml" before="-" />
19
- <block type="sociallogin/sociallogin" name="lrbelowlogin" template="sociallogin/belowlogin.phtml" />
20
- </reference>
21
- </customer_account_login>
22
- <customer_account_create>
23
- <reference name="content">
24
- <block type="sociallogin/sociallogin" name="lrbelowregister" template="sociallogin/belowregister.phtml" />
25
- <block type="sociallogin/sociallogin" name="lraboveregister" template="sociallogin/aboveregister.phtml" before="-" />
26
- </reference>
27
- </customer_account_create>
28
- <customer_account_index>
29
- <reference name="content">
30
- <block type="sociallogin/sociallogin" name="sociallinking" after="-" template="sociallogin/linking.phtml" />
31
- </reference>
32
- </customer_account_index>
33
- <checkout_onepage_success>
34
- <reference name="content">
35
- <block type="sociallogin/sociallogin" name="checkoutsuccessshare" template="sociallogin/socialsharesuccess.phtml" before="-" />
36
- </reference>
37
- </checkout_onepage_success>
38
- </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/template/sociallogin/abovelogin.phtml DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- if( $this->loginEnable() == "1" && !$this->user_is_already_login() ){
3
- $aboveLogin = $this->getAboveLogin();
4
- $ApiKey = trim($this->getApikey());
5
- $ApiSecrete = trim($this->getApiSecret());
6
- $loginRadiusTitle = trim( $this->getLoginRadiusTitle() );
7
- $UserAuth = $this->getApiResult($ApiKey, $ApiSecrete);
8
- if ($aboveLogin == 1) {
9
- echo '<div class="block" style="margin-top:15px"><div class="block-title"><strong><span>'.__('Social Login').'</span></strong></div><div class="block-content"><p class="empty">';
10
- if($ApiKey == "" && $ApiSecrete == ""){
11
- echo '<p style ="color:red;">'. $this -> __('To activate your plugin, please log in to LoginRadius and get API Key & Secret. Web') .': <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
12
- }elseif ($UserAuth == false) {
13
- echo '<p style ="color:red;">'. $this -> __('Your LoginRadius API Key and Secret is not valid, please correct it or contact LoginRadius support at') .' <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
14
- }
15
- else {
16
- echo '<div style="margin:5px"><div style="margin-bottom:5px">'.__(Mage::helper('core')->htmlEscape($loginRadiusTitle)).'</div><div class="interfacecontainerdiv"></div></div>';
17
- }
18
- echo '</p></div></div>';
19
- }
20
- }
21
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/template/sociallogin/aboveregister.phtml DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- if( $this->loginEnable() == "1" && !$this->user_is_already_login() ){
3
- $aboveRegister = $this->getAboveRegister();
4
- $ApiKey = trim($this->getApikey());
5
- $ApiSecrete = trim($this->getApiSecret());
6
- $loginRadiusTitle = trim( $this->getLoginRadiusTitle() );
7
- $UserAuth = $this->getApiResult($ApiKey, $ApiSecrete);
8
- if ($aboveRegister == 1) {
9
- echo '<div class="block" style="margin-top:15px"><div class="block-title"><strong><span>'.__('Social Login').'</span></strong></div><div class="block-content"><p class="empty">';
10
- if($ApiKey == "" && $ApiSecrete == ""){
11
- echo '<p style ="color:red;">'. $this -> __('To activate your plugin, please log in to LoginRadius and get API Key & Secret. Web') .': <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
12
- }elseif ($UserAuth == false) {
13
- echo '<p style ="color:red;">'. $this -> __('Your LoginRadius API Key and Secret is not valid, please correct it or contact LoginRadius support at') .' <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
14
- }
15
- else {
16
- echo '<div style="margin:5px"><div style="margin-bottom:5px">'.__(Mage::helper('core')->htmlEscape($loginRadiusTitle)).'</div><div class="interfacecontainerdiv" ></div></div>';
17
- }
18
- echo '</p></div></div>';
19
- }
20
- }
21
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/template/sociallogin/belowlogin.phtml DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- if( $this->loginEnable() == "1" && !$this->user_is_already_login() ){
3
- $belowLogin = $this->getBelowLogin();
4
- $ApiKey = trim($this->getApikey());
5
- $ApiSecrete = trim($this->getApiSecret());
6
- $loginRadiusTitle = trim( $this->getLoginRadiusTitle() );
7
- $UserAuth = $this->getApiResult($ApiKey, $ApiSecrete);
8
- if ($belowLogin == 1) {
9
- echo '<div class="block" style="margin-top:15px"><div class="block-title"><strong><span>'.__('Social Login').'</span></strong></div><div class="block-content"><p class="empty">';
10
- if($ApiKey == "" && $ApiSecrete == ""){
11
- echo '<p style ="color:red;">'. $this -> __('To activate your plugin, please log in to LoginRadius and get API Key & Secret. Web') .': <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
12
- }elseif ($UserAuth == false) {
13
- echo '<p style ="color:red;">'. $this -> __('Your LoginRadius API Key and Secret is not valid, please correct it or contact LoginRadius support at') .' <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
14
- }
15
- else {
16
- echo '<div style="margin:5px"><div style="margin-bottom:5px">'.__(Mage::helper('core')->htmlEscape($loginRadiusTitle)).'</div><div class="interfacecontainerdiv"></div></div>';
17
- }
18
- echo '</p></div></div>';
19
- }
20
- }
21
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/template/sociallogin/belowregister.phtml DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- if( $this->loginEnable() == "1" && !$this->user_is_already_login() ){
3
- $belowRegister = $this->getBelowRegister();
4
- $ApiKey = trim($this->getApikey());
5
- $ApiSecrete = trim($this->getApiSecret());
6
- $loginRadiusTitle = trim( $this->getLoginRadiusTitle() );
7
- $UserAuth = $this->getApiResult($ApiKey, $ApiSecrete);
8
- if ($belowRegister == 1) {
9
- echo '<div class="block" style="margin-top:15px"><div class="block-title"><strong><span>'.__('Social Login').'</span></strong></div><div class="block-content"><p class="empty">';
10
- if($ApiKey == "" && $ApiSecrete == ""){
11
- echo '<p style ="color:red;">'. $this -> __('To activate your plugin, please log in to LoginRadius and get API Key & Secret. Web') .': <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
12
- }elseif ($UserAuth == false) {
13
- echo '<p style ="color:red;">'. $this -> __('Your LoginRadius API Key and Secret is not valid, please correct it or contact LoginRadius support at') .' <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
14
- }
15
- else {
16
- echo '<div style="margin:5px"><div style="margin-bottom:5px">'.__(Mage::helper('core')->htmlEscape($loginRadiusTitle)).'</div><div class="interfacecontainerdiv"></div></div>';
17
- }
18
- echo '</p></div></div>';
19
- }
20
- }
21
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/template/sociallogin/linking.phtml DELETED
@@ -1,98 +0,0 @@
1
- <?php
2
- if( $this->loginEnable() == "1" ){
3
- ?>
4
- <div class="dashboard">
5
- <div class="box-account box-info">
6
- <div class="box-head">
7
- <h2>Login Radius</h2>
8
- </div>
9
- <div class="col2-set">
10
- <div class="col-1">
11
- <div class="box">
12
- <div class="box-title">
13
- <h3><?php echo __('Linked Accounts') ?></h3>
14
- </div>
15
- <div class="box-content">
16
- <?php
17
- // account linking successful
18
- if(isset($_GET['LoginRadiusLinked']) && trim($_GET['LoginRadiusLinked']) == 1){
19
- ?>
20
- <div style="color:green; background-color: #eaffdc; border: 1px solid #84b47a; padding: 3px 5px; margin:10px 0">
21
- <?php echo __('Account linked successfully.') ?>
22
- </div>
23
- <?php
24
- // account from this provider is already linked
25
- }elseif(isset($_GET['LoginRadiusLinked']) && trim($_GET['LoginRadiusLinked']) == 2){
26
- ?>
27
- <div style="color:red; background-color: rgb(255, 235, 232); border: 1px solid rgb(204, 0, 0); padding: 3px 5px; margin:10px 0">
28
- <?php echo __('Multiple accounts cannot be linked from the same Social ID Provider.') ?>
29
- </div>
30
- <?php
31
- // account already mapped or exists
32
- }elseif(isset($_GET['LoginRadiusLinked']) && trim($_GET['LoginRadiusLinked']) == 0){
33
- ?>
34
- <div style="color:red; background-color: rgb(255, 235, 232); border: 1px solid rgb(204, 0, 0); padding: 3px 5px;; margin:10px 0">
35
- <?php echo __('Account already exists or mapped.') ?>
36
- </div>
37
- <?php
38
- }
39
- // get logged in user's id
40
- $loginRadiusUserId = Mage::getSingleton("customer/session")->getCustomer()->getId();
41
- // unlink account
42
- if(isset($_GET['LoginRadiusUnlink']) && trim($_GET['LoginRadiusUnlink']) != ""){
43
- $loginRadiusConn = Mage::getSingleton('core/resource')
44
- ->getConnection('core_write');
45
- try{
46
- // delete query magento way
47
- $loginRadiusConn->delete(
48
- Mage::getSingleton('core/resource')->getTableName('sociallogin'),
49
- array('entity_id = ?' => $loginRadiusUserId,
50
- 'sociallogin_id = ?' => trim($_GET['LoginRadiusUnlink']))
51
- );
52
- }catch(Exception $e){
53
- }
54
- ?>
55
- <div style="color:green; background-color: #eaffdc; border: 1px solid #84b47a; padding: 3px 5px;">
56
- <?php echo __('Account removed successfully.') ?>
57
- </div>
58
- <?php
59
- }
60
- // list the linked accounts
61
- $loginRadiusConn = Mage::getSingleton('core/resource')
62
- ->getConnection('core_read');
63
- $loginRadiusQuery = "select sociallogin_id, entity_id, provider from ".Mage::getSingleton('core/resource')->getTableName('sociallogin')." where entity_id = ".$loginRadiusUserId;
64
- $loginRadiusQueryHandle = $loginRadiusConn->query($loginRadiusQuery);
65
- $loginRadiusResult = $loginRadiusQueryHandle->fetchAll();
66
- if(count($loginRadiusResult) > 0){
67
- $loginRadiusSessionSocialId = Mage::getSingleton("customer/session")->getloginRadiusId();
68
- foreach($loginRadiusResult as $result){
69
- if($result["provider"] != NULL || $result["provider"] != ""){
70
- echo '<div style="float:left">';
71
- if(Mage::getSingleton("customer/session")->getloginRadiusId() == $result["sociallogin_id"]){
72
- echo '<span style="color:green">'.__("Currently").' </span>';
73
- }
74
- echo __('Connected with').' <img alt="'.ucfirst($result['provider']).'" title="'.ucfirst($result['provider']).'" src="'.Mage::getDesign()->getSkinUrl("Loginradius".DS."Sociallogin".DS."images".DS."Linking".DS.$result["provider"].'.png', array('_area'=>'frontend')).'" />'.
75
- '</div> <div style="float:right"><a href="'.Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK).'customer/account/?LoginRadiusUnlink='.$result["sociallogin_id"].'" title="'.__('Unlink this ID from your account').'">'.__('Remove').'</a></div>'.
76
- '<br />';
77
- }
78
- }
79
- }
80
- ?>
81
- </div>
82
- </div>
83
- </div>
84
- <div class="col-2">
85
- <div class="box">
86
- <div class="box-title">
87
- <h3><?php echo __('Link Social IDs to your Magento Account') ?></h3>
88
- </div>
89
- <div class="box-content">
90
- <div class="interfacecontainerdiv" style="margin-left:10px"></div>
91
- </div>
92
- </div>
93
- </div>
94
- </div>
95
- </div>
96
- </div>
97
- <?php
98
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/template/sociallogin/linkingscript.phtml DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- if( $this->loginEnable() == "1" ){
3
- $loc = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."sociallogin/";
4
- ?>
5
- <script src="http://hub.loginradius.com/include/js/LoginRadius.js" ></script>
6
- <script type="text/javascript"> var options={}; options.login=true; LoginRadius_SocialLogin.util.ready(function () { $ui = LoginRadius_SocialLogin.lr_login_settings;$ui.interfacesize = "small";$ui.apikey = "<?php echo trim($this->getApikey()) ?>";$ui.callback = "<?php echo $loc ?>"; $ui.lrinterfacecontainer ="interfacecontainerdiv"; LoginRadius_SocialLogin.init(options); });
7
- </script>
8
- <?php
9
- }
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/template/sociallogin/sociallogin.phtml DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
- if( $this->loginEnable() == "1" ){
3
- $showdefault = $this->getShowDefault();
4
- $ApiKey = trim($this->getApikey());
5
- $ApiSecrete = trim($this->getApiSecret());
6
- $loginRadiusTitle = trim( $this->getLoginRadiusTitle() );
7
- $UserAuth = $this->getApiResult($ApiKey, $ApiSecrete);
8
- if ($showdefault == 1) {
9
- echo '<div class="block"><div class="block-title"><strong><span>'.__('Social Login').'</span></strong></div><div class="block-content"><p class="empty">';
10
- if ($this->user_is_already_login()) {
11
- $userName = Mage::getSingleton('customer/session')->getCustomer()->getName();
12
- if( $loginRadiusAvatar = trim( $this->getAvatar( Mage::getSingleton('customer/session')->getCustomer()->getId() ) ) ){
13
- echo "<img style='float:left' width='50' height='50' src='".$loginRadiusAvatar."' />";
14
- }
15
- echo "<span style='clear:both; float:left'>".__("Welcome")."! $userName </span>";
16
- }
17
- else {
18
- if($ApiKey == "" && $ApiSecrete == ""){
19
- echo '<p style ="color:red;">'. $this -> __('To activate your plugin, please log in to LoginRadius and get API Key & Secret. Web') .': <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
20
- }elseif ($UserAuth == false) {
21
- echo '<p style ="color:red;">'. $this -> __('Your LoginRadius API Key and Secret is not valid, please correct it or contact LoginRadius support at') .' <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
22
- }
23
- else {
24
- echo __($loginRadiusTitle).'<div class="interfacecontainerdiv" style="margin-left:10px"></div>';
25
- }
26
- }
27
- echo '</p></div></div>';
28
- }
29
- }
30
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/template/sociallogin/sociallogincustom.phtml DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
- if( $this->loginEnable() == "1" && !$this->user_is_already_login() ){
3
- $aboveRegister = $this->getAboveRegister();
4
- $ApiKey = trim($this->getApikey());
5
- $ApiSecrete = trim($this->getApiSecret());
6
- $loginRadiusTitle = trim( $this->getLoginRadiusTitle() );
7
- $UserAuth = $this->getApiResult($ApiKey, $ApiSecrete);
8
- echo '<div><h2>OR</h2>';
9
- if($ApiKey == "" && $ApiSecrete == ""){
10
- echo '<p style ="color:red;">'. $this -> __('To activate your plugin, please log in to LoginRadius and get API Key & Secret. Web') .': <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
11
- }elseif ($UserAuth == false) {
12
- echo '<p style ="color:red;">'. $this -> __('Your LoginRadius API Key and Secret is not valid, please correct it or contact LoginRadius support at') .' <b><a href ="http://www.loginradius.com" target = "_blank">www.LoginRadius.com</a></b></p>';
13
- }
14
- else {
15
- echo '<div style="margin-bottom:5px">'.__(Mage::helper('core')->htmlEscape($loginRadiusTitle)).'</div><div class="interfacecontainerdiv"></div>';
16
- }
17
- echo '</div>';
18
- }
19
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/template/sociallogin/socialshare_head.phtml DELETED
@@ -1,156 +0,0 @@
1
- <?php
2
- if($this->horizontalShareEnable() == "1" || $this->verticalShareEnable() == "1"){
3
- echo '<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>';
4
- }
5
- $sharingScript = '<script type="text/javascript">';
6
- if( $this->horizontalShareEnable() == "1" ){
7
- // interface
8
- if($this->horizontalSharingTheme() == "32" || $this->horizontalSharingTheme() == "16"){
9
- $interface = 'horizontal';
10
- }elseif($this->horizontalSharingTheme() == "single_large" || $this->horizontalSharingTheme() == "single_small"){
11
- $interface = 'simpleimage';
12
- }elseif($this->horizontalSharingTheme() == "counter_horizontal" || $this->horizontalSharingTheme() == "counter_vertical"){
13
- // set counter variables
14
- $interface = 'simple';
15
- $isHorizontal = "true";
16
- // interface
17
- if($this->horizontalSharingTheme() == "counter_vertical"){
18
- $type = 'vertical';
19
- }else{
20
- $type = 'horizontal';
21
- }
22
- }else{
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
- if( $this->loginEnable() == "1" ){
142
- $loc = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)."sociallogin/";
143
- if($this->getLayout()->getBlock('head')->getTitle() == "Checkout"){
144
- $loginRadiusCallback = $loc."?loginradiuscheckout=1";
145
- }elseif($this->getLayout()->getBlock('head')->getTitle() == "My Account"){
146
- $loginRadiusCallback = $loc."?loginRadiusLinking=1";
147
- }else{
148
- $loginRadiusCallback = $loc."?redirect_to=".Mage::helper('core/url')->getCurrentUrl();
149
- }
150
- ?>
151
- <script src="//hub.loginradius.com/include/js/LoginRadius.js" ></script>
152
- <script type="text/javascript"> var options={}; options.login=true; LoginRadius_SocialLogin.util.ready(function () { $ui = LoginRadius_SocialLogin.lr_login_settings;$ui.interfacesize = "<?php echo $this->iconSize() == 'small' ? 'small' : '' ?>"; <?php if(trim($this->iconsPerRow()) != ''){ echo '$ui.noofcolumns = '.trim($this->iconsPerRow()).';'; } ?> $ui.apikey = "<?php echo trim($this->getApikey()) ?>";$ui.callback = "<?php echo $loginRadiusCallback ?>"; $ui.lrinterfacebackground = "<?php if(trim($this->backgroundColor()) != ''){ echo trim($this->backgroundColor()); } ?>"; $ui.lrinterfacecontainer ="interfacecontainerdiv"; $ui.samewindow = <?php if(trim($this->getLoginWindow()) != ''){ echo trim($this->getLoginWindow()); } ?>; LoginRadius_SocialLogin.init(options); });
153
- </script>
154
- <?php
155
- }
156
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/template/sociallogin/socialshareproduct.phtml DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- if( $this->horizontalShareEnable() == "1" && $this->horizontalShareProduct() == "1"){
3
- if(trim($this->sharingTitle()) != ""){
4
- echo '<div style="font-weight:bold">'.__(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/default/default/template/sociallogin/socialsharesuccess.phtml DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- if($this->horizontalShareEnable() == "1" && $this->horizontalShareSuccess() == "1"){
3
- if(trim($this->sharingTitle()) != ""){
4
- echo '<div style="font-weight:bold">'.__(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
- ?>
 
 
 
 
 
 
 
 
 
 
 
app/etc/modules/Loginradius_Sociallogin.xml CHANGED
@@ -1,9 +1,8 @@
1
-
2
  <config>
3
  <modules>
4
  <Loginradius_Sociallogin>
5
  <active>true</active>
6
  <codePool>community</codePool>
7
- </Loginradius_Sociallogin>
8
  </modules>
9
  </config>
 
1
  <config>
2
  <modules>
3
  <Loginradius_Sociallogin>
4
  <active>true</active>
5
  <codePool>community</codePool>
6
+ </Loginradius_Sociallogin>
7
  </modules>
8
  </config>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>LoginRadius</name>
4
- <version>3.7.1</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Social Login and Sharing for Magento</summary>
10
  <description>Add Social Login and Sharing to your Magento website and also get accurate User Profile Data and Social Analytics.</description>
11
- <notes>Fourteenth release of social login</notes>
12
  <authors><author><name>LoginRadius Team</name><user>LoginRadius</user><email>developers@loginradius.com</email></author></authors>
13
- <date>2014-02-11</date>
14
- <time>04:12:31</time>
15
- <contents><target name="magecommunity"><dir name="Loginradius"><dir name="Sociallogin"><dir name="Block"><file name="Auth.php" hash="7ec44bd9926175c0bc40662116050252"/><file name="Sociallogin.php" hash="918df09944a385e68485fdd0224d69b6"/><file name="horizontalsharing.php" hash="daee7f72d53fd2492740cf546c897c37"/><file name="verticalsharing.php" hash="e2322a53ba7c97abbf495506d078e0fb"/></dir><dir name="Helper"><file name="Data.php" hash="7fe10f157031a33dd5c312f61f36f650"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Sociallogin"><file name="Collection.php" hash="b4632ab82692843577c985a3ed23981f"/></dir><file name="Sociallogin.php" hash="8c8d5d266c57ea0400d5a560a943ea14"/></dir><file name="Sociallogin.php" hash="a49fc157930cd09fcbe522aabb1d986b"/><dir name="Source"><file name="HorizontalSharing.php" hash="5e1c18d133cd3117e0eb0c732544177c"/><file name="Iconsize.php" hash="072bf28bd0d145829cbbae420b898d36"/><file name="LoginPopup.php" hash="8ba2cc068b1589bf324a0e4309ef0f9f"/><file name="SharingVerticalAlignment.php" hash="be293d7c6bddf42341be05ff092f857d"/><file name="Uihover.php" hash="6115effdefc9b9a870a03c79b56557aa"/><file name="Uihover2.php" hash="eea7208694113c353853ee5838bd9449"/><file name="VerticalSharing.php" hash="01788a41fea1546ddd334bf9c3f9d7f4"/></dir><dir name="System"><dir name="Config"><file name="Info.php" hash="02f7a69cd622726884ac8c58fc8d4100"/></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="2fa4ef51fd0cadcbdaed9301b14f96ef"/><file name="Popup.php" hash="9799c22186dc85d31625b83c7731196d"/></dir><dir name="etc"><file name="config.xml" hash="b90eaf130c1c14951c13f710953b64b3"/><file name="system.xml" hash="1090c3ee11f131fb99cdebb40ecb605b"/><file name="widget.xml" hash="f6e8a254aa3a9ff86f958710c4e8edca"/></dir><dir name="sql"><dir name="sociallogin_setup"><file name="mysql4-install-3.7.1.php" hash="3d30d28a993571d91575763bdb23b566"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="sociallogin.xml" hash="1ae5bad554147c76462c5bdbb3d7b010"/></dir><dir name="template"><dir name="sociallogin"><file name="abovelogin.phtml" hash="76260ae94bc50ba7c2cd750f529747b4"/><file name="aboveregister.phtml" hash="fcc579c2bd34b2bc9877e61f6abfd0d5"/><file name="belowlogin.phtml" hash="cb854a34b1a5ef7262ffb1de3ff0f247"/><file name="belowregister.phtml" hash="b9a31437aa487f28f24cb046ad7a5239"/><file name="linking.phtml" hash="607c388e2d168b92978fb7978abcf54b"/><file name="linkingscript.phtml" hash="77f0e6348fed90c6cb24f064a8fac2e9"/><file name="sociallogin.phtml" hash="0b3979470d8dabde7f03fc09cde9ba90"/><file name="sociallogincustom.phtml" hash="04daac1337596641b2b3bdd38aad0dba"/><file name="socialshare_head.phtml" hash="9b310030dc65a958a216e45336fe3fcc"/><file name="socialshareproduct.phtml" hash="d4b16132913796507de4d2820b3302d2"/><file name="socialsharesuccess.phtml" hash="38e93ea63416c7fa84d498a994bcaf40"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="loginradius_sociallogin.xml" hash="300c18f5087d5003e17ada708086d5bd"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Loginradius_Sociallogin.xml" hash="6c5bb03c460936006692aa1d01d142ba"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="Loginradius"><dir name="Sociallogin"><dir name="css"><file name="admin-ui.css" hash="a2822df004eabad62380a827c7b415fd"/><file name="lrshare_iconsprite32.png" hash="a016ded3f25653acf2fa9dfab8a38103"/></dir><dir name="images"><dir name="Linking"><file name="amazon.png" hash="961d0082ed4b433d8e0274c133072e2c"/><file name="aol.png" hash="4e51f60c1b8750c5b9dfa94f56fe13b1"/><file name="facebook.png" hash="141309628c58912076f00954b3fd19a6"/><file name="foursquare.png" hash="de2f4fcf5b3c1156f22ed546f5c3f0c5"/><file name="github.png" hash="45f8e1436fc5c5803ed9d4edb7cb59b6"/><file name="google.png" hash="ffeddc7d14c9b4de2efb6b8ea0f5f652"/><file name="hyves.png" hash="3c77fd2243b22c61915a950c3910f37c"/><file name="kaixin.png" hash="bc84991a5c9d15e20946fae5e9c27f4d"/><file name="linkedin.png" hash="7a9bc12ec91ab2a30442c56a9f70e9ea"/><file name="live.png" hash="9d747bae72fc0f2e3a04f32896d62fbc"/><file name="livejournal.png" hash="e21f34630444412ab3dd197884e0c2e6"/><file name="mixi.png" hash="909e7edc76e59b448d56043eee5e1412"/><file name="myopenid.png" hash="c8295969044cb9d99f8348091ba75319"/><file name="myspace.png" hash="42cd07decb5f4a1fba604ef8df32ef2e"/><file name="odnoklassniki.png" hash="34cd7d239583b015cdd1adb5b7fec085"/><file name="openid.png" hash="92bd4471ef1d5dd04855887806db74f0"/><file name="orange.png" hash="9b9b8f2da956a238e7d58c241423af8a"/><file name="paypal.png" hash="082f0b50411b1dfb1bfd86cfdeb92cea"/><file name="persona.png" hash="e0d926f89e9c428aece1e0f9dbb1f8f2"/><file name="qq.png" hash="8e6dc34bdf03f07277e0aadf8706a4a7"/><file name="renren.png" hash="040a0af8119b7f85bfc2df41ec56f915"/><file name="salesforce.png" hash="e41bcac63438bb04af3a9745b816a675"/><file name="stackexchange.png" hash="8ab952fe75d4a96d6752792ffdcbf0c3"/><file name="steamcommunity.png" hash="ad05c57a4ee01ebc01428b0da905d6b6"/><file name="twitter.png" hash="48044aca3a1d4864361f78c02ba86848"/><file name="verisign.png" hash="7a15fd820171218d803d26e7a3ec46a3"/><file name="virgilio.png" hash="f5c3b6e19c38903a192954934000f60a"/><file name="vkontakte.png" hash="ae1e98911fe9ea6da8a50a568c082133"/><file name="wordpress.png" hash="8ce8b46a2233b8497dd10d9c4d535e22"/><file name="yahoo.png" hash="5c159cc8fed73621b2c12600f8dac288"/></dir><dir name="Sharing"><dir name="Horizontal"><file name="horizonSharing16.png" hash="64188c128c8263c052153cf9708ac218"/><file name="horizonSharing32.png" hash="5e85ac81864885bcef5cc9691a9eba49"/><file name="horizontal.png" hash="6bb8038603bbf9cc70bac8365eebd7ba"/><file name="single-image-theme-large.png" hash="e6ff4a26149b631639b601d95e2dc361"/><file name="single-image-theme-small.png" hash="8c2b20fa0f276e33f3876783eb2cbd74"/><file name="vertical.png" hash="9c71cfb83ffb121a0ef89e263d474387"/></dir><dir name="Vertical"><file name="16VerticlewithBox.png" hash="73b3abf54889144e9188ffaa76cbb11f"/><file name="32VerticlewithBox.png" hash="37060e164ca4f7c00f430d5f1ab7eddd"/><file name="verticalhorizontal.png" hash="469ce5302d294dc987bdb070ef448446"/><file name="verticalvertical.png" hash="f59288edc8c87dde216b6616027aa72b"/></dir></dir></dir><dir name="js"><file name="admin-ui.js" hash="5a13f39c431397e4fc5f8488dd4e072f"/><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>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>LoginRadius</name>
4
+ <version>4.0.0</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Social Login and Sharing for Magento</summary>
10
  <description>Add Social Login and Sharing to your Magento website and also get accurate User Profile Data and Social Analytics.</description>
11
+ <notes>Sixteenth release of social login</notes>
12
  <authors><author><name>LoginRadius Team</name><user>LoginRadius</user><email>developers@loginradius.com</email></author></authors>
13
+ <date>2014-12-24</date>
14
+ <time>11:41:47</time>
15
+ <contents><target name="magecommunity"><dir name="Loginradius"><dir name="Sociallogin"><dir name="Block"><file name="Auth.php" hash="4d9b0a7b6e403ff9c2a0898cae41afd8"/><file name="Emailpopup.php" hash="d4aac86b3de441ea4cf35559a605e973"/><file name="Sociallogin.php" hash="6d91ed9e156fe7d03c2bf95c97aac590"/><file name="Socialsharing.php" hash="4f761eda5322ba05e1e0cb96d188a0cc"/><file name="horizontalsharing.php" hash="67fc95c9238a9d3327ca16ad3f18f2e4"/><file name="verticalsharing.php" hash="6410be41f2e7af717d4dd5de83ff4ca4"/></dir><dir name="Helper"><file name="Adminhelper.php" hash="0e88b0ae2a83aa6e419ca11194328b3c"/><file name="Data.php" hash="9b4cfd68e9bdbfa73038be009da120ca"/><file name="LoginRadiusSDK.php" hash="e55149a472facdf2c83e6513c73caa3b"/><file name="Loginhelper.php" hash="0a0ebe79e72d239e97ebd31e64f9494a"/></dir><dir name="Model"><dir name="Backend"><file name="Validator.php" hash="151ee6cc958f5c08fbad177c186d0bba"/></dir><file name="Observer.php" hash="c6e5b6d19ba39ad46398ee1950e1c940"/><dir name="Source"><file name="HorizontalSharing.php" hash="3dae6386a5f32e20ba270eb3c2d15de9"/><file name="Iconsize.php" hash="42eeb07db318ba705a09161c9496f1d8"/><file name="LoginPopup.php" hash="b423750764b43bbbb7504d2186e5cfc0"/><file name="SharingVerticalAlignment.php" hash="e897335623190b33778940d0559ce13e"/><file name="TwitterRecipients.php" hash="20c2e3e4e3662d610c55211b94d74d9d"/><file name="Uihover.php" hash="12c37574892cea00e167e679cc96eadd"/><file name="Uihover2.php" hash="8be4bac9bc4500977c81046ea511dada"/><file name="VerticalSharing.php" hash="2e9b88d5a8f4b38481e282534256f3b1"/></dir><dir name="System"><dir name="Config"><file name="Info.php" hash="f8e9832aa4b0910c7a68de2e5e368925"/></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="a113f4fd078468be9e89f33599dc563e"/></dir><dir name="etc"><file name="config.xml" hash="38b72a52b3de98316829abd0cf34d14c"/><file name="system.xml" hash="650c5b76041656f6b54efadf528e8fbf"/><file name="widget.xml" hash="f6e8a254aa3a9ff86f958710c4e8edca"/></dir><dir name="sql"><dir name="sociallogin_setup"><file name="mysql4-install-4.0.0.php" hash="c02ab421149fa4aafbfb0813ff350071"/><file name="mysql4-upgrade-3.7.1-4.0.0.php" hash="145b69433c87f3f3e7189ca0a647e71a"/><file name="mysql4-upgrade-3.7.2-4.0.0.php" hash="145b69433c87f3f3e7189ca0a647e71a"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Loginradius_Sociallogin.xml" hash="20cb11d66b0f486ebca4b8deedacc86b"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="loginradius_sociallogin.xml" hash="86b4e183c723dc96e13ee28198a36bc8"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="sociallogin.xml" hash="dcc24b2735bf4a240ca8916a597b8157"/></dir><dir name="template"><dir name="sociallogin"><file name="abovelogin.phtml" hash="29723ed6743adb5c94f553ce440effe2"/><file name="aboveregister.phtml" hash="e966762897e2084916733a5b594b56f3"/><file name="belowlogin.phtml" hash="5e81b7807c53da0230671c39e35fa682"/><file name="belowregister.phtml" hash="603509b2093ec24863cb3d8cd82e929c"/><file name="linking.phtml" hash="d1c8d7cdcf808425d86436bc84aadecf"/><file name="popup.phtml" hash="58d021ac61250c5d29237dc637c9c1e7"/><file name="popupscript.phtml" hash="45dcdebdfca0cebbc748540e3a3d3e67"/><file name="sociallogin.phtml" hash="ec7b7beb4850cb05e2e5fae23968e26e"/><file name="sociallogin_head.phtml" hash="a7724bf91373886e7c4293aad597c552"/><file name="sociallogincustom.phtml" hash="74981f871595e6ec876390bf9d9172d3"/><file name="socialshare_head.phtml" hash="ac05792d7af1badb469db4befa21b10a"/><file name="socialshareproduct.phtml" hash="2c306de83dff3995de1ccf424cd645bd"/><file name="socialsharesuccess.phtml" hash="b8de15c1333b70764beb8fa67a36265d"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="Loginradius"><dir name="Sociallogin"><dir name="css"><file name="Thumbs.db" hash="48d8e49d8f4b82fff044544f39a16537"/><file name="admin-ui.css" hash="bbb74482c891fe366ff8ae8638afa09e"/><file name="lrshare_iconsprite32.png" hash="a016ded3f25653acf2fa9dfab8a38103"/></dir><dir name="images"><dir name="Linking"><file name="amazon.png" hash="961d0082ed4b433d8e0274c133072e2c"/><file name="aol.png" hash="4e51f60c1b8750c5b9dfa94f56fe13b1"/><file name="facebook.png" hash="141309628c58912076f00954b3fd19a6"/><file name="foursquare.png" hash="de2f4fcf5b3c1156f22ed546f5c3f0c5"/><file name="github.png" hash="45f8e1436fc5c5803ed9d4edb7cb59b6"/><file name="google.png" hash="ffeddc7d14c9b4de2efb6b8ea0f5f652"/><file name="hyves.png" hash="3c77fd2243b22c61915a950c3910f37c"/><file name="kaixin.png" hash="bc84991a5c9d15e20946fae5e9c27f4d"/><file name="linkedin.png" hash="7a9bc12ec91ab2a30442c56a9f70e9ea"/><file name="live.png" hash="9d747bae72fc0f2e3a04f32896d62fbc"/><file name="livejournal.png" hash="e21f34630444412ab3dd197884e0c2e6"/><file name="mixi.png" hash="909e7edc76e59b448d56043eee5e1412"/><file name="myopenid.png" hash="c8295969044cb9d99f8348091ba75319"/><file name="myspace.png" hash="42cd07decb5f4a1fba604ef8df32ef2e"/><file name="odnoklassniki.png" hash="34cd7d239583b015cdd1adb5b7fec085"/><file name="openid.png" hash="92bd4471ef1d5dd04855887806db74f0"/><file name="orange.png" hash="9b9b8f2da956a238e7d58c241423af8a"/><file name="paypal.png" hash="082f0b50411b1dfb1bfd86cfdeb92cea"/><file name="persona.png" hash="e0d926f89e9c428aece1e0f9dbb1f8f2"/><file name="qq.png" hash="8e6dc34bdf03f07277e0aadf8706a4a7"/><file name="renren.png" hash="040a0af8119b7f85bfc2df41ec56f915"/><file name="salesforce.png" hash="e41bcac63438bb04af3a9745b816a675"/><file name="stackexchange.png" hash="8ab952fe75d4a96d6752792ffdcbf0c3"/><file name="steamcommunity.png" hash="ad05c57a4ee01ebc01428b0da905d6b6"/><file name="twitter.png" hash="48044aca3a1d4864361f78c02ba86848"/><file name="verisign.png" hash="7a15fd820171218d803d26e7a3ec46a3"/><file name="virgilio.png" hash="f5c3b6e19c38903a192954934000f60a"/><file name="vkontakte.png" hash="ae1e98911fe9ea6da8a50a568c082133"/><file name="wordpress.png" hash="8ce8b46a2233b8497dd10d9c4d535e22"/><file name="yahoo.png" hash="5c159cc8fed73621b2c12600f8dac288"/></dir><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="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="Thumbs.db" hash="2bf832cc35446fe90ae3b62f3d1d6044"/><file name="facebook.png" hash="206f9ea5a7374595f0d8dc94a713eb01"/><file name="google.png" hash="aeb7ef22d42ef585b133f4f6f9332996"/><file name="linkedin.png" hash="30428fd794b1d4444891a987b76080df"/><file name="twitter.png" hash="ebab12206bed415ea082231ed2d5c3b9"/><file name="youtube.png" hash="a78066dee928ad36762b83a29cdea932"/></dir></dir><dir name="js"><file name="admin-ui.js" hash="e325d2de12ba432e1598e1c972a096cc"/><file name="jquery.js" hash="5654b0561c66ca9c0ad2a1dd75e5d9b8"/><file name="jquery.ui.sortable.min.js" hash="b847eafb05bcc6ef0908ff07dcd2b0f1"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="Loginradius"><dir name="Sociallogin"><dir name="css"><file name="lrshare_iconsprite32.png" hash="a016ded3f25653acf2fa9dfab8a38103"/><file name="popup.css" hash="d2b6b3044d2a499ae1dfb93c62b77809"/></dir><dir name="images"><dir name="Linking"><file name="amazon.png" hash="961d0082ed4b433d8e0274c133072e2c"/><file name="aol.png" hash="4e51f60c1b8750c5b9dfa94f56fe13b1"/><file name="facebook.png" hash="141309628c58912076f00954b3fd19a6"/><file name="foursquare.png" hash="de2f4fcf5b3c1156f22ed546f5c3f0c5"/><file name="github.png" hash="45f8e1436fc5c5803ed9d4edb7cb59b6"/><file name="google.png" hash="ffeddc7d14c9b4de2efb6b8ea0f5f652"/><file name="hyves.png" hash="3c77fd2243b22c61915a950c3910f37c"/><file name="kaixin.png" hash="bc84991a5c9d15e20946fae5e9c27f4d"/><file name="linkedin.png" hash="7a9bc12ec91ab2a30442c56a9f70e9ea"/><file name="live.png" hash="9d747bae72fc0f2e3a04f32896d62fbc"/><file name="livejournal.png" hash="e21f34630444412ab3dd197884e0c2e6"/><file name="mixi.png" hash="909e7edc76e59b448d56043eee5e1412"/><file name="myopenid.png" hash="c8295969044cb9d99f8348091ba75319"/><file name="myspace.png" hash="42cd07decb5f4a1fba604ef8df32ef2e"/><file name="odnoklassniki.png" hash="34cd7d239583b015cdd1adb5b7fec085"/><file name="openid.png" hash="92bd4471ef1d5dd04855887806db74f0"/><file name="orange.png" hash="9b9b8f2da956a238e7d58c241423af8a"/><file name="paypal.png" hash="082f0b50411b1dfb1bfd86cfdeb92cea"/><file name="persona.png" hash="e0d926f89e9c428aece1e0f9dbb1f8f2"/><file name="qq.png" hash="8e6dc34bdf03f07277e0aadf8706a4a7"/><file name="renren.png" hash="040a0af8119b7f85bfc2df41ec56f915"/><file name="salesforce.png" hash="e41bcac63438bb04af3a9745b816a675"/><file name="stackexchange.png" hash="8ab952fe75d4a96d6752792ffdcbf0c3"/><file name="steamcommunity.png" hash="ad05c57a4ee01ebc01428b0da905d6b6"/><file name="twitter.png" hash="48044aca3a1d4864361f78c02ba86848"/><file name="verisign.png" hash="7a15fd820171218d803d26e7a3ec46a3"/><file name="virgilio.png" hash="f5c3b6e19c38903a192954934000f60a"/><file name="vkontakte.png" hash="ae1e98911fe9ea6da8a50a568c082133"/><file name="wordpress.png" hash="8ce8b46a2233b8497dd10d9c4d535e22"/><file name="yahoo.png" hash="5c159cc8fed73621b2c12600f8dac288"/></dir><dir name="Sharing"><dir name="Horizontal"><file name="horizonSharing16.png" hash="64188c128c8263c052153cf9708ac218"/><file name="horizonSharing32.png" hash="5e85ac81864885bcef5cc9691a9eba49"/><file name="horizontal.png" hash="6bb8038603bbf9cc70bac8365eebd7ba"/><file name="single-image-theme-large.png" hash="e6ff4a26149b631639b601d95e2dc361"/><file name="single-image-theme-small.png" hash="8c2b20fa0f276e33f3876783eb2cbd74"/><file name="vertical.png" hash="9c71cfb83ffb121a0ef89e263d474387"/></dir><dir name="Vertical"><file name="16VerticlewithBox.png" hash="73b3abf54889144e9188ffaa76cbb11f"/><file name="32VerticlewithBox.png" hash="37060e164ca4f7c00f430d5f1ab7eddd"/><file name="verticalhorizontal.png" hash="469ce5302d294dc987bdb070ef448446"/><file name="verticalvertical.png" hash="f59288edc8c87dde216b6616027aa72b"/></dir></dir></dir><dir name="js"><file name="LoginRadiusSDK.2.0.0.js" hash="4bcc695e646cca3e0775e8279dfd773b"/><file name="jquery.js" hash="5654b0561c66ca9c0ad2a1dd75e5d9b8"/><file name="jquery.ui.sortable.min.js" hash="b847eafb05bcc6ef0908ff07dcd2b0f1"/><file name="popup.js" hash="29c4ce9392fa95d76fe21e12ba1b91b2"/></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
skin/adminhtml/default/default/Loginradius/Sociallogin/css/Thumbs.db ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/css/admin-ui.css ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*Options cleanup changes starts...*/
2
+ tr#row_sociallogin_options_basicSettings_redirectAfterLogin td input, tr#row_sociallogin_options_basicSettings_redirectAfterRegistration td input{
3
+ float:left !important;
4
+ margin-right: 6px;
5
+ }
6
+ tr#row_sociallogin_options_basicSettings_redirectAfterLogin label.inline{
7
+
8
+ }
9
+ tr#row_sociallogin_options_horizontalSharing_horizontalSharingTheme td input {
10
+ margin-top: 7px;
11
+ margin-right: 6px;
12
+ float:left;
13
+
14
+ }
15
+ tr#row_sociallogin_options_horizontalSharing_horizontalSharingTheme td img {
16
+ padding-bottom:10px;
17
+ }
18
+ #sociallogin_options_horizontalSharing_horizontalSharingTheme32{
19
+
20
+ }
21
+ #sociallogin_options_horizontalSharing_horizontalSharingTheme16{
22
+ margin-top:4px !important;
23
+ }
24
+ #sociallogin_options_horizontalSharing_horizontalSharingThemesingle_small{
25
+ margin-top:3px !important;
26
+ }
27
+ tr#row_sociallogin_options_basicSettings_redirectSettings td label{
28
+ font-size: 15px;
29
+ font-weight: bold;
30
+
31
+ }
32
+ tr#row_sociallogin_options_basicSettings_redirectSettings{
33
+ border-bottom: 1px solid grey !important;
34
+ }
35
+ .lr_admin_configuration_info_fieldsets.lr_configuration_info_fieldsets_left{
36
+ width: 63%;
37
+ float:left;
38
+ margin-right: 6px;
39
+ }
40
+ #lr_thank_message_container{
41
+ padding-bottom: 25px;
42
+ height:169px;
43
+ }
44
+ #lr_extension_help_container{
45
+ height:130px;
46
+ padding-bottom: 0 !important;
47
+ }
48
+ #lr_extension_support_container{
49
+ height:130px;
50
+ }
51
+ .lr_admin_fieldset_title{
52
+ border-bottom:#d7d7d7 1px solid !important;
53
+ }
54
+ #lr_extension_info_container img {
55
+ width:50px;
56
+ }
57
+
58
+ #lr_extension_info_container{
59
+ width:30%;
60
+ padding-bottom: 0 !important;
61
+ }
62
+
63
+ .lr_admin_configuration_info_fieldsets.lr_configuration_info_fieldsets_right{
64
+ width: 30%;
65
+ float:left;
66
+ padding-bottom:0 !important;
67
+ }
68
+ .lr_configuration_info_fieldsets_right{
69
+ padding-bottom: 0px !important;
70
+ }
71
+ .lr_admin_configuration_info_fieldsets{
72
+ border-radius:6px;
73
+ }
74
+
75
+
76
+ .lr_configuration_info_fieldsets a:hover, .loginRadiusHelpDiv ul li a:hover{
77
+ text-decoration:underline !important
78
+ }
79
+ .loginRadiusHelpDiv ul li{
80
+ list-style-type: disc;
81
+ }
82
+ .loginRadiusHelpDiv ul{
83
+ margin: 0 15px;
84
+ }
85
+ .loginradius_radio{
86
+ vertical-align:top;
87
+ margin-left:7px
88
+ }
89
+ #row_sociallogin_options_horizontalSharing_horizontalSharingProviders ul li{
90
+ width:149px;
91
+ float:left
92
+ }
93
+ #row_sociallogin_options_messages_redirect td input{
94
+ margin-right:2px
95
+ }
96
+ #row_sociallogin_options_verticalSharing_verticalSharingProviders ul li{
97
+ width:149px;
98
+ float:left
99
+ }
100
+ #row_sociallogin_options_verticalSharing_verticalCounterProviders ul li{
101
+ width:149px;
102
+ float:left
103
+ }
104
+ #row_sociallogin_options_horizontalSharing_horizontalCounterProviders ul li{
105
+ width:149px;
106
+ float:left
107
+ }
108
+ #loginRadiushorizontalRearrangeSharing li, #loginRadiusverticalRearrangeSharing li{
109
+ float:left
110
+ }
111
+ #row_sociallogin_options_verticalSharing_verticalSharingTheme td label{
112
+ float:left !important
113
+ }
114
+ #row_sociallogin_options_messages_iconSize td input{
115
+ margin-right:2px
116
+ }
117
+ #row_sociallogin_options_messages_sameWindow td input{
118
+ margin-right:2px
119
+ }
120
+ #row_sociallogin_options_verticalSharing_verticalSharingTheme td input{
121
+ float:left !important;
122
+ margin-left:4px
123
+ }
124
+ #row_sociallogin_options_horizontalSharing_horizontalSharingTheme td input{
125
+ vertical-align:top
126
+ }
127
+ #row_sociallogin_options_horizontalSharing_horizontalSharingTheme td[class=value]{
128
+ width: 400px !important
129
+ }
130
+ #row_sociallogin_options_verticalSharing_verticalSharingTheme td.value{
131
+ width:400px !important;
132
+ }
133
+ #row_sociallogin_options_sharing_verticalSharing td input{
134
+ vertical-align:top !important;
135
+ float:left !important;
136
+ margin-right:2px
137
+ }
138
+ #row_sociallogin_options_sharing_verticalSharing td label, #row_sociallogin_options_counter_verticalCounter td label{
139
+ float:left !important
140
+ }
141
+ #row_sociallogin_options_sharing_horizontalSharing td input{
142
+ vertical-align:top !important;
143
+ margin-right:2px
144
+ }
145
+ #row_sociallogin_options_counter_horizontalCounter td input{
146
+ vertical-align:top !important;
147
+ margin-right:2px
148
+ }
149
+ #row_sociallogin_options_counter_verticalCounter td input{
150
+ vertical-align:top !important;
151
+ margin-right:2px;
152
+ float:left !important
153
+ }
154
+ .lrshare_iconsprite32{
155
+ cursor: pointer !important;
156
+ height: 32px;
157
+ margin: 4px !important;
158
+ width: 32px;
159
+ padding: 0px !important;
160
+ border: none !important;
161
+ background: url("lrshare_iconsprite32.png") no-repeat scroll left top transparent;
162
+ list-style-type: none !important;
163
+ }
164
+ .lrshare_iconsprite32.lrshare_delicious { background-position: 0px 0px; width: 32px; height: 32px; }
165
+ .lrshare_iconsprite32.lrshare_digg { background-position: -34px 0px; width: 32px; height: 32px; }
166
+ .lrshare_iconsprite32.lrshare_dotnetkicks { background-position: -68px 0px; width: 32px; height: 32px; }
167
+ .lrshare_iconsprite32.lrshare_email { background-position: -102px 0px; width: 32px; height: 32px; }
168
+ .lrshare_iconsprite32.lrshare_evenmore32 { background-position: -138px 0px; width: 32px; height: 32px; }
169
+ .lrshare_iconsprite32.lrshare_facebook { background-position: -174px 0px; width: 32px; height: 32px; }
170
+ .lrshare_iconsprite32.lrshare_google { background-position: -208px 0px; width: 32px; height: 32px; }
171
+ .lrshare_iconsprite32.lrshare_googleplus { background-position: -242px 0px; width: 32px; height: 32px; }
172
+ .lrshare_iconsprite32.lrshare_hyves { background-position: -276px 0px; width: 32px; height: 32px; }
173
+ .lrshare_iconsprite32.lrshare_linkedin { background-position: -310px 0px; width: 32px; height: 32px; }
174
+ .lrshare_iconsprite32.lrshare_live { background-position: -344px 0px; width: 32px; height: 32px; }
175
+ .lrshare_iconsprite32.lrshare_myspace { background-position: -378px 0px; width: 32px; height: 32px; }
176
+ .lrshare_iconsprite32.lrshare_pinterest { background-position: -412px 0px; width: 32px; height: 32px; }
177
+ .lrshare_iconsprite32.lrshare_print { background-position: -446px 0px; width: 32px; height: 32px; }
178
+ .lrshare_iconsprite32.lrshare_reddit { background-position: -480px 0px; width: 32px; height: 32px; }
179
+ .lrshare_iconsprite32.lrshare_sharingcounter32 { background-position: -514px 0px; width: 50px; height: 32px; padding-top:4px !important; font-size:18px; }
180
+ .lrshare_iconsprite32.lrshare_tumblr { background-position: -576px 0px; width: 32px; height: 32px; }
181
+ .lrshare_iconsprite32.lrshare_twitter { background-position: -610px 0px; width: 32px; height: 32px; }
182
+ .lrshare_iconsprite32.lrshare_viadeo { background-position: -644px 0px; width: 32px; height: 32px; }
183
+ .lrshare_iconsprite32.lrshare_vkontakte { background-position: -678px 0px; width: 32px; height: 32px; }
184
+ .lrshare_iconsprite32.lrshare_wordpress { background-position: -712px 0px; width: 32px; height: 32px; }
185
+ .lrshare_iconsprite32.lrshare_yahoo { background-position: -746px 0px; width: 32px; height: 32px; }
skin/adminhtml/default/default/Loginradius/Sociallogin/css/lrshare_iconsprite32.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/amazon.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/aol.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/facebook.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/foursquare.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/github.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/google.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/hyves.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/kaixin.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/linkedin.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/live.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/livejournal.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/mixi.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/myopenid.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/myspace.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/odnoklassniki.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/openid.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/orange.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/paypal.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/persona.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/qq.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/renren.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/salesforce.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/stackexchange.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/steamcommunity.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/twitter.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/verisign.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/virgilio.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/vkontakte.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/wordpress.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Linking/yahoo.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Horizontal/horizonSharing16.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Horizontal/horizonSharing32.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Horizontal/horizontal.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Horizontal/single-image-theme-large.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Horizontal/single-image-theme-small.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Horizontal/vertical.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Vertical/16VerticlewithBox.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Vertical/32VerticlewithBox.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Vertical/verticalhorizontal.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/Sharing/Vertical/verticalvertical.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/media-pages/Thumbs.db ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/media-pages/facebook.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/media-pages/google.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/media-pages/linkedin.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/media-pages/twitter.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/images/media-pages/youtube.png ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/js/admin-ui.js ADDED
@@ -0,0 +1,364 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ // validate numeric data
8
+ function loginRadiusIsNumber(n) {
9
+ return !isNaN(parseFloat(n)) && isFinite(n);
10
+ }
11
+ var $loginRadiusJquery = jQuery.noConflict();
12
+ // prepare admin UI on window load
13
+ function loginRadiusPrepareAdminUI(){
14
+
15
+ // highlight API Key and Secret notification
16
+ if(jQuery('#loginRadiusKeySecretNotification')){
17
+ jQuery('#loginRadiusKeySecretNotification').animate({'backgroundColor' : 'rgb(241, 142, 127)'}, 1000).animate({'backgroundColor' : '#FFFFE0'}, 1000).animate({'backgroundColor' : 'rgb(241, 142, 127)'}, 1000).animate({'backgroundColor' : '#FFFFE0'}, 1000);
18
+ }
19
+
20
+ // show warning, if number of social login icons is < 2 or if non-numeric
21
+ document.getElementById('sociallogin_options_advancedSettings_iconsPerRow').onblur = function(){
22
+ if(document.getElementById('sociallogin_options_advancedSettings_iconsPerRow').value.trim() < 2 || !loginRadiusIsNumber(document.getElementById('sociallogin_options_messages_iconsPerRow').value.trim())){
23
+ if($loginRadiusJquery('#loginRadiusNoColumnsError').html() == undefined){
24
+ $loginRadiusJquery('#sociallogin_options_advancedSettings_iconsPerRow').before('<span id="loginRadiusNoColumnsError" style="color:red">Please enter a valid number greater than 1.</span>');
25
+ }else{
26
+ $loginRadiusJquery('#loginRadiusNoColumnsError').html('Please enter a valid number greater than 1.');
27
+ }
28
+ }else{
29
+ $loginRadiusJquery('#loginRadiusNoColumnsError').html('');
30
+ }
31
+ }
32
+
33
+ var horizontalSharingTheme, verticalSharingTheme;
34
+ // fetch horizontal and vertical sharing providers dynamically from LoginRadius on window load
35
+ var sharingType = ['horizontal', 'vertical'];
36
+ var sharingModes = ['Sharing', 'Counter'];
37
+ // show the sharing/counter providers according to the selected sharing theme
38
+ for(var j = 0; j < sharingType.length; j++){
39
+ var loginRadiusHorizontalSharingThemes = document.getElementById('row_sociallogin_options_'+sharingType[j]+'Sharing_'+sharingType[j]+'SharingTheme').getElementsByTagName('input');
40
+ for(var i = 0; i < loginRadiusHorizontalSharingThemes.length; i++){
41
+ if(sharingType[j] == 'horizontal'){
42
+ loginRadiusHorizontalSharingThemes[i].onclick = function(){
43
+ loginRadiusToggleSharingProviders(this, 'horizontal');
44
+ }
45
+ }else if(sharingType[j] == 'vertical'){
46
+ loginRadiusHorizontalSharingThemes[i].onclick = function(){
47
+ loginRadiusToggleSharingProviders(this, 'vertical');
48
+ }
49
+ }
50
+ if(loginRadiusHorizontalSharingThemes[i].checked == true){
51
+ if(sharingType[j] == 'horizontal'){
52
+ horizontalSharingTheme = loginRadiusHorizontalSharingThemes[i].value;
53
+ }else if(sharingType[j] == 'vertical'){
54
+ verticalSharingTheme = loginRadiusHorizontalSharingThemes[i].value;
55
+ }
56
+ loginRadiusToggleSharingProviders(loginRadiusHorizontalSharingThemes[i], sharingType[j]);
57
+ }
58
+ }
59
+ }
60
+ // set left margin for first radio button in Social Login Icon Size
61
+ jQuery("#sociallogin_options_basicSettings_redirectAfterLoginsame,#sociallogin_options_basicSettings_redirectAfterRegistrationsame,#sociallogin_options_horizontalSharing_horizontalSharingTheme32").css({"margin-right": "12px"});
62
+
63
+ // if selected sharing theme is worth showing rearrange icons, then show rearrange icons and manage sharing providers in hidden field
64
+ for(var j = 0; j < sharingType.length; j++){
65
+ for(var jj = 0; jj < sharingModes.length; jj++){
66
+ // get sharing providers table-row reference
67
+ var loginRadiusHorizontalSharingProvidersRow = document.getElementById('row_sociallogin_options_'+sharingType[j]+'Sharing_'+sharingType[j]+sharingModes[jj]+'Providers');
68
+ // get sharing providers checkboxes reference
69
+ var loginRadiusHorizontalSharingProviders = loginRadiusHorizontalSharingProvidersRow.getElementsByTagName('input');
70
+ for(var i = 0; i < loginRadiusHorizontalSharingProviders.length; i++){
71
+ if(sharingType[j] == 'horizontal'){
72
+ if(sharingModes[jj] == 'Sharing'){
73
+ loginRadiusHorizontalSharingProviders[i].onclick = function(){
74
+ loginRadiusShowIcon(false, this, 'horizontal');
75
+ }
76
+ }else{
77
+ loginRadiusHorizontalSharingProviders[i].onclick = function(){
78
+ loginRadiusPopulateCounter(this, 'horizontal');
79
+ }
80
+ }
81
+ }else if(sharingType[j] == 'vertical'){
82
+ if(sharingModes[jj] == 'Sharing'){
83
+ loginRadiusHorizontalSharingProviders[i].onclick = function(){
84
+ loginRadiusShowIcon(false, this, 'vertical');
85
+ }
86
+ }else{
87
+ loginRadiusHorizontalSharingProviders[i].onclick = function(){
88
+ loginRadiusPopulateCounter(this, 'vertical');
89
+ }
90
+ }
91
+ }
92
+ }
93
+
94
+ // check the sharing providers that were saved previously in the hidden field
95
+ var loginRadiusSharingProvidersHidden = document.getElementById('sociallogin_options_'+sharingType[j]+'Sharing_'+sharingType[j]+sharingModes[jj]+'ProvidersHidden').value.trim();
96
+ if(loginRadiusSharingProvidersHidden != ""){
97
+ var loginRadiusSharingProviderArray = loginRadiusSharingProvidersHidden.split(',');
98
+ if(sharingModes[jj] == 'Sharing'){
99
+ for(var i = 0; i < loginRadiusSharingProviderArray.length; i++){
100
+ if(document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i])){
101
+ document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]).checked = true;
102
+ loginRadiusShowIcon(true, document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]), sharingType[j]);
103
+ }
104
+ }
105
+ }else{
106
+ for(var i = 0; i < loginRadiusSharingProviderArray.length; i++){
107
+ if(document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i])){
108
+ document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]).checked = true;
109
+ }
110
+ }
111
+ }
112
+ }else{
113
+ if(sharingModes[jj] == 'Sharing'){
114
+ var loginRadiusSharingProviderArray = ["Facebook", "GooglePlus", "Twitter", "Pinterest", "Email", "Print"];
115
+ for(var i = 0; i < loginRadiusSharingProviderArray.length; i++){
116
+ document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]).checked = true;
117
+ loginRadiusShowIcon(true, document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]), sharingType[j], true);
118
+ }
119
+ }else{
120
+ var loginRadiusSharingProviderArray = ["Facebook Like", "Google+ +1", "Twitter Tweet", "Pinterest Pin it", "Hybridshare"];
121
+ for(var i = 0; i < loginRadiusSharingProviderArray.length; i++){
122
+ document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]).checked = true;
123
+ loginRadiusPopulateCounter(document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]), sharingType[j]);
124
+ }
125
+ }
126
+ }
127
+ }
128
+ }
129
+ }
130
+ // show sharing themes according to the selected option
131
+ function loginRadiusToggleSharing(theme){
132
+ if(typeof this.value == "undefined"){
133
+ var sharingTheme = theme;
134
+ }else{
135
+ var sharingTheme = this.value;
136
+ }
137
+ if(sharingTheme == "horizontal"){
138
+ document.getElementById('row_sociallogin_options_sharing_verticalSharing').style.display = 'none';
139
+ document.getElementById('row_sociallogin_options_sharing_horizontalSharing').style.display = 'table-row';
140
+ document.getElementById('row_sociallogin_options_sharing_sharingVerticalAlignment').style.display = 'none';
141
+ document.getElementById('row_sociallogin_options_sharing_sharingOffset').style.display = 'none';
142
+ }else if(sharingTheme == "vertical"){
143
+ document.getElementById('row_sociallogin_options_sharing_verticalSharing').style.display = 'table-row';
144
+ document.getElementById('row_sociallogin_options_sharing_horizontalSharing').style.display = 'none';
145
+ document.getElementById('row_sociallogin_options_sharing_sharingVerticalAlignment').style.display = 'table-row';
146
+ document.getElementById('row_sociallogin_options_sharing_sharingOffset').style.display = 'table-row';
147
+ }
148
+ }
149
+ // show counter themes according to the selected option
150
+ function loginRadiusToggleCounter(theme){
151
+ if(typeof this.value == "undefined"){
152
+ var counterTheme = theme;
153
+ }else{
154
+ var counterTheme = this.value;
155
+ }
156
+ if(counterTheme == "horizontal"){
157
+ document.getElementById('row_sociallogin_options_counter_verticalCounter').style.display = 'none';
158
+ document.getElementById('row_sociallogin_options_counter_horizontalCounter').style.display = 'table-row';
159
+ document.getElementById('row_sociallogin_options_counter_counterVerticalAlignment').style.display = 'none';
160
+ document.getElementById('row_sociallogin_options_counter_counterOffset').style.display = 'none';
161
+ }else if(counterTheme == "vertical"){
162
+ document.getElementById('row_sociallogin_options_counter_verticalCounter').style.display = 'table-row';
163
+ document.getElementById('row_sociallogin_options_counter_horizontalCounter').style.display = 'none';
164
+ document.getElementById('row_sociallogin_options_counter_counterVerticalAlignment').style.display = 'table-row';
165
+ document.getElementById('row_sociallogin_options_counter_counterOffset').style.display = 'table-row';
166
+ }
167
+ }
168
+ // limit maximum number of providers selected in sharing
169
+ function loginRadiusSharingLimit(elem, sharingType){
170
+ var checkCount = 0;
171
+ // get providers table-row reference
172
+ var loginRadiusSharingProvidersRow = document.getElementById('row_sociallogin_options_'+sharingType+'Sharing_'+sharingType+'SharingProviders');
173
+ // get sharing providers checkboxes reference
174
+ var loginRadiusSharingProviders = loginRadiusSharingProvidersRow.getElementsByTagName('input');
175
+ for(var i = 0; i < loginRadiusSharingProviders.length; i++){
176
+ if(loginRadiusSharingProviders[i].checked){
177
+ // count checked providers
178
+ checkCount++;
179
+ if(checkCount >= 10){
180
+ elem.checked = false;
181
+ if(document.getElementById('loginRadius'+sharingType+'ErrorDiv') == null){
182
+ // create and show div having error message
183
+ var errorDiv = document.createElement('div');
184
+ errorDiv.setAttribute('id', 'loginRadius'+sharingType+'ErrorDiv');
185
+ errorDiv.innerHTML = "You can select only 9 providers.";
186
+ errorDiv.style.color = 'red';
187
+ errorDiv.style.marginBottom = '10px';
188
+ // append div to the <td> containing sharing provider checkboxes
189
+ var rearrangeTd = loginRadiusSharingProvidersRow.getElementsByTagName('td');
190
+ $loginRadiusJquery(rearrangeTd[1]).find('ul').before(errorDiv);
191
+ }
192
+ return;
193
+ }
194
+ }
195
+ }
196
+ }
197
+ // add/remove icons from counter hidden field
198
+ function loginRadiusPopulateCounter(elem, sharingType, lrDefault){
199
+ if(elem.value != 1){
200
+ // get providers hidden field value
201
+ var providers = document.getElementById('sociallogin_options_'+sharingType+'Sharing_'+sharingType+'CounterProvidersHidden');
202
+ if(elem.checked){
203
+ // add selected providers in the hiddem field value
204
+ if(typeof elem.checked != "undefined" || lrDefault == true){
205
+ if(providers.value == ""){
206
+ providers.value = elem.value;
207
+ }else{
208
+ providers.value += ","+elem.value;
209
+ }
210
+ }
211
+ }else{
212
+ if(providers.value.indexOf(',') == -1){
213
+ providers.value = providers.value.replace(elem.value, "");
214
+ }else{
215
+ if(providers.value.indexOf(","+elem.value) == -1){
216
+ providers.value = providers.value.replace(elem.value+",", "");
217
+ }else{
218
+ providers.value = providers.value.replace(","+elem.value, "");
219
+ }
220
+ }
221
+ }
222
+ }
223
+ }
224
+ // show selected providers in rearrange option
225
+ function loginRadiusShowIcon(pageRefresh, elem, sharingType, lrDefault){
226
+ loginRadiusSharingLimit(elem, sharingType);
227
+ if(elem.value != 1){
228
+ // get providers hidden field value
229
+ var providers = document.getElementById('sociallogin_options_'+sharingType+'Sharing_'+sharingType+'SharingProvidersHidden');
230
+ if(elem.checked){
231
+ // get reference to "rearrange providers" <ul> element
232
+ var ul = document.getElementById('loginRadius'+sharingType+'RearrangeSharing');
233
+ // if <ul> is not already created
234
+ if(ul == null){
235
+ // create <ul> element
236
+ var ul = document.createElement('ul');
237
+ ul.setAttribute('id', 'loginRadius'+sharingType+'RearrangeSharing');
238
+ $loginRadiusJquery(ul).sortable({
239
+ update: function(e, ui) {
240
+ var val = $loginRadiusJquery(this).children().map(function() {
241
+ return $loginRadiusJquery(this).attr('title');
242
+ }).get().join();
243
+ $loginRadiusJquery(providers).val(val);
244
+ },
245
+ revert: true});
246
+ }
247
+ // create list items
248
+ var listItem = document.createElement('li');
249
+ listItem.setAttribute('id', 'loginRadius'+sharingType+'LI'+elem.value);
250
+ listItem.setAttribute('title', elem.value);
251
+ listItem.setAttribute('class', 'lrshare_iconsprite32 lrshare_'+elem.value.toLowerCase());
252
+ ul.appendChild(listItem);
253
+ // add selected providers in the hiddem field value
254
+ if(!pageRefresh || lrDefault == true){
255
+ if(providers.value == ""){
256
+ providers.value = elem.value;
257
+ }else{
258
+ providers.value += ","+elem.value;
259
+ }
260
+ }
261
+ // append <ul> to the <td>
262
+ var rearrangeRow = document.getElementById('row_sociallogin_options_'+sharingType+'Sharing_'+sharingType+'SharingProvidersHidden');
263
+ var rearrangeTd = rearrangeRow.getElementsByTagName('td');
264
+ rearrangeTd[1].appendChild(ul);
265
+ }else{
266
+ var remove = document.getElementById('loginRadius'+sharingType+'LI'+elem.value);
267
+ if(remove){
268
+ remove.parentNode.removeChild(remove);
269
+ }
270
+ if(providers.value.indexOf(',') == -1){
271
+ providers.value = providers.value.replace(elem.value, "");
272
+ }else{
273
+ if(providers.value.indexOf(","+elem.value) == -1){
274
+ providers.value = providers.value.replace(elem.value+",", "");
275
+ }else{
276
+ providers.value = providers.value.replace(","+elem.value, "");
277
+ }
278
+ }
279
+ }
280
+ }
281
+ }
282
+
283
+ jQuery(document).ready(function(){
284
+ loginradiusChangeInheritCheckboxHidden('horizontalSharing','horizontalCounter');
285
+ loginradiusChangeInheritCheckboxHidden('verticalSharing','verticalCounter');
286
+ loginradiusChangeInheritCheckboxHidden('horizontalSharing','horizontalSharing');
287
+ loginradiusChangeInheritCheckboxHidden('verticalSharing','verticalSharing');
288
+ jQuery("#sociallogin_options_horizontalSharing_horizontalCounterProviders_inherit").click(function(){
289
+ loginradiusChangeInheritCheckbox('horizontalSharing','horizontalCounter');
290
+ });
291
+ jQuery("#sociallogin_options_verticalSharing_verticalCounterProviders_inherit").click(function(){
292
+ loginradiusChangeInheritCheckbox('verticalSharing','verticalCounter');
293
+ });
294
+ jQuery("#sociallogin_options_horizontalSharing_horizontalSharingProviders_inherit").click(function(){
295
+ loginradiusChangeInheritCheckbox('horizontalSharing','horizontalSharing');
296
+ });
297
+ jQuery("#sociallogin_options_verticalSharing_verticalSharingProviders_inherit").click(function(){
298
+ loginradiusChangeInheritCheckbox('verticalSharing','verticalSharing');
299
+ });
300
+ jQuery("#sociallogin_options_horizontalSharing_horizontalSharingProvidersHidden_inherit").click(function(){
301
+ loginradiusChangeInheritCheckboxHidden('horizontalSharing','horizontalSharing');
302
+ });
303
+ jQuery("#sociallogin_options_verticalSharing_verticalSharingProvidersHidden_inherit").click(function(){
304
+ loginradiusChangeInheritCheckboxHidden('verticalSharing','verticalSharing');
305
+ });
306
+
307
+ loginradiusToggleRedirection();
308
+ jQuery("#row_sociallogin_options_basicSettings_redirectAfterLogin").change(function() {
309
+ loginradiusToggleRedirection();
310
+ });
311
+ jQuery("#sociallogin_options_basicSettings_redirectAfterRegistration").change(function() {
312
+ loginradiusToggleRedirection();
313
+ });
314
+
315
+ });
316
+ function loginradiusChangeInheritValueSharing(sharingType){
317
+ if(jQuery("#sociallogin_options_"+sharingType+"Sharing_"+sharingType+"SharingProviders_inherit").is(':checked')){
318
+ jQuery("#sociallogin_options_"+sharingType+"Sharing_"+sharingType+"SharingProvidersHidden_inherit").attr('checked', true);
319
+ } else {
320
+ jQuery("#sociallogin_options_"+sharingType+"Sharing_"+sharingType+"SharingProvidersHidden_inherit").attr('checked', false);
321
+ jQuery("#sociallogin_options_"+sharingType+"Sharing_"+sharingType+"SharingProvidersHidden").prop("disabled", false);
322
+ }
323
+ }
324
+ function loginradiusChangeInheritValue(sharingType){
325
+ if(jQuery("#sociallogin_options_"+sharingType+"Sharing_"+sharingType+"CounterProviders_inherit").is(':checked')){
326
+ jQuery("#sociallogin_options_"+sharingType+"Sharing_"+sharingType+"CounterProvidersHidden_inherit").attr('checked', true);
327
+ } else {
328
+ jQuery("#sociallogin_options_"+sharingType+"Sharing_"+sharingType+"CounterProvidersHidden_inherit").attr('checked', false);
329
+ jQuery("#sociallogin_options_"+sharingType+"Sharing_"+sharingType+"CounterProvidersHidden").prop("disabled", false);
330
+ }
331
+ }
332
+
333
+ function loginradiusToggleRedirection(){
334
+ if(jQuery('#sociallogin_options_basicSettings_redirectAfterLogin').val() == 'custom'){
335
+
336
+ jQuery('#row_sociallogin_options_basicSettings_customUrlLogin').show();
337
+ }else{
338
+ jQuery('#row_sociallogin_options_basicSettings_customUrlLogin').hide();
339
+ }
340
+ if(jQuery('#sociallogin_options_basicSettings_redirectAfterRegistration').val() == 'custom'){
341
+ jQuery('#row_sociallogin_options_basicSettings_customUrlRegistration').show();
342
+ }else{
343
+ jQuery('#row_sociallogin_options_basicSettings_customUrlRegistration').hide();
344
+ }
345
+ }
346
+ function loginradiusChangeInheritCheckbox(shareId1,shareId2){
347
+ if(jQuery("#sociallogin_options_"+shareId1+"_"+shareId2+"Providers_inherit").is(':checked')){
348
+ jQuery("#sociallogin_options_"+shareId1+"_"+shareId2+"ProvidersHidden_inherit").attr('checked',true);
349
+ jQuery("#sociallogin_options_"+shareId1+"_"+shareId2+"ProvidersHidden").attr("disabled", true);
350
+ }else{
351
+ jQuery("#sociallogin_options_"+shareId1+"_"+shareId2+"ProvidersHidden_inherit").attr('checked',false);
352
+ jQuery("#sociallogin_options_"+shareId1+"_"+shareId2+"ProvidersHidden").attr("disabled", false);
353
+ }
354
+ }
355
+
356
+ function loginradiusChangeInheritCheckboxHidden(shareId1,shareId2){
357
+ if(jQuery("#sociallogin_options_"+shareId1+"_"+shareId2+"ProvidersHidden_inherit").is(':checked')){
358
+ jQuery("#sociallogin_options_"+shareId1+"_"+shareId2+"Providers_inherit").attr('checked',true);
359
+ jQuery("#sociallogin_options_"+shareId1+"_"+shareId2+"ProvidersHidden").attr("disabled", true);
360
+ }else{
361
+ jQuery("#sociallogin_options_"+shareId1+"_"+shareId2+"Providers_inherit").attr('checked',false);
362
+ jQuery("#sociallogin_options_"+shareId1+"_"+shareId2+"ProvidersHidden").attr("disabled", false);
363
+ }
364
+ }
skin/adminhtml/default/default/Loginradius/Sociallogin/js/jquery.js ADDED
Binary file
skin/adminhtml/default/default/Loginradius/Sociallogin/js/jquery.ui.sortable.min.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*! jQuery UI - v1.10.1 - 2013-02-15
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.effect.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.position.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
4
+ * Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
5
+ (function(e,t){function i(t,n){var r,i,o,u=t.nodeName.toLowerCase();return"area"===u?(r=t.parentNode,i=r.name,!t.href||!i||r.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap=#"+i+"]")[0],!!o&&s(o))):(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"===u?t.href||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return e.css(this,"visibility")==="hidden"}).length}var n=0,r=/^ui-id-\d+$/;e.ui=e.ui||{};if(e.ui.version)return;e.extend(e.ui,{version:"1.10.1",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({_focus:e.fn.focus,focus:function(t,n){return typeof t=="number"?this.each(function(){var r=this;setTimeout(function(){e(r).focus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):t=this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(t,!r)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n){var r,i=e.plugins[t];if(!i||!e.element[0].parentNode||e.element[0].parentNode.nodeType===11)return;for(r=0;r<i.length;r++)e.options[i[r][0]]&&i[r][1].apply(e.element,n)}},hasScroll:function(t,n){if(e(t).css("overflow")==="hidden")return!1;var r=n&&n==="left"?"scrollLeft":"scrollTop",i=!1;return t[r]>0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)}})})(jQuery),function(e,t){var n=0,r=Array.prototype.slice,i=e.cleanData;e.cleanData=function(t){for(var n=0,r;(r=t[n])!=null;n++)try{e(r).triggerHandler("remove")}catch(s){}i(t)},e.widget=function(t,n,r){var i,s,o,u,a={},f=t.split(".")[0];t=t.split(".")[1],i=f+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[f]=e[f]||{},s=e[f][t],o=e[f][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),u=new n,u.options=e.widget.extend({},u.options),e.each(r,function(t,r){if(!e.isFunction(r)){a[t]=r;return}a[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},i=function(e){return n.prototype[t].apply(this,e)};return function(){var t=this._super,n=this._superApply,s;return this._super=e,this._superApply=i,s=r.apply(this,arguments),this._super=t,this._superApply=n,s}}()}),o.prototype=e.widget.extend(u,{widgetEventPrefix:s?u.widgetEventPrefix:t},a,{constructor:o,namespace:f,widgetName:t,widgetFullName:i}),s?(e.each(s._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,o,n._proto)}),delete s._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o)},e.widget.extend=function(n){var i=r.call(arguments,1),s=0,o=i.length,u,a;for(;s<o;s++)for(u in i[s])a=i[s][u],i[s].hasOwnProperty(u)&&a!==t&&(e.isPlainObject(a)?n[u]=e.isPlainObject(n[u])?e.widget.extend({},n[u],a):e.widget.extend({},a):n[u]=a);return n},e.widget.bridge=function(n,i){var s=i.prototype.widgetFullName||n;e.fn[n]=function(o){var u=typeof o=="string",a=r.call(arguments,1),f=this;return o=!u&&a.length?e.widget.extend.apply(null,[o].concat(a)):o,u?this.each(function(){var r,i=e.data(this,s);if(!i)return e.error("cannot call methods on "+n+" prior to initialization; "+"attempted to call method '"+o+"'");if(!e.isFunction(i[o])||o.charAt(0)==="_")return e.error("no such method '"+o+"' for "+n+" widget instance");r=i[o].apply(i,a);if(r!==i&&r!==t)return f=r&&r.jquery?f.pushStack(r.get()):r,!1}):this.each(function(){var t=e.data(this,s);t?t.option(o||{})._init():e.data(this,s,new i(o,this))}),f}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),r!==this&&(e.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(n,r){var i=n,s,o,u;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof n=="string"){i={},s=n.split("."),n=s.shift();if(s.length){o=i[n]=e.widget.extend({},this.options[n]);for(u=0;u<s.length-1;u++)o[s[u]]=o[s[u]]||{},o=o[s[u]];n=s.pop();if(r===t)return o[n]===t?null:o[n];o[n]=r}else{if(r===t)return this.options[n]===t?null:this.options[n];i[n]=r}}return this._setOptions(i),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,e==="disabled"&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(t,n,r){var i,s=this;typeof t!="boolean"&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,function(r,o){function u(){if(!t&&(s.options.disabled===!0||e(this).hasClass("ui-state-disabled")))return;return(typeof o=="string"?s[o]:o).apply(s,arguments)}typeof o!="string"&&(u.guid=o.guid=o.guid||u.guid||e.guid++);var a=r.match(/^(\w+)\s*(.*)$/),f=a[1]+s.eventNamespace,l=a[2];l?i.delegate(l,f,u):n.bind(f,u)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function n(){return(typeof e=="string"?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,n,r){var i,s,o=this.options[t];r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){typeof i=="string"&&(i={effect:i});var o,u=i?i===!0||typeof i=="number"?n:i.effect||n:t;i=i||{},typeof i=="number"&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&e.effects.effect[u]?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}})}(jQuery),function(e,t){var n=!1;e(document).mouseup(function(){n=!1}),e.widget("ui.mouse",{version:"1.10.1",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(n){if(!0===e.data(n.target,t.widgetName+".preventClickEvent"))return e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(n)return;this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var r=this,i=t.which===1,s=typeof this.options.cancel=="string"&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;if(!i||s||!this._mouseCapture(t))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==!1;if(!this._mouseStarted)return t.preventDefault(),!0}return!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return r._mouseMove(e)},this._mouseUpDelegate=function(e){return r._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),n=!0,!0},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(jQuery),function(e,t){e.widget("ui.draggable",e.ui.mouse,{version:"1.10.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){this.options.helper==="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var n=this.options;return this.helper||n.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(e(n.iframeFix===!0?"iframe":n.iframeFix).each(function(){e("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,n){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}if(!this.options.axis||this.options.axis!=="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!=="x")this.helper[0].style.top=this.position.top+"px";return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n,r=this,i=!1,s=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),n=this.element[0];while(n&&(n=n.parentNode))n===document&&(i=!0);return!i&&this.options.helper==="original"?!1:(this.options.revert==="invalid"&&!s||this.options.revert==="valid"&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){r._trigger("stop",t)!==!1&&r._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1)},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){var n=!this.options.handle||!e(this.options.handle,this.element).length?!0:!1;return e(this.options.handle,this.element).find("*").addBack().each(function(){this===t.target&&(n=!0)}),n},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):n.helper==="clone"?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo(n.appendTo==="parent"?this.element[0].parentNode:n.appendTo),r[0]!==this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))&&r.css("position","absolute"),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,n,r,i=this.options;i.containment==="parent"&&(i.containment=this.helper[0].parentNode);if(i.containment==="document"||i.containment==="window")this.containment=[i.containment==="document"?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,i.containment==="document"?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(i.containment==="document"?0:e(window).scrollLeft())+e(i.containment==="document"?document:window).width()-this.helperProportions.width-this.margins.left,(i.containment==="document"?0:e(window).scrollTop())+(e(i.containment==="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(i.containment)&&i.containment.constructor!==Array){n=e(i.containment),r=n[0];if(!r)return;t=e(r).css("overflow")!=="hidden",this.containment=[(parseInt(e(r).css("borderLeftWidth"),10)||0)+(parseInt(e(r).css("paddingLeft"),10)||0),(parseInt(e(r).css("borderTopWidth"),10)||0)+(parseInt(e(r).css("paddingTop"),10)||0),(t?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(e(r).css("borderLeftWidth"),10)||0)-(parseInt(e(r).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(e(r).css("borderTopWidth"),10)||0)-(parseInt(e(r).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n}else i.containment.constructor===Array&&(this.containment=i.containment)},_convertPositionTo:function(t,n){n||(n=this.position);var r=t==="absolute"?1:-1,i=this.cssPosition!=="absolute"||this.scrollParent[0]!==document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,s=/(html|body)/i.test(i[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():s?0:i.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():s?0:i.scrollLeft())*r}},_generatePosition:function(t){var n,r,i,s,o=this.options,u=this.cssPosition!=="absolute"||this.scrollParent[0]!==document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(u[0].tagName),f=t.pageX,l=t.pageY;return this.originalPosition&&(this.containment&&(this.relative_container?(r=this.relative_container.offset(),n=[this.containment[0]+r.left,this.containment[1]+r.top,this.containment[2]+r.left,this.containment[3]+r.top]):n=this.containment,t.pageX-this.offset.click.left<n[0]&&(f=n[0]+this.offset.click.left),t.pageY-this.offset.click.top<n[1]&&(l=n[1]+this.offset.click.top),t.pageX-this.offset.click.left>n[2]&&(f=n[2]+this.offset.click.left),t.pageY-this.offset.click.top>n[3]&&(l=n[3]+this.offset.click.top)),o.grid&&(i=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=n?i-this.offset.click.top>=n[1]||i-this.offset.click.top>n[3]?i:i-this.offset.click.top>=n[1]?i-o.grid[1]:i+o.grid[1]:i,s=o.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,f=n?s-this.offset.click.left>=n[0]||s-this.offset.click.left>n[2]?s:s-this.offset.click.left>=n[0]?s-o.grid[0]:s+o.grid[0]:s)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():a?0:u.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():a?0:u.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,n,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[n,r]),t==="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n){var r=e(this).data("ui-draggable"),i=r.options,s=e.extend({},n,{item:r.element});r.sortables=[],e(i.connectToSortable).each(function(){var n=e.data(this,"ui-sortable");n&&!n.options.disabled&&(r.sortables.push({instance:n,shouldRevert:n.options.revert}),n.refreshPositions(),n._trigger("activate",t,s))})},stop:function(t,n){var r=e(this).data("ui-draggable"),i=e.extend({},n,{item:r.element});e.each(r.sortables,function(){this.instance.isOver?(this.instance.isOver=0,r.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,r.options.helper==="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,i))})},drag:function(t,n){var r=e(this).data("ui-draggable"),i=this;e.each(r.sortables,function(){var s=!1,o=this;this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(s=!0,e.each(r.sortables,function(){return this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])&&(s=!1),s})),s?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(i).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return n.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=r.offset.click.top,this.instance.offset.click.left=r.offset.click.left,this.instance.offset.parent.left-=r.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=r.offset.parent.top-this.instance.offset.parent.top,r._trigger("toSortable",t),r.dropped=this.instance.element,r.currentItem=r.element,this.instance.fromOutside=r),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),r._trigger("fromSortable",t),r.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(){var t=e("body"),n=e(this).data("ui-draggable").options;t.css("cursor")&&(n._cursor=t.css("cursor")),t.css("cursor",n.cursor)},stop:function(){var t=e(this).data("ui-draggable").options;t._cursor&&e("body").css("cursor",t._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n){var r=e(n.helper),i=e(this).data("ui-draggable").options;r.css("opacity")&&(i._opacity=r.css("opacity")),r.css("opacity",i.opacity)},stop:function(t,n){var r=e(this).data("ui-draggable").options;r._opacity&&e(n.helper).css("opacity",r._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(){var t=e(this).data("ui-draggable");t.scrollParent[0]!==document&&t.scrollParent[0].tagName!=="HTML"&&(t.overflowOffset=t.scrollParent.offset())},drag:function(t){var n=e(this).data("ui-draggable"),r=n.options,i=!1;if(n.scrollParent[0]!==document&&n.scrollParent[0].tagName!=="HTML"){if(!r.axis||r.axis!=="x")n.overflowOffset.top+n.scrollParent[0].offsetHeight-t.pageY<r.scrollSensitivity?n.scrollParent[0].scrollTop=i=n.scrollParent[0].scrollTop+r.scrollSpeed:t.pageY-n.overflowOffset.top<r.scrollSensitivity&&(n.scrollParent[0].scrollTop=i=n.scrollParent[0].scrollTop-r.scrollSpeed);if(!r.axis||r.axis!=="y")n.overflowOffset.left+n.scrollParent[0].offsetWidth-t.pageX<r.scrollSensitivity?n.scrollParent[0].scrollLeft=i=n.scrollParent[0].scrollLeft+r.scrollSpeed:t.pageX-n.overflowOffset.left<r.scrollSensitivity&&(n.scrollParent[0].scrollLeft=i=n.scrollParent[0].scrollLeft-r.scrollSpeed)}else{if(!r.axis||r.axis!=="x")t.pageY-e(document).scrollTop()<r.scrollSensitivity?i=e(document).scrollTop(e(document).scrollTop()-r.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<r.scrollSensitivity&&(i=e(document).scrollTop(e(document).scrollTop()+r.scrollSpeed));if(!r.axis||r.axis!=="y")t.pageX-e(document).scrollLeft()<r.scrollSensitivity?i=e(document).scrollLeft(e(document).scrollLeft()-r.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<r.scrollSensitivity&&(i=e(document).scrollLeft(e(document).scrollLeft()+r.scrollSpeed))}i!==!1&&e.ui.ddmanager&&!r.dropBehaviour&&e.ui.ddmanager.prepareOffsets(n,t)}}),e.ui.plugin.add("draggable","snap",{start:function(){var t=e(this).data("ui-draggable"),n=t.options;t.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var n=e(this),r=n.offset();this!==t.element[0]&&t.snapElements.push({item:this,width:n.outerWidth(),height:n.outerHeight(),top:r.top,left:r.left})})},drag:function(t,n){var r,i,s,o,u,a,f,l,c,h,p=e(this).data("ui-draggable"),d=p.options,v=d.snapTolerance,m=n.offset.left,g=m+p.helperProportions.width,y=n.offset.top,b=y+p.helperProportions.height;for(c=p.snapElements.length-1;c>=0;c--){u=p.snapElements[c].left,a=u+p.snapElements[c].width,f=p.snapElements[c].top,l=f+p.snapElements[c].height;if(!(u-v<m&&m<a+v&&f-v<y&&y<l+v||u-v<m&&m<a+v&&f-v<b&&b<l+v||u-v<g&&g<a+v&&f-v<y&&y<l+v||u-v<g&&g<a+v&&f-v<b&&b<l+v)){p.snapElements[c].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=!1;continue}d.snapMode!=="inner"&&(r=Math.abs(f-b)<=v,i=Math.abs(l-y)<=v,s=Math.abs(u-g)<=v,o=Math.abs(a-m)<=v,r&&(n.position.top=p._convertPositionTo("relative",{top:f-p.helperProportions.height,left:0}).top-p.margins.top),i&&(n.position.top=p._convertPositionTo("relative",{top:l,left:0}).top-p.margins.top),s&&(n.position.left=p._convertPositionTo("relative",{top:0,left:u-p.helperProportions.width}).left-p.margins.left),o&&(n.position.left=p._convertPositionTo("relative",{top:0,left:a}).left-p.margins.left)),h=r||i||s||o,d.snapMode!=="outer"&&(r=Math.abs(f-y)<=v,i=Math.abs(l-b)<=v,s=Math.abs(u-m)<=v,o=Math.abs(a-g)<=v,r&&(n.position.top=p._convertPositionTo("relative",{top:f,left:0}).top-p.margins.top),i&&(n.position.top=p._convertPositionTo("relative",{top:l-p.helperProportions.height,left:0}).top-p.margins.top),s&&(n.position.left=p._convertPositionTo("relative",{top:0,left:u}).left-p.margins.left),o&&(n.position.left=p._convertPositionTo("relative",{top:0,left:a-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[c].snapping&&(r||i||s||o||h)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=r||i||s||o||h}}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,n=this.data("ui-draggable").options,r=e.makeArray(e(n.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});if(!r.length)return;t=parseInt(e(r[0]).css("zIndex"),10)||0,e(r).each(function(n){e(this).css("zIndex",t+n)}),this.css("zIndex",t+r.length)}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n){var r=e(n.helper),i=e(this).data("ui-draggable").options;r.css("zIndex")&&(i._zIndex=r.css("zIndex")),r.css("zIndex",i.zIndex)},stop:function(t,n){var r=e(this).data("ui-draggable").options;r._zIndex&&e(n.helper).css("zIndex",r._zIndex)}})}(jQuery),function(e,t){function n(e,t,n){return e>t&&e<t+n}e.widget("ui.droppable",{version:"1.10.1",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t=this.options,n=t.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(n)?n:function(e){return e.is(n)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){var t=0,n=e.ui.ddmanager.droppables[this.options.scope];for(;t<n.length;t++)n[t]===this&&n.splice(t,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,n){t==="accept"&&(this.accept=e.isFunction(n)?n:function(e){return e.is(n)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),n&&this._trigger("activate",t,this.ui(n))},_deactivate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),n&&this._trigger("deactivate",t,this.ui(n))},_over:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]===this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(n)))},_out:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]===this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(n)))},_drop:function(t,n){var r=n||e.ui.ddmanager.current,i=!1;return!r||(r.currentItem||r.element)[0]===this.element[0]?!1:(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"ui-droppable");if(t.options.greedy&&!t.options.disabled&&t.options.scope===r.options.scope&&t.accept.call(t.element[0],r.currentItem||r.element)&&e.ui.intersect(r,e.extend(t,{offset:t.element.offset()}),t.options.tolerance))return i=!0,!1}),i?!1:this.accept.call(this.element[0],r.currentItem||r.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(r)),this.element):!1)},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(e,t,r){if(!t.offset)return!1;var i,s,o=(e.positionAbs||e.position.absolute).left,u=o+e.helperProportions.width,a=(e.positionAbs||e.position.absolute).top,f=a+e.helperProportions.height,l=t.offset.left,c=l+t.proportions.width,h=t.offset.top,p=h+t.proportions.height;switch(r){case"fit":return l<=o&&u<=c&&h<=a&&f<=p;case"intersect":return l<o+e.helperProportions.width/2&&u-e.helperProportions.width/2<c&&h<a+e.helperProportions.height/2&&f-e.helperProportions.height/2<p;case"pointer":return i=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left,s=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top,n(s,h,t.proportions.height)&&n(i,l,t.proportions.width);case"touch":return(a>=h&&a<=p||f>=h&&f<=p||a<h&&f>p)&&(o>=l&&o<=c||u>=l&&u<=c||o<l&&u>c);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,n){var r,i,s=e.ui.ddmanager.droppables[t.options.scope]||[],o=n?n.type:null,u=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(r=0;r<s.length;r++){if(s[r].options.disabled||t&&!s[r].accept.call(s[r].element[0],t.currentItem||t.element))continue;for(i=0;i<u.length;i++)if(u[i]===s[r].element[0]){s[r].proportions.height=0;continue e}s[r].visible=s[r].element.css("display")!=="none";if(!s[r].visible)continue;o==="mousedown"&&s[r]._activate.call(s[r],n),s[r].offset=s[r].element.offset(),s[r].proportions={width:s[r].element[0].offsetWidth,height:s[r].element[0].offsetHeight}}},drop:function(t,n){var r=!1;return e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options)return;!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(r=this._drop.call(this,n)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,n))}),r},dragStart:function(t,n){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)})},drag:function(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var r,i,s,o=e.ui.intersect(t,this,this.options.tolerance),u=!o&&this.isover?"isout":o&&!this.isover?"isover":null;if(!u)return;this.options.greedy&&(i=this.options.scope,s=this.element.parents(":data(ui-droppable)").filter(function(){return e.data(this,"ui-droppable").options.scope===i}),s.length&&(r=e.data(s[0],"ui-droppable"),r.greedyChild=u==="isover")),r&&u==="isover"&&(r.isover=!1,r.isout=!0,r._out.call(r,n)),this[u]=!0,this[u==="isout"?"isover":"isout"]=!1,this[u==="isover"?"_over":"_out"].call(this,n),r&&u==="isout"&&(r.isout=!1,r.isover=!0,r._over.call(r,n))})},dragStop:function(t,n){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}}}(jQuery),function(e,t){function n(e){return parseInt(e,10)||0}function r(e){return!isNaN(parseInt(e,10))}e.widget("ui.resizable",e.ui.mouse,{version:"1.10.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var t,n,r,i,s,o=this,u=this.options;this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!u.aspectRatio,aspectRatio:u.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:u.helper||u.ghost||u.animate?u.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=u.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor===String){this.handles==="all"&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={};for(n=0;n<t.length;n++)r=e.trim(t[n]),s="ui-resizable-"+r,i=e("<div class='ui-resizable-handle "+s+"'></div>"),i.css({zIndex:u.zIndex}),"se"===r&&i.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[r]=".ui-resizable-"+r,this.element.append(i)}this._renderAxis=function(t){var n,r,i,s;t=t||this.element;for(n in this.handles){this.handles[n].constructor===String&&(this.handles[n]=e(this.handles[n],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(r=e(this.handles[n],this.element),s=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth(),i=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize());if(!e(this.handles[n]).length)continue}},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=i&&i[1]?i[1]:"se")}),u.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){if(u.disabled)return;e(this).removeClass("ui-resizable-autohide"),o._handles.show()}).mouseleave(function(){if(u.disabled)return;o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,n=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(n(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),n(this.originalElement),this},_mouseCapture:function(t){var n,r,i=!1;for(n in this.handles){r=e(this.handles[n])[0];if(r===t.target||e.contains(r,t.target))i=!0}return!this.options.disabled&&i},_mouseStart:function(t){var r,i,s,o=this.options,u=this.element.position(),a=this.element;return this.resizing=!0,/absolute/.test(a.css("position"))?a.css({position:"absolute",top:a.css("top"),left:a.css("left")}):a.is(".ui-draggable")&&a.css({position:"absolute",top:u.top,left:u.left}),this._renderProxy(),r=n(this.helper.css("left")),i=n(this.helper.css("top")),o.containment&&(r+=e(o.containment).scrollLeft()||0,i+=e(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:r,top:i},this.size=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.originalPosition={left:r,top:i},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio=typeof o.aspectRatio=="number"?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor",s==="auto"?this.axis+"-resize":s),a.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var n,r=this.helper,i={},s=this.originalMousePosition,o=this.axis,u=this.position.top,a=this.position.left,f=this.size.width,l=this.size.height,c=t.pageX-s.left||0,h=t.pageY-s.top||0,p=this._change[o];if(!p)return!1;n=p.apply(this,[t,c,h]),this._updateVirtualBoundaries(t.shiftKey);if(this._aspectRatio||t.shiftKey)n=this._updateRatio(n,t);return n=this._respectSize(n,t),this._updateCache(n),this._propagate("resize",t),this.position.top!==u&&(i.top=this.position.top+"px"),this.position.left!==a&&(i.left=this.position.left+"px"),this.size.width!==f&&(i.width=this.size.width+"px"),this.size.height!==l&&(i.height=this.size.height+"px"),r.css(i),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(i)||this._trigger("resize",t,this.ui()),!1},_mouseStop:function(t){this.resizing=!1;var n,r,i,s,o,u,a,f=this.options,l=this;return this._helper&&(n=this._proportionallyResizeElements,r=n.length&&/textarea/i.test(n[0].nodeName),i=r&&e.ui.hasScroll(n[0],"left")?0:l.sizeDiff.height,s=r?0:l.sizeDiff.width,o={width:l.helper.width()-s,height:l.helper.height()-i},u=parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left)||null,a=parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top)||null,f.animate||this.element.css(e.extend(o,{top:a,left:u})),l.helper.height(l.size.height),l.helper.width(l.size.width),this._helper&&!f.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t,n,i,s,o,u=this.options;o={minWidth:r(u.minWidth)?u.minWidth:0,maxWidth:r(u.maxWidth)?u.maxWidth:Infinity,minHeight:r(u.minHeight)?u.minHeight:0,maxHeight:r(u.maxHeight)?u.maxHeight:Infinity};if(this._aspectRatio||e)t=o.minHeight*this.aspectRatio,i=o.minWidth/this.aspectRatio,n=o.maxHeight*this.aspectRatio,s=o.maxWidth/this.aspectRatio,t>o.minWidth&&(o.minWidth=t),i>o.minHeight&&(o.minHeight=i),n<o.maxWidth&&(o.maxWidth=n),s<o.maxHeight&&(o.maxHeight=s);this._vBoundaries=o},_updateCache:function(e){this.offset=this.helper.offset(),r(e.left)&&(this.position.left=e.left),r(e.top)&&(this.position.top=e.top),r(e.height)&&(this.size.height=e.height),r(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,n=this.size,i=this.axis;return r(e.height)?e.width=e.height*this.aspectRatio:r(e.width)&&(e.height=e.width/this.aspectRatio),i==="sw"&&(e.left=t.left+(n.width-e.width),e.top=null),i==="nw"&&(e.top=t.top+(n.height-e.height),e.left=t.left+(n.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,n=this.axis,i=r(e.width)&&t.maxWidth&&t.maxWidth<e.width,s=r(e.height)&&t.maxHeight&&t.maxHeight<e.height,o=r(e.width)&&t.minWidth&&t.minWidth>e.width,u=r(e.height)&&t.minHeight&&t.minHeight>e.height,a=this.originalPosition.left+this.originalSize.width,f=this.position.top+this.size.height,l=/sw|nw|w/.test(n),c=/nw|ne|n/.test(n);return o&&(e.width=t.minWidth),u&&(e.height=t.minHeight),i&&(e.width=t.maxWidth),s&&(e.height=t.maxHeight),o&&l&&(e.left=a-t.minWidth),i&&l&&(e.left=a-t.maxWidth),u&&c&&(e.top=f-t.minHeight),s&&c&&(e.top=f-t.maxHeight),!e.width&&!e.height&&!e.left&&e.top?e.top=null:!e.width&&!e.height&&!e.top&&e.left&&(e.left=null),e},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length)return;var e,t,n,r,i,s=this.helper||this.element;for(e=0;e<this._proportionallyResizeElements.length;e++){i=this._proportionallyResizeElements[e];if(!this.borderDif){this.borderDif=[],n=[i.css("borderTopWidth"),i.css("borderRightWidth"),i.css("borderBottomWidth"),i.css("borderLeftWidth")],r=[i.css("paddingTop"),i.css("paddingRight"),i.css("paddingBottom"),i.css("paddingLeft")];for(t=0;t<n.length;t++)this.borderDif[t]=(parseInt(n[t],10)||0)+(parseInt(r[t],10)||0)}i.css({height:s.height()-this.borderDif[0]-this.borderDif[2]||0,width:s.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var t=this.element,n=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var n=this.originalSize,r=this.originalPosition;return{left:r.left+t,width:n.width-t}},n:function(e,t,n){var r=this.originalSize,i=this.originalPosition;return{top:i.top+n,height:r.height-n}},s:function(e,t,n){return{height:this.originalSize.height+n}},se:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},sw:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,n,r]))},ne:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},nw:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,n,r]))}},_propagate:function(t,n){e.ui.plugin.call(this,t,[n,this.ui()]),t!=="resize"&&this._trigger(t,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var n=e(this).data("ui-resizable"),r=n.options,i=n._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),o=s&&e.ui.hasScroll(i[0],"left")?0:n.sizeDiff.height,u=s?0:n.sizeDiff.width,a={width:n.size.width-u,height:n.size.height-o},f=parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left)||null,l=parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top)||null;n.element.animate(e.extend(a,l&&f?{top:l,left:f}:{}),{duration:r.animateDuration,easing:r.animateEasing,step:function(){var r={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};i&&i.length&&e(i[0]).css({width:r.width,height:r.height}),n._updateCache(r),n._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,r,i,s,o,u,a,f=e(this).data("ui-resizable"),l=f.options,c=f.element,h=l.containment,p=h instanceof e?h.get(0):/parent/.test(h)?c.parent().get(0):h;if(!p)return;f.containerElement=e(p),/document/.test(h)||h===document?(f.containerOffset={left:0,top:0},f.containerPosition={left:0,top:0},f.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(p),r=[],e(["Top","Right","Left","Bottom"]).each(function(e,i){r[e]=n(t.css("padding"+i))}),f.containerOffset=t.offset(),f.containerPosition=t.position(),f.containerSize={height:t.innerHeight()-r[3],width:t.innerWidth()-r[1]},i=f.containerOffset,s=f.containerSize.height,o=f.containerSize.width,u=e.ui.hasScroll(p,"left")?p.scrollWidth:o,a=e.ui.hasScroll(p)?p.scrollHeight:s,f.parentData={element:p,left:i.left,top:i.top,width:u,height:a})},resize:function(t){var n,r,i,s,o=e(this).data("ui-resizable"),u=o.options,a=o.containerOffset,f=o.position,l=o._aspectRatio||t.shiftKey,c={top:0,left:0},h=o.containerElement;h[0]!==document&&/static/.test(h.css("position"))&&(c=a),f.left<(o._helper?a.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-a.left:o.position.left-c.left),l&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=u.helper?a.left:0),f.top<(o._helper?a.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-a.top:o.position.top),l&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?a.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,n=Math.abs((o._helper?o.offset.left-c.left:o.offset.left-c.left)+o.sizeDiff.width),r=Math.abs((o._helper?o.offset.top-c.top:o.offset.top-a.top)+o.sizeDiff.height),i=o.containerElement.get(0)===o.element.parent().get(0),s=/relative|absolute/.test(o.containerElement.css("position")),i&&s&&(n-=o.parentData.left),n+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-n,l&&(o.size.height=o.size.width/o.aspectRatio)),r+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-r,l&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var t=e(this).data("ui-resizable"),n=t.options,r=t.containerOffset,i=t.containerPosition,s=t.containerElement,o=e(t.helper),u=o.offset(),a=o.outerWidth()-t.sizeDiff.width,f=o.outerHeight()-t.sizeDiff.height;t._helper&&!n.animate&&/relative/.test(s.css("position"))&&e(this).css({left:u.left-i.left-r.left,width:a,height:f}),t._helper&&!n.animate&&/static/.test(s.css("position"))&&e(this).css({left:u.left-i.left-r.left,width:a,height:f})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).data("ui-resizable"),n=t.options,r=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};typeof n.alsoResize=="object"&&!n.alsoResize.parentNode?n.alsoResize.length?(n.alsoResize=n.alsoResize[0],r(n.alsoResize)):e.each(n.alsoResize,function(e){r(e)}):r(n.alsoResize)},resize:function(t,n){var r=e(this).data("ui-resizable"),i=r.options,s=r.originalSize,o=r.originalPosition,u={height:r.size.height-s.height||0,width:r.size.width-s.width||0,top:r.position.top-o.top||0,left:r.position.left-o.left||0},a=function(t,r){e(t).each(function(){var t=e(this),i=e(this).data("ui-resizable-alsoresize"),s={},o=r&&r.length?r:t.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var n=(i[t]||0)+(u[t]||0);n&&n>=0&&(s[t]=n||null)}),t.css(s)})};typeof i.alsoResize=="object"&&!i.alsoResize.nodeType?e.each(i.alsoResize,function(e,t){a(e,t)}):a(i.alsoResize)},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).data("ui-resizable"),n=t.options,r=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:r.height,width:r.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof n.ghost=="string"?n.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).data("ui-resizable");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).data("ui-resizable");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t=e(this).data("ui-resizable"),n=t.options,r=t.size,i=t.originalSize,s=t.originalPosition,o=t.axis,u=typeof n.grid=="number"?[n.grid,n.grid]:n.grid,a=u[0]||1,f=u[1]||1,l=Math.round((r.width-i.width)/a)*a,c=Math.round((r.height-i.height)/f)*f,h=i.width+l,p=i.height+c,d=n.maxWidth&&n.maxWidth<h,v=n.maxHeight&&n.maxHeight<p,m=n.minWidth&&n.minWidth>h,g=n.minHeight&&n.minHeight>p;n.grid=u,m&&(h+=a),g&&(p+=f),d&&(h-=a),v&&(p-=f),/^(se|s|e)$/.test(o)?(t.size.width=h,t.size.height=p):/^(ne)$/.test(o)?(t.size.width=h,t.size.height=p,t.position.top=s.top-c):/^(sw)$/.test(o)?(t.size.width=h,t.size.height=p,t.position.left=s.left-l):(t.size.width=h,t.size.height=p,t.position.top=s.top-c,t.position.left=s.left-l)}})}(jQuery),function(e,t){e.widget("ui.selectable",e.ui.mouse,{version:"1.10.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,n=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(n.options.filter,n.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),n=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:n.left,top:n.top,right:n.left+t.outerWidth(),bottom:n.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var n=this,r=this.options;this.opos=[t.pageX,t.pageY];if(this.options.disabled)return;this.selectees=e(r.filter,this.element[0]),this._trigger("start",t),e(r.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var r=e.data(this,"selectable-item");r.startselected=!0,!t.metaKey&&!t.ctrlKey&&(r.$element.removeClass("ui-selected"),r.selected=!1,r.$element.addClass("ui-unselecting"),r.unselecting=!0,n._trigger("unselecting",t,{unselecting:r.element}))}),e(t.target).parents().addBack().each(function(){var r,i=e.data(this,"selectable-item");if(i)return r=!t.metaKey&&!t.ctrlKey||!i.$element.hasClass("ui-selected"),i.$element.removeClass(r?"ui-unselecting":"ui-selected").addClass(r?"ui-selecting":"ui-unselecting"),i.unselecting=!r,i.selecting=r,i.selected=r,r?n._trigger("selecting",t,{selecting:i.element}):n._trigger("unselecting",t,{unselecting:i.element}),!1})},_mouseDrag:function(t){this.dragged=!0;if(this.options.disabled)return;var n,r=this,i=this.options,s=this.opos[0],o=this.opos[1],u=t.pageX,a=t.pageY;return s>u&&(n=u,u=s,s=n),o>a&&(n=a,a=o,o=n),this.helper.css({left:s,top:o,width:u-s,height:a-o}),this.selectees.each(function(){var n=e.data(this,"selectable-item"),f=!1;if(!n||n.element===r.element[0])return;i.tolerance==="touch"?f=!(n.left>u||n.right<s||n.top>a||n.bottom<o):i.tolerance==="fit"&&(f=n.left>s&&n.right<u&&n.top>o&&n.bottom<a),f?(n.selected&&(n.$element.removeClass("ui-selected"),n.selected=!1),n.unselecting&&(n.$element.removeClass("ui-unselecting"),n.unselecting=!1),n.selecting||(n.$element.addClass("ui-selecting"),n.selecting=!0,r._trigger("selecting",t,{selecting:n.element}))):(n.selecting&&((t.metaKey||t.ctrlKey)&&n.startselected?(n.$element.removeClass("ui-selecting"),n.selecting=!1,n.$element.addClass("ui-selected"),n.selected=!0):(n.$element.removeClass("ui-selecting"),n.selecting=!1,n.startselected&&(n.$element.addClass("ui-unselecting"),n.unselecting=!0),r._trigger("unselecting",t,{unselecting:n.element}))),n.selected&&!t.metaKey&&!t.ctrlKey&&!n.startselected&&(n.$element.removeClass("ui-selected"),n.selected=!1,n.$element.addClass("ui-unselecting"),n.unselecting=!0,r._trigger("unselecting",t,{unselecting:n.element})))}),!1},_mouseStop:function(t){var n=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-unselecting"),r.unselecting=!1,r.startselected=!1,n._trigger("unselected",t,{unselected:r.element})}),e(".ui-selecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-selecting").addClass("ui-selected"),r.selecting=!1,r.selected=!0,r.startselected=!0,n._trigger("selected",t,{selected:r.element})}),this._trigger("stop",t),this.helper.remove(),!1}})}(jQuery),function(e,t){function n(e,t,n){return e>t&&e<t+n}e.widget("ui.sortable",e.ui.mouse,{version:"1.10.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?e.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,n){t==="disabled"?(this.options[t]=n,this.widget().toggleClass("ui-sortable-disabled",!!n)):e.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,n){var r=null,i=!1,s=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type==="static")return!1;this._refreshItems(t),e(t.target).parents().each(function(){if(e.data(this,s.widgetName+"-item")===s)return r=e(this),!1}),e.data(t.target,s.widgetName+"-item")===s&&(r=e(t.target));if(!r)return!1;if(this.options.handle&&!n){e(this.options.handle,r).find("*").addBack().each(function(){this===t.target&&(i=!0)});if(!i)return!1}return this.currentItem=r,this._removeCurrentsFromItems(),!0},_mouseStart:function(t,n,r){var i,s=this.options;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,s.cursorAt&&this._adjustOffsetFromHelper(s.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),s.containment&&this._setContainment(),s.cursor&&(e("body").css("cursor")&&(this._storedCursor=e("body").css("cursor")),e("body").css("cursor",s.cursor)),s.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",s.opacity)),s.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",s.zIndex)),this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!r)for(i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!s.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var n,r,i,s,o=this.options,u=!1;this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=u=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=u=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=u=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=u=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-e(document).scrollTop()<o.scrollSensitivity?u=e(document).scrollTop(e(document).scrollTop()-o.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<o.scrollSensitivity&&(u=e(document).scrollTop(e(document).scrollTop()+o.scrollSpeed)),t.pageX-e(document).scrollLeft()<o.scrollSensitivity?u=e(document).scrollLeft(e(document).scrollLeft()-o.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<o.scrollSensitivity&&(u=e(document).scrollLeft(e(document).scrollLeft()+o.scrollSpeed))),u!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!=="x")this.helper[0].style.top=this.position.top+"px";for(n=this.items.length-1;n>=0;n--){r=this.items[n],i=r.item[0],s=this._intersectsWithPointer(r);if(!s)continue;if(r.instance!==this.currentContainer)continue;if(i!==this.currentItem[0]&&this.placeholder[s===1?"next":"prev"]()[0]!==i&&!e.contains(this.placeholder[0],i)&&(this.options.type==="semi-dynamic"?!e.contains(this.element[0],i):!0)){this.direction=s===1?"down":"up";if(this.options.tolerance!=="pointer"&&!this._intersectsWithSides(r))break;this._rearrange(t,r),this._trigger("change",t,this._uiHash());break}}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,n){if(!t)return;e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t);if(this.options.revert){var r=this,i=this.placeholder.offset();this.reverting=!0,e(this.helper).animate({left:i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft),top:i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){r._clear(t)})}else this._clear(t,n);return!1},cancel:function(){if(this.dragging){this._mouseUp({target:null}),this.options.helper==="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},e(n).each(function(){var n=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);n&&r.push((t.key||n[1]+"[]")+"="+(t.key&&t.expression?n[1]:n[2]))}),!r.length&&t.key&&r.push(t.key+"="),r.join("&")},toArray:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},n.each(function(){r.push(e(t.item||this).attr(t.attribute||"id")||"")}),r},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,r=this.positionAbs.top,i=r+this.helperProportions.height,s=e.left,o=s+e.width,u=e.top,a=u+e.height,f=this.offset.click.top,l=this.offset.click.left,c=r+f>u&&r+f<a&&t+l>s&&t+l<o;return this.options.tolerance==="pointer"||this.options.forcePointerForContainers||this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?c:s<t+this.helperProportions.width/2&&n-this.helperProportions.width/2<o&&u<r+this.helperProportions.height/2&&i-this.helperProportions.height/2<a},_intersectsWithPointer:function(e){var t=this.options.axis==="x"||n(this.positionAbs.top+this.offset.click.top,e.top,e.height),r=this.options.axis==="y"||n(this.positionAbs.left+this.offset.click.left,e.left,e.width),i=t&&r,s=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return i?this.floating?o&&o==="right"||s==="down"?2:1:s&&(s==="down"?2:1):!1},_intersectsWithSides:function(e){var t=n(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),r=n(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),i=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return this.floating&&s?s==="right"&&r||s==="left"&&!r:i&&(i==="down"&&t||i==="up"&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return e!==0&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return e!==0&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){var n,r,i,s,o=[],u=[],a=this._connectWith();if(a&&t)for(n=a.length-1;n>=0;n--){i=e(a[n]);for(r=i.length-1;r>=0;r--)s=e.data(i[r],this.widgetFullName),s&&s!==this&&!s.options.disabled&&u.push([e.isFunction(s.options.items)?s.options.items.call(s.element):e(s.options.items,s.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),s])}u.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(n=u.length-1;n>=0;n--)u[n][0].each(function(){o.push(this)});return e(o)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var n=0;n<t.length;n++)if(t[n]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var n,r,i,s,o,u,a,f,l=this.items,c=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],h=this._connectWith();if(h&&this.ready)for(n=h.length-1;n>=0;n--){i=e(h[n]);for(r=i.length-1;r>=0;r--)s=e.data(i[r],this.widgetFullName),s&&s!==this&&!s.options.disabled&&(c.push([e.isFunction(s.options.items)?s.options.items.call(s.element[0],t,{item:this.currentItem}):e(s.options.items,s.element),s]),this.containers.push(s))}for(n=c.length-1;n>=0;n--){o=c[n][1],u=c[n][0];for(r=0,f=u.length;r<f;r++)a=e(u[r]),a.data(this.widgetName+"-item",o),l.push({item:a,instance:o,width:0,height:0,left:0,top:0})}},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var n,r,i,s;for(n=this.items.length-1;n>=0;n--){r=this.items[n];if(r.instance!==this.currentContainer&&this.currentContainer&&r.item[0]!==this.currentItem[0])continue;i=this.options.toleranceElement?e(this.options.toleranceElement,r.item):r.item,t||(r.width=i.outerWidth(),r.height=i.outerHeight()),s=i.offset(),r.left=s.left,r.top=s.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(n=this.containers.length-1;n>=0;n--)s=this.containers[n].element.offset(),this.containers[n].containerCache.left=s.left,this.containers[n].containerCache.top=s.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var n,r=t.options;if(!r.placeholder||r.placeholder.constructor===String)n=r.placeholder,r.placeholder={element:function(){var r=e(document.createElement(t.currentItem[0].nodeName)).addClass(n||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return n||(r.style.visibility="hidden"),r},update:function(e,i){if(n&&!r.forcePlaceholderSize)return;i.height()||i.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),i.width()||i.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10))}};t.placeholder=e(r.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),r.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var n,r,i,s,o,u,a,f,l,c=null,h=null;for(n=this.containers.length-1;n>=0;n--){if(e.contains(this.currentItem[0],this.containers[n].element[0]))continue;if(this._intersectsWith(this.containers[n].containerCache)){if(c&&e.contains(this.containers[n].element[0],c.element[0]))continue;c=this.containers[n],h=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",t,this._uiHash(this)),this.containers[n].containerCache.over=0)}if(!c)return;if(this.containers.length===1)this.containers[h]._trigger("over",t,this._uiHash(this)),this.containers[h].containerCache.over=1;else{i=1e4,s=null,o=this.containers[h].floating?"left":"top",u=this.containers[h].floating?"width":"height",a=this.positionAbs[o]+this.offset.click[o];for(r=this.items.length-1;r>=0;r--){if(!e.contains(this.containers[h].element[0],this.items[r].item[0]))continue;if(this.items[r].item[0]===this.currentItem[0])continue;f=this.items[r].item.offset()[o],l=!1,Math.abs(f-a)>Math.abs(f+this.items[r][u]-a)&&(l=!0,f+=this.items[r][u]),Math.abs(f-a)<i&&(i=Math.abs(f-a),s=this.items[r],this.direction=l?"up":"down")}if(!s&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[h],s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[h].element,!0),this._trigger("change",t,this._uiHash()),this.containers[h]._trigger("change",t,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[h]._trigger("over",t,this._uiHash(this)),this.containers[h].containerCache.over=1}},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t,this.currentItem])):n.helper==="clone"?this.currentItem.clone():this.currentItem;return r.parents("body").length||e(n.appendTo!=="parent"?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]),r[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!r[0].style.width||n.forceHelperSize)&&r.width(this.currentItem.width()),(!r[0].style.height||n.forceHelperSize)&&r.height(this.currentItem.height()),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,n,r,i=this.options;i.containment==="parent"&&(i.containment=this.helper[0].parentNode);if(i.containment==="document"||i.containment==="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e(i.containment==="document"?document:window).width()-this.helperProportions.width-this.margins.left,(e(i.containment==="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];/^(document|window|parent)$/.test(i.containment)||(t=e(i.containment)[0],n=e(i.containment).offset(),r=e(t).css("overflow")!=="hidden",this.containment=[n.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,n.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,n.left+(r?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,n.top+(r?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,n){n||(n=this.position);var r=t==="absolute"?1:-1,i=this.cssPosition!=="absolute"||this.scrollParent[0]!==document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,s=/(html|body)/i.test(i[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():s?0:i.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():s?0:i.scrollLeft())*r}},_generatePosition:function(t){var n,r,i=this.options,s=t.pageX,o=t.pageY,u=this.cssPosition!=="absolute"||this.scrollParent[0]!==document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(u[0].tagName);return this.cssPosition==="relative"&&(this.scrollParent[0]===document||this.scrollParent[0]===this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(s=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(s=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),i.grid&&(n=this.originalPageY+Math.round((o-this.originalPageY)/i.grid[1])*i.grid[1],o=this.containment?n-this.offset.click.top>=this.containment[1]&&n-this.offset.click.top<=this.containment[3]?n:n-this.offset.click.top>=this.containment[1]?n-i.grid[1]:n+i.grid[1]:n,r=this.originalPageX+Math.round((s-this.originalPageX)/i.grid[0])*i.grid[0],s=this.containment?r-this.offset.click.left>=this.containment[0]&&r-this.offset.click.left<=this.containment[2]?r:r-this.offset.click.left>=this.containment[0]?r-i.grid[0]:r+i.grid[0]:r)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():a?0:u.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():a?0:u.scrollLeft())}},_rearrange:function(e,t,n,r){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],this.direction==="down"?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i===this.counter&&this.refreshPositions(!r)})},_clear:function(t,n){this.reverting=!1;var r,i=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(r in this._storedCSS)if(this._storedCSS[r]==="auto"||this._storedCSS[r]==="static")this._storedCSS[r]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!n&&i.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!n&&i.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(n||(i.push(function(e){this._trigger("remove",e,this._uiHash())}),i.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),i.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer))));for(r=this.containers.length-1;r>=0;r--)n||i.push(function(e){return function(t){e._trigger("deactivate",t,this._uiHash(this))}}.call(this,this.containers[r])),this.containers[r].containerCache.over&&(i.push(function(e){return function(t){e._trigger("out",t,this._uiHash(this))}}.call(this,this.containers[r])),this.containers[r].containerCache.over=0);this._storedCursor&&e("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!n){this._trigger("beforeStop",t,this._uiHash());for(r=0;r<i.length;r++)i[r].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}n||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!n){for(r=0;r<i.length;r++)i[r].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var n=t||this;return{helper:n.helper,placeholder:n.placeholder||e([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:t?t.element:null}}})}(jQuery),jQuery.effects||function(e,t){var n="ui-effects-";e.effects={effect:{}},function(e,t){function h(e,t,n){var r=u[t.type]||{};return e==null?n||!t.def?null:t.def:(e=r.floor?~~e:parseFloat(e),isNaN(e)?t.def:r.mod?(e+r.mod)%r.mod:0>e?0:r.max<e?r.max:e)}function p(t){var n=s(),r=n._rgba=[];return t=t.toLowerCase(),c(i,function(e,i){var s,u=i.re.exec(t),a=u&&i.parse(u),f=i.space||"rgba";if(a)return s=n[f](a),n[o[f].cache]=s[o[f].cache],r=n._rgba=s._rgba,!1}),r.length?(r.join()==="0,0,0,0"&&e.extend(r,l.transparent),n):l[t]}function d(e,t,n){return n=(n+1)%1,n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}var n="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,i=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1]*2.55,e[2]*2.55,e[3]*2.55,e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],s=e.Color=function(t,n,r,i){return new e.Color.fn.parse(t,n,r,i)},o={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},a=s.support={},f=e("<p>")[0],l,c=e.each;f.style.cssText="background-color:rgba(1,1,1,.5)",a.rgba=f.style.backgroundColor.indexOf("rgba")>-1,c(o,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),s.fn=e.extend(s.prototype,{parse:function(n,r,i,u){if(n===t)return this._rgba=[null,null,null,null],this;if(n.jquery||n.nodeType)n=e(n).css(r),r=t;var a=this,f=e.type(n),d=this._rgba=[];r!==t&&(n=[n,r,i,u],f="array");if(f==="string")return this.parse(p(n)||l._default);if(f==="array")return c(o.rgba.props,function(e,t){d[t.idx]=h(n[t.idx],t)}),this;if(f==="object")return n instanceof s?c(o,function(e,t){n[t.cache]&&(a[t.cache]=n[t.cache].slice())}):c(o,function(t,r){var i=r.cache;c(r.props,function(e,t){if(!a[i]&&r.to){if(e==="alpha"||n[e]==null)return;a[i]=r.to(a._rgba)}a[i][t.idx]=h(n[e],t,!0)}),a[i]&&e.inArray(null,a[i].slice(0,3))<0&&(a[i][3]=1,r.from&&(a._rgba=r.from(a[i])))}),this},is:function(e){var t=s(e),n=!0,r=this;return c(o,function(e,i){var s,o=t[i.cache];return o&&(s=r[i.cache]||i.to&&i.to(r._rgba)||[],c(i.props,function(e,t){if(o[t.idx]!=null)return n=o[t.idx]===s[t.idx],n})),n}),n},_space:function(){var e=[],t=this;return c(o,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var n=s(e),r=n._space(),i=o[r],a=this.alpha()===0?s("transparent"):this,f=a[i.cache]||i.to(a._rgba),l=f.slice();return n=n[i.cache],c(i.props,function(e,r){var i=r.idx,s=f[i],o=n[i],a=u[r.type]||{};if(o===null)return;s===null?l[i]=o:(a.mod&&(o-s>a.mod/2?s+=a.mod:s-o>a.mod/2&&(s-=a.mod)),l[i]=h((o-s)*t+s,r))}),this[r](l)},blend:function(t){if(this._rgba[3]===1)return this;var n=this._rgba.slice(),r=n.pop(),i=s(t)._rgba;return s(e.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var t="rgba(",n=e.map(this._rgba,function(e,t){return e==null?t>2?1:0:e});return n[3]===1&&(n.pop(),t="rgb("),t+n.join()+")"},toHslaString:function(){var t="hsla(",n=e.map(this.hsla(),function(e,t){return e==null&&(e=t>2?1:0),t&&t<3&&(e=Math.round(e*100)+"%"),e});return n[3]===1&&(n.pop(),t="hsl("),t+n.join()+")"},toHexString:function(t){var n=this._rgba.slice(),r=n.pop();return t&&n.push(~~(r*255)),"#"+e.map(n,function(e){return e=(e||0).toString(16),e.length===1?"0"+e:e}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),s.fn.parse.prototype=s.fn,o.hsla.to=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=e[3],s=Math.max(t,n,r),o=Math.min(t,n,r),u=s-o,a=s+o,f=a*.5,l,c;return o===s?l=0:t===s?l=60*(n-r)/u+360:n===s?l=60*(r-t)/u+120:l=60*(t-n)/u+240,u===0?c=0:f<=.5?c=u/a:c=u/(2-a),[Math.round(l)%360,c,f,i==null?1:i]},o.hsla.from=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],i=e[3],s=r<=.5?r*(1+n):r+n-r*n,o=2*r-s;return[Math.round(d(o,s,t+1/3)*255),Math.round(d(o,s,t)*255),Math.round(d(o,s,t-1/3)*255),i]},c(o,function(n,i){var o=i.props,u=i.cache,a=i.to,f=i.from;s.fn[n]=function(n){a&&!this[u]&&(this[u]=a(this._rgba));if(n===t)return this[u].slice();var r,i=e.type(n),l=i==="array"||i==="object"?n:arguments,p=this[u].slice();return c(o,function(e,t){var n=l[i==="object"?e:t.idx];n==null&&(n=p[t.idx]),p[t.idx]=h(n,t)}),f?(r=s(f(p)),r[u]=p,r):s(p)},c(o,function(t,i){if(s.fn[t])return;s.fn[t]=function(s){var o=e.type(s),u=t==="alpha"?this._hsla?"hsla":"rgba":n,a=this[u](),f=a[i.idx],l;return o==="undefined"?f:(o==="function"&&(s=s.call(this,f),o=e.type(s)),s==null&&i.empty?this:(o==="string"&&(l=r.exec(s),l&&(s=f+parseFloat(l[2])*(l[1]==="+"?1:-1))),a[i.idx]=s,this[u](a)))}})}),s.hook=function(t){var n=t.split(" ");c(n,function(t,n){e.cssHooks[n]={set:function(t,r){var i,o,u="";if(r!=="transparent"&&(e.type(r)!=="string"||(i=p(r)))){r=s(i||r);if(!a.rgba&&r._rgba[3]!==1){o=n==="backgroundColor"?t.parentNode:t;while((u===""||u==="transparent")&&o&&o.style)try{u=e.css(o,"backgroundColor"),o=o.parentNode}catch(f){}r=r.blend(u&&u!=="transparent"?u:"_default")}r=r.toRgbaString()}try{t.style[n]=r}catch(f){}}},e.fx.step[n]=function(t){t.colorInit||(t.start=s(t.elem,n),t.end=s(t.end),t.colorInit=!0),e.cssHooks[n].set(t.elem,t.start.transition(t.end,t.pos))}})},s.hook(n),e.cssHooks.borderColor={expand:function(e){var t={};return c(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},l=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(t){var n,r,i=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,s={};if(i&&i.length&&i[0]&&i[i[0]]){r=i.length;while(r--)n=i[r],typeof i[n]=="string"&&(s[e.camelCase(n)]=i[n])}else for(n in i)typeof i[n]=="string"&&(s[n]=i[n]);return s}function s(t,n){var i={},s,o;for(s in n)o=n[s],t[s]!==o&&!r[s]&&(e.fx.step[s]||!isNaN(parseFloat(o)))&&(i[s]=o);return i}var n=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){if(e.end!=="none"&&!e.setAttr||e.pos===1&&!e.setAttr)jQuery.style(e.elem,n,e.end),e.setAttr=!0}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(t,r,o,u){var a=e.speed(r,o,u);return this.queue(function(){var r=e(this),o=r.attr("class")||"",u,f=a.children?r.find("*").addBack():r;f=f.map(function(){var t=e(this);return{el:t,start:i(this)}}),u=function(){e.each(n,function(e,n){t[n]&&r[n+"Class"](t[n])})},u(),f=f.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),r.attr("class",o),f=f.map(function(){var t=this,n=e.Deferred(),r=e.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){u(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(r[0])})})},e.fn.extend({_addClass:e.fn.addClass,addClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{add:t},n,r,i):this._addClass(t)},_removeClass:e.fn.removeClass,removeClass:function(t,n,r,i){return arguments.length>1?e.effects.animateClass.call(this,{remove:t},n,r,i):this._removeClass.apply(this,arguments)},_toggleClass:e.fn.toggleClass,toggleClass:function(n,r,i,s,o){return typeof r=="boolean"||r===t?i?e.effects.animateClass.call(this,r?{add:n}:{remove:n},i,s,o):this._toggleClass(n,r):e.effects.animateClass.call(this,{toggle:n},r,i,s)},switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function r(t,n,r,i){e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},n==null&&(n={}),e.isFunction(n)&&(i=n,r=null,n={});if(typeof n=="number"||e.fx.speeds[n])i=r,r=n,n={};return e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:typeof r=="number"?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function i(t){return!t||typeof t=="number"||e.fx.speeds[t]?!0:typeof t=="string"&&!e.effects.effect[t]}e.extend(e.effects,{version:"1.10.1",save:function(e,t){for(var r=0;r<t.length;r++)t[r]!==null&&e.data(n+t[r],e[0].style[t[r]])},restore:function(e,r){var i,s;for(s=0;s<r.length;s++)r[s]!==null&&(i=e.data(n+r[s]),i===t&&(i=""),e.css(r[s],i))},setMode:function(e,t){return t==="toggle"&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var n,r;switch(e[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=e[0]/t.height}switch(e[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=e[1]/t.width}return{x:r,y:n}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var n={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},r=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).focus(),r=t.parent(),t.css("position")==="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).focus()),t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function o(n){function u(){e.isFunction(i)&&i.call(r[0]),e.isFunction(n)&&n()}var r=e(this),i=t.complete,o=t.mode;(r.is(":hidden")?o==="hide":o==="show")?u():s.call(r[0],t,u)}var t=r.apply(this,arguments),n=t.mode,i=t.queue,s=e.effects.effect[t.effect];return e.fx.off||!s?n?this[n](t.duration,t.complete):this.each(function(){t.complete&&t.complete.call(this)}):i===!1?this.each(o):this.queue(i||"fx",o)},_show:e.fn.show,show:function(e){if(i(e))return this._show.apply(this,arguments);var t=r.apply(this,arguments);return t.mode="show",this.effect.call(this,t)},_hide:e.fn.hide,hide:function(e){if(i(e))return this._hide.apply(this,arguments);var t=r.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(i(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=r.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:1-n(e*-2+2)/2}})}()}(jQuery),function(e,t){var n=0,r={},i={};r.height=r.paddingTop=r.paddingBottom=r.borderTopWidth=r.borderBottomWidth="hide",i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.10.1",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),!t.collapsible&&(t.active===!1||t.active==null)&&(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e(),content:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this.options.heightStyle!=="content"&&e.css("height","")},_setOption:function(e,t){if(e==="active"){this._activate(t);return}e==="event"&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),e==="collapsible"&&!t&&this.options.active===!1&&this._activate(0),e==="icons"&&(this._destroyIcons(),t&&this._createIcons()),e==="disabled"&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)},_keydown:function(t){if(t.altKey||t.ctrlKey)return;var n=e.ui.keyCode,r=this.headers.length,i=this.headers.index(t.target),s=!1;switch(t.keyCode){case n.RIGHT:case n.DOWN:s=this.headers[(i+1)%r];break;case n.LEFT:case n.UP:s=this.headers[(i-1+r)%r];break;case n.SPACE:case n.ENTER:this._eventHandler(t);break;case n.HOME:s=this.headers[0];break;case n.END:s=this.headers[r-1]}s&&(e(t.target).attr("tabIndex",-1),e(s).attr("tabIndex",0),s.focus(),t.preventDefault())},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels();if(t.active===!1&&t.collapsible===!0||!this.headers.length)t.active=!1,this.active=e();t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var t,r=this.options,i=r.heightStyle,s=this.element.parent(),o=this.accordionId="ui-accordion-"+(this.element.attr("id")||++n);this.active=this._findActive(r.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(t){var n=e(this),r=n.attr("id"),i=n.next(),s=i.attr("id");r||(r=o+"-header-"+t,n.attr("id",r)),s||(s=o+"-panel-"+t,i.attr("id",s)),n.attr("aria-controls",s),i.attr("aria-labelledby",r)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(r.event),i==="fill"?(t=s.height(),this.element.siblings(":visible").each(function(){var n=e(this),r=n.css("position");if(r==="absolute"||r==="fixed")return;t-=n.outerHeight(!0)}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):i==="auto"&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var n=this._findActive(t)[0];if(n===this.active[0])return;n=n||this.active[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return typeof t=="number"?this.headers.eq(t):e()},_setupEvents:function(t){var n={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,n),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i[0]===r[0],o=s&&n.collapsible,u=o?e():i.next(),a=r.next(),f={oldHeader:r,oldPanel:a,newHeader:o?e():i,newPanel:u};t.preventDefault();if(s&&!n.collapsible||this._trigger("beforeActivate",t,f)===!1)return;n.active=o?!1:this.headers.index(i),this.active=s?e():i,this._toggle(f),r.removeClass("ui-accordion-header-active ui-state-active"),n.icons&&r.children(".ui-accordion-header-icon").removeClass(n.icons.activeHeader).addClass(n.icons.header),s||(i.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),n.icons&&i.children(".ui-accordion-header-icon").removeClass(n.icons.header).addClass(n.icons.activeHeader),i.next().addClass("ui-accordion-content-active"))},_toggle:function(t){var n=t.newPanel,r=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=n,this.prevHide=r,this.options.animate?this._animate(n,r,t):(r.hide(),n.show(),this._toggleComplete(t)),r.attr({"aria-expanded":"false","aria-hidden":"true"}),r.prev().attr("aria-selected","false"),n.length&&r.length?r.prev().attr("tabIndex",-1):n.length&&this.headers.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),n.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(e,t,n){var s,o,u,a=this,f=0,l=e.length&&(!t.length||e.index()<t.index()),c=this.options.animate||{},h=l&&c.down||c,p=function(){a._toggleComplete(n)};typeof h=="number"&&(u=h),typeof h=="string"&&(o=h),o=o||h.easing||c.easing,u=u||h.duration||c.duration;if(!t.length)return e.animate(i,u,o,p);if(!e.length)return t.animate(r,u,o,p);s=e.show().outerHeight(),t.animate(r,{duration:u,easing:o,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(i,{duration:u,easing:o,complete:p,step:function(e,n){n.now=Math.round(e),n.prop!=="height"?f+=n.now:a.options.heightStyle!=="content"&&(n.now=Math.round(s-t.outerHeight()-f),f=0)}})},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}})}(jQuery),function(e,t){var n=0;e.widget("ui.autocomplete",{version:"1.10.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var t,n,r,i=this.element[0].nodeName.toLowerCase(),s=i==="textarea",o=i==="input";this.isMultiLine=s?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[s||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(i){if(this.element.prop("readOnly")){t=!0,r=!0,n=!0;return}t=!1,r=!1,n=!1;var s=e.ui.keyCode;switch(i.keyCode){case s.PAGE_UP:t=!0,this._move("previousPage",i);break;case s.PAGE_DOWN:t=!0,this._move("nextPage",i);break;case s.UP:t=!0,this._keyEvent("previous",i);break;case s.DOWN:t=!0,this._keyEvent("next",i);break;case s.ENTER:case s.NUMPAD_ENTER:this.menu.active&&(t=!0,i.preventDefault(),this.menu.select(i));break;case s.TAB:this.menu.active&&this.menu.select(i);break;case s.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(i),i.preventDefault());break;default:n=!0,this._searchTimeout(i)}},keypress:function(r){if(t){t=!1,r.preventDefault();return}if(n)return;var i=e.ui.keyCode;switch(r.keyCode){case i.PAGE_UP:this._move("previousPage",r);break;case i.PAGE_DOWN:this._move("nextPage",r);break;case i.UP:this._keyEvent("previous",r);break;case i.DOWN:this._keyEvent("next",r)}},input:function(e){if(r){r=!1,e.preventDefault();return}this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}clearTimeout(this.searching),this.close(e),this._change(e)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({input:e(),role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var n=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(r){r.target!==t.element[0]&&r.target!==n&&!e.contains(n,r.target)&&t.close()})})},menufocus:function(t,n){if(this.isNewMenu){this.isNewMenu=!1;if(t.originalEvent&&/^mouse/.test(t.originalEvent.type)){this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)});return}}var r=n.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:r})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(r.value):this.liveRegion.text(r.value)},menuselect:function(e,t){var n=t.item.data("ui-autocomplete-item"),r=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=r,this._delay(function(){this.previous=r,this.selectedItem=n})),!1!==this._trigger("select",e,{item:n})&&this._value(n.value),this.term=this._value(),this.close(e),this.selectedItem=n}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertAfter(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),e==="source"&&this._initSource(),e==="appendTo"&&this.menu.element.appendTo(this._appendTo()),e==="disabled"&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,n,r=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(n,r){r(e.ui.autocomplete.filter(t,n.term))}):typeof this.options.source=="string"?(n=this.options.source,this.source=function(t,i){r.xhr&&r.xhr.abort(),r.xhr=e.ajax({url:n,data:t,dataType:"json",success:function(e){i(e)},error:function(){i([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){e=e!=null?e:this._value(),this.term=this._value();if(e.length<this.options.minLength)return this.close(t);if(this._trigger("search",t)===!1)return;return this._search(e)},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var e=this,t=++n;return function(r){t===n&&e.__response(r),e.pending--,e.pending||e.element.removeClass("ui-autocomplete-loading")}},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return typeof t=="string"?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var n=this.menu.element.empty();this._renderMenu(n,t),this.menu.refresh(),n.show(),this._resizeMenu(),n.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,n){var r=this;e.each(n,function(e,n){r._renderItemData(t,n)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,n){return e("<li>").append(e("<a>").text(n.label)).appendTo(t)},_move:function(e,t){if(!this.menu.element.is(":visible")){this.search(null,t);return}if(this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)){this._value(this.term),this.menu.blur();return}this.menu[e](t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(e,t),t.preventDefault()}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,n){var r=new RegExp(e.ui.autocomplete.escapeRegex(n),"i");return e.grep(t,function(e){return r.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments);if(this.options.disabled||this.cancelSearch)return;e&&e.length?t=this.options.messages.results(e.length):t=this.options.messages.noResults,this.liveRegion.text(t)}})}(jQuery),function(e,t){var n,r,i,s,o="ui-button ui-widget ui-state-default ui-corner-all",u="ui-state-hover ui-state-active ",a="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",f=function(){var t=e(this).find(":ui-button");setTimeout(function(){t.button("refresh")},1)},l=function(t){var n=t.name,r=t.form,i=e([]);return n&&(n=n.replace(/'/g,"\\'"),r?i=e(r).find("[name='"+n+"']"):i=e("[name='"+n+"']",t.ownerDocument).filter(function(){return!this.form})),i};e.widget("ui.button",{version:"1.10.1",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,f),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,u=this.options,a=this.type==="checkbox"||this.type==="radio",c=a?"":"ui-state-active",h="ui-state-focus";u.label===null&&(u.label=this.type==="input"?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){if(u.disabled)return;this===n&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){if(u.disabled)return;e(this).removeClass(c)}).bind("click"+this.eventNamespace,function(e){u.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){t.buttonElement.addClass(h)}).bind("blur"+this.eventNamespace,function(){t.buttonElement.removeClass(h)}),a&&(this.element.bind("change"+this.eventNamespace,function(){if(s)return;t.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(e){if(u.disabled)return;s=!1,r=e.pageX,i=e.pageY}).bind("mouseup"+this.eventNamespace,function(e){if(u.disabled)return;if(r!==e.pageX||i!==e.pageY)s=!0})),this.type==="checkbox"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1}):this.type==="radio"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var n=t.element[0];l(n).not(n).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).addClass("ui-state-active"),n=this,t.document.one("mouseup",function(){n=null})}).bind("mouseup"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(t){if(u.disabled)return!1;(t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active")}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",u.disabled),this._resetButton()},_determineButtonType:function(){var e,t,n;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button",this.type==="checkbox"||this.type==="radio"?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),n=this.element.is(":checked"),n&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",n)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(o+" "+u+" "+a).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){this._super(e,t);if(e==="disabled"){t?this.element.prop("disabled",!0):this.element.prop("disabled",!1);return}this._resetButton()},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),this.type==="radio"?l(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input"){this.options.label&&this.element.val(this.options.label);return}var t=this.buttonElement.removeClass(a),n=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),r=this.options.icons,i=r.primary&&r.secondary,s=[];r.primary||r.secondary?(this.options.text&&s.push("ui-button-text-icon"+(i?"s":r.primary?"-primary":"-secondary")),r.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+r.primary+"'></span>"),r.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+r.secondary+"'></span>"),this.options.text||(s.push(i?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(n)))):s.push("ui-button-text-only"),t.addClass(s.join(" "))}}),e.widget("ui.buttonset",{version:"1.10.1",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){e==="disabled"&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})}(jQuery),function(e,t){function s(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.dpDiv=o(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function o(t){var n="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(n,"mouseout",function(){e(this).removeClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!==-1&&e(this).removeClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!==-1&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(n,"mouseover",function(){e.datepicker._isDisabledDatepicker(i.inline?t.parent()[0]:i.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!==-1&&e(this).addClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!==-1&&e(this).addClass("ui-datepicker-next-hover"))})}function u(t,n){e.extend(t,n);for(var r in n)n[r]==null&&(t[r]=n[r]);return t}e.extend(e.ui,{datepicker:{version:"1.10.1"}});var n="datepicker",r=(new Date).getTime(),i;e.extend(s.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return u(this._defaults,e||{}),this},_attachDatepicker:function(t,n){var r,i,s;r=t.nodeName.toLowerCase(),i=r==="div"||r==="span",t.id||(this.uuid+=1,t.id="dp"+this.uuid),s=this._newInst(e(t),i),s.settings=e.extend({},n||{}),r==="input"?this._connectDatepicker(t,s):i&&this._inlineDatepicker(t,s)},_newInst:function(t,n){var r=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:r,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:n,dpDiv:n?o(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,r){var i=e(t);r.append=e([]),r.trigger=e([]);if(i.hasClass(this.markerClassName))return;this._attachments(i,r),i.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(r),e.data(t,n,r),r.settings.disabled&&this._disableDatepicker(t)},_attachments:function(t,n){var r,i,s,o=this._get(n,"appendText"),u=this._get(n,"isRTL");n.append&&n.append.remove(),o&&(n.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[u?"before":"after"](n.append)),t.unbind("focus",this._showDatepicker),n.trigger&&n.trigger.remove(),r=this._get(n,"showOn"),(r==="focus"||r==="both")&&t.focus(this._showDatepicker);if(r==="button"||r==="both")i=this._get(n,"buttonText"),s=this._get(n,"buttonImage"),n.trigger=e(this._get(n,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:s,alt:i,title:i}):e("<button type='button'></button>").addClass(this._triggerClass).html(s?e("<img/>").attr({src:s,alt:i,title:i}):i)),t[u?"before":"after"](n.trigger),n.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1})},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,n,r,i,s=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){n=0,r=0;for(i=0;i<e.length;i++)e[i].length>n&&(n=e[i].length,r=i);return r},s.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),s.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-s.getDay())),e.input.attr("size",this._formatDate(e,s).length)}},_inlineDatepicker:function(t,r){var i=e(t);if(i.hasClass(this.markerClassName))return;i.addClass(this.markerClassName).append(r.dpDiv),e.data(t,n,r),this._setDate(r,this._getDefaultDate(r),!0),this._updateDatepicker(r),this._updateAlternate(r),r.settings.disabled&&this._disableDatepicker(t),r.dpDiv.css("display","block")},_dialogDatepicker:function(t,r,i,s,o){var a,f,l,c,h,p=this._dialogInst;return p||(this.uuid+=1,a="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+a+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},e.data(this._dialogInput[0],n,p)),u(p.settings,s||{}),r=r&&r.constructor===Date?this._formatDate(p,r):r,this._dialogInput.val(r),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(f=document.documentElement.clientWidth,l=document.documentElement.clientHeight,c=document.documentElement.scrollLeft||document.body.scrollLeft,h=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[f/2-100+c,l/2-150+h]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=i,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],n,p),this},_destroyDatepicker:function(t){var r,i=e(t),s=e.data(t,n);if(!i.hasClass(this.markerClassName))return;r=t.nodeName.toLowerCase(),e.removeData(t,n),r==="input"?(s.append.remove(),s.trigger.remove(),i.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(r==="div"||r==="span")&&i.removeClass(this.markerClassName).empty()},_enableDatepicker:function(t){var r,i,s=e(t),o=e.data(t,n);if(!s.hasClass(this.markerClassName))return;r=t.nodeName.toLowerCase();if(r==="input")t.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(r==="div"||r==="span")i=s.children("."+this._inlineClass),i.children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1);this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e})},_disableDatepicker:function(t){var r,i,s=e(t),o=e.data(t,n);if(!s.hasClass(this.markerClassName))return;r=t.nodeName.toLowerCase();if(r==="input")t.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(r==="div"||r==="span")i=s.children("."+this._inlineClass),i.children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0);this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,n)}catch(r){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(n,r,i){var s,o,a,f,l=this._getInst(n);if(arguments.length===2&&typeof r=="string")return r==="defaults"?e.extend({},e.datepicker._defaults):l?r==="all"?e.extend({},l.settings):this._get(l,r):null;s=r||{},typeof r=="string"&&(s={},s[r]=i),l&&(this._curInst===l&&this._hideDatepicker(),o=this._getDateDatepicker(n,!0),a=this._getMinMaxDate(l,"min"),f=this._getMinMaxDate(l,"max"),u(l.settings,s),a!==null&&s.dateFormat!==t&&s.minDate===t&&(l.settings.minDate=this._formatDate(l,a)),f!==null&&s.dateFormat!==t&&s.maxDate===t&&(l.settings.maxDate=this._formatDate(l,f)),"disabled"in s&&(s.disabled?this._disableDatepicker(n):this._enableDatepicker(n)),this._attachments(e(n),l),this._autoSize(l),this._setDate(l,o),this._updateAlternate(l),this._updateDatepicker(l))},_changeDatepicker:function(e,t,n){this._optionDatepicker(e,t,n)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var n=this._getInst(e);n&&(this._setDate(n,t),this._updateDatepicker(n),this._updateAlternate(n))},_getDateDatepicker:function(e,t){var n=this._getInst(e);return n&&!n.inline&&this._setDateFromField(n,t),n?this._getDate(n):null},_doKeyDown:function(t){var n,r,i,s=e.datepicker._getInst(t.target),o=!0,u=s.dpDiv.is(".ui-datepicker-rtl");s._keyEvent=!0;if(e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return i=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",s.dpDiv),i[0]&&e.datepicker._selectDay(t.target,s.selectedMonth,s.selectedYear,i[0]),n=e.datepicker._get(s,"onSelect"),n?(r=e.datepicker._formatDate(s),n.apply(s.input?s.input[0]:null,[r,s])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(s,"stepBigMonths"):-e.datepicker._get(s,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(s,"stepBigMonths"):+e.datepicker._get(s,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,u?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(s,"stepBigMonths"):-e.datepicker._get(s,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,u?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(s,"stepBigMonths"):+e.datepicker._get(s,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else t.keyCode===36&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var n,r,i=e.datepicker._getInst(t.target);if(e.datepicker._get(i,"constrainInput"))return n=e.datepicker._possibleChars(e.datepicker._get(i,"dateFormat")),r=String.fromCharCode(t.charCode==null?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||r<" "||!n||n.indexOf(r)>-1},_doKeyUp:function(t){var n,r=e.datepicker._getInst(t.target);if(r.input.val()!==r.lastVal)try{n=e.datepicker.parseDate(e.datepicker._get(r,"dateFormat"),r.input?r.input.val():null,e.datepicker._getFormatConfig(r)),n&&(e.datepicker._setDateFromField(r),e.datepicker._updateAlternate(r),e.datepicker._updateDatepicker(r))}catch(i){}return!0},_showDatepicker:function(t){t=t.target||t,t.nodeName.toLowerCase()!=="input"&&(t=e("input",t.parentNode)[0]);if(e.datepicker._isDisabledDatepicker(t)||e.datepicker._lastInput===t)return;var n,r,i,s,o,a,f;n=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==n&&(e.datepicker._curInst.dpDiv.stop(!0,!0),n&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),r=e.datepicker._get(n,"beforeShow"),i=r?r.apply(t,[t,n]):{};if(i===!1)return;u(n.settings,i),n.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(n),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),s=!1,e(t).parents().each(function(){return s|=e(this).css("position")==="fixed",!s}),o={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,n.dpDiv.empty(),n.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(n),o=e.datepicker._checkOffset(n,o,s),n.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":s?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),n.inline||(a=e.datepicker._get(n,"showAnim"),f=e.datepicker._get(n,"duration"),n.dpDiv.zIndex(e(t).zIndex()+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[a]?n.dpDiv.show(a,e.datepicker._get(n,"showOptions"),f):n.dpDiv[a||"show"](a?f:null),n.input.is(":visible")&&!n.input.is(":disabled")&&n.input.focus(),e.datepicker._curInst=n)},_updateDatepicker:function(t){this.maxRows=4,i=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t),t.dpDiv.find("."+this._dayOverClass+" a").mouseover();var n,r=this._getNumberOfMonths(t),s=r[1],o=17;t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),s>1&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",o*s+"em"),t.dpDiv[(r[0]!==1||r[1]!==1?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&t.input[0]!==document.activeElement&&t.input.focus(),t.yearshtml&&(n=t.yearshtml,setTimeout(function(){n===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),n=t.yearshtml=null},0))},_getBorders:function(e){var t=function(e){return{thin:1,medium:2,thick:3}[e]||e};return[parseFloat(t(e.css("border-left-width"))),parseFloat(t(e.css("border-top-width")))]},_checkOffset:function(t,n,r){var i=t.dpDiv.outerWidth(),s=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,u=t.input?t.input.outerHeight():0,a=document.documentElement.clientWidth+(r?0:e(document).scrollLeft()),f=document.documentElement.clientHeight+(r?0:e(document).scrollTop());return n.left-=this._get(t,"isRTL")?i-o:0,n.left-=r&&n.left===t.input.offset().left?e(document).scrollLeft():0,n.top-=r&&n.top===t.input.offset().top+u?e(document).scrollTop():0,n.left-=Math.min(n.left,n.left+i>a&&a>i?Math.abs(n.left+i-a):0),n.top-=Math.min(n.top,n.top+s>f&&f>s?Math.abs(s+u):0),n},_findPos:function(t){var n,r=this._getInst(t),i=this._get(r,"isRTL");while(t&&(t.type==="hidden"||t.nodeType!==1||e.expr.filters.hidden(t)))t=t[i?"previousSibling":"nextSibling"];return n=e(t).offset(),[n.left,n.top]},_hideDatepicker:function(t){var r,i,s,o,u=this._curInst;if(!u||t&&u!==e.data(t,n))return;this._datepickerShowing&&(r=this._get(u,"showAnim"),i=this._get(u,"duration"),s=function(){e.datepicker._tidyDialog(u)},e.effects&&(e.effects.effect[r]||e.effects[r])?u.dpDiv.hide(r,e.datepicker._get(u,"showOptions"),i,s):u.dpDiv[r==="slideDown"?"slideUp":r==="fadeIn"?"fadeOut":"hide"](r?i:null,s),r||s(),this._datepickerShowing=!1,o=this._get(u,"onClose"),o&&o.apply(u.input?u.input[0]:null,[u.input?u.input.val():"",u]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(!e.datepicker._curInst)return;var n=e(t.target),r=e.datepicker._getInst(n[0]);(n[0].id!==e.datepicker._mainDivId&&n.parents("#"+e.datepicker._mainDivId).length===0&&!n.hasClass(e.datepicker.markerClassName)&&!n.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||n.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==r)&&e.datepicker._hideDatepicker()},_adjustDate:function(t,n,r){var i=e(t),s=this._getInst(i[0]);if(this._isDisabledDatepicker(i[0]))return;this._adjustInstDate(s,n+(r==="M"?this._get(s,"showCurrentAtPos"):0),r),this._updateDatepicker(s)},_gotoToday:function(t){var n,r=e(t),i=this._getInst(r[0]);this._get(i,"gotoCurrent")&&i.currentDay?(i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear):(n=new Date,i.selectedDay=n.getDate(),i.drawMonth=i.selectedMonth=n.getMonth(),i.drawYear=i.selectedYear=n.getFullYear()),this._notifyChange(i),this._adjustDate(r)},_selectMonthYear:function(t,n,r){var i=e(t),s=this._getInst(i[0]);s["selected"+(r==="M"?"Month":"Year")]=s["draw"+(r==="M"?"Month":"Year")]=parseInt(n.options[n.selectedIndex].value,10),this._notifyChange(s),this._adjustDate(i)},_selectDay:function(t,n,r,i){var s,o=e(t);if(e(i).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0]))return;s=this._getInst(o[0]),s.selectedDay=s.currentDay=e("a",i).html(),s.selectedMonth=s.currentMonth=n,s.selectedYear=s.currentYear=r,this._selectDate(t,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear))},_clearDate:function(t){var n=e(t);this._selectDate(n,"")},_selectDate:function(t,n){var r,i=e(t),s=this._getInst(i[0]);n=n!=null?n:this._formatDate(s),s.input&&s.input.val(n),this._updateAlternate(s),r=this._get(s,"onSelect"),r?r.apply(s.input?s.input[0]:null,[n,s]):s.input&&s.input.trigger("change"),s.inline?this._updateDatepicker(s):(this._hideDatepicker(),this._lastInput=s.input[0],typeof s.input[0]!="object"&&s.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var n,r,i,s=this._get(t,"altField");s&&(n=this._get(t,"altFormat")||this._get(t,"dateFormat"),r=this._getDate(t),i=this.formatDate(n,r,this._getFormatConfig(t)),e(s).each(function(){e(this).val(i)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&t<6,""]},iso8601Week:function(e){var t,n=new Date(e.getTime());return n.setDate(n.getDate()+4-(n.getDay()||7)),t=n.getTime(),n.setMonth(0),n.setDate(1),Math.floor(Math.round((t-n)/864e5)/7)+1},parseDate:function(t,n,r){if(t==null||n==null)throw"Invalid arguments";n=typeof n=="object"?n.toString():n+"";if(n==="")return null;var i,s,o,u=0,a=(r?r.shortYearCutoff:null)||this._defaults.shortYearCutoff,f=typeof a!="string"?a:(new Date).getFullYear()%100+parseInt(a,10),l=(r?r.dayNamesShort:null)||this._defaults.dayNamesShort,c=(r?r.dayNames:null)||this._defaults.dayNames,h=(r?r.monthNamesShort:null)||this._defaults.monthNamesShort,p=(r?r.monthNames:null)||this._defaults.monthNames,d=-1,v=-1,m=-1,g=-1,y=!1,b,w=function(e){var n=i+1<t.length&&t.charAt(i+1)===e;return n&&i++,n},E=function(e){var t=w(e),r=e==="@"?14:e==="!"?20:e==="y"&&t?4:e==="o"?3:2,i=new RegExp("^\\d{1,"+r+"}"),s=n.substring(u).match(i);if(!s)throw"Missing number at position "+u;return u+=s[0].length,parseInt(s[0],10)},S=function(t,r,i){var s=-1,o=e.map(w(t)?i:r,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});e.each(o,function(e,t){var r=t[1];if(n.substr(u,r.length).toLowerCase()===r.toLowerCase())return s=t[0],u+=r.length,!1});if(s!==-1)return s+1;throw"Unknown name at position "+u},x=function(){if(n.charAt(u)!==t.charAt(i))throw"Unexpected literal at position "+u;u++};for(i=0;i<t.length;i++)if(y)t.charAt(i)==="'"&&!w("'")?y=!1:x();else switch(t.charAt(i)){case"d":m=E("d");break;case"D":S("D",l,c);break;case"o":g=E("o");break;case"m":v=E("m");break;case"M":v=S("M",h,p);break;case"y":d=E("y");break;case"@":b=new Date(E("@")),d=b.getFullYear(),v=b.getMonth()+1,m=b.getDate();break;case"!":b=new Date((E("!")-this._ticksTo1970)/1e4),d=b.getFullYear(),v=b.getMonth()+1,m=b.getDate();break;case"'":w("'")?x():y=!0;break;default:x()}if(u<n.length){o=n.substr(u);if(!/^\s+/.test(o))throw"Extra/unparsed characters found in date: "+o}d===-1?d=(new Date).getFullYear():d<100&&(d+=(new Date).getFullYear()-(new Date).getFullYear()%100+(d<=f?0:-100));if(g>-1){v=1,m=g;do{s=this._getDaysInMonth(d,v-1);if(m<=s)break;v++,m-=s}while(!0)}b=this._daylightSavingAdjust(new Date(d,v-1,m));if(b.getFullYear()!==d||b.getMonth()+1!==v||b.getDate()!==m)throw"Invalid date";return b},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(e,t,n){if(!t)return"";var r,i=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,s=(n?n.dayNames:null)||this._defaults.dayNames,o=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,u=(n?n.monthNames:null)||this._defaults.monthNames,a=function(t){var n=r+1<e.length&&e.charAt(r+1)===t;return n&&r++,n},f=function(e,t,n){var r=""+t;if(a(e))while(r.length<n)r="0"+r;return r},l=function(e,t,n,r){return a(e)?r[t]:n[t]},c="",h=!1;if(t)for(r=0;r<e.length;r++)if(h)e.charAt(r)==="'"&&!a("'")?h=!1:c+=e.charAt(r);else switch(e.charAt(r)){case"d":c+=f("d",t.getDate(),2);break;case"D":c+=l("D",t.getDay(),i,s);break;case"o":c+=f("o",Math.round(((new Date(t.getFullYear(),t.getMonth(),t.getDate())).getTime()-(new Date(t.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":c+=f("m",t.getMonth()+1,2);break;case"M":c+=l("M",t.getMonth(),o,u);break;case"y":c+=a("y")?t.getFullYear():(t.getYear()%100<10?"0":"")+t.getYear()%100;break;case"@":c+=t.getTime();break;case"!":c+=t.getTime()*1e4+this._ticksTo1970;break;case"'":a("'")?c+="'":h=!0;break;default:c+=e.charAt(r)}return c},_possibleChars:function(e){var t,n="",r=!1,i=function(n){var r=t+1<e.length&&e.charAt(t+1)===n;return r&&t++,r};for(t=0;t<e.length;t++)if(r)e.charAt(t)==="'"&&!i("'")?r=!1:n+=e.charAt(t);else switch(e.charAt(t)){case"d":case"m":case"y":case"@":n+="0123456789";break;case"D":case"M":return null;case"'":i("'")?n+="'":r=!0;break;default:n+=e.charAt(t)}return n},_get:function(e,n){return e.settings[n]!==t?e.settings[n]:this._defaults[n]},_setDateFromField:function(e,t){if(e.input.val()===e.lastVal)return;var n=this._get(e,"dateFormat"),r=e.lastVal=e.input?e.input.val():null,i=this._getDefaultDate(e),s=i,o=this._getFormatConfig(e);try{s=this.parseDate(n,r,o)||i}catch(u){r=t?"":r}e.selectedDay=s.getDate(),e.drawMonth=e.selectedMonth=s.getMonth(),e.drawYear=e.selectedYear=s.getFullYear(),e.currentDay=r?s.getDate():0,e.currentMonth=r?s.getMonth():0,e.currentYear=r?s.getFullYear():0,this._adjustInstDate(e)},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,n,r){var i=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},s=function(n){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),n,e.datepicker._getFormatConfig(t))}catch(r){}var i=(n.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,s=i.getFullYear(),o=i.getMonth(),u=i.getDate(),a=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,f=a.exec(n);while(f){switch(f[2]||"d"){case"d":case"D":u+=parseInt(f[1],10);break;case"w":case"W":u+=parseInt(f[1],10)*7;break;case"m":case"M":o+=parseInt(f[1],10),u=Math.min(u,e.datepicker._getDaysInMonth(s,o));break;case"y":case"Y":s+=parseInt(f[1],10),u=Math.min(u,e.datepicker._getDaysInMonth(s,o))}f=a.exec(n)}return new Date(s,o,u)},o=n==null||n===""?r:typeof n=="string"?s(n):typeof n=="number"?isNaN(n)?r:i(n):new Date(n.getTime());return o=o&&o.toString()==="Invalid Date"?r:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,n){var r=!t,i=e.selectedMonth,s=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),(i!==e.selectedMonth||s!==e.selectedYear)&&!n&&this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(r?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&e.input.val()===""?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var n=this._get(t,"stepMonths"),i="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){window["DP_jQuery_"+r].datepicker._adjustDate(i,-n,"M")},next:function(){window["DP_jQuery_"+r].datepicker._adjustDate(i,+n,"M")},hide:function(){window["DP_jQuery_"+r].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+r].datepicker._gotoToday(i)},selectDay:function(){return window["DP_jQuery_"+r].datepicker._selectDay(i,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+r].datepicker._selectMonthYear(i,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+r].datepicker._selectMonthYear(i,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j,F,I,q=new Date,R=this._daylightSavingAdjust(new Date(q.getFullYear(),q.getMonth(),q.getDate())),U=this._get(e,"isRTL"),z=this._get(e,"showButtonPanel"),W=this._get(e,"hideIfNoPrevNext"),X=this._get(e,"navigationAsDateFormat"),V=this._getNumberOfMonths(e),$=this._get(e,"showCurrentAtPos"),J=this._get(e,"stepMonths"),K=V[0]!==1||V[1]!==1,Q=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),G=this._getMinMaxDate(e,"min"),Y=this._getMinMaxDate(e,"max"),Z=e.drawMonth-$,et=e.drawYear;Z<0&&(Z+=12,et--);if(Y){t=this._daylightSavingAdjust(new Date(Y.getFullYear(),Y.getMonth()-V[0]*V[1]+1,Y.getDate())),t=G&&t<G?G:t;while(this._daylightSavingAdjust(new Date(et,Z,1))>t)Z--,Z<0&&(Z=11,et--)}e.drawMonth=Z,e.drawYear=et,n=this._get(e,"prevText"),n=X?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z-J,1)),this._getFormatConfig(e)):n,r=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"e":"w")+"'>"+n+"</span></a>":W?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"e":"w")+"'>"+n+"</span></a>",i=this._get(e,"nextText"),i=X?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z+J,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"w":"e")+"'>"+i+"</span></a>":W?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"w":"e")+"'>"+i+"</span></a>",o=this._get(e,"currentText"),u=this._get(e,"gotoCurrent")&&e.currentDay?Q:R,o=X?this.formatDate(o,u,this._getFormatConfig(e)):o,a=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",f=z?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(U?a:"")+(this._isInRange(e,u)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(U?"":a)+"</div>":"",l=parseInt(this._get(e,"firstDay"),10),l=isNaN(l)?0:l,c=this._get(e,"showWeek"),h=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),d=this._get(e,"monthNames"),v=this._get(e,"monthNamesShort"),m=this._get(e,"beforeShowDay"),g=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),w="",E;for(S=0;S<V[0];S++){x="",this.maxRows=4;for(T=0;T<V[1];T++){N=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),C=" ui-corner-all",k="";if(K){k+="<div class='ui-datepicker-group";if(V[1]>1)switch(T){case 0:k+=" ui-datepicker-group-first",C=" ui-corner-"+(U?"right":"left");break;case V[1]-1:k+=" ui-datepicker-group-last",C=" ui-corner-"+(U?"left":"right");break;default:k+=" ui-datepicker-group-middle",C=""}k+="'>"}k+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+C+"'>"+(/all|left/.test(C)&&S===0?U?s:r:"")+(/all|right/.test(C)&&S===0?U?r:s:"")+this._generateMonthYearHeader(e,Z,et,G,Y,S>0||T>0,d,v)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",L=c?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"";for(E=0;E<7;E++)A=(E+l)%7,L+="<th"+((E+l+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+h[A]+"'>"+p[A]+"</span></th>";k+=L+"</tr></thead><tbody>",O=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,O)),M=(this._getFirstDayOfMonth(et,Z)-l+7)%7,_=Math.ceil((M+O)/7),D=K?this.maxRows>_?this.maxRows:_:_,this.maxRows=D,P=this._daylightSavingAdjust(new Date(et,Z,1-M));for(H=0;H<D;H++){k+="<tr>",B=c?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(P)+"</td>":"";for(E=0;E<7;E++)j=m?m.apply(e.input?e.input[0]:null,[P]):[!0,""],F=P.getMonth()!==Z,I=F&&!y||!j[0]||G&&P<G||Y&&P>Y,B+="<td class='"+((E+l+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(P.getTime()===N.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===P.getTime()&&b.getTime()===N.getTime()?" "+this._dayOverClass:"")+(I?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!g?"":" "+j[1]+(P.getTime()===Q.getTime()?" "+this._currentClass:"")+(P.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+((!F||g)&&j[2]?" title='"+j[2].replace(/'/g,"&#39;")+"'":"")+(I?"":" data-handler='selectDay' data-event='click' data-month='"+P.getMonth()+"' data-year='"+P.getFullYear()+"'")+">"+(F&&!g?"&#xa0;":I?"<span class='ui-state-default'>"+P.getDate()+"</span>":"<a class='ui-state-default"+(P.getTime()===R.getTime()?" ui-state-highlight":"")+(P.getTime()===Q.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+P.getDate()+"</a>")+"</td>",P.setDate(P.getDate()+1),P=this._daylightSavingAdjust(P);k+=B+"</tr>"}Z++,Z>11&&(Z=0,et++),k+="</tbody></table>"+(K?"</div>"+(V[0]>0&&T===V[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=k}w+=x}return w+=f,e._keyEvent=!1,w},_generateMonthYearHeader:function(e,t,n,r,i,s,o,u){var a,f,l,c,h,p,d,v,m=this._get(e,"changeMonth"),g=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",w="";if(s||!m)w+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{a=r&&r.getFullYear()===n,f=i&&i.getFullYear()===n,w+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";for(l=0;l<12;l++)(!a||l>=r.getMonth())&&(!f||l<=i.getMonth())&&(w+="<option value='"+l+"'"+(l===t?" selected='selected'":"")+">"+u[l]+"</option>");w+="</select>"}y||(b+=w+(s||!m||!g?"&#xa0;":""));if(!e.yearshtml){e.yearshtml="";if(s||!g)b+="<span class='ui-datepicker-year'>"+n+"</span>";else{c=this._get(e,"yearRange").split(":"),h=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?n+parseInt(e.substring(1),10):e.match(/[+\-].*/)?h+parseInt(e,10):parseInt(e,10);return isNaN(t)?h:t},d=p(c[0]),v=Math.max(d,p(c[1]||"")),d=r?Math.max(d,r.getFullYear()):d,v=i?Math.min(v,i.getFullYear()):v,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";for(;d<=v;d++)e.yearshtml+="<option value='"+d+"'"+(d===n?" selected='selected'":"")+">"+d+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}}return b+=this._get(e,"yearSuffix"),y&&(b+=(s||!m||!g?"&#xa0;":"")+w),b+="</div>",b},_adjustInstDate:function(e,t,n){var r=e.drawYear+(n==="Y"?t:0),i=e.drawMonth+(n==="M"?t:0),s=Math.min(e.selectedDay,this._getDaysInMonth(r,i))+(n==="D"?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(r,i,s)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),(n==="M"||n==="Y")&&this._notifyChange(e)},_restrictMinMax:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max"),i=n&&t<n?n:t;return r&&i>r?r:i},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return t==null?[1,1]:typeof t=="number"?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return(new Date(e,t,1)).getDay()},_canAdjustMonth:function(e,t,n,r){var i=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(n,r+(t<0?t:i[0]*i[1]),1));return t<0&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var n,r,i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),o=null,u=null,a=this._get(e,"yearRange");return a&&(n=a.split(":"),r=(new Date).getFullYear(),o=parseInt(n[0],10),u=parseInt(n[1],10),n[0].match(/[+\-].*/)&&(o+=r),n[1].match(/[+\-].*/)&&(u+=r)),(!i||t.getTime()>=i.getTime())&&(!s||t.getTime()<=s.getTime())&&(!o||t.getFullYear()>=o)&&(!u||t.getFullYear()<=u)},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t=typeof t!="string"?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,n,r){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var i=t?typeof t=="object"?t:this._daylightSavingAdjust(new Date(r,n,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),i,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),e("#"+e.datepicker._mainDivId).length===0&&e("body").append(e.datepicker.dpDiv);var n=Array.prototype.slice.call(arguments,1);return typeof t!="string"||t!=="isDisabled"&&t!=="getDate"&&t!=="widget"?t==="option"&&arguments.length===2&&typeof arguments[1]=="string"?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(n)):this.each(function(){typeof t=="string"?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(n)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(n))},e.datepicker=new s,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.10.1",window["DP_jQuery_"+r]=e}(jQuery),function(e,t){var n={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},r={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.10.1",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var n=this;if(!this._isOpen||this._trigger("beforeClose",t)===!1)return;this._isOpen=!1,this._destroyOverlay(),this.opener.filter(":focusable").focus().length||e(this.document[0].activeElement).blur(),this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",t)})},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,t){var n=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return n&&!t&&this._trigger("focus",e),n},open:function(){var t=this;if(this._isOpen){this._moveToTop()&&this._focusTabbable();return}this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._trigger("open")},_focusTabbable:function(){var e=this.element.find("[autofocus]");e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function n(){var t=this.document[0].activeElement,n=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);n||this._focusTabbable()}t.preventDefault(),n.call(this),this._delay(n)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE){t.preventDefault(),this.close(t);return}if(t.keyCode!==e.ui.keyCode.TAB)return;var n=this.uiDialog.find(":tabbable"),r=n.filter(":first"),i=n.filter(":last");t.target!==i[0]&&t.target!==this.uiDialog[0]||!!t.shiftKey?(t.target===r[0]||t.target===this.uiDialog[0])&&t.shiftKey&&(i.focus(1),t.preventDefault()):(r.focus(1),t.preventDefault())},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,n=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty();if(e.isEmptyObject(n)||e.isArray(n)&&!n.length){this.uiDialog.removeClass("ui-dialog-buttons");return}e.each(n,function(n,r){var i,s;r=e.isFunction(r)?{click:r,text:n}:r,r=e.extend({type:"button"},r),i=r.click,r.click=function(){i.apply(t.element[0],arguments)},s={icons:r.icons,text:r.showText},delete r.icons,delete r.showText,e("<button></button>",r).button(s).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)},_makeDraggable:function(){function r(e){return{position:e.position,offset:e.offset}}var t=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,i){e(this).addClass("ui-dialog-dragging"),t._blockFrames(),t._trigger("dragStart",n,r(i))},drag:function(e,n){t._trigger("drag",e,r(n))},stop:function(i,s){n.position=[s.position.left-t.document.scrollLeft(),s.position.top-t.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),t._unblockFrames(),t._trigger("dragStop",i,r(s))}})},_makeResizable:function(){function o(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var t=this,n=this.options,r=n.resizable,i=this.uiDialog.css("position"),s=typeof r=="string"?r:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:n.maxWidth,maxHeight:n.maxHeight,minWidth:n.minWidth,minHeight:this._minHeight(),handles:s,start:function(n,r){e(this).addClass("ui-dialog-resizing"),t._blockFrames(),t._trigger("resizeStart",n,o(r))},resize:function(e,n){t._trigger("resize",e,o(n))},stop:function(r,i){n.height=e(this).height(),n.width=e(this).width(),e(this).removeClass("ui-dialog-resizing"),t._unblockFrames(),t._trigger("resizeStop",r,o(i))}}).css("position",i)},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,o={};e.each(t,function(e,t){i._setOption(e,t),e in n&&(s=!0),e in r&&(o[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(e,t){var n,r,i=this.uiDialog;e==="dialogClass"&&i.removeClass(this.options.dialogClass).addClass(t);if(e==="disabled")return;this._super(e,t),e==="appendTo"&&this.uiDialog.appendTo(this._appendTo()),e==="buttons"&&this._createButtons(),e==="closeText"&&this.uiDialogTitlebarClose.button({label:""+t}),e==="draggable"&&(n=i.is(":data(ui-draggable)"),n&&!t&&i.draggable("destroy"),!n&&t&&this._makeDraggable()),e==="position"&&this._position(),e==="resizable"&&(r=i.is(":data(ui-resizable)"),r&&!t&&i.resizable("destroy"),r&&typeof t=="string"&&i.resizable("option","handles",t),!r&&t!==!1&&this._makeResizable()),e==="title"&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title"))},_size:function(){var e,t,n,r=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),r.minWidth>r.width&&(r.width=r.minWidth),e=this.uiDialog.css({height:"auto",width:r.width}).outerHeight(),t=Math.max(0,r.minHeight-e),n=typeof r.maxHeight=="number"?Math.max(0,r.maxHeight-e):"none",r.height==="auto"?this.element.css({minHeight:t,maxHeight:n,height:"auto"}):this.element.height(Math.max(0,r.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_createOverlay:function(){if(!this.options.modal)return;e.ui.dialog.overlayInstances||this._delay(function(){e.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(t){!e(t.target).closest(".ui-dialog").length&&!e(t.target).closest(".ui-datepicker").length&&(t.preventDefault(),e(".ui-dialog:visible:last .ui-dialog-content").data("ui-dialog")._focusTabbable())})}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),e.ui.dialog.overlayInstances++},_destroyOverlay:function(){if(!this.options.modal)return;this.overlay&&(e.ui.dialog.overlayInstances--,e.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),e.ui.dialog.overlayInstances=0,e.uiBackCompat!==!1&&e.widget("ui.dialog",e.ui.dialog,{_position:function(){var t=this.options.position,n=[],r=[0,0],i;if(t){if(typeof t=="string"||typeof t=="object"&&"0"in t)n=t.split?t.split(" "):[t[0],t[1]],n.length===1&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(r[e]=n[e],n[e]=t)}),t={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]),at:n.join(" ")};t=e.extend({},e.ui.dialog.prototype.options.position,t)}else t=e.ui.dialog.prototype.options.position;i=this.uiDialog.is(":visible"),i||this.uiDialog.show(),this.uiDialog.position(t),i||this.uiDialog.hide()}})}(jQuery),function(e,t){var n=/up|down|vertical/,r=/up|left|vertical|horizontal/;e.effects.effect.blind=function(t,i){var s=e(this),o=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(s,t.mode||"hide"),a=t.direction||"up",f=n.test(a),l=f?"height":"width",c=f?"top":"left",h=r.test(a),p={},d=u==="show",v,m,g;s.parent().is(".ui-effects-wrapper")?e.effects.save(s.parent(),o):e.effects.save(s,o),s.show(),v=e.effects.createWrapper(s).css({overflow:"hidden"}),m=v[l](),g=parseFloat(v.css(c))||0,p[l]=d?m:0,h||(s.css(f?"bottom":"right",0).css(f?"top":"left","auto").css({position:"absolute"}),p[c]=d?g:m+g),d&&(v.css(l,0),h||v.css(c,g+m)),v.animate(p,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){u==="hide"&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}})}}(jQuery),function(e,t){e.effects.effect.bounce=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=s==="hide",u=s==="show",a=t.direction||"up",f=t.distance,l=t.times||5,c=l*2+(u||o?1:0),h=t.duration/c,p=t.easing,d=a==="up"||a==="down"?"top":"left",v=a==="up"||a==="left",m,g,y,b=r.queue(),w=b.length;(u||o)&&i.push("opacity"),e.effects.save(r,i),r.show(),e.effects.createWrapper(r),f||(f=r[d==="top"?"outerHeight":"outerWidth"]()/3),u&&(y={opacity:1},y[d]=0,r.css("opacity",0).css(d,v?-f*2:f*2).animate(y,h,p)),o&&(f/=Math.pow(2,l-1)),y={},y[d]=0;for(m=0;m<l;m++)g={},g[d]=(v?"-=":"+=")+f,r.animate(g,h,p).animate(y,h,p),f=o?f*2:f/2;o&&(g={opacity:0},g[d]=(v?"-=":"+=")+f,r.animate(g,h,p)),r.queue(function(){o&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}),w>1&&b.splice.apply(b,[1,0].concat(b.splice(w,c+1))),r.dequeue()}}(jQuery),function(e,t){e.effects.effect.clip=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"vertical",a=u==="vertical",f=a?"height":"width",l=a?"top":"left",c={},h,p,d;e.effects.save(r,i),r.show(),h=e.effects.createWrapper(r).css({overflow:"hidden"}),p=r[0].tagName==="IMG"?h:r,d=p[f](),o&&(p.css(f,0),p.css(l,d/2)),c[f]=o?d:0,c[l]=o?0:d/2,p.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o||r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}}(jQuery),function(e,t){e.effects.effect.drop=function(t,n){var r=e(this),i=["position","top","bottom","left","right","opacity","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left"?"pos":"neg",l={opacity:o?1:0},c;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),c=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0)/2,o&&r.css("opacity",0).css(a,f==="pos"?-c:c),l[a]=(o?f==="pos"?"+=":"-=":f==="pos"?"-=":"+=")+c,r.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}}(jQuery),function(e,t){e.effects.effect.explode=function(t,n){function y(){c.push(this),c.length===r*i&&b()}function b(){s.css({visibility:"visible"}),e(c).remove(),u||s.hide(),n()}var r=t.pieces?Math.round(Math.sqrt(t.pieces)):3,i=r,s=e(this),o=e.effects.setMode(s,t.mode||"hide"),u=o==="show",a=s.show().css("visibility","hidden").offset(),f=Math.ceil(s.outerWidth()/i),l=Math.ceil(s.outerHeight()/r),c=[],h,p,d,v,m,g;for(h=0;h<r;h++){v=a.top+h*l,g=h-(r-1)/2;for(p=0;p<i;p++)d=a.left+p*f,m=p-(i-1)/2,s.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-p*f,top:-h*l}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:f,height:l,left:d+(u?m*f:0),top:v+(u?g*l:0),opacity:u?0:1}).animate({left:d+(u?0:m*f),top:v+(u?0:g*l),opacity:u?1:0},t.duration||500,t.easing,y)}}}(jQuery),function(e,t){e.effects.effect.fade=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"toggle");r.animate({opacity:i},{queue:!1,duration:t.duration,easing:t.easing,complete:n})}}(jQuery),function(e,t){e.effects.effect.fold=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=s==="hide",a=t.size||15,f=/([0-9]+)%/.exec(a),l=!!t.horizFirst,c=o!==l,h=c?["width","height"]:["height","width"],p=t.duration/2,d,v,m={},g={};e.effects.save(r,i),r.show(),d=e.effects.createWrapper(r).css({overflow:"hidden"}),v=c?[d.width(),d.height()]:[d.height(),d.width()],f&&(a=parseInt(f[1],10)/100*v[u?0:1]),o&&d.css(l?{height:0,width:a}:{height:a,width:0}),m[h[0]]=o?v[0]:a,g[h[1]]=o?v[1]:0,d.animate(m,p,t.easing).animate(g,p,t.easing,function(){u&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()})}}(jQuery),function(e,t){e.effects.effect.highlight=function(t,n){var r=e(this),i=["backgroundImage","backgroundColor","opacity"],s=e.effects.setMode(r,t.mode||"show"),o={backgroundColor:r.css("backgroundColor")};s==="hide"&&(o.opacity=0),e.effects.save(r,i),r.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),n()}})}}(jQuery),function(e,t){e.effects.effect.pulsate=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"show"),s=i==="show",o=i==="hide",u=s||i==="hide",a=(t.times||5)*2+(u?1:0),f=t.duration/a,l=0,c=r.queue(),h=c.length,p;if(s||!r.is(":visible"))r.css("opacity",0).show(),l=1;for(p=1;p<a;p++)r.animate({opacity:l},f,t.easing),l=1-l;r.animate({opacity:l},f,t.easing),r.queue(function(){o&&r.hide(),n()}),h>1&&c.splice.apply(c,[1,0].concat(c.splice(h,a+1))),r.dequeue()}}(jQuery),function(e,t){e.effects.effect.puff=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"hide"),s=i==="hide",o=parseInt(t.percent,10)||150,u=o/100,a={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:i,complete:n,percent:s?o:100,from:s?a:{height:a.height*u,width:a.width*u,outerHeight:a.outerHeight*u,outerWidth:a.outerWidth*u}}),r.effect(t)},e.effects.effect.scale=function(t,n){var r=e(this),i=e.extend(!0,{},t),s=e.effects.setMode(r,t.mode||"effect"),o=parseInt(t.percent,10)||(parseInt(t.percent,10)===0?0:s==="hide"?0:100),u=t.direction||"both",a=t.origin,f={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()},l={y:u!=="horizontal"?o/100:1,x:u!=="vertical"?o/100:1};i.effect="size",i.queue=!1,i.complete=n,s!=="effect"&&(i.origin=a||["middle","center"],i.restore=!0),i.from=t.from||(s==="show"?{height:0,width:0,outerHeight:0,outerWidth:0}:f),i.to={height:f.height*l.y,width:f.width*l.x,outerHeight:f.outerHeight*l.y,outerWidth:f.outerWidth*l.x},i.fade&&(s==="show"&&(i.from.opacity=0,i.to.opacity=1),s==="hide"&&(i.from.opacity=1,i.to.opacity=0)),r.effect(i)},e.effects.effect.size=function(t,n){var r,i,s,o=e(this),u=["position","top","bottom","left","right","width","height","overflow","opacity"],a=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],l=["fontSize"],c=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),d=t.restore||p!=="effect",v=t.scale||"both",m=t.origin||["middle","center"],g=o.css("position"),y=d?u:a,b={height:0,width:0,outerHeight:0,outerWidth:0};p==="show"&&o.show(),r={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},t.mode==="toggle"&&p==="show"?(o.from=t.to||b,o.to=t.from||r):(o.from=t.from||(p==="show"?b:r),o.to=t.to||(p==="hide"?b:r)),s={from:{y:o.from.height/r.height,x:o.from.width/r.width},to:{y:o.to.height/r.height,x:o.to.width/r.width}};if(v==="box"||v==="both")s.from.y!==s.to.y&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,s.from.y,o.from),o.to=e.effects.setTransition(o,c,s.to.y,o.to)),s.from.x!==s.to.x&&(y=y.concat(h),o.from=e.effects.setTransition(o,h,s.from.x,o.from),o.to=e.effects.setTransition(o,h,s.to.x,o.to));(v==="content"||v==="both")&&s.from.y!==s.to.y&&(y=y.concat(l).concat(f),o.from=e.effects.setTransition(o,l,s.from.y,o.from),o.to=e.effects.setTransition(o,l,s.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(i=e.effects.getBaseline(m,r),o.from.top=(r.outerHeight-o.outerHeight())*i.y,o.from.left=(r.outerWidth-o.outerWidth())*i.x,o.to.top=(r.outerHeight-o.to.outerHeight)*i.y,o.to.left=(r.outerWidth-o.to.outerWidth)*i.x),o.css(o.from);if(v==="content"||v==="both")c=c.concat(["marginTop","marginBottom"]).concat(l),h=h.concat(["marginLeft","marginRight"]),f=u.concat(c).concat(h),o.find("*[width]").each(function(){var n=e(this),r={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};d&&e.effects.save(n,f),n.from={height:r.height*s.from.y,width:r.width*s.from.x,outerHeight:r.outerHeight*s.from.y,outerWidth:r.outerWidth*s.from.x},n.to={height:r.height*s.to.y,width:r.width*s.to.x,outerHeight:r.height*s.to.y,outerWidth:r.width*s.to.x},s.from.y!==s.to.y&&(n.from=e.effects.setTransition(n,c,s.from.y,n.from),n.to=e.effects.setTransition(n,c,s.to.y,n.to)),s.from.x!==s.to.x&&(n.from=e.effects.setTransition(n,h,s.from.x,n.from),n.to=e.effects.setTransition(n,h,s.to.x,n.to)),n.css(n.from),n.animate(n.to,t.duration,t.easing,function(){d&&e.effects.restore(n,f)})});o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o.to.opacity===0&&o.css("opacity",o.from.opacity),p==="hide"&&o.hide(),e.effects.restore(o,y),d||(g==="static"?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,n){var r=parseInt(n,10),i=e?o.to.left:o.to.top;return n==="auto"?i+"px":r+i+"px"})})),e.effects.removeWrapper(o),n()}})}}(jQuery),function(e,t){e.effects.effect.shake=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=t.direction||"left",u=t.distance||20,a=t.times||3,f=a*2+1,l=Math.round(t.duration/f),c=o==="up"||o==="down"?"top":"left",h=o==="up"||o==="left",p={},d={},v={},m,g=r.queue(),y=g.length;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),p[c]=(h?"-=":"+=")+u,d[c]=(h?"+=":"-=")+u*2,v[c]=(h?"-=":"+=")+u*2,r.animate(p,l,t.easing);for(m=1;m<a;m++)r.animate(d,l,t.easing).animate(v,l,t.easing);r.animate(d,l,t.easing).animate(p,l/2,t.easing).queue(function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}),y>1&&g.splice.apply(g,[1,0].concat(g.splice(y,f+1))),r.dequeue()}}(jQuery),function(e,t){e.effects.effect.slide=function(t,n){var r=e(this),i=["position","top","bottom","left","right","width","height"],s=e.effects.setMode(r,t.mode||"show"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left",l,c={};e.effects.save(r,i),r.show(),l=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(r).css({overflow:"hidden"}),o&&r.css(a,f?isNaN(l)?"-"+l:-l:l),c[a]=(o?f?"+=":"-=":f?"-=":"+=")+l,r.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}}(jQuery),function(e,t){e.effects.effect.transfer=function(t,n){var r=e(this),i=e(t.to),s=i.css("position")==="fixed",o=e("body"),u=s?o.scrollTop():0,a=s?o.scrollLeft():0,f=i.offset(),l={top:f.top-u,left:f.left-a,height:i.innerHeight(),width:i.innerWidth()},c=r.offset(),h=e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({top:c.top-u,left:c.left-a,height:r.innerHeight(),width:r.innerWidth(),position:s?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){h.remove(),n()})}}(jQuery),function(e,t){e.widget("ui.menu",{version:"1.10.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,e.proxy(function(e){this.options.disabled&&e.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(e){e.preventDefault()},"click .ui-state-disabled > a":function(e){e.preventDefault()},"click .ui-menu-item:has(a)":function(t){var n=e(t.target).closest(".ui-menu-item");!this.mouseHandled&&n.not(".ui-state-disabled").length&&(this.mouseHandled=!0,this.select(t),n.has(".ui-menu").length?this.expand(t):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&this.active.parents(".ui-menu").length===1&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var n=e(t.currentTarget);n.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(t,n)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var n=this.active||this.element.children(".ui-menu-item").eq(0);t||this.focus(e,n)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){e(t.target).closest(".ui-menu").length||this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function a(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,r,i,s,o,u=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:u=!1,r=this.previousFilter||"",i=String.fromCharCode(t.keyCode),s=!1,clearTimeout(this.filterTimer),i===r?s=!0:i=r+i,o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())}),n=s&&n.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):n,n.length||(i=String.fromCharCode(t.keyCode),o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())})),n.length?(this.focus(t,n),n.length>1?(this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}u&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,n=this.options.icons.submenu,r=this.element.find(this.options.menus);r.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),r=t.prev("a"),i=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);r.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",r.attr("id"))}),t=r.add(this.element),t.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),t.children(":not(.ui-menu-item)").each(function(){var t=e(this);/[^\-\u2014\u2013\s]/.test(t.text())||t.addClass("ui-widget-content ui-menu-divider")}),t.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){e==="icons"&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),this._super(e,t)},focus:function(e,t){var n,r;this.blur(e,e&&e.type==="focus"),this._scrollIntoView(t),this.active=t.first(),r=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),e&&e.type==="keydown"?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=t.children(".ui-menu"),n.length&&/^mouse/.test(e.type)&&this._startOpening(n),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var n,r,i,s,o,u;this._hasScroll()&&(n=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-n-r,s=this.activeMenu.scrollTop(),o=this.activeMenu.height(),u=t.height(),i<0?this.activeMenu.scrollTop(s+i):i+u>o&&this.activeMenu.scrollTop(s+i-o+u))},blur:function(e,t){t||clearTimeout(this.timer);if(!this.active)return;this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active})},_startOpening:function(e){clearTimeout(this.timer);if(e.attr("aria-hidden")!=="true")return;this.timer=this._delay(function(){this._close(),this._open(e)},this.delay)},_open:function(t){var n=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(t,n){clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(t),this.activeMenu=r},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,n){var r;this.active&&(e==="first"||e==="last"?r=this.active[e==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1):r=this.active[e+"All"](".ui-menu-item").eq(0));if(!r||!r.length||!this.active)r=this.activeMenu.children(".ui-menu-item")[t]();this.focus(n,r)},nextPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isLastItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r-i<0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())},previousPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isFirstItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r+i>0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item").first())},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var n={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,n)}})}(jQuery),function(e,t){function h(e,t,n){return[parseFloat(e[0])*(l.test(e[0])?t/100:1),parseFloat(e[1])*(l.test(e[1])?n/100:1)]}function p(t,n){return parseInt(e.css(t,n),10)||0}function d(t){var n=t[0];return n.nodeType===9?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(n)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,r=Math.max,i=Math.abs,s=Math.round,o=/left|center|right/,u=/top|center|bottom/,a=/[\+\-]\d+(\.[\d]+)?%?/,f=/^\w+/,l=/%$/,c=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var r,i,s=e("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return e("body").append(s),r=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,r===i&&(i=s[0].clientWidth),s.remove(),n=r-i},getScrollInfo:function(t){var n=t.isWindow?"":t.element.css("overflow-x"),r=t.isWindow?"":t.element.css("overflow-y"),i=n==="scroll"||n==="auto"&&t.width<t.element[0].scrollWidth,s=r==="scroll"||r==="auto"&&t.height<t.element[0].scrollHeight;return{width:i?e.position.scrollbarWidth():0,height:s?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),r=e.isWindow(n[0]);return{element:n,isWindow:r,offset:n.offset()||{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:r?n.width():n.outerWidth(),height:r?n.height():n.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return c.apply(this,arguments);t=e.extend({},t);var n,l,v,m,g,y,b=e(t.of),w=e.position.getWithinInfo(t.within),E=e.position.getScrollInfo(w),S=(t.collision||"flip").split(" "),x={};return y=d(b),b[0].preventDefault&&(t.at="left top"),l=y.width,v=y.height,m=y.offset,g=e.extend({},m),e.each(["my","at"],function(){var e=(t[this]||"").split(" "),n,r;e.length===1&&(e=o.test(e[0])?e.concat(["center"]):u.test(e[0])?["center"].concat(e):["center","center"]),e[0]=o.test(e[0])?e[0]:"center",e[1]=u.test(e[1])?e[1]:"center",n=a.exec(e[0]),r=a.exec(e[1]),x[this]=[n?n[0]:0,r?r[0]:0],t[this]=[f.exec(e[0])[0],f.exec(e[1])[0]]}),S.length===1&&(S[1]=S[0]),t.at[0]==="right"?g.left+=l:t.at[0]==="center"&&(g.left+=l/2),t.at[1]==="bottom"?g.top+=v:t.at[1]==="center"&&(g.top+=v/2),n=h(x.at,l,v),g.left+=n[0],g.top+=n[1],this.each(function(){var o,u,a=e(this),f=a.outerWidth(),c=a.outerHeight(),d=p(this,"marginLeft"),y=p(this,"marginTop"),T=f+d+p(this,"marginRight")+E.width,N=c+y+p(this,"marginBottom")+E.height,C=e.extend({},g),k=h(x.my,a.outerWidth(),a.outerHeight());t.my[0]==="right"?C.left-=f:t.my[0]==="center"&&(C.left-=f/2),t.my[1]==="bottom"?C.top-=c:t.my[1]==="center"&&(C.top-=c/2),C.left+=k[0],C.top+=k[1],e.support.offsetFractions||(C.left=s(C.left),C.top=s(C.top)),o={marginLeft:d,marginTop:y},e.each(["left","top"],function(r,i){e.ui.position[S[r]]&&e.ui.position[S[r]][i](C,{targetWidth:l,targetHeight:v,elemWidth:f,elemHeight:c,collisionPosition:o,collisionWidth:T,collisionHeight:N,offset:[n[0]+k[0],n[1]+k[1]],my:t.my,at:t.at,within:w,elem:a})}),t.using&&(u=function(e){var n=m.left-C.left,s=n+l-f,o=m.top-C.top,u=o+v-c,h={target:{element:b,left:m.left,top:m.top,width:l,height:v},element:{element:a,left:C.left,top:C.top,width:f,height:c},horizontal:s<0?"left":n>0?"right":"center",vertical:u<0?"top":o>0?"bottom":"middle"};l<f&&i(n+s)<l&&(h.horizontal="center"),v<c&&i(o+u)<v&&(h.vertical="middle"),r(i(n),i(s))>r(i(o),i(u))?h.important="horizontal":h.important="vertical",t.using.call(this,e,h)}),a.offset(e.extend(C,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,o=e.left-t.collisionPosition.marginLeft,u=i-o,a=o+t.collisionWidth-s-i,f;t.collisionWidth>s?u>0&&a<=0?(f=e.left+u+t.collisionWidth-s-i,e.left+=u-f):a>0&&u<=0?e.left=i:u>a?e.left=i+s-t.collisionWidth:e.left=i:u>0?e.left+=u:a>0?e.left-=a:e.left=r(e.left-o,e.left)},top:function(e,t){var n=t.within,i=n.isWindow?n.scrollTop:n.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,u=i-o,a=o+t.collisionHeight-s-i,f;t.collisionHeight>s?u>0&&a<=0?(f=e.top+u+t.collisionHeight-s-i,e.top+=u-f):a>0&&u<=0?e.top=i:u>a?e.top=i+s-t.collisionHeight:e.top=i:u>0?e.top+=u:a>0?e.top-=a:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var n=t.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,u=e.left-t.collisionPosition.marginLeft,a=u-o,f=u+t.collisionWidth-s-o,l=t.my[0]==="left"?-t.elemWidth:t.my[0]==="right"?t.elemWidth:0,c=t.at[0]==="left"?t.targetWidth:t.at[0]==="right"?-t.targetWidth:0,h=-2*t.offset[0],p,d;if(a<0){p=e.left+l+c+h+t.collisionWidth-s-r;if(p<0||p<i(a))e.left+=l+c+h}else if(f>0){d=e.left-t.collisionPosition.marginLeft+l+c+h-o;if(d>0||i(d)<f)e.left+=l+c+h}},top:function(e,t){var n=t.within,r=n.offset.top+n.scrollTop,s=n.height,o=n.isWindow?n.scrollTop:n.offset.top,u=e.top-t.collisionPosition.marginTop,a=u-o,f=u+t.collisionHeight-s-o,l=t.my[1]==="top",c=l?-t.elemHeight:t.my[1]==="bottom"?t.elemHeight:0,h=t.at[1]==="top"?t.targetHeight:t.at[1]==="bottom"?-t.targetHeight:0,p=-2*t.offset[1],d,v;a<0?(v=e.top+c+h+p+t.collisionHeight-s-r,e.top+c+h+p>a&&(v<0||v<i(a))&&(e.top+=c+h+p)):f>0&&(d=e.top-t.collisionPosition.marginTop+c+h+p-o,e.top+c+h+p>f&&(d>0||i(d)<f)&&(e.top+=c+h+p))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,n,r,i,s,o=document.getElementsByTagName("body")[0],u=document.createElement("div");t=document.createElement(o?"div":"body"),r={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&e.extend(r,{position:"absolute",left:"-1000px",top:"-1000px"});for(s in r)t.style[s]=r[s];t.appendChild(u),n=o||document.documentElement,n.insertBefore(t,n.firstChild),u.style.cssText="position: absolute; left: 10.7432222px;",i=e(u).offset().left,e.support.offsetFractions=i>10&&i<11,t.innerHTML="",n.removeChild(t)}()}(jQuery),function(e,t){e.widget("ui.progressbar",{version:"1.10.1",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){if(e===t)return this.options.value;this.options.value=this._constrainedValue(e),this._refreshValue()},_constrainedValue:function(e){return e===t&&(e=this.options.value),this.indeterminate=e===!1,typeof e!="number"&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){e==="max"&&(t=Math.max(this.min,t)),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,n=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(n.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}})}(jQuery),function(e,t){var n=5;e.widget("ui.slider",e.ui.mouse,{version:"1.10.1",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,n,r=this.options,i=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),s="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",o=[];n=r.values&&r.values.length||1,i.length>n&&(i.slice(n).remove(),i=i.slice(0,n));for(t=i.length;t<n;t++)o.push(s);this.handles=i.add(e(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,n="";t.range?(t.range===!0&&(t.values?t.values.length&&t.values.length!==2?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),!this.range||!this.range.length?(this.range=e("<div></div>").appendTo(this.element),n="ui-slider-range ui-widget-header ui-corner-all"):this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}),this.range.addClass(n+(t.range==="min"||t.range==="max"?" ui-slider-range-"+t.range:""))):this.range=e([])},_setupEvents:function(){var e=this.handles.add(this.range).filter("a");this._off(e),this._on(e,this._handleEvents),this._hoverable(e),this._focusable(e)},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var n,r,i,s,o,u,a,f,l=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),n={x:t.pageX,y:t.pageY},r=this._normValueFromMouse(n),i=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var n=Math.abs(r-l.values(t));if(i>n||i===n&&(t===l._lastChangedValue||l.values(t)===c.min))i=n,s=e(this),o=t}),u=this._start(t,o),u===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,s.addClass("ui-state-active").focus(),a=s.offset(),f=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=f?{left:0,top:0}:{left:t.pageX-a.left-s.width()/2,top:t.pageY-a.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,r),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return this.orientation==="horizontal"?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),r<0&&(r=0),this.orientation==="vertical"&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_start:function(e,t){var n={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("start",e,n)},_slide:function(e,t,n){var r,i,s;this.options.values&&this.options.values.length?(r=this.values(t?0:1),this.options.values.length===2&&this.options.range===!0&&(t===0&&n>r||t===1&&n<r)&&(n=r),n!==this.values(t)&&(i=this.values(),i[t]=n,s=this._trigger("slide",e,{handle:this.handles[t],value:n,values:i}),r=this.values(t?0:1),s!==!1&&this.values(t,n,!0))):n!==this.value()&&(s=this._trigger("slide",e,{handle:this.handles[t],value:n}),s!==!1&&this.value(n))},_stop:function(e,t){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("stop",e,n)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,n)}},value:function(e){if(arguments.length){this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0);return}return this._value()},values:function(t,n){var r,i,s;if(arguments.length>1){this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t);return}if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();r=this.options.values,i=arguments[0];for(s=0;s<r.length;s+=1)r[s]=this._trimAlignValue(i[s]),this._change(null,s);this._refreshValue()},_setOption:function(t,n){var r,i=0;t==="range"&&this.options.range===!0&&(n==="min"?(this.options.value=this._values(0),this.options.values=null):n==="max"&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(i=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments);switch(t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(r=0;r<i;r+=1)this._change(null,r);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e),e},_values:function(e){var t,n,r;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t),t;if(this.options.values&&this.options.values.length){n=this.options.values.slice();for(r=0;r<n.length;r+=1)n[r]=this._trimAlignValue(n[r]);return n}return[]},_trimAlignValue:function(e){if(e<=this._valueMin())return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,n=(e-this._valueMin())%t,r=e-n;return Math.abs(n)*2>=t&&(r+=n>0?t:-t),parseFloat(r.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,n,r,i,s,o=this.options.range,u=this.options,a=this,f=this._animateOff?!1:u.animate,l={};this.options.values&&this.options.values.length?this.handles.each(function(r){n=(a.values(r)-a._valueMin())/(a._valueMax()-a._valueMin())*100,l[a.orientation==="horizontal"?"left":"bottom"]=n+"%",e(this).stop(1,1)[f?"animate":"css"](l,u.animate),a.options.range===!0&&(a.orientation==="horizontal"?(r===0&&a.range.stop(1,1)[f?"animate":"css"]({left:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:u.animate})):(r===0&&a.range.stop(1,1)[f?"animate":"css"]({bottom:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:u.animate}))),t=n}):(r=this.value(),i=this._valueMin(),s=this._valueMax(),n=s!==i?(r-i)/(s-i)*100:0,l[this.orientation==="horizontal"?"left":"bottom"]=n+"%",this.handle.stop(1,1)[f?"animate":"css"](l,u.animate),o==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[f?"animate":"css"]({width:n+"%"},u.animate),o==="max"&&this.orientation==="horizontal"&&this.range[f?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:u.animate}),o==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[f?"animate":"css"]({height:n+"%"},u.animate),o==="max"&&this.orientation==="vertical"&&this.range[f?"animate":"css"]({height:100-n+"%"},{queue:!1,duration:u.animate}))},_handleEvents:{keydown:function(t){var r,i,s,o,u=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:t.preventDefault();if(!this._keySliding){this._keySliding=!0,e(t.target).addClass("ui-state-active"),r=this._start(t,u);if(r===!1)return}}o=this.options.step,this.options.values&&this.options.values.length?i=s=this.values(u):i=s=this.value();switch(t.keyCode){case e.ui.keyCode.HOME:s=this._valueMin();break;case e.ui.keyCode.END:s=this._valueMax();break;case e.ui.keyCode.PAGE_UP:s=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.PAGE_DOWN:s=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(i===this._valueMax())return;s=this._trimAlignValue(i+o);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i===this._valueMin())return;s=this._trimAlignValue(i-o)}this._slide(t,u,s)},click:function(e){e.preventDefault()},keyup:function(t){var n=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,n),this._change(t,n),e(t.target).removeClass("ui-state-active"))}}})}(jQuery),function(e){function t(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.widget("ui.spinner",{version:"1.10.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},n=this.element;return e.each(["min","max","step"],function(e,r){var i=n.attr(r);i!==undefined&&i.length&&(t[r]=i)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e)},mousewheel:function(e,t){if(!t)return;if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()},"mousedown .ui-spinner-button":function(t){function r(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),r.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,r.call(this)});if(this._start(t)===!1)return;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(!e(t.currentTarget).hasClass("ui-state-active"))return;if(this._start(t)===!1)return!1;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(e.height()*.5)&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var n=this.options,r=e.ui.keyCode;switch(t.keyCode){case r.UP:return this._repeat(null,1,t),!0;case r.DOWN:return this._repeat(null,-1,t),!0;case r.PAGE_UP:return this._repeat(null,n.page,t),!0;case r.PAGE_DOWN:return this._repeat(null,-n.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(e){return!this.spinning&&this._trigger("start",e)===!1?!1:(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(e,t,n){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,n)},e),this._spin(t*this.options.step,n)},_spin:function(e,t){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+e*this._increment(this.counter));if(!this.spinning||this._trigger("spin",t,{value:n})!==!1)this._value(n),this.counter++},_increment:function(t){var n=this.options.incremental;return n?e.isFunction(n)?n(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return this.options.min!==null&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),n=t.indexOf(".");return n===-1?0:t.length-n-1},_adjustValue:function(e){var t,n,r=this.options;return t=r.min!==null?r.min:0,n=e-t,n=Math.round(n/r.step)*r.step,e=t+n,e=parseFloat(e.toFixed(this._precision())),r.max!==null&&e>r.max?r.max:r.min!==null&&e<r.min?r.min:e},_stop:function(e){if(!this.spinning)return;clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e)},_setOption:function(e,t){if(e==="culture"||e==="numberFormat"){var n=this._parse(this.element.val());this.options[e]=t,this.element.val(this._format(n));return}(e==="max"||e==="min"||e==="step")&&typeof t=="string"&&(t=this._parse(t)),e==="icons"&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),e==="disabled"&&(t?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:t(function(e){this._super(e),this._value(this.element.val())}),_parse:function(e){return typeof e=="string"&&e!==""&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),e===""||isNaN(e)?null:e},_format:function(e){return e===""?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(e,t){var n;e!==""&&(n=this._parse(e),n!==null&&(t||(n=this._adjustValue(n)),e=this._format(n))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:t(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:t(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:t(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:t(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){if(!arguments.length)return this._parse(this.element.val());t(this._value).call(this,e)},widget:function(){return this.uiSpinner}})}(jQuery),function(e,t){function i(){return++n}function s(e){return e.hash.length>1&&decodeURIComponent(e.href.replace(r,""))===decodeURIComponent(location.href.replace(r,""))}var n=0,r=/#.*$/;e.widget("ui.tabs",{version:"1.10.1",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var t=this,n=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",n.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),n.active=this._initialActive(),e.isArray(n.disabled)&&(n.disabled=e.unique(n.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(n.active):this.active=e(),this._refresh(),this.active.length&&this.load(n.active)},_initialActive:function(){var t=this.options.active,n=this.options.collapsible,r=location.hash.substring(1);if(t===null){r&&this.tabs.each(function(n,i){if(e(i).attr("aria-controls")===r)return t=n,!1}),t===null&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active")));if(t===null||t===-1)t=this.tabs.length?0:!1}return t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),t===-1&&(t=n?!1:0)),!n&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var n=e(this.document[0].activeElement).closest("li"),r=this.tabs.index(n),i=!0;if(this._handlePageNav(t))return;switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:r++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:i=!1,r--;break;case e.ui.keyCode.END:r=this.anchors.length-1;break;case e.ui.keyCode.HOME:r=0;break;case e.ui.keyCode.SPACE:t.preventDefault(),clearTimeout(this.activating),this._activate(r);return;case e.ui.keyCode.ENTER:t.preventDefault(),clearTimeout(this.activating),this._activate(r===this.options.active?!1:r);return;default:return}t.preventDefault(),clearTimeout(this.activating),r=this._focusNextTab(r,i),t.ctrlKey||(n.attr("aria-selected","false"),this.tabs.eq(r).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",r)},this.delay))},_panelKeydown:function(t){if(this._handlePageNav(t))return;t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP)return this._activate(this._focusNextTab(this.options.active-1,!1)),!0;if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN)return this._activate(this._focusNextTab(this.options.active+1,!0)),!0},_findNextTab:function(t,n){function i(){return t>r&&(t=0),t<0&&(t=r),t}var r=this.tabs.length-1;while(e.inArray(i(),this.options.disabled)!==-1)t=n?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){if(e==="active"){this._activate(t);return}if(e==="disabled"){this._setupDisabled(t);return}this._super(e,t),e==="collapsible"&&(this.element.toggleClass("ui-tabs-collapsible",t),!t&&this.options.active===!1&&this._activate(0)),e==="event"&&this._setupEvents(t),e==="heightStyle"&&this._setupHeightStyle(t)},_tabId:function(e){return e.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,n=this.tablist.children(":has(a[href])");t.disabled=e.map(n.filter(".ui-state-disabled"),function(e){return n.index(e)}),this._processTabs(),t.active===!1||!this.anchors.length?(t.active=!1,this.active=e()):this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(n,r){var i,o,u,a=e(r).uniqueId().attr("id"),f=e(r).closest("li"),l=f.attr("aria-controls");s(r)?(i=r.hash,o=t.element.find(t._sanitizeSelector(i))):(u=t._tabId(f),i="#"+u,o=t.element.find(i),o.length||(o=t._createPanel(u),o.insertAfter(t.panels[n-1]||t.tablist)),o.attr("aria-live","polite")),o.length&&(t.panels=t.panels.add(o)),l&&f.data("ui-tabs-aria-controls",l),f.attr({"aria-controls":i.substring(1),"aria-labelledby":a}),o.attr("aria-labelledby",a)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var n=0,r;r=this.tabs[n];n++)t===!0||e.inArray(n,t)!==-1?e(r).addClass("ui-state-disabled").attr("aria-disabled","true"):e(r).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var n={click:function(e){e.preventDefault()}};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var n,r=this.element.parent();t==="fill"?(n=r.height(),n-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),r=t.css("position");if(r==="absolute"||r==="fixed")return;n-=t.outerHeight(!0)}),this.element.children().not(this.panels).each(function(){n-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):t==="auto"&&(n=0,this.panels.each(function(){n=Math.max(n,e(this).height("").height())}).height(n))},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i.closest("li"),o=s[0]===r[0],u=o&&n.collapsible,a=u?e():this._getPanelForTab(s),f=r.length?this._getPanelForTab(r):e(),l={oldTab:r,oldPanel:f,newTab:u?e():s,newPanel:a};t.preventDefault();if(s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!n.collapsible||this._trigger("beforeActivate",t,l)===!1)return;n.active=u?!1:this.tabs.index(s),this.active=o?e():s,this.xhr&&this.xhr.abort(),!f.length&&!a.length&&e.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,l)},_toggle:function(t,n){function o(){r.running=!1,r._trigger("activate",t,n)}function u(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),i.length&&r.options.show?r._show(i,r.options.show,o):(i.show(),o())}var r=this,i=n.newPanel,s=n.oldPanel;this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),u()),s.attr({"aria-expanded":"false","aria-hidden":"true"}),n.oldTab.attr("aria-selected","false"),i.length&&s.length?n.oldTab.attr("tabIndex",-1):i.length&&this.tabs.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}),n.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(t){var n,r=this._findActive(t);if(r[0]===this.active[0])return;r.length||(r=this.active),n=r.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return typeof e=="string"&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),n=t.data("ui-tabs-aria-controls");n?t.attr("aria-controls",n).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),this.options.heightStyle!=="content"&&this.panels.css("height","")},enable:function(n){var r=this.options.disabled;if(r===!1)return;n===t?r=!1:(n=this._getIndex(n),e.isArray(r)?r=e.map(r,function(e){return e!==n?e:null}):r=e.map(this.tabs,function(e,t){return t!==n?t:null})),this._setupDisabled(r)},disable:function(n){var r=this.options.disabled;if(r===!0)return;if(n===t)r=!0;else{n=this._getIndex(n);if(e.inArray(n,r)!==-1)return;e.isArray(r)?r=e.merge([n],r).sort():r=[n]}this._setupDisabled(r)},load:function(t,n){t=this._getIndex(t);var r=this,i=this.tabs.eq(t),o=i.find(".ui-tabs-anchor"),u=this._getPanelForTab(i),a={tab:i,panel:u};if(s(o[0]))return;this.xhr=e.ajax(this._ajaxSettings(o,n,a)),this.xhr&&this.xhr.statusText!=="canceled"&&(i.addClass("ui-tabs-loading"),u.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){u.html(e),r._trigger("load",n,a)},1)}).complete(function(e,t){setTimeout(function(){t==="abort"&&r.panels.stop(!1,!0),i.removeClass("ui-tabs-loading"),u.removeAttr("aria-busy"),e===r.xhr&&delete r.xhr},1)}))},_ajaxSettings:function(t,n,r){var i=this;return{url:t.attr("href"),beforeSend:function(t,s){return i._trigger("beforeLoad",n,e.extend({jqXHR:t,ajaxSettings:s},r))}}},_getPanelForTab:function(t){var n=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}})}(jQuery),function(e){function n(t,n){var r=(t.attr("aria-describedby")||"").split(/\s+/);r.push(n),t.data("ui-tooltip-id",n).attr("aria-describedby",e.trim(r.join(" ")))}function r(t){var n=t.data("ui-tooltip-id"),r=(t.attr("aria-describedby")||"").split(/\s+/),i=e.inArray(n,r);i!==-1&&r.splice(i,1),t.removeData("ui-tooltip-id"),r=e.trim(r.join(" ")),r?t.attr("aria-describedby",r):t.removeAttr("aria-describedby")}var t=0;e.widget("ui.tooltip",{version:"1.10.1",options:{content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(t,n){var r=this;if(t==="disabled"){this[n?"_disable":"_enable"](),this.options[t]=n;return}this._super(t,n),t==="content"&&e.each(this.tooltips,function(e,t){r._updateContent(t)})},_disable:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var n=this,r=e(t?t.target:this.element).closest(this.options.items);if(!r.length||r.data("ui-tooltip-id"))return;r.attr("title")&&r.data("ui-tooltip-title",r.attr("title")),r.data("ui-tooltip-open",!0),t&&t.type==="mouseover"&&r.parents().each(function(){var t=e(this),r;t.data("ui-tooltip-open")&&(r=e.Event("blur"),r.target=r.currentTarget=this,n.close(r,!0)),t.attr("title")&&(t.uniqueId(),n.parents[this.id]={element:this,title:t.attr("title")},t.attr("title",""))}),this._updateContent(r,t)},_updateContent:function(e,t){var n,r=this.options.content,i=this,s=t?t.type:null;if(typeof r=="string")return this._open(t,e,r);n=r.call(e[0],function(n){if(!e.data("ui-tooltip-open"))return;i._delay(function(){t&&(t.type=s),this._open(t,e,n)})}),n&&this._open(t,e,n)},_open:function(t,r,i){function f(e){a.of=e;if(s.is(":hidden"))return;s.position(a)}var s,o,u,a=e.extend({},this.options.position);if(!i)return;s=this._find(r);if(s.length){s.find(".ui-tooltip-content").html(i);return}r.is("[title]")&&(t&&t.type==="mouseover"?r.attr("title",""):r.removeAttr("title")),s=this._tooltip(r),n(r,s.attr("id")),s.find(".ui-tooltip-content").html(i),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:f}),f(t)):s.position(e.extend({of:r},this.options.position)),s.hide(),this._show(s,this.options.show),this.options.show&&this.options.show.delay&&(u=this.delayedShow=setInterval(function(){s.is(":visible")&&(f(a.of),clearInterval(u))},e.fx.interval)),this._trigger("open",t,{tooltip:s}),o={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var n=e.Event(t);n.currentTarget=r[0],this.close(n,!0)}},remove:function(){this._removeTooltip(s)}};if(!t||t.type==="mouseover")o.mouseleave="close";if(!t||t.type==="focusin")o.focusout="close";this._on(!0,r,o)},close:function(t){var n=this,i=e(t?t.currentTarget:this.element),s=this._find(i);if(this.closing)return;clearInterval(this.delayedShow),i.data("ui-tooltip-title")&&i.attr("title",i.data("ui-tooltip-title")),r(i),s.stop(!0),this._hide(s,this.options.hide,function(){n._removeTooltip(e(this))}),i.removeData("ui-tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),t&&t.type==="mouseleave"&&e.each(this.parents,function(t,r){e(r.element).attr("title",r.title),delete n.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:s}),this.closing=!1},_tooltip:function(n){var r="ui-tooltip-"+t++,i=e("<div>").attr({id:r,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[r]=n,i},_find:function(t){var n=t.data("ui-tooltip-id");return n?e("#"+n):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0),e("#"+n).remove(),r.data("ui-tooltip-title")&&(r.attr("title",r.data("ui-tooltip-title")),r.removeData("ui-tooltip-title"))})}})}(jQuery);
skin/frontend/base/default/Loginradius/Sociallogin/css/admin-ui.css DELETED
@@ -1,134 +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
- color: #00ccff;
23
- text-decoration: none;
24
- }
25
- .loginRadiusFieldset a:hover, .loginRadiusHelpDiv ul li a:hover{
26
- text-decoration:underline !important
27
- }
28
- .loginRadiusHelpDiv ul li{
29
- list-style-type: disc;
30
- }
31
- .loginRadiusHelpDiv ul{
32
- margin: 0 15px;
33
- }
34
- loginradius_radio{
35
- vertical-align:top;
36
- margin-left:7px
37
- }
38
- #row_sociallogin_options_horizontalSharing_horizontalSharingProviders ul li{
39
- width:149px;
40
- float:left
41
- }
42
- #row_sociallogin_options_messages_redirect td input{
43
- margin-right:2px
44
- }
45
- #row_sociallogin_options_verticalSharing_verticalSharingProviders ul li{
46
- width:149px;
47
- float:left
48
- }
49
- #row_sociallogin_options_verticalSharing_verticalCounterProviders ul li{
50
- width:149px;
51
- float:left
52
- }
53
- #row_sociallogin_options_horizontalSharing_horizontalCounterProviders ul li{
54
- width:149px;
55
- float:left
56
- }
57
- #loginRadiushorizontalRearrangeSharing li, #loginRadiusverticalRearrangeSharing li{
58
- float:left
59
- }
60
- #row_sociallogin_options_verticalSharing_verticalSharingTheme td label{
61
- float:left !important
62
- }
63
- #row_sociallogin_options_messages_iconSize td input{
64
- margin-right:2px
65
- }
66
- #row_sociallogin_options_messages_sameWindow td input{
67
- margin-right:2px
68
- }
69
- #row_sociallogin_options_verticalSharing_verticalSharingTheme td input{
70
- float:left !important;
71
- margin-left:4px
72
- }
73
- #row_sociallogin_options_horizontalSharing_horizontalSharingTheme td input{
74
- vertical-align:top
75
- }
76
- #row_sociallogin_options_horizontalSharing_horizontalSharingTheme td[class=value]{
77
- width: 400px !important
78
- }
79
- #row_sociallogin_options_verticalSharing_verticalSharingTheme td.value{
80
- width:400px !important;
81
- }
82
- #row_sociallogin_options_sharing_verticalSharing td input{
83
- vertical-align:top !important;
84
- float:left !important;
85
- margin-right:2px
86
- }
87
- #row_sociallogin_options_sharing_verticalSharing td label, #row_sociallogin_options_counter_verticalCounter td label{
88
- float:left !important
89
- }
90
- #row_sociallogin_options_sharing_horizontalSharing td input{
91
- vertical-align:top !important;
92
- margin-right:2px
93
- }
94
- #row_sociallogin_options_counter_horizontalCounter td input{
95
- vertical-align:top !important;
96
- margin-right:2px
97
- }
98
- #row_sociallogin_options_counter_verticalCounter td input{
99
- vertical-align:top !important;
100
- margin-right:2px;
101
- float:left !important
102
- }
103
- .lrshare_iconsprite32{
104
- cursor: pointer !important;
105
- height: 32px;
106
- margin: 4px !important;
107
- width: 32px;
108
- padding: 0px !important;
109
- border: none !important;
110
- background: url("lrshare_iconsprite32.png") no-repeat scroll left top transparent;
111
- list-style-type: none !important;
112
- }
113
- .lrshare_iconsprite32.lrshare_delicious { background-position: 0px 0px; width: 32px; height: 32px; }
114
- .lrshare_iconsprite32.lrshare_digg { background-position: -34px 0px; width: 32px; height: 32px; }
115
- .lrshare_iconsprite32.lrshare_dotnetkicks { background-position: -68px 0px; width: 32px; height: 32px; }
116
- .lrshare_iconsprite32.lrshare_email { background-position: -102px 0px; width: 32px; height: 32px; }
117
- .lrshare_iconsprite32.lrshare_evenmore32 { background-position: -138px 0px; width: 32px; height: 32px; }
118
- .lrshare_iconsprite32.lrshare_facebook { background-position: -174px 0px; width: 32px; height: 32px; }
119
- .lrshare_iconsprite32.lrshare_google { background-position: -208px 0px; width: 32px; height: 32px; }
120
- .lrshare_iconsprite32.lrshare_googleplus { background-position: -242px 0px; width: 32px; height: 32px; }
121
- .lrshare_iconsprite32.lrshare_hyves { background-position: -276px 0px; width: 32px; height: 32px; }
122
- .lrshare_iconsprite32.lrshare_linkedin { background-position: -310px 0px; width: 32px; height: 32px; }
123
- .lrshare_iconsprite32.lrshare_live { background-position: -344px 0px; width: 32px; height: 32px; }
124
- .lrshare_iconsprite32.lrshare_myspace { background-position: -378px 0px; width: 32px; height: 32px; }
125
- .lrshare_iconsprite32.lrshare_pinterest { background-position: -412px 0px; width: 32px; height: 32px; }
126
- .lrshare_iconsprite32.lrshare_print { background-position: -446px 0px; width: 32px; height: 32px; }
127
- .lrshare_iconsprite32.lrshare_reddit { background-position: -480px 0px; width: 32px; height: 32px; }
128
- .lrshare_iconsprite32.lrshare_sharingcounter32 { background-position: -514px 0px; width: 50px; height: 32px; padding-top:4px !important; font-size:18px; }
129
- .lrshare_iconsprite32.lrshare_tumblr { background-position: -576px 0px; width: 32px; height: 32px; }
130
- .lrshare_iconsprite32.lrshare_twitter { background-position: -610px 0px; width: 32px; height: 32px; }
131
- .lrshare_iconsprite32.lrshare_viadeo { background-position: -644px 0px; width: 32px; height: 32px; }
132
- .lrshare_iconsprite32.lrshare_vkontakte { background-position: -678px 0px; width: 32px; height: 32px; }
133
- .lrshare_iconsprite32.lrshare_wordpress { background-position: -712px 0px; width: 32px; height: 32px; }
134
- .lrshare_iconsprite32.lrshare_yahoo { background-position: -746px 0px; width: 32px; height: 32px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
skin/frontend/base/default/Loginradius/Sociallogin/css/popup.css ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .LoginRadius_overlay{
2
+ background: rgb(127, 127, 127); /* The Fallback */
3
+ background: none no-repeat scroll 0 0 rgba(127, 127, 127, 0.6);
4
+ position: absolute;
5
+ top: 0;
6
+ left: 0;
7
+ z-index: 1000001;
8
+ width: 100%;
9
+ height: 100%;
10
+ overflow: auto;
11
+ padding: 0;
12
+ position: fixed;
13
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=97)";
14
+ filter: alpha(opacity=97);
15
+ }
16
+
17
+ .lr-popupheading{
18
+ font-size: 17px;
19
+ text-align: center;
20
+ font-weight: normal;
21
+ }
22
+ #popupouter{
23
+ border-radius: 0 23px;
24
+ background: #f3f3f3;
25
+ left: 50%;
26
+ margin: -114px auto 0 -250px;
27
+ overflow: auto;
28
+ padding: 0;
29
+ position: absolute;
30
+ top: 30%;
31
+ width: 500px;
32
+ font-family: Arial, Helvetica, sans-serif;
33
+ }
34
+ #popupinner {
35
+ overflow: auto;
36
+ background: #ffffff;
37
+ padding: 15px 20px;
38
+ }
39
+ #textmatter {
40
+ color: #666666;
41
+ font-family: Arial,Helvetica,sans-serif;
42
+ font-size: 14px;
43
+ margin: 10px 0;
44
+ float:left
45
+ }
46
+ .loginRadiusText{
47
+ font-family: Arial, Helvetica, sans-serif;
48
+ color: #444;
49
+ font-size: 13px;
50
+ border: 1px solid #e2efe1;
51
+ width: 330px;
52
+ height: 33px;
53
+ line-height: 33px;
54
+ margin-bottom: 5px !important;
55
+ padding-left: 10px;
56
+ border-radius: 0px 12px;
57
+ background: #fff;
58
+ }
59
+ select.loginRadiusText {
60
+ width: 365px;
61
+ }
62
+ .inputbutton{
63
+ border: #dcdcdc 1px solid !important;
64
+ text-decoration: none !important;
65
+ color: #6e6e6e !important;
66
+ font-family: Arial, Helvetica, sans-serif;
67
+ font-size: 13px !important;
68
+ cursor: pointer !important;
69
+ background: #f3f3f3 !important;
70
+ padding: 6px 17px !important;
71
+ margin-right: 15px;
72
+ float: left;
73
+ margin-bottom: 0 !important;
74
+ border-radius: 0px 11px !important;
75
+ text-transform: none !important;
76
+ font-weight: normal !important;
77
+ }
78
+ .inputbutton:hover{
79
+ text-decoration: none !important;
80
+ cursor: pointer !important;
81
+ background: #f3f3f3 !important;
82
+ color: #000 !important;
83
+ }
84
+ #textdivpopup{
85
+ text-align:right;
86
+ font-family:Arial, Helvetica, sans-serif;
87
+ font-size:11px;
88
+ color:#000000;
89
+ }
90
+ .spanpopup{
91
+ font-family:Arial, Helvetica, sans-serif;
92
+ font-size:11px;
93
+ color:#00ccff;
94
+ }
95
+ .span1{
96
+ font-family:Arial, Helvetica, sans-serif;
97
+ font-size:11px;
98
+ color:#333333;
99
+ }
100
+ .lr-error {
101
+ text-align: left;
102
+ background-color: rgb(255, 235, 232);
103
+ margin-bottom: 12px;
104
+ padding: 12px;
105
+ }
106
+
107
+ .lr-noerror {
108
+ text-align: left;
109
+ background-color: #e1eabc;
110
+ margin-bottom: 12px;
111
+ padding: 12px;
112
+
113
+ }
114
+ <!--[if IE]>
115
+ .LoginRadius_content_IE
116
+ {
117
+ background:black;
118
+ -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=90)";
119
+ filter: alpha(opacity=90);
120
+ }
121
+ .loginRadiusDiv{
122
+ float:left;
123
+ margin: 0 0 4px 2px;
124
+ }
125
+ .loginRadiusDiv label{
126
+ width: 94px;
127
+ margin: 5px 10px 10px 0;
128
+ display: block;
129
+ text-align: left;
130
+ }
131
+
132
+ <![endif]-->
133
+
134
+ @media (max-width: 769px) {
135
+ #popupouter {
136
+ border-radius: 0 23px !important;
137
+ background: none repeat scroll 0 0 #f3f3f3;
138
+ border-radius: 4px;
139
+ left: 0;
140
+ margin: 5% auto 0;
141
+ overflow: auto;
142
+ padding: 0;
143
+ position: static;
144
+ top: 0;
145
+ width: 400px;
146
+ }
147
+
148
+ .inputtxt {
149
+ width: 336px;
150
+ }
151
+ }
152
+
153
+ @media (max-width: 480px) {
154
+ #popupouter {
155
+ width: 300px;
156
+ border-radius: 0 23px !important;
157
+ }
158
+
159
+ .inputtxt {
160
+ width: 236px;
161
+ }
162
+ }
skin/frontend/base/default/Loginradius/Sociallogin/js/LoginRadiusSDK.2.0.0.js ADDED
@@ -0,0 +1,313 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 
2
+ var LoginRadiusSDK = (function () {
3
+ //for cross browser communication
4
+ (function (a, b) { "use strict"; var c = function () { var b = function () { var b = a.location.hash ? a.location.hash.substr(1).split("&") : [], c = {}; for (var d = 0; d < b.length; d++) { var e = b[d].split("="); c[e[0]] = decodeURIComponent(e[1]) } return c }; var c = function (b) { var c = []; for (var d in b) { c.push(d + "=" + encodeURIComponent(b[d])) } a.location.hash = c.join("&") }; return { get: function (a) { var c = b(); if (a) { return c[a] } else { return c } }, add: function (a) { var d = b(); for (var e in a) { d[e] = a[e] } c(d) }, remove: function (a) { a = typeof a == "string" ? [a] : a; var d = b(); for (var e = 0; e < a.length; e++) { delete d[a[e]] } c(d) }, clear: function () { c({}) } } }(); a.hash = c })(window)
5
+
6
+ var lrToken = hash.get('lr-token');
7
+ if (lrToken) {
8
+ window.opener.loginradiushtml5passToken(lrToken);
9
+ document.write('<style type="text/css">body { display: none !important; } </style>');
10
+ window.close();
11
+ }
12
+
13
+
14
+ var apiDomain = "api.loginradius.com";
15
+
16
+ var token = 'LRTokenKey';
17
+
18
+ var util = {};
19
+
20
+ // store all about loginradius module
21
+ var module = {};
22
+ var onlogin = function () { };
23
+
24
+
25
+ module.isauthenticated = false;
26
+
27
+
28
+ /**function is used to set Callback Handler to login
29
+ * @function
30
+ * @public
31
+ * @param fn {function}
32
+ */
33
+ module.setLoginCallback = function (fn) {
34
+ module.onlogin = fn;
35
+ };
36
+
37
+
38
+ /**The User Profile API is used to get social profile data from the user’s social account after authentication. The social profile will be retrieved via oAuth and OpenID protocols. The data is normalized into LoginRadius' standard data format.
39
+ * @function
40
+ * @public
41
+ * @param handle {CallbackHandler} callback handler, invoke after getting Userprofile from LoginRadius
42
+ */
43
+ module.getUserprofile = function (handle) {
44
+ util.jsonpCall("https://" + apiDomain + "/api/v2/userprofile?access_token=" + module.getToken(), function (data) {
45
+ handle(data);
46
+ });
47
+ };
48
+
49
+ /**The photo API is used to get photo data from the user’s social account. The data will be normalized into LoginRadius' data format.
50
+ * @function
51
+ * @public
52
+ * @param A valid albumId, it return album photos
53
+ * @param handle {CallbackHandler} callback handler, invoke after getting Userprofile from LoginRadius
54
+ */
55
+ module.getPhotos = function (albumId, handle) {
56
+ util.jsonpCall("https://" + apiDomain + "/api/v2/photo?access_token=" + module.getToken() + "&albumid=" + albumId, function (data) {
57
+ handle(data);
58
+ });
59
+ };
60
+
61
+ /**The Check In API is used to get check-ins data from the user’s social account. The data will be normalized into LoginRadius' data format.
62
+ * @function
63
+ * @public
64
+ * @param handle {CallbackHandler} callback handler, invoke after getting Userprofile from LoginRadius
65
+ */
66
+ module.getCheckins = function (handle) {
67
+ util.jsonpCall("https://" + apiDomain + "/api/v2/checkin?access_token=" + module.getToken(), function (data) {
68
+ handle(data);
69
+ });
70
+ };
71
+
72
+ /**The Albums API is used to get the Albums data from the user’s social account. The data will be normalized into LoginRadius' data format.
73
+ * @function
74
+ * @public
75
+ * @param handle {CallbackHandler} callback handler, invoke after getting Userprofile from LoginRadius
76
+ */
77
+ module.getAlbums = function (handle) {
78
+ util.jsonpCall("https://" + apiDomain + "/api/v2/album?access_token=" + module.getToken(), function (data) {
79
+ handle(data);
80
+ });
81
+ };
82
+
83
+
84
+ /**The Audio API is used to get audio files data from the user’s social account. The data will be normalized into LoginRadius' data format.
85
+ * @function
86
+ * @public
87
+ * @param handle {CallbackHandler} callback handler, invoke after getting Userprofile from LoginRadius
88
+ */
89
+ module.getAudios = function (handle) {
90
+ util.jsonpCall("https://" + apiDomain + "/api/v2/audio?access_token=" + module.getToken(), function (data) {
91
+ handle(data);
92
+ });
93
+ };
94
+
95
+
96
+ /**The Mention API is used to get mention data from the user’s social account. The data will be normalized into LoginRadius' data format.
97
+ * @function
98
+ * @public
99
+ * @param handle {CallbackHandler} callback handler, invoke after getting Userprofile from LoginRadius
100
+ */
101
+ module.getMentions = function (handle) {
102
+ util.jsonpCall("https://" + apiDomain + "/api/v2/mention?access_token=" + module.getToken(), function (data) {
103
+ handle(data);
104
+ });
105
+ };
106
+
107
+
108
+ /**The Following API is used to get the followers’ information from the user’s social account. The data will be normalized into LoginRadius' data format.
109
+ * @function
110
+ * @public
111
+ * @param handle {CallbackHandler} callback handler, invoke after getting Userprofile from LoginRadius
112
+ */
113
+ module.getFollowings = function (handle) {
114
+ util.jsonpCall("https://" + apiDomain + "/api/v2/following?access_token=" + module.getToken(), function (data) {
115
+ handle(data);
116
+ });
117
+ };
118
+
119
+
120
+ /**The Event API is used to get the event data from the user’s social account. The data will be normalized into LoginRadius' data format.
121
+ * @function
122
+ * @public
123
+ * @param handle {CallbackHandler} callback handler, invoke after getting Userprofile from LoginRadius
124
+ */
125
+ module.getEvents = function (handle) {
126
+ util.jsonpCall("https://" + apiDomain + "/api/v2/event?access_token=" + module.getToken(), function (data) {
127
+ handle(data);
128
+ });
129
+ };
130
+
131
+
132
+ /**The Post API is used to get posted messages from the user’s social account. The data will be normalized into LoginRadius' data format.
133
+ * @function
134
+ * @public
135
+ * @param handle {CallbackHandler} callback handler, invoke after getting Userprofile from LoginRadius
136
+ */
137
+ module.getPosts = function (handle) {
138
+ util.jsonpCall("https://" + apiDomain + "/api/v2/post?access_token=" + module.getToken(), function (data) {
139
+ handle(data);
140
+ });
141
+ };
142
+
143
+
144
+ /**The Company API is used to get the followed company’s data in the user’s social account. The data will be normalized into LoginRadius' data format.
145
+ * @function
146
+ * @public
147
+ * @param handle {CallbackHandler} callback handler, invoke after getting Userprofile from LoginRadius
148
+ */
149
+ module.getCompanies = function (handle) {
150
+ util.jsonpCall("https://" + apiDomain + "/api/v2/company?access_token=" + module.getToken(), function (data) {
151
+ handle(data);
152
+ });
153
+ };
154
+
155
+
156
+ /**The Group API is used to get group data from the user’s social account. The data will be normalized into LoginRadius' data format.
157
+ * @function
158
+ * @public
159
+ * @param handle {CallbackHandler} callback handler, invoke after getting Userprofile from LoginRadius
160
+ */
161
+ module.getGroups = function (handle) {
162
+ util.jsonpCall("https://" + apiDomain + "/api/v2/group?access_token=" + module.getToken(), function (data) {
163
+ handle(data);
164
+ });
165
+ };
166
+
167
+ /**The Status API is used to get the status messages from the user’s social account. The data will be normalized into LoginRadius' data format.
168
+ * @function
169
+ * @public
170
+ * @param handle {CallbackHandler} callback handler, invoke after getting Userprofile from LoginRadius
171
+ */
172
+ module.getStatuses = function (handle) {
173
+ util.jsonpCall("https://" + apiDomain + "/api/v2/status?access_token=" + module.getToken(), function (data) {
174
+ handle(data);
175
+ });
176
+ };
177
+
178
+ /**The Contact API is used to get contacts/friends/connections data from the user’s social account. The data will normalized into LoginRadius' data format.
179
+ * @function
180
+ * @public
181
+ * @param Curser value for getting next records set
182
+ * @param handle {CallbackHandler} callback handler, invoke after getting Userprofile from LoginRadius
183
+ */
184
+ module.getContacts = function (cursor, handle) {
185
+ util.jsonpCall("https://" + apiDomain + "/api/v2/contact?access_token=" + module.getToken() + "&nextcursor=" + cursor, function (data) {
186
+ handle(data);
187
+ });
188
+ };
189
+
190
+
191
+ /**The Video API is used to get videos data from the user’s social account. The data will be normalized into LoginRadius' data format.
192
+ * @function
193
+ * @public
194
+ * @param handle {CallbackHandler} callback handler, invoke after getting Userprofile from LoginRadius
195
+ */
196
+ module.getVideos = function (handle) {
197
+ util.jsonpCall("https://" + apiDomain + "/api/v2/video?access_token=" + module.getToken(), function (data) {
198
+ handle(data);
199
+ });
200
+ };
201
+
202
+
203
+ /**The Likes API is used to get likes data from the user’s social account. The data will be normalized into LoginRadius' data format.
204
+ * @function
205
+ * @public
206
+ * @param handle {CallbackHandler} callback handler, invoke after getting Userprofile from LoginRadius
207
+ */
208
+ module.getLikes = function (handle) {
209
+ util.jsonpCall("https://" + apiDomain + "/api/v2/like?access_token=" + module.getToken(), function (data) {
210
+ handle(data);
211
+ });
212
+ };
213
+
214
+ /**This API is used to update the status on the user’s wall.
215
+ * @function
216
+ * @public
217
+ * @param title for status message.
218
+ * @param A web link of the status message
219
+ * @param An image URL of the status message
220
+ * @param The status message text
221
+ * @param A caption of the status message
222
+ * @param A description of the status message
223
+ * @param handle {CallbackHandler} callback handler, invoke after getting Userprofile from LoginRadius
224
+ */
225
+ module.postStatus = function (title, url, status, imageurl, caption, description, handle) {
226
+ util.jsonpCall("https://" + apiDomain + "/api/v2/status/js?access_token=" + module.getToken() + "&title=" + title + "&url=" + url + "&imageurl=" + imageurl + "&status=" + status + "&caption=" + caption + "&description=" + description, function (data) {
227
+ handle(data);
228
+ });
229
+ };
230
+
231
+
232
+ /**The Message API is used to post messages to the user’s contacts. After using the Contact API, you can send messages to the retrieved contacts.
233
+ * @function
234
+ * @public
235
+ * @param A valid friend id to send the message, it would be fetched from the contacts list
236
+ * @param The subject of the message to be send
237
+ * @param The details of the message to be send
238
+ * @param handle {CallbackHandler} callback handler, invoke after getting Userprofile from LoginRadius
239
+ */
240
+ module.postMessage = function (to, subject, message, handle) {
241
+ util.jsonpCall("https://" + apiDomain + "/api/v2/message/js?access_token=" + module.getToken() + "&to=" + to + "&subject=" + subject + "&message=" + message, function (data) {
242
+ handle(data);
243
+ });
244
+ };
245
+
246
+ /**The Access Token API is used to get the LoginRadius access token after authentication. It will be valid for the specific duration of time specified in the response.
247
+ * @function
248
+ * @public
249
+ */
250
+ module.getToken = function () {
251
+ return sessionStorage.getItem(token);
252
+ };
253
+
254
+
255
+ util.jsonpCall = function (url, handle) {
256
+ var func = 'Loginradius' + Math.floor((Math.random() * 1000000000000000000) + 1);
257
+ window[func] = function (data) {
258
+ handle(data);
259
+
260
+ try {
261
+ delete window[func];
262
+ }
263
+ catch (e) {
264
+ window[func] = undefined;
265
+ }
266
+ document.body.removeChild(js);
267
+ }
268
+ var js = document.createElement('script');
269
+ js.src = url.indexOf('?') != -1 ? url + '&callback=' + func : url + '?callback=' + func;
270
+ js.type = "text/javascript";
271
+ document.body.appendChild(js);
272
+ };
273
+
274
+
275
+ util.addEvent = function (type, element, handle) {
276
+ var elements = [];
277
+ if (element instanceof Array) {
278
+ elements = element;
279
+ } else {
280
+ elements.push(element);
281
+ }
282
+ for (var i = 0; i < elements.length; i++) {
283
+ if (elements[i].attachEvent) {
284
+ elements[i].attachEvent("on" + type, function (e) {
285
+ handle(e);
286
+ });
287
+ } else if (elements[i].addEventListener) {
288
+ elements[i].addEventListener(type, handle, false);
289
+ }
290
+ }
291
+ };
292
+
293
+
294
+ function receiveToken(event) {
295
+ if (event.origin.indexOf("hub.loginradius.com") == -1) {
296
+ return;
297
+ }
298
+ loginradiushtml5passToken(event.data);
299
+ };
300
+
301
+
302
+
303
+ util.addEvent("message", window, receiveToken);
304
+
305
+ window.loginradiushtml5passToken = function (tok) {
306
+ sessionStorage.setItem(token, tok);
307
+ module.isauthenticated = true;
308
+ module.onlogin();
309
+ };
310
+
311
+ return module;
312
+ })();
313
+
skin/frontend/base/default/Loginradius/Sociallogin/js/admin-ui.js DELETED
@@ -1,303 +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
- // validate numeric data
8
- function loginRadiusIsNumber(n) {
9
- return !isNaN(parseFloat(n)) && isFinite(n);
10
- }
11
- var $loginRadiusJquery = jQuery.noConflict();
12
- // prepare admin UI on window load
13
- function loginRadiusPrepareAdminUI(){
14
-
15
- // highlight API Key and Secret notification
16
- if($loginRadiusJquery('#loginRadiusKeySecretNotification')){
17
- $loginRadiusJquery('#loginRadiusKeySecretNotification').animate({'backgroundColor' : 'rgb(241, 142, 127)'}, 1000).animate({'backgroundColor' : '#FFFFE0'}, 1000).animate({'backgroundColor' : 'rgb(241, 142, 127)'}, 1000).animate({'backgroundColor' : '#FFFFE0'}, 1000);
18
- }
19
- // show notification, if API Key and secret are same
20
- document.getElementById('sociallogin_options_messages_appkey').onkeyup = function(){
21
- if(this.value.trim() == document.getElementById('sociallogin_options_messages_appid').value.trim()){
22
- if($loginRadiusJquery('#spanApiKeyError').html() == undefined){
23
- $loginRadiusJquery('#sociallogin_options_messages_appkey').before('<span id="spanApiKeyError" style="color:red">API Key and Secret cannot be same. Please paste correct API Key and Secret from your LoginRadius account in the corresponding fields.</span>');
24
- }else{
25
- $loginRadiusJquery('#spanApiKeyError').html('API Key and Secret cannot be same. Please paste correct API Key and Secret from your LoginRadius account in the corresponding fields.');
26
- }
27
- }else{
28
- $loginRadiusJquery('#spanApiKeyError').html('');
29
- }
30
- }
31
- // show warning, if number of social login icons is < 2 or if non-numeric
32
- document.getElementById('sociallogin_options_messages_iconsPerRow').onblur = function(){
33
- if(document.getElementById('sociallogin_options_messages_iconsPerRow').value.trim() < 2 || !loginRadiusIsNumber(document.getElementById('sociallogin_options_messages_iconsPerRow').value.trim())){
34
- if($loginRadiusJquery('#loginRadiusNoColumnsError').html() == undefined){
35
- $loginRadiusJquery('#sociallogin_options_messages_iconsPerRow').before('<span id="loginRadiusNoColumnsError" style="color:red">Please enter a valid number greater than 1.</span>');
36
- }else{
37
- $loginRadiusJquery('#loginRadiusNoColumnsError').html('Please enter a valid number greater than 1.');
38
- }
39
- }else{
40
- $loginRadiusJquery('#loginRadiusNoColumnsError').html('');
41
- }
42
- }
43
- // show warning, if "top" offset is non-numeric
44
- document.getElementById('sociallogin_options_verticalSharing_offset').onblur = function(){
45
- if(!loginRadiusIsNumber(document.getElementById('sociallogin_options_verticalSharing_offset').value.trim())){
46
- if($loginRadiusJquery('#loginRadiusOffsetError').html() == undefined){
47
- $loginRadiusJquery('#sociallogin_options_verticalSharing_offset').before('<span id="loginRadiusOffsetError" style="color:red">Please enter a valid number.</span>');
48
- }else{
49
- $loginRadiusJquery('#loginRadiusOffsetError').html('Please enter a valid number.');
50
- }
51
- }else{
52
- $loginRadiusJquery('#loginRadiusOffsetError').html('');
53
- }
54
- }
55
- var horizontalSharingTheme, verticalSharingTheme;
56
- // fetch horizontal and vertical sharing providers dynamically from LoginRadius on window load
57
- var sharingType = ['horizontal', 'vertical'];
58
- var sharingModes = ['Sharing', 'Counter'];
59
- // show the sharing/counter providers according to the selected sharing theme
60
- for(var j = 0; j < sharingType.length; j++){
61
- var loginRadiusHorizontalSharingThemes = document.getElementById('row_sociallogin_options_'+sharingType[j]+'Sharing_'+sharingType[j]+'SharingTheme').getElementsByTagName('input');
62
- for(var i = 0; i < loginRadiusHorizontalSharingThemes.length; i++){
63
- if(sharingType[j] == 'horizontal'){
64
- loginRadiusHorizontalSharingThemes[i].onclick = function(){
65
- loginRadiusToggleSharingProviders(this, 'horizontal');
66
- }
67
- }else if(sharingType[j] == 'vertical'){
68
- loginRadiusHorizontalSharingThemes[i].onclick = function(){
69
- loginRadiusToggleSharingProviders(this, 'vertical');
70
- }
71
- }
72
- if(loginRadiusHorizontalSharingThemes[i].checked == true){
73
- if(sharingType[j] == 'horizontal'){
74
- horizontalSharingTheme = loginRadiusHorizontalSharingThemes[i].value;
75
- }else if(sharingType[j] == 'vertical'){
76
- verticalSharingTheme = loginRadiusHorizontalSharingThemes[i].value;
77
- }
78
- loginRadiusToggleSharingProviders(loginRadiusHorizontalSharingThemes[i], sharingType[j]);
79
- }
80
- }
81
- }
82
- // set left margin for first radio button in Social Login Icon Size
83
- document.getElementById('sociallogin_options_messages_iconSizemedium').style.marginLeft = '6px';
84
- // set left margin for first radio button in Horizontal counter
85
- document.getElementById('sociallogin_options_horizontalSharing_horizontalSharingTheme32').style.marginLeft = '6px';
86
- // set left margin for first radio button in Horizontal counter
87
- document.getElementById('sociallogin_options_messages_sameWindow1').style.marginLeft = '6px';
88
- // set left margin for first radio button in login redirection
89
- var loginRadiusRedirectionOptions = document.getElementById('row_sociallogin_options_messages_redirect').getElementsByTagName('input');
90
- loginRadiusRedirectionOptions[0].style.marginLeft = '6px';
91
-
92
-
93
- // if selected sharing theme is worth showing rearrange icons, then show rearrange icons and manage sharing providers in hidden field
94
- for(var j = 0; j < sharingType.length; j++){
95
- for(var jj = 0; jj < sharingModes.length; jj++){
96
- // get sharing providers table-row reference
97
- var loginRadiusHorizontalSharingProvidersRow = document.getElementById('row_sociallogin_options_'+sharingType[j]+'Sharing_'+sharingType[j]+sharingModes[jj]+'Providers');
98
- // get sharing providers checkboxes reference
99
- var loginRadiusHorizontalSharingProviders = loginRadiusHorizontalSharingProvidersRow.getElementsByTagName('input');
100
- for(var i = 0; i < loginRadiusHorizontalSharingProviders.length; i++){
101
- if(sharingType[j] == 'horizontal'){
102
- if(sharingModes[jj] == 'Sharing'){
103
- loginRadiusHorizontalSharingProviders[i].onclick = function(){
104
- loginRadiusShowIcon(false, this, 'horizontal');
105
- }
106
- }else{
107
- loginRadiusHorizontalSharingProviders[i].onclick = function(){
108
- loginRadiusPopulateCounter(this, 'horizontal');
109
- }
110
- }
111
- }else if(sharingType[j] == 'vertical'){
112
- if(sharingModes[jj] == 'Sharing'){
113
- loginRadiusHorizontalSharingProviders[i].onclick = function(){
114
- loginRadiusShowIcon(false, this, 'vertical');
115
- }
116
- }else{
117
- loginRadiusHorizontalSharingProviders[i].onclick = function(){
118
- loginRadiusPopulateCounter(this, 'vertical');
119
- }
120
- }
121
- }
122
- }
123
-
124
- // check the sharing providers that were saved previously in the hidden field
125
- var loginRadiusSharingProvidersHidden = document.getElementById('sociallogin_options_'+sharingType[j]+'Sharing_'+sharingType[j]+sharingModes[jj]+'ProvidersHidden').value.trim();
126
- if(loginRadiusSharingProvidersHidden != ""){
127
- var loginRadiusSharingProviderArray = loginRadiusSharingProvidersHidden.split(',');
128
- if(sharingModes[jj] == 'Sharing'){
129
- for(var i = 0; i < loginRadiusSharingProviderArray.length; i++){
130
- document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]).checked = true;
131
- loginRadiusShowIcon(true, document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]), sharingType[j]);
132
- }
133
- }else{
134
- for(var i = 0; i < loginRadiusSharingProviderArray.length; i++){
135
- document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]).checked = true;
136
- }
137
- }
138
- }else{
139
- if(sharingModes[jj] == 'Sharing'){
140
- var loginRadiusSharingProviderArray = ["Facebook", "GooglePlus", "Twitter", "Pinterest", "Email", "Print"];
141
- for(var i = 0; i < loginRadiusSharingProviderArray.length; i++){
142
- document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]).checked = true;
143
- loginRadiusShowIcon(true, document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]), sharingType[j], true);
144
- }
145
- }else{
146
- var loginRadiusSharingProviderArray = ["Facebook Like", "Google+ +1", "Twitter Tweet", "Pinterest Pin it", "Hybridshare"];
147
- for(var i = 0; i < loginRadiusSharingProviderArray.length; i++){
148
- document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]).checked = true;
149
- loginRadiusPopulateCounter(document.getElementById(sharingType[j]+"_"+sharingModes[jj]+"_"+loginRadiusSharingProviderArray[i]), sharingType[j]);
150
- }
151
- }
152
- }
153
- }
154
- }
155
- }
156
- // show sharing themes according to the selected option
157
- function loginRadiusToggleSharing(theme){
158
- if(typeof this.value == "undefined"){
159
- var sharingTheme = theme;
160
- }else{
161
- var sharingTheme = this.value;
162
- }
163
- if(sharingTheme == "horizontal"){
164
- document.getElementById('row_sociallogin_options_sharing_verticalSharing').style.display = 'none';
165
- document.getElementById('row_sociallogin_options_sharing_horizontalSharing').style.display = 'table-row';
166
- document.getElementById('row_sociallogin_options_sharing_sharingVerticalAlignment').style.display = 'none';
167
- document.getElementById('row_sociallogin_options_sharing_sharingOffset').style.display = 'none';
168
- }else if(sharingTheme == "vertical"){
169
- document.getElementById('row_sociallogin_options_sharing_verticalSharing').style.display = 'table-row';
170
- document.getElementById('row_sociallogin_options_sharing_horizontalSharing').style.display = 'none';
171
- document.getElementById('row_sociallogin_options_sharing_sharingVerticalAlignment').style.display = 'table-row';
172
- document.getElementById('row_sociallogin_options_sharing_sharingOffset').style.display = 'table-row';
173
- }
174
- }
175
- // show counter themes according to the selected option
176
- function loginRadiusToggleCounter(theme){
177
- if(typeof this.value == "undefined"){
178
- var counterTheme = theme;
179
- }else{
180
- var counterTheme = this.value;
181
- }
182
- if(counterTheme == "horizontal"){
183
- document.getElementById('row_sociallogin_options_counter_verticalCounter').style.display = 'none';
184
- document.getElementById('row_sociallogin_options_counter_horizontalCounter').style.display = 'table-row';
185
- document.getElementById('row_sociallogin_options_counter_counterVerticalAlignment').style.display = 'none';
186
- document.getElementById('row_sociallogin_options_counter_counterOffset').style.display = 'none';
187
- }else if(counterTheme == "vertical"){
188
- document.getElementById('row_sociallogin_options_counter_verticalCounter').style.display = 'table-row';
189
- document.getElementById('row_sociallogin_options_counter_horizontalCounter').style.display = 'none';
190
- document.getElementById('row_sociallogin_options_counter_counterVerticalAlignment').style.display = 'table-row';
191
- document.getElementById('row_sociallogin_options_counter_counterOffset').style.display = 'table-row';
192
- }
193
- }
194
- // limit maximum number of providers selected in sharing
195
- function loginRadiusSharingLimit(elem, sharingType){
196
- var checkCount = 0;
197
- // get providers table-row reference
198
- var loginRadiusSharingProvidersRow = document.getElementById('row_sociallogin_options_'+sharingType+'Sharing_'+sharingType+'SharingProviders');
199
- // get sharing providers checkboxes reference
200
- var loginRadiusSharingProviders = loginRadiusSharingProvidersRow.getElementsByTagName('input');
201
- for(var i = 0; i < loginRadiusSharingProviders.length; i++){
202
- if(loginRadiusSharingProviders[i].checked){
203
- // count checked providers
204
- checkCount++;
205
- if(checkCount >= 10){
206
- elem.checked = false;
207
- if(document.getElementById('loginRadius'+sharingType+'ErrorDiv') == null){
208
- // create and show div having error message
209
- var errorDiv = document.createElement('div');
210
- errorDiv.setAttribute('id', 'loginRadius'+sharingType+'ErrorDiv');
211
- errorDiv.innerHTML = "You can select only 9 providers.";
212
- errorDiv.style.color = 'red';
213
- errorDiv.style.marginBottom = '10px';
214
- // append div to the <td> containing sharing provider checkboxes
215
- var rearrangeTd = loginRadiusSharingProvidersRow.getElementsByTagName('td');
216
- $loginRadiusJquery(rearrangeTd[1]).find('ul').before(errorDiv);
217
- }
218
- return;
219
- }
220
- }
221
- }
222
- }
223
- // add/remove icons from counter hidden field
224
- function loginRadiusPopulateCounter(elem, sharingType, lrDefault){
225
- // get providers hidden field value
226
- var providers = document.getElementById('sociallogin_options_'+sharingType+'Sharing_'+sharingType+'CounterProvidersHidden');
227
- if(elem.checked){
228
- // add selected providers in the hiddem field value
229
- if(typeof elem.checked != "undefined" || lrDefault == true){
230
- if(providers.value == ""){
231
- providers.value = elem.value;
232
- }else{
233
- providers.value += ","+elem.value;
234
- }
235
- }
236
- }else{
237
- if(providers.value.indexOf(',') == -1){
238
- providers.value = providers.value.replace(elem.value, "");
239
- }else{
240
- if(providers.value.indexOf(","+elem.value) == -1){
241
- providers.value = providers.value.replace(elem.value+",", "");
242
- }else{
243
- providers.value = providers.value.replace(","+elem.value, "");
244
- }
245
- }
246
- }
247
- }
248
- // show selected providers in rearrange option
249
- function loginRadiusShowIcon(pageRefresh, elem, sharingType, lrDefault){
250
- loginRadiusSharingLimit(elem, sharingType);
251
- // get providers hidden field value
252
- var providers = document.getElementById('sociallogin_options_'+sharingType+'Sharing_'+sharingType+'SharingProvidersHidden');
253
- if(elem.checked){
254
- // get reference to "rearrange providers" <ul> element
255
- var ul = document.getElementById('loginRadius'+sharingType+'RearrangeSharing');
256
- // if <ul> is not already created
257
- if(ul == null){
258
- // create <ul> element
259
- var ul = document.createElement('ul');
260
- ul.setAttribute('id', 'loginRadius'+sharingType+'RearrangeSharing');
261
- $loginRadiusJquery(ul).sortable({
262
- update: function(e, ui) {
263
- var val = $loginRadiusJquery(this).children().map(function() {
264
- return $loginRadiusJquery(this).attr('title');
265
- }).get().join();
266
- $loginRadiusJquery(providers).val(val);
267
- },
268
- revert: true});
269
- }
270
- // create list items
271
- var listItem = document.createElement('li');
272
- listItem.setAttribute('id', 'loginRadius'+sharingType+'LI'+elem.value);
273
- listItem.setAttribute('title', elem.value);
274
- listItem.setAttribute('class', 'lrshare_iconsprite32 lrshare_'+elem.value.toLowerCase());
275
- ul.appendChild(listItem);
276
- // add selected providers in the hiddem field value
277
- if(!pageRefresh || lrDefault == true){
278
- if(providers.value == ""){
279
- providers.value = elem.value;
280
- }else{
281
- providers.value += ","+elem.value;
282
- }
283
- }
284
- // append <ul> to the <td>
285
- var rearrangeRow = document.getElementById('row_sociallogin_options_'+sharingType+'Sharing_'+sharingType+'SharingProvidersHidden');
286
- var rearrangeTd = rearrangeRow.getElementsByTagName('td');
287
- rearrangeTd[1].appendChild(ul);
288
- }else{
289
- var remove = document.getElementById('loginRadius'+sharingType+'LI'+elem.value);
290
- if(remove){
291
- remove.parentNode.removeChild(remove);
292
- }
293
- if(providers.value.indexOf(',') == -1){
294
- providers.value = providers.value.replace(elem.value, "");
295
- }else{
296
- if(providers.value.indexOf(","+elem.value) == -1){
297
- providers.value = providers.value.replace(elem.value+",", "");
298
- }else{
299
- providers.value = providers.value.replace(","+elem.value, "");
300
- }
301
- }
302
- }
303
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
skin/frontend/base/default/Loginradius/Sociallogin/js/popup.js ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // variable to check if submit button of popup is clicked
2
+ var loginRadiusPopupSubmit = true;
3
+ // get trim() worked in IE
4
+ if (typeof String.prototype.trim !== 'function') {
5
+ String.prototype.trim = function() {
6
+ return this.replace(/^\s+|\s+$/g, '');
7
+ }
8
+ }
9
+ // validate numeric data
10
+ function isNumber(n) {
11
+ return !isNaN(parseFloat(n)) && isFinite(n);
12
+ }
13
+ // validate required fields form
14
+ function loginRadiusValidateForm() {
15
+ var loginRadiusForm = document.getElementById('loginRadiusForm');
16
+ if (!loginRadiusPopupSubmit) {
17
+ loginRadiusForm.setAttribute('action', window.location.href);
18
+ return true;
19
+ }
20
+ var loginRadiusErrorDiv = document.getElementById('lr-message');
21
+ if (document.getElementById('loginRadiusCountry')!= null && document.getElementById('loginRadiusCountry').value.trim() == "US") {
22
+ var validateProvince = true;
23
+ } else {
24
+ var validateProvince = false;
25
+ }
26
+ for (var i = 0; i < loginRadiusForm.elements.length; i++) {
27
+ if (!validateProvince && loginRadiusForm.elements[i].id == "loginRadiusProvince") {
28
+ continue;
29
+ }
30
+ if (loginRadiusForm.elements[i].value.trim() == "" && loginRadiusForm.elements[i].id != "loginRadiusEmail") {
31
+ loginRadiusErrorDiv.innerHTML = "Please fill all the fields";
32
+ loginRadiusErrorDiv.style.backgroundColor = "rgb(255, 235, 232)";
33
+ loginRadiusErrorDiv.style.textAlign = "left";
34
+ return false;
35
+ }
36
+ if (loginRadiusForm.elements[i].id == "loginRadiusEmail") {
37
+ var email = loginRadiusForm.elements[i].value.trim();
38
+ var atPosition = email.indexOf("@");
39
+ var dotPosition = email.lastIndexOf(".");
40
+ if (atPosition < 1 || dotPosition < atPosition + 2 || dotPosition + 2 >= email.length) {
41
+ loginRadiusErrorDiv.innerHTML = "Please enter a valid email address.";
42
+ loginRadiusErrorDiv.style.backgroundColor = "rgb(255, 235, 232)";
43
+ loginRadiusErrorDiv.style.textAlign = "left";
44
+ return false;
45
+ }
46
+ }
47
+ }
48
+ return true;
49
+ }