You are here

function theme_freelink in Freelinking 7.3

Same name and namespace in other branches
  1. 6.3 freelinking.module \theme_freelink()

Theme the Freelink

1 theme call to theme_freelink()
freelinking_get_freelink in ./freelinking.utilities.inc
Process the target text into a link with the specified plugin.

File

./freelinking.module, line 421

Code

function theme_freelink($variables) {
  $prefix = '';
  $suffix = '';
  $plugin = $variables['plugin'];
  $link = $variables['link'];
  if (isset($link['extra'])) {
    $prefix = $link['extra']['prefix'];
    $suffix = $link['extra']['suffix'];
    unset($link['extra']);
  }

  // Tweak the language to be an object if it exists.
  $options = $link[2];
  if (isset($link[2]['language']) && !isset($link[2]['language']->language)) {
    $language = $link[2]['language'];
    $link[2]['language'] = new StdClass();
    $link[2]['language']->language = $language;
  }
  $rendered = $prefix . call_user_func_array('l', $link) . $suffix;
  return $rendered;
}