You are here

function sharethis_service_links in ShareThis 6.2

Implementation of hook_service_links().

See the Service Links module.

File

./sharethis.module, line 35

Code

function sharethis_service_links() {

  // The main ShareThis button.
  $links['sharethis'] = array(
    'name' => 'ShareThis',
    'description' => t('ShareThis makes sharing easy!'),
    'link' => 'http://sharethis.com/post?url=<encoded-url>&title=<encoded-title>',
    'icon' => drupal_get_path('module', 'sharethis') . '/images/' . variable_get('sharethis_icon', 'sharethis.png'),
    'javascript' => drupal_get_path('module', 'sharethis') . '/sharethis.js',
    'callback' => 'sharethis_service_links_callback',
  );

  // Construct the individual chicklets.
  $chicklets = array(
    'email' => array(
      'name' => 'Email',
      'description' => t('Send this post to a friend via Email.'),
    ),
    'twitter' => array(
      'name' => 'Twitter',
      'description' => t('Share this post on Twitter.'),
    ),
  );
  foreach ($chicklets as $name => $chicklet) {
    $links['sharethis-' . $name] = array(
      'name' => $chicklet['name'],
      'description' => $chicklet['description'],
      'link' => 'http://sharethis.com/post?url=<encoded-url>&title=<encoded-title>',
      'icon' => drupal_get_path('module', 'sharethis') . "/images/{$name}.gif",
      'attributes' => array(
        'class' => $name,
      ),
      'javascript' => drupal_get_path('module', 'sharethis') . '/sharethis.js',
      'callback' => 'sharethis_service_links_callback',
    );
  }
  return $links;
}