You are here

function theme_sharethis in ShareThis 6

Same name and namespace in other branches
  1. 5 sharethis.module \theme_sharethis()
  2. 7.2 sharethis.module \theme_sharethis()

Themes the ShareThis options given.

Parameters

$title: (optional) The name of the article you want to share. If not given, will use the title of the currently displayed page.

$url: (optional) The URL of the article you want to share. If not given, will use the URL of the page you're currently on.

Return value

HTML for the ShareThis element.

4 theme calls to theme_sharethis()
sharethis_block in ./sharethis.module
Implementation of hook_block().
sharethis_handler_link::render in ./sharethis_handler_link.inc
sharethis_help in ./sharethis.module
Implementation of hook_help().
sharethis_nodeapi in ./sharethis.module
Implementation of hook_nodeapi().

File

./sharethis.module, line 172
Provides the ShareThis service.

Code

function theme_sharethis($title = NULL, $url = NULL) {

  // Add the JavaScript and render the HTML.
  sharethis_add_js();

  // Construct the ShareThis link using the title and the URL.
  $title = isset($title) ? $title : drupal_get_title();
  $url = isset($url) ? $url : $_GET['q'];
  return l(t('ShareThis'), $url, array(
    'absolute' => TRUE,
    'attributes' => array(
      'class' => 'sharethis-link',
      'title' => $title,
      'rel' => 'nofollow',
    ),
  ));
}