You are here

function ws_facebook_share_data in Service links 7.2

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

Callback function for Facebook Share.

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

File

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

Code

function ws_facebook_share_data(&$service, $subst) {
  static $fs_settings;
  if (!isset($fs_settings)) {
    $fs_settings = array(
      'type' => check_plain(variable_get('service_links_fs_type', 'button_count')),
      'app_id' => check_plain(variable_get('service_links_fs_app_id', '150123828484431')),
      'css' => check_plain(preg_replace('/[^0-9a-z\\-:;]/', '', variable_get('service_links_fs_css', ''))),
      'locale' => check_plain(variable_get('service_links_fs_locale', 'en_US')),
    );
    drupal_add_js(array(
      'ws_fs' => $fs_settings,
    ), 'setting');
  }
  $service['attributes']['rel'] = $subst['url'];
}