Skip to content

Commit

Permalink
add social-connect html only if there is a social login enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigoprimo committed Oct 22, 2013
1 parent eb5d07a commit 2f6badc
Showing 1 changed file with 47 additions and 46 deletions.
93 changes: 47 additions & 46 deletions ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,53 +19,54 @@ function sc_render_login_form_social_connect( $args = NULL ) {
$wordpress_enabled = get_option( 'social_connect_wordpress_enabled', 1 );
?>

<div class="social_connect_ui <?php if( strpos( $_SERVER['REQUEST_URI'], 'wp-signup.php' ) ) echo 'mu_signup'; ?>">
<p class="comment-form-social-connect">
<?php if( $display_label !== false ) : ?>
<label><?php _e( 'Connect with', 'social_connect' ); ?></label>
<?php endif; ?>
<div class="social_connect_form">
<?php do_action ('social_connect_pre_form'); ?>
<?php if( $facebook_enabled ) :
echo apply_filters('social_connect_login_facebook','<a href="javascript:void(0);" title="Facebook" class="social_connect_login_facebook"><img alt="Facebook" src="'.$images_url.'facebook_32.png" /></a>');
endif; ?>
<?php if( $twitter_enabled ) :
echo apply_filters('social_connect_login_twitter','<a href="javascript:void(0);" title="Twitter" class="social_connect_login_twitter"><img alt="Twitter" src="'.$images_url.'twitter_32.png" /></a>');
endif; ?>
<?php if( $google_enabled ) :
echo apply_filters('social_connect_login_google','<a href="javascript:void(0);" title="Google" class="social_connect_login_google"><img alt="Google" src="'.$images_url.'google_32.png" /></a>');
endif; ?>
<?php if( $yahoo_enabled ) :
echo apply_filters('social_connect_login_yahoo','<a href="javascript:void(0);" title="Yahoo" class="social_connect_login_yahoo"><img alt="Yahoo" src="'.$images_url.'yahoo_32.png" /></a>');
endif; ?>
<?php if( $wordpress_enabled ) :
echo apply_filters('social_connect_login_wordpress','<a href="javascript:void(0);" title="WordPress.com" class="social_connect_login_wordpress"><img alt="WordPress.com" src="'.$images_url.'wordpress_32.png" /></a>');
endif; ?>
<?php do_action ('social_connect_post_form'); ?>
</div></p>

<?php
$social_connect_provider = isset( $_COOKIE['social_connect_current_provider']) ? $_COOKIE['social_connect_current_provider'] : '';
<?php if ($twitter_enabled || $facebook_enabled || $google_enabled || $yahoo_enabled || $wordpress_enabled) : ?>
<div class="social_connect_ui <?php if( strpos( $_SERVER['REQUEST_URI'], 'wp-signup.php' ) ) echo 'mu_signup'; ?>">
<p class="comment-form-social-connect">
<?php if( $display_label !== false ) : ?>
<label><?php _e( 'Connect with', 'social_connect' ); ?></label>
<?php endif; ?>
<div class="social_connect_form">
<?php do_action ('social_connect_pre_form'); ?>
<?php if( $facebook_enabled ) :
echo apply_filters('social_connect_login_facebook','<a href="javascript:void(0);" title="Facebook" class="social_connect_login_facebook"><img alt="Facebook" src="'.$images_url.'facebook_32.png" /></a>');
endif; ?>
<?php if( $twitter_enabled ) :
echo apply_filters('social_connect_login_twitter','<a href="javascript:void(0);" title="Twitter" class="social_connect_login_twitter"><img alt="Twitter" src="'.$images_url.'twitter_32.png" /></a>');
endif; ?>
<?php if( $google_enabled ) :
echo apply_filters('social_connect_login_google','<a href="javascript:void(0);" title="Google" class="social_connect_login_google"><img alt="Google" src="'.$images_url.'google_32.png" /></a>');
endif; ?>
<?php if( $yahoo_enabled ) :
echo apply_filters('social_connect_login_yahoo','<a href="javascript:void(0);" title="Yahoo" class="social_connect_login_yahoo"><img alt="Yahoo" src="'.$images_url.'yahoo_32.png" /></a>');
endif; ?>
<?php if( $wordpress_enabled ) :
echo apply_filters('social_connect_login_wordpress','<a href="javascript:void(0);" title="WordPress.com" class="social_connect_login_wordpress"><img alt="WordPress.com" src="'.$images_url.'wordpress_32.png" /></a>');
endif; ?>
<?php do_action ('social_connect_post_form'); ?>
</div></p>

do_action ('social_connect_auth'); ?>
<div id="social_connect_facebook_auth">
<input type="hidden" name="client_id" value="<?php echo get_option( 'social_connect_facebook_api_key' ); ?>" />
<input type="hidden" name="redirect_uri" value="<?php echo urlencode( SOCIAL_CONNECT_PLUGIN_URL . '/facebook/callback.php' ); ?>" />
</div>
<div id="social_connect_twitter_auth"><input type="hidden" name="redirect_uri" value="<?php echo( SOCIAL_CONNECT_PLUGIN_URL . '/twitter/connect.php' ); ?>" /></div>
<div id="social_connect_google_auth"><input type="hidden" name="redirect_uri" value="<?php echo( SOCIAL_CONNECT_PLUGIN_URL . '/google/connect.php' ); ?>" /></div>
<div id="social_connect_yahoo_auth"><input type="hidden" name="redirect_uri" value="<?php echo( SOCIAL_CONNECT_PLUGIN_URL . '/yahoo/connect.php' ); ?>" /></div>
<div id="social_connect_wordpress_auth"><input type="hidden" name="redirect_uri" value="<?php echo( SOCIAL_CONNECT_PLUGIN_URL . '/wordpress/connect.php' ); ?>" /></div>

<div class="social_connect_wordpress_form" title="WordPress">
<p><?php _e( 'Enter your WordPress.com blog URL', 'social_connect' ); ?></p><br />
<p>
<span>http://</span><input class="wordpress_blog_url" size="15" value=""/><span>.wordpress.com</span> <br /><br />
<a href="javascript:void(0);" class="social_connect_wordpress_proceed"><?php _e( 'Proceed', 'social_connect' ); ?></a>
</p>
</div>
</div> <!-- End of social_connect_ui div -->
<?php
<?php
$social_connect_provider = isset( $_COOKIE['social_connect_current_provider']) ? $_COOKIE['social_connect_current_provider'] : '';

do_action ('social_connect_auth'); ?>
<div id="social_connect_facebook_auth">
<input type="hidden" name="client_id" value="<?php echo get_option( 'social_connect_facebook_api_key' ); ?>" />
<input type="hidden" name="redirect_uri" value="<?php echo urlencode( SOCIAL_CONNECT_PLUGIN_URL . '/facebook/callback.php' ); ?>" />
</div>
<div id="social_connect_twitter_auth"><input type="hidden" name="redirect_uri" value="<?php echo( SOCIAL_CONNECT_PLUGIN_URL . '/twitter/connect.php' ); ?>" /></div>
<div id="social_connect_google_auth"><input type="hidden" name="redirect_uri" value="<?php echo( SOCIAL_CONNECT_PLUGIN_URL . '/google/connect.php' ); ?>" /></div>
<div id="social_connect_yahoo_auth"><input type="hidden" name="redirect_uri" value="<?php echo( SOCIAL_CONNECT_PLUGIN_URL . '/yahoo/connect.php' ); ?>" /></div>
<div id="social_connect_wordpress_auth"><input type="hidden" name="redirect_uri" value="<?php echo( SOCIAL_CONNECT_PLUGIN_URL . '/wordpress/connect.php' ); ?>" /></div>

<div class="social_connect_wordpress_form" title="WordPress">
<p><?php _e( 'Enter your WordPress.com blog URL', 'social_connect' ); ?></p><br />
<p>
<span>http://</span><input class="wordpress_blog_url" size="15" value=""/><span>.wordpress.com</span> <br /><br />
<a href="javascript:void(0);" class="social_connect_wordpress_proceed"><?php _e( 'Proceed', 'social_connect' ); ?></a>
</p>
</div>
</div> <!-- End of social_connect_ui div -->
<?php endif;
}
endif; // function_exist

Expand Down

0 comments on commit 2f6badc

Please sign in to comment.