You are here

function theme_link_formatter_link_label in Link 7

Formats a link using the field's label as link text.

File

./link.module, line 1473
Defines simple link field types.

Code

function theme_link_formatter_link_label($vars) {

  // If no URL value is present there's no point in continuing.
  if (empty($vars['element']['url'])) {
    return '';
  }
  $link_options = $vars['element'];
  unset($link_options['title']);
  unset($link_options['url']);
  $label = $vars['field']['label'];
  if (function_exists('i18n_string_translate')) {
    $i18n_string_name = "field:{$vars['field']['field_name']}:{$vars['field']['bundle']}:label";
    $label = i18n_string_translate($i18n_string_name, $label);
  }
  return l($label, $vars['element']['url'], $link_options);
}