Просмотр исходного кода

#2008 Facebook Connect & other connection apps

RomanL 7 лет назад
Родитель
Сommit
79a7481ecb

+ 1 - 1
modules/boonex/drupal_connect/install/langs/en.xml

@@ -6,7 +6,7 @@
 	<string name="_bx_drupal_information_block"><![CDATA[
         <p>This module can be used to login to this site using Drupal credentials.</p>]]></string>
 	<string name="_bx_drupal_profile_error_api_keys"><![CDATA[Please configure the module in admin panel (can't define Client ID and Secret)]]></string>
-    <string name="_bx_drupal_auth_title"><![CDATA[Drupal Connect]]></string>
+    <string name="_bx_drupal_auth_title"><![CDATA[Login with Drupal]]></string>
     <string name="_bx_drupal_json_decode_failed"><![CDATA[JSON decode failed]]></string>	
     <string name="_bx_drupal_wrong_username_or_pass"><![CDATA[Wrong username or password]]></string>	
 

+ 2 - 2
modules/boonex/drupal_connect/install/sql/enable.sql

@@ -6,8 +6,8 @@ INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `B
 
 -- Auth objects
 
-INSERT INTO `sys_objects_auths` (`Name`, `Title`, `Link`, `Icon`) VALUES
-('bx_drupal', '_bx_drupal_auth_title', 'modules/?r=drupal/start', 'fab drupal');
+INSERT INTO `sys_objects_auths` (`Name`, `Title`, `Link`, `Icon`, `Style`) VALUES
+('bx_drupal', '_bx_drupal_auth_title', 'modules/?r=drupal/start', 'fab drupal', 'a:1:{s:7:".bx-btn";a:1:{s:10:"background";s:18:"#045292 !important";}}');
 
 -- Alerts
 

+ 1 - 1
modules/boonex/facebook_connect/install/langs/en.xml

@@ -6,7 +6,7 @@
 	<string name="_bx_facebook_information_block"><![CDATA[To get your "App ID" and "App Secret", you need to <a href="https://developers.facebook.com/apps/" target="_blank">make Facebook app</a>. <br /><br />Redirect URI: <b>{0}</b>]]></string>
 	<string name="_bx_facebook_profile_error_api_keys"><![CDATA[Please configure the module in admin panel (can't define facebook api keys)]]></string>
 	<string name="_bx_facebook_chart"><![CDATA[Facebook Profiles]]></string>
-	<string name="_bx_facebook_auth_title"><![CDATA[Facebook Connect]]></string>
+	<string name="_bx_facebook_auth_title"><![CDATA[Login with Facebook]]></string>
 	<string name="_bx_facebook_error"><![CDATA[Error]]></string>
 
     <string name="_bx_facebook_adm_stg_cpt_type"><![CDATA[Facebook Connect]]></string>

+ 2 - 2
modules/boonex/facebook_connect/install/sql/enable.sql

@@ -6,8 +6,8 @@ INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `B
 
 -- OBJECTS: AUTH
 
-INSERT INTO `sys_objects_auths` (`Name`, `Title`, `Link`, `Icon`) VALUES
-('bx_facebook', '_bx_facebook_auth_title', 'modules/?r=facebook_connect/login_form', 'fab facebook-square');
+INSERT INTO `sys_objects_auths` (`Name`, `Title`, `Link`, `Icon`, `Style`) VALUES
+('bx_facebook', '_bx_facebook_auth_title', 'modules/?r=facebook_connect/login_form', 'fab facebook-square', 'a:1:{s:7:".bx-btn";a:1:{s:10:"background";s:18:"#3b5999 !important";}}');
 
 -- ALERTS
 

+ 1 - 1
modules/boonex/google_connect/install/langs/en.xml

@@ -12,7 +12,7 @@
             Then enter generated Client ID & Secret pair in this module settings.
         </p>]]></string>
 	<string name="_bx_googlecon_profile_error_api_keys"><![CDATA[Please configure the module in admin panel (can't define Client ID & Secret)]]></string>
-	<string name="_bx_googlecon_auth_title"><![CDATA[Google Connect]]></string>
+	<string name="_bx_googlecon_auth_title"><![CDATA[Login with Google]]></string>
 
     <string name="_bx_googlecon_adm_stg_cpt_type"><![CDATA[Google Connect]]></string>
     <string name="_bx_googlecon_option_app_id"><![CDATA[Client ID]]></string>

+ 2 - 2
modules/boonex/google_connect/install/sql/enable.sql

@@ -6,8 +6,8 @@ INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `B
 
 -- Auth objects
 
-INSERT INTO `sys_objects_auths` (`Name`, `Title`, `Link`, `Icon`) VALUES
-('bx_googlecon', '_bx_googlecon_auth_title', 'modules/?r=googlecon/start', 'fab google-plus-square');
+INSERT INTO `sys_objects_auths` (`Name`, `Title`, `Link`, `Icon`, `Style`) VALUES
+('bx_googlecon', '_bx_googlecon_auth_title', 'modules/?r=googlecon/start', 'fab google-plus-square', 'a:1:{s:7:".bx-btn";a:1:{s:10:"background";s:18:"#cb4023 !important";}}');
 
 -- Alerts
 

+ 1 - 1
modules/boonex/linkedin_connect/install/langs/en.xml

@@ -13,7 +13,7 @@
             Then enter generated Client ID & Secret pair in this module settings.
         </p>]]></string>
 	<string name="_bx_linkedin_profile_error_api_keys"><![CDATA[Please configure the module in admin panel (can't define Client ID and Secret)]]></string>
-	<string name="_bx_linkedin_auth_title"><![CDATA[LinkedIn Connect]]></string>	
+	<string name="_bx_linkedin_auth_title"><![CDATA[Login with LinkedIn]]></string>	
 
     <string name="_bx_linkedin_adm_stg_cpt_type"><![CDATA[LinkedIn Connect]]></string>
     <string name="_bx_linkedin_option_app_id"><![CDATA[Client ID]]></string>

+ 2 - 2
modules/boonex/linkedin_connect/install/sql/enable.sql

@@ -6,8 +6,8 @@ INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `B
 
 -- Auth objects
 
-INSERT INTO `sys_objects_auths` (`Name`, `Title`, `Link`, `Icon`) VALUES
-('bx_linkedin', '_bx_linkedin_auth_title', 'modules/?r=linkedin/start', 'fab linkedin-in');
+INSERT INTO `sys_objects_auths` (`Name`, `Title`, `Link`, `Icon`, `Style`) VALUES
+('bx_linkedin', '_bx_linkedin_auth_title', 'modules/?r=linkedin/start', 'fab linkedin-in', 'a:1:{s:7:".bx-btn";a:1:{s:10:"background";s:18:"#1a82b9 !important";}}');
 
 -- Alerts
 

+ 1 - 1
modules/boonex/russian/data/langs/bx_facebook/ru.xml

@@ -6,7 +6,7 @@
     <string name="_bx_facebook_information_block"><![CDATA[Чтобы получить "App ID" и "App Secret", нужно <a href="https://developers.facebook.com/apps/" target="_blank">создать новое приложение</a>. <br /><br />URL-адрес для перенаправления: <b>{0}</b>]]></string>
 	<string name="_bx_facebook_profile_error_api_keys"><![CDATA[Пожалуйста, настройте модуль в административной панели (невозможно определить ключи facebook api)]]></string>
 	<string name="_bx_facebook_chart"><![CDATA[Facebook профили]]></string>
-	<string name="_bx_facebook_auth_title"><![CDATA[Facebook-соединение]]></string>
+	<string name="_bx_facebook_auth_title"><![CDATA[Вход через Facebook]]></string>
 	<string name="_bx_facebook_error"><![CDATA[Ошибка]]></string>
 
     <string name="_bx_facebook_adm_stg_cpt_type"><![CDATA[Facebook-соединение]]></string>

+ 1 - 1
modules/boonex/russian/data/langs/bx_googlecon/ru.xml

@@ -12,7 +12,7 @@
             Затем нужно ввести полученную пару Client ID & Secret в настройках этого модуля.
         </p>]]></string>
 	<string name="_bx_googlecon_profile_error_api_keys"><![CDATA[Нужно настроить модуль - указать Google Client ID & Secret]]></string>
-	<string name="_bx_googlecon_auth_title"><![CDATA[Google-соединение]]></string>
+	<string name="_bx_googlecon_auth_title"><![CDATA[Вход через Google]]></string>
 
     <string name="_bx_googlecon_adm_stg_cpt_type"><![CDATA[Google-соединение]]></string>
     <string name="_bx_googlecon_option_app_id"><![CDATA[Client ID]]></string>

+ 1 - 1
modules/boonex/russian/data/langs/bx_linkedin/ru.xml

@@ -14,7 +14,7 @@
         </p>]]></string>
     
     <string name="_bx_linkedin_profile_error_api_keys"><![CDATA[Нужно настроить модуль - указать LinkedIn Client ID & Secret]]></string>
