You are here

function link_field_formatter_settings_form in Link 7

Implements hook_field_formatter_settings_form().

File

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

Code

function link_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $element = array();
  if ($display['type'] == 'link_domain') {
    $element['strip_www'] = array(
      '#title' => t('Strip www. from domain'),
      '#type' => 'checkbox',
      '#default_value' => $settings['strip_www'],
    );
  }
  if ($display['type'] == 'link_default') {
    $element['custom_title'] = array(
      '#title' => t('Override title'),
      '#description' => t('Optionally override the title for the link(s).'),
      '#type' => 'textfield',
      '#default_value' => $settings['custom_title'],
    );
  }
  return $element;
}