You are here

function theme_addthis_button in AddThis 7.2

Same name and namespace in other branches
  1. 6.3 addthis.module \theme_addthis_button()
  2. 6.2 addthis.module \theme_addthis_button()

Theme the AddThis button.

1 theme call to theme_addthis_button()
_addthis_create_button in ./addthis.module
Internal function to generate code for AddThis button

File

./addthis.module, line 153
Stand alone module file to handle AddThis button integration

Code

function theme_addthis_button($variables) {
  $build_mode = $variables['build_mode'];
  $https = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on';
  if (variable_get('addthis_dropdown_disabled', '0')) {
    return sprintf('
      <a href="http://www.addthis.com/bookmark.php"
        onclick="addthis_url   = location.href; addthis_title = document.title; return addthis_click(this);">
      <img src="%s" width="%d" height="%d" %s /></a>
      ', $https ? addslashes(variable_get('addthis_image_secure', 'https://secure.addthis.com/button1-share.gif')) : addslashes(variable_get('addthis_image', 'http://s9.addthis.com/button1-share.gif')), addslashes(variable_get('addthis_image_width', '125')), addslashes(variable_get('addthis_image_height', '16')), addslashes(variable_get('addthis_image_attributes', 'alt=""')));
  }
  else {
    return sprintf('
      <a href="http://www.addthis.com/bookmark.php"
        onmouseover="return addthis_open(this, \'\', \'%s\', \'%s\')"
        onmouseout="addthis_close()"
        onclick="return addthis_sendto()"><img src="%s" width="%d" height="%d" %s /></a>
      <script type="text/javascript" src="%s/js/' . variable_get('addthis_widget_version', '152') . '/addthis_widget.js"></script>
      ', $build_mode == 'teaser' ? url('node/' . $node->nid, array(
      'absolute' => 1,
    )) : '[URL]', $build_mode == 'teaser' ? addslashes($node->title) : '[TITLE]', $https == 'on' ? addslashes(check_plain(variable_get('addthis_image_secure', 'https://secure.addthis.com/button1-share.gif'))) : addslashes(check_plain(variable_get('addthis_image', 'http://s9.addthis.com/button1-share.gif'))), addslashes(variable_get('addthis_image_width', '125')), addslashes(variable_get('addthis_image_height', '16')), filter_xss(variable_get('addthis_image_attributes', 'alt=""')), $https == 'on' ? 'https://secure.addthis.com' : 'http://s7.addthis.com');
  }
}