You are here

function ws_google_plus_one_data in Service links 7.2

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

Callback function for Google Plus One.

1 string reference to 'ws_google_plus_one_data'
widget_services_service_links in services/widget_services.module
Implements hook_service_links().

File

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

Code

function ws_google_plus_one_data(&$service, $subst) {
  static $gpo_settings;
  if (!isset($gpo_settings)) {
    $gpo_settings = array(
      'size' => check_plain(variable_get('service_links_gpo_size', '')),
      'annotation' => check_plain(variable_get('service_links_gpo_annotation', '')),
      'lang' => check_plain(variable_get('service_links_gpo_lang', '')),
      'callback' => check_plain(variable_get('service_links_gpo_callback', '')),
      'width' => (int) variable_get('service_links_gpo_width', 300),
    );
    drupal_add_js(array(
      'ws_gpo' => $gpo_settings,
    ), 'setting');
  }
}