You are here

function _easysocial_button_twitter_markup in Easy Social 7

Same name and namespace in other branches
  1. 6 easy_social.module \_easysocial_button_twitter_markup()

Generate the needed markup for the twitter share link

Parameters

$url The url to be shared:

$type Generate horizontal or vertical widgets:

$data Assoc array with info for the tweet:

Return value

the html markup

File

./easy_social.module, line 420
This is the file description for Easy Social module.

Code

function _easysocial_button_twitter_markup($url, $type, $data = NULL, $lang = 'en') {
  $type = $type == 0 ? 'horizontal' : 'vertical';
  $account_via = variable_get_value('easysocial_tt_global_account_via');
  $account_related = variable_get_value('easysocial_tt_global_account_related');
  $description = variable_get_value('easysocial_tt_global_account_description');
  $description = str_replace('!title', $data['title'], $description);
  $markup = <<<TT
    <a href="http://twitter.com/share"
    class="twitter-share-button"
    data-url="{<span class="php-variable">$url</span>}"
    data-count="{<span class="php-variable">$type</span>}"
    data-lang = "{<span class="php-variable">$lang</span>}"
    data-via="{<span class="php-variable">$account_via</span>}"
    data-related="{<span class="php-variable">$account_related</span>}"
    data-text="{<span class="php-variable">$description</span>}">Tweet</a>
TT;
  return $markup;
}