You are here

public function field_timer_text_base::getSettingsForm in Field Timer 7.2

@inheritdoc

Overrides field_timer_formatter_interface::getSettingsForm

1 call to field_timer_text_base::getSettingsForm()
field_timer_text_date_field_base::getSettingsForm in includes/field_timer_text.inc
@inheritdoc
1 method overrides field_timer_text_base::getSettingsForm()
field_timer_text_date_field_base::getSettingsForm in includes/field_timer_text.inc
@inheritdoc

File

includes/field_timer_text.inc, line 58
Contains help classes to perform field_timer_text formatter related actions.

Class

field_timer_text_base
Base class for field_timer_text formatter.

Code

public function getSettingsForm($settings, $field) {
  $settings_form = array();
  $settings_form['type'] = array(
    '#type' => 'select',
    '#title' => t('Type'),
    '#options' => $this
      ->formatterTypes(),
    '#default_value' => $settings['type'],
  );
  $settings_form['granularity_type'] = array(
    '#type' => 'select',
    '#title' => t('Granularity'),
    '#options' => $this
      ->granularityTypes(),
    '#default_value' => $settings['granularity_type'],
    '#attributes' => array(
      'class' => array(
        'field-timer-text-granularity-type',
      ),
    ),
  );
  $settings_form['granularity_auto'] = array(
    '#type' => 'select',
    '#options' => $this
      ->formatterGranularityAuto(),
    '#default_value' => $settings['granularity_auto'],
    '#states' => array(
      'visible' => array(
        'select.field-timer-text-granularity-type' => array(
          'value' => 'auto',
        ),
      ),
    ),
  );
  $settings_form['granularity_manual'] = array(
    '#type' => 'select',
    '#multiple' => TRUE,
    '#options' => $this
      ->formatterGranularityManual(),
    '#default_value' => $settings['granularity_manual'],
    '#states' => array(
      'visible' => array(
        'select.field-timer-text-granularity-type' => array(
          'value' => 'manual',
        ),
      ),
    ),
  );
  return $settings_form;
}