You are here

function hook_service_links in Service links 6.2

Same name and namespace in other branches
  1. 7.2 service_links.api.php \hook_service_links()

Obtains all available service links.

Return value

An array containing all service links, keyed by name.

15 functions implement hook_service_links()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

basque_services_service_links in services/basque_services.module
Implementation of hook_service_links().
dutch_services_service_links in services/dutch_services.module
Implementation of hook_service_links().
farsi_services_service_links in services/farsi_services.module
Implementation of hook_service_links().
favorite_services_service_links in services/favorite_services.module
Implementation of hook_service_links().
forward_services_service_links in services/forward_services.module
Implementation of hook_service_links().

... See full list

1 invocation of hook_service_links()
service_links_get_links in ./service_links.module
Discover all available service links by invoking hook_service_links().

File

./service_links.api.php, line 16
Provides documentation for the Service Links API.

Code

function hook_service_links() {
  $links = array();
  $links['myservice'] = array(
    // The name of the service.
    'name' => 'MyService',
    // A short description for the link.
    'description' => t('Share this post on MyService'),
    // The service URL and its params.
    'link' => 'http://example.com/?url=<encoded-url>&title=<encoded-title>&summary=<encoded-teaser>',
    // The service icon. The id name and .png extension is used as default.
    'icon' => drupal_get_path('module', 'myservice') . '/myservice.png',
    // Any additional attributes to apply to the element.
    'attributes' => array(
      'class' => 'myservice-special-class',
      // A special class.
      'style' => 'text-decoration: underline;',
    ),
    // JavaScript to add when this link is processed, can be a string or an array.
    'javascript' => drupal_get_path('module', 'myservice') . '/myservice.js',
    // CSS to add when this link is processed, can be a string or an array.
    'css' => drupal_get_path('module', 'myservice') . '/myservice.css',
    // A PHP function invoked before the link is created, useful to add new tags.
    'preset' => 'myservice_preset',
    // A PHP function callback that is invoked when the link is created.
    'callback' => 'myservice_callback',
  );
  return $links;
}