You are here

forward_services.module in Service links 7.2

Same filename and directory in other branches
  1. 6.2 services/forward_services.module

Extends Service Links with Forward module support.

@author Fabio Mucciante (TheCrow)

File

services/forward_services.module
View source
<?php

/**
 * @file
 * Extends Service Links with Forward module support.
 *
 * @author Fabio Mucciante (TheCrow)
 */

/**
 * Implements hook_service_links().
 */
function forward_services_service_links() {
  $links = array();
  $links['forward'] = array(
    'name' => 'Forward',
    'link' => variable_get('clean_url', 0) == 1 ? '<front-page>forward?path=<encoded-query>' : '<front-page>forward&path=<encoded-query>',
    'description' => t('Send to a friend'),
    'preset' => 'forward_url_fix',
  );
  return $links;
}
function forward_url_fix(&$service, &$settings, $node = NULL) {
  if (isset($node->nid)) {
    $service['link'] = str_replace('<encoded-query>', 'node/<node-id>', $service['link']);
  }
}