You are here

function theme_addthis_toolbox_item in AddThis 6.3

Theme function to render an individual toolbox item. This is often, but not necessarily, in the context of an AddThis toolbox.

Parameters

service: A custom service code or a basic AddThis service code. Full list at http://addthis.com/services/all

1 theme call to theme_addthis_toolbox_item()
theme_addthis_toolbox in ./addthis.module
Theme function to render an AddThis toolbox.

File

./addthis.module, line 208
Provides integration with the AddThis.com bookmarking & sharing service.

Code

function theme_addthis_toolbox_item($service) {
  addthis_add_default_js();
  static $services;
  if (!isset($services)) {
    $services = addthis_get_custom_services();
  }

  // Look for the service in the custom services list.
  if (isset($services[$service])) {
    if (isset($services[$service]['output'])) {
      return $services[$service]['output'];
    }
    else {
      $class = 'addthis_toolbox_item ' . check_plain($services[$service]['class']);
      $attributes = filter_xss($services[$service]['attributes']);
      $title = filter_xss_admin($services[$service]['title']);
      return "<a class='{$class}' {$attributes}>{$title}</a>";
    }
  }

  // No custom service found; use the default output.
  $output = "<a class='addthis_toolbox_item addthis_button_" . check_plain($service) . "'></a>";
  return $output;
}