-	<string name="_bx_linkedin_auth_title"><![CDATA[LinkedIn-соединение]]></string>
+	<string name="_bx_linkedin_auth_title"><![CDATA[Вход через LinkedIn]]></string>
 
     <string name="_bx_linkedin_adm_stg_cpt_type"><![CDATA[LinkedIn-соединение]]></string>
     <string name="_bx_linkedin_option_app_id"><![CDATA[Client ID]]></string>

+ 1 - 1
modules/boonex/russian/data/langs/bx_twitter/ru.xml

@@ -21,7 +21,7 @@
         </p>]]></string>
     
 	<string name="_bx_twitter_profile_error_api_keys"><![CDATA[Нужно настроить модуль - указать API Key & Secret]]></string>
-	<string name="_bx_twitter_auth_title"><![CDATA[Twitter-соединение]]></string>
+	<string name="_bx_twitter_auth_title"><![CDATA[Вход через Twitter]]></string>
 	<string name="_bx_twitter_error_no_oauth_token"><![CDATA[Отсутствует "Auth token"]]></string>
 
     <string name="_bx_twitter_adm_stg_cpt_type"><![CDATA[Twitter-соединение]]></string>

+ 1 - 1
modules/boonex/russian/data/langs/bx_unacon/ru.xml

@@ -10,7 +10,7 @@
 Затем нужно ввести полученные ключ и секретный код в настройках этого модуля]]></string>
 	<string name="_bx_unacon_profile_error_api_keys"><![CDATA[Пожалуйста, настройте модуль в административной панели (невозможно определить ключи)]]></string>
 	<string name="_bx_unacon_chart"><![CDATA[UNA профили]]></string>
-	<string name="_bx_unacon_auth_title"><![CDATA[UNA-соединение]]></string>
+	<string name="_bx_unacon_auth_title"><![CDATA[Вход через UNA]]></string>
 
     <string name="_bx_unacon_adm_stg_cpt_type"><![CDATA[UNA-соединение]]></string>
     <string name="_bx_unacon_option_app_id"><![CDATA[UNA App ID]]></string>

+ 1 - 1
modules/boonex/twitter_connect/install/langs/en.xml

@@ -21,7 +21,7 @@
         </p>]]></string>
 		
 	<string name="_bx_twitter_profile_error_api_keys"><![CDATA[Please configure the module in admin panel (can't define API key, secret & URL)]]></string>
-	<string name="_bx_twitter_auth_title"><![CDATA[Twitter Connect]]></string>
+	<string name="_bx_twitter_auth_title"><![CDATA[Login with Twitter]]></string>
 	<string name="_bx_twitter_error_no_oauth_token"><![CDATA[Auth token is missing]]></string>
 
     <string name="_bx_twitter_adm_stg_cpt_type"><![CDATA[Twitter Connect]]></string>    

+ 2 - 2
modules/boonex/twitter_connect/install/sql/enable.sql

@@ -6,8 +6,8 @@ INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `B
 
 -- Auth objects
 
-INSERT INTO `sys_objects_auths` (`Name`, `Title`, `Link`, `Icon`) VALUES
-('bx_twitter', '_bx_twitter_auth_title', 'modules/?r=twitter/start', 'fab twitter');
+INSERT INTO `sys_objects_auths` (`Name`, `Title`, `Link`, `Icon`, `Style`) VALUES
+('bx_twitter', '_bx_twitter_auth_title', 'modules/?r=twitter/start', 'fab twitter', 'a:1:{s:7:".bx-btn";a:1:{s:10:"background";s:18:"#5aa4eb !important";}}');
 
 -- Alerts
 

+ 1 - 1
modules/boonex/una_connect/install/langs/en.xml

@@ -10,7 +10,7 @@ To make it work, go to the master site, install "OAuth2 Server" module and add n
 Then enter generated on the master site the Key & Server pair in this module settings.]]></string>
 	<string name="_bx_unacon_profile_error_api_keys"><![CDATA[Please configure the module in admin panel (can't define API key, secret & URL)]]></string>
 	<string name="_bx_unacon_chart"><![CDATA[UNA Profiles]]></string>
-	<string name="_bx_unacon_auth_title"><![CDATA[UNA Connect]]></string>
+	<string name="_bx_unacon_auth_title"><![CDATA[Login with UNA]]></string>
 
     <string name="_bx_unacon_adm_stg_cpt_type"><![CDATA[UNA Connect]]></string>
     <string name="_bx_unacon_option_app_id"><![CDATA[UNA App ID]]></string>

+ 2 - 2
modules/boonex/una_connect/install/sql/enable.sql

@@ -6,8 +6,8 @@ INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `B
 
 -- Auth objects
 
-INSERT INTO `sys_objects_auths` (`Name`, `Title`, `Link`, `Icon`) VALUES
-('bx_unacon', '_bx_unacon_auth_title', 'modules/?r=unacon/start', 'sign-in-alt');
+INSERT INTO `sys_objects_auths` (`Name`, `Title`, `Link`, `Icon`, `Style`) VALUES
+('bx_unacon', '_bx_unacon_auth_title', 'modules/?r=unacon/start', 'sign-in-alt', 'a:1:{s:7:".bx-btn";a:1:{s:10:"background";s:18:"#40b060 !important";}}');
 
 -- Alerts
 

+ 9 - 6
template/auth.html

@@ -1,7 +1,10 @@
-<bx_repeat:buttons>
-<div class="sys-auth __class__ bx-def-margin-sec-bottom bx-clearfix">
-	<a class="bx-btn" href="__href__"<bx_if:show_onclick> onclick="__onclick__"</bx_if:show_onclick> title="__title_alt__">
-		<bx_if:show_icon><i class="sys-icon __icon__"></i></bx_if:show_icon><bx_if:show_title><u>__title__</u></bx_if:show_title>
-	</a>
+<div class="sys-auth-block bx-def-margin-bottom __class_container__">
+    <bx_repeat:buttons>
+        <div class="sys-auth __class__ bx-def-margin-sec-bottom  bx-clearfix">
+            <a class="bx-btn" href="__href__"
+                <bx_if:show_onclick> onclick="__onclick__"</bx_if:show_onclick> title="__title_alt__">
+                <bx_if:show_icon><i class="sys-icon __icon__ sys-colored"></i></bx_if:show_icon><bx_if:show_title><u>__title__</u></bx_if:show_title>
+            </a>
+        </div>
+    </bx_repeat:buttons>
 </div>
-</bx_repeat:buttons>

+ 27 - 4
template/css/auth.css

@@ -1,10 +1,33 @@
+.sys-auth-block {
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: space-between;
+    align-content: space-between;
+}
+
+.sys-auth-block.sys-auth-compact-container {
+    justify-content:flex-start;
+}
+
+.sys-auth-block .sys-auth:not(.sys-auth-compact) {
+    width: 48%;
+}
+
 .sys-auth .bx-btn {
     float: none;
     width: 100%;
-    text-align: center;
-    text-transform: uppercase;
-    font-weight: bold;
+    text-align: left;
+    font-weight:normal;
     white-space: nowrap;
+    color: #fff;
+    height: 3rem;
+    line-height: 3rem;
+    border-radius:4px;
+}
+
+.sys-auth .bx-btn .sys-icon {
+    color: #fff;
+    font-size: 1.5rem;
 }
 
 .sys-auth-compact {
@@ -14,4 +37,4 @@
 
 .sys-auth-compact .bx-btn {
 	width: auto;
-}
+}

+ 10 - 3
template/scripts/BxBaseServiceLogin.php

@@ -33,8 +33,8 @@ class BxBaseServiceLogin extends BxDol
         foreach($aAuthTypes as $iKey => $aItems) {
             $sTitle = _t($aItems['Title']);
 
-            $aTmplButtons[] = array(
-            	'class' => $bCompact ? 'sys-auth-compact bx-def-margin-sec-left-auto' : '',
+            $aTmplButtons[] = array( 
+            	'class' => ($bCompact ? 'sys-auth-compact bx-def-margin-sec-left-auto ' : '') . $aItems['Name'],
                 'href' => !empty($aItems['Link']) ? BX_DOL_URL_ROOT . $aItems['Link'] : 'javascript:void(0)',
                 'title_alt' => bx_html_attribute($sTitle),
                 'bx_if:show_onclick' => array(
@@ -56,12 +56,19 @@ class BxBaseServiceLogin extends BxDol
                     )
                 )
             );
+            if ($aItems['Style'] != ""){
+                $aStyles = unserialize($aItems['Style']);
+                foreach($aStyles as $sKey => $aValues) {
+                    BxDolTemplate::getInstance()->addCssStyle('.'. $aItems['Name'] .' ' . $sKey, $aValues);
+                }
+            }
         }
 
         BxDolTemplate::getInstance()->addCss(array('auth.css'));
 
         return BxDolTemplate::getInstance()->parseHtmlByName('auth.html', array(
-            'bx_repeat:buttons' => $aTmplButtons
+            'bx_repeat:buttons' => $aTmplButtons,
+             'class_container' => ($bCompact ? 'sys-auth-compact-container' : '')
         ));
     }