<?php
/**
 * @package     Share
 * @subpackage  mod_share
 * @copyright   Copyright (C) 2012 TDH WebSites. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
?>
<div id="module-share-<?php echo $module->id; ?>" class="module-share<?php echo $moduleclass_sfx; ?>">
	<?php 
	// Facebook Button
	?>
	<div class="facebook-button">
		<div
			class="fb-like"
			<?php if($params->get('facebookUrlShareAutomatic', 1)) :?>
			data-href="<?php echo JURI::current(); ?>"
			<?php else: ?>
			data-href="<?php echo $params->get('facebookUrlShare', ''); ?>"
			<?php endif; ?>
			data-send="<?php echo $params->get('facebookShowSendButton', false); ?>"
			data-layout="<?php echo $params->get('facebookLayoutStyle', 'button_count'); ?>"
			data-width="<?php echo $params->get('facebookWidth', '450'); ?>"
			data-show-faces="<?php echo $params->get('facebookShowFaces', false); ?>"
			data-font="<?php echo $params->get('facebookFont', 'arial'); ?>"
			<?php if($params->get('facebookVerbdisplay', 0) == 1): ?>
			data-action="recommend"
			<?php endif; ?>
		></div>

		<script>(function(d, s, id) {
		  var js, fjs = d.getElementsByTagName(s)[0];
		  if (d.getElementById(id)) return;
		  js = d.createElement(s); js.id = id;
		  js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1";
		  fjs.parentNode.insertBefore(js, fjs);
		  }(document, 'script', 'facebook-jssdk'));
		</script>
	</div>
	<?php 
	// Twitter Button
	?>
	<div class="twitter-button">
		<a
			href="https://twitter.com/share"
			class="twitter-share-button"
			<?php if($params->get('twitterUrlShareAutomatic', 1) == 0): ?>
			data-url="<?php echo $params->get('twitterUrlShare'); ?>"
			<?php endif; ?>

			<?php if($params->get('twitterTextShareAutomatic', 1) == 0): ?>
			data-text="<?php echo $params->get('twitterTextShare'); ?>"
			<?php endif; ?>

			data-lang="pt"

			<?php if($params->get('twitterShowCount', 1) == 0): ?>
			data-count="none"
			<?php endif; ?>

			<?php if($params->get('twitterViaUser', '') != ''): ?>
			data-via="<?php echo $params->get('twitterViaUser', ''); ?>"
			<?php endif; ?>

			<?php if($params->get('twitterRecommendUser', '') != ''): ?>
			data-related="<?php echo $params->get('twitterRecommendUser', ''); ?>"
			<?php endif; ?>
			
			<?php if($params->get('twitterHashtag', '') != ''): ?>
			data-hashtags="<?php echo $params->get('twitterHashtag', ''); ?>"
			<?php endif; ?>

			<?php if($params->get('twitterButtonBig', 0) == 1): ?>
			data-size="large"
			<?php endif; ?>

			<?php if($params->get('twitterDisableContentCustom', 0) == 1): ?>
			data-dnt="true"
			<?php endif; ?>>Tweetar</a>
		<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>
	</div>
	<div class="clearfix"></div>
</div>