1 text.module text_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state)

Implements hook_field_formatter_settings_form().

File

core/modules/field/modules/text/text.module, line 215
Defines simple text field types.

Code

function text_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];

  $element = array();

  if (strpos($display['type'], '_trimmed') !== FALSE) {
    $element['trim_length'] = array(
      '#title' => t('Trimmed limit'),
      '#type' => 'number',
      '#max' => 1000000,
      '#field_suffix' => t('characters'),
      '#default_value' => $settings['trim_length'],
      '#min' => 1,
      '#required' => TRUE,
      '#description' => t('If the summary is not set, the trimmed %label field will be shorter than this character limit.', array('%label' => $instance['label'])),
    );
  }

  return $element;
}