You are here

function widget_services_service_links in Service links 6.2

Same name and namespace in other branches
  1. 7.2 services/widget_services.module \widget_services_service_links()

Implementation of hook_service_links().

File

services/widget_services.module, line 13
Extends Service Links with dynamic buttons.

Code

function widget_services_service_links() {
  $links = array();
  $links['facebook_share'] = array(
    'name' => t('Share on Facebook'),
    'link' => 'http://www.facebook.com/sharer.php',
    'description' => t('Share this post on Facebook'),
    'javascript' => 'facebook_share.js',
    'icon' => 'facebook.png',
    'style' => SERVICE_LINKS_STYLE_EMPTY,
    'callback' => 'ws_facebook_share_data',
  );
  $links['twitter_widget'] = array(
    'name' => 'Tweet Widget',
    'link' => 'http://twitter.com/share?url=<raw-encoded-short-url>&count=<data-count>&via=<data-via>&text=<raw-encoded-title>&counturl=<raw-encoded-url>',
    'icon' => 'twitter.png',
    'description' => t('Tweet This'),
    'attributes' => array(
      'class' => 'twitter-share-button',
    ),
    'javascript' => 'twitter_button.js',
    'style' => SERVICE_LINKS_STYLE_EMPTY,
    'callback' => 'ws_twitter_widget_data',
  );
  $links['facebook_like'] = array(
    'name' => 'Facebook Like',
    'link' => 'http://www.facebook.com/plugins/like.php?href=<encoded-url>&layout=<layout>&show_faces=<show_faces>&action=<action>&colorscheme=<colorscheme>&width=<width>&height=<height>&font=<font>&locale=<locale>',
    'icon' => 'facebook.png',
    'description' => t('I Like it'),
    'javascript' => 'facebook_like.js',
    'style' => SERVICE_LINKS_STYLE_EMPTY,
    'callback' => 'ws_facebook_like_data',
  );
  $links['google_plus_one'] = array(
    'name' => 'Google Plus One',
    'link' => '<url>',
    'description' => t('Plus it'),
    'javascript' => 'google_plus_one.js',
    'style' => SERVICE_LINKS_STYLE_EMPTY,
    'callback' => 'ws_google_plus_one_data',
  );
  $links['linkedin_share_button'] = array(
    'name' => 'Linkedin Share Button',
    'link' => '<url>',
    'icon' => 'linkedin.png',
    'description' => t('Share on Linkedin'),
    'javascript' => array(
      'linkedin_share_button.js',
    ),
    'style' => SERVICE_LINKS_STYLE_EMPTY,
    'callback' => 'ws_linkedin_share_button_data',
  );
  $links['pinterest_button'] = array(
    'name' => 'Pinterest',
    //'link' => 'http://pinterest.com/pin/create/button/?url=<raw-encoded-url>&description=<pinterest-description>&media=<pinterest-media>',
    'link' => 'http://pinterest.com/pin/create/button/?url=<raw-encoded-long-url>&description=<pinterest-description>&media=<pinterest-media>',
    'icon' => 'pinterest.png',
    'description' => t('Pin It'),
    'javascript' => array(
      'pinterest_button.js',
    ),
    'style' => SERVICE_LINKS_STYLE_EMPTY,
    'attributes' => array(
      'class' => 'pin-it-button',
    ),
    'callback' => 'ws_pinterest_button_data',
    'preset' => 'ws_pinterest_button_tags',
  );
  return $links;
}