You are here

function url_field_formatter_settings_summary in URL field 8

Same name and namespace in other branches
  1. 7 url.module \url_field_formatter_settings_summary()

Implements hook_field_formatter_settings_form().

File

./url.module, line 251
Provides a URL field type that stores external links with optional titles.

Code

function url_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $summary = array();
  if (!empty($settings['trim_length'])) {
    $summary[] = t('Link text trimmed to @char characters.', array(
      '@char' => $settings['trim_length'],
    ));
  }
  else {
    $summary[] = t('Link text not trimmed.');
  }
  if (!empty($settings['nofollow'])) {
    $summary[] = t('Add rel="nofollow"');
  }
  return implode('<br />', $summary);
}