css for share field formatter

This commit is contained in:
Bachir Soussi Chiadmi
2015-05-09 12:31:20 +02:00
parent 7b71ab2e1b
commit 2b0085405e
4 changed files with 126 additions and 49 deletions
@@ -161,6 +161,7 @@ function jeemod_preprocess_jeemod_share_links(&$vars){
$tags = explode(' ', str_replace('#', '', $entity->field_partager['und'][0]['value']));
// twitter
$vars['twitter_url'] = url("https://twitter.com/intent/tweet", array(
'absolute'=>true,
'query'=>array(
@@ -171,6 +172,7 @@ function jeemod_preprocess_jeemod_share_links(&$vars){
));
$vars['twitter_title'] = "Twitter $nodetitle";
// face book
$vars['fb_url'] = url("https://www.facebook.com/sharer.php", array(
'absolute'=>true,
'query'=>array(
@@ -180,5 +182,16 @@ function jeemod_preprocess_jeemod_share_links(&$vars){
));
$vars['fb_title'] = "Partager $nodetitle";
// mail
// $vars['mail_url'] = "mailto:?subject=$nodetitle&body=$text";
$vars['mail_url'] = url("mailto:", array(
'absolute'=>true,
'query'=>array(
"subject"=>$text,
"body"=>$text,
)
));
$vars['mail_title'] = "Envoyer par email $nodetitle";
}
@@ -1,7 +1,17 @@
<a class="twitter-buttuon" href="<?php print $twitter_url; ?>" target="_blank">
<?php print $twitter_title; ?>
</a>
<br/>
<a class="fb-button" href="<?php print $fb_url; ?>" target="_blank">
<?php print $fb_title; ?>
</a>
<ul>
<li>
<a class="twitter-button" href="<?php print $twitter_url; ?>" target="_blank">
<?php print $twitter_title; ?>
</a>
</li>
<li>
<a class="fb-button" href="<?php print $fb_url; ?>" target="_blank">
<?php print $fb_title; ?>
</a>
</li>
<li>
<a class="mail-button" href="<?php print $mail_url; ?>" target="_blank">
<?php print $mail_title; ?>
</a>
</li>
</ul>