From bf450949db085f2c488b86efd4a020392b7b4c17 Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Thu, 2 Aug 2012 21:29:36 +0000 Subject: [PATCH] Added social-app key-registration links to admin -> prefs. Fixed 'hide email' signup option. Added rel=external link option to jquery lib. --- e107_admin/prefs.php | 19 ++++++++++++++----- .../shortcodes/batch/signup_shortcodes.php | 5 +++-- e107_files/jslib/core/all.jquery.js | 13 +++++++++++++ 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php index 6e29ff5ab..c16fe1a30 100644 --- a/e107_admin/prefs.php +++ b/e107_admin/prefs.php @@ -706,7 +706,7 @@ $text .= " // Single Login / / copied from hybridAuth config.php so it's easy to add more. // Used Below. -$single_logins = array ( +$social_logins = array ( // openid providers "OpenID" => array ( "enabled" => true @@ -765,8 +765,15 @@ $single_logins = array ( ); - - +// Key registration +$social_external = array( + "Facebook" => "https://developers.facebook.com/apps", + "Twitter" => "https://dev.twitter.com/apps/new", + "Google" => "https://code.google.com/apis/console/", + "Live" => "https://manage.dev.live.com/ApplicationOverview.aspx", + "LinkedIn" => "https://www.linkedin.com/secure/developer", + "Foursquare" => "https://www.foursquare.com/oauth/" +); $text .= " @@ -791,12 +798,14 @@ $text .= " $pref['social_login'] = array(); } - foreach($single_logins as $prov=>$val) + foreach($social_logins as $prov=>$val) { + + $label = varset($social_external[$prov]) ? "".$prov."" : $prov; $text .= " - ".$prov." + ".$label." "; foreach($val as $k=>$v) diff --git a/e107_core/shortcodes/batch/signup_shortcodes.php b/e107_core/shortcodes/batch/signup_shortcodes.php index 281eb57f0..12dcec133 100755 --- a/e107_core/shortcodes/batch/signup_shortcodes.php +++ b/e107_core/shortcodes/batch/signup_shortcodes.php @@ -229,9 +229,10 @@ class signup_shortcodes extends e_shortcode function sc_signup_hide_email() { - global $rs,$pref; + global $rs; $default_email_setting = 1; // Gives option of turning into a pref later if wanted - if ($pref['signup_option_realname']) + $pref = e107::getPref('signup_option_hideemail'); + if ($pref) { return $rs->form_radio("hideemail", 1, $default_email_setting==1)." ".LAN_YES."  ".$rs->form_radio("hideemail", 0,$default_email_setting==0)." ".LAN_NO; } diff --git a/e107_files/jslib/core/all.jquery.js b/e107_files/jslib/core/all.jquery.js index 11bd35105..1f2d4671e 100644 --- a/e107_files/jslib/core/all.jquery.js +++ b/e107_files/jslib/core/all.jquery.js @@ -435,6 +435,19 @@ $(document).ready(function() }); + + + + // Does the same as externalLinks(); + $('a').each(function() { + var href = $(this).attr("href"); + var rel = $(this).attr("rel"); + if(href && rel == 'external') + { + $(this).attr("target",'_blank'); + } + }); + })