<?php /* NOTE: GENERATED BY GULP !!! */ ?><?php
	$default_sharing_services = array(
    	array(  'value' => 'facebook', 'label' => 'Facebook'),
		array(  'value' => 'twitter', 'label' => 'Twitter' ),
		array(  'value' => 'pinterest', 'label' => 'Pinterest' )
	);
	$flo_sharing_options = flo_get_option('flo-lovely2-sharing-options', $default_sharing_services);

	global $share_enabled, $pinterest_sharing_enabled;
  	$share_enabled = true; //flag that share enabled
  	$pinterest_sharing_enabled = false;
?>

<?php if(isset($flo_sharing_options) && is_array( $flo_sharing_options) && sizeof($flo_sharing_options)): ?>
	<?php
    $site_title = get_bloginfo('name');
		$post_permalink = urlencode(get_permalink($post->ID));

		$social_mapping = array(
			'facebook' => 'http://www.facebook.com/sharer/sharer.php?u='.$post_permalink,
			'twitter' => 'https://twitter.com/intent/tweet?text='.urlencode($post->post_title).'&url='.$post_permalink,
			'gplus' => 'https://plus.google.com/share?url='.$post_permalink,
      		'pinterest' => 'https://www.pinterest.com/pin/create/button/'
		);

	?>

  <?php foreach($flo_sharing_options as $key => $social_profile): ?>
  	<?php if( isset($social_profile['value']) && 'pinterest' == $social_profile['value']): ?>
  		<?php  $pinterest_sharing_enabled = true;  // this flag is used in the footer to include the necessary Pinterest script ?>
  		<a class="flo-share-link" data-pin-do="buttonBookmark" data-pin-custom="true" href="https://www.pinterest.com/pin/create/button/">
  			<i class="flo-icon-<?php echo $social_profile['value']; ?>"></i>
  		</a>

  	<?php else: ?>
  		<?php if( isset($social_profile['value']) && isset($social_mapping[$social_profile['value']])): ?>
		  	<a class="flo-share-link <?php echo $social_profile['value']; ?>-share-button" href="<?php echo $social_mapping[$social_profile['value']]; ?>" target="_blank">
		      <i class="flo-icon-<?php echo $social_profile['value']; ?>"></i>
		  	</a>
	  	<?php endif; ?>
  	<?php endif; ?>
  <?php endforeach; ?>


<?php endif; ?>
