You are here

public function field_timer_jquery_countdown_date_field_base::getSettingsForm in Field Timer 7.2

@inheritdoc

Overrides field_timer_jquery_countdown_base::getSettingsForm

File

includes/field_timer_jquery_countdown.inc, line 324
Help file. Contains help classes to perform field_timer_jquery_countdown formatter related actions.

Class

field_timer_jquery_countdown_date_field_base
Base class for field_timer_jquery_countdown formatter and date field types.

Code

public function getSettingsForm($settings, $field) {
  $settings_form = parent::getSettingsForm($settings, $field);
  $settings_form['title'] = array(
    '#type' => 'textfield',
    '#title' => empty($field['settings']['todate']) ? t('Title') : t('Title for Start date'),
    '#default_value' => $settings['title'],
    '#weight' => -10,
  );
  if (!empty($field['settings']['todate'])) {
    $settings_form['type']['#title'] = t('Type for Start date');
    $settings_form['regional']['#title'] = t('Region for Start date');
    $settings_form['format']['#title'] = t('Format for Start date');
    $settings_form['layout']['#title'] = t('Layout for Start date');
    $settings_form['compact']['#title'] = t('Display Start date in compact format');
    $settings_form['significant']['#title'] = t('Granularity for Start date');
    $settings_form['timeSeparator']['#title'] = t('Time separator for Start date');
    $settings_form['padZeroes']['#title'] = t('Pad with zeroes for Start date');
    $settings_form['title2'] = array(
      '#type' => 'textfield',
      '#title' => t('Title for End date'),
      '#default_value' => $settings['title2'],
    );
    $settings_form['type2'] = array(
      '#type' => 'select',
      '#title' => t('Type for End date'),
      '#options' => $this
        ->formatterTypes(),
      '#default_value' => $settings['type2'],
    );
    $settings_form['regional2'] = array(
      '#type' => 'select',
      '#title' => t('Region for End date'),
      '#default_value' => $settings['regional2'],
      '#options' => $this
        ->formatterRegions(),
    );
    $settings_form['format2'] = array(
      '#type' => 'textfield',
      '#title' => t('Format for End date'),
      '#default_value' => $settings['format2'],
      '#description' => t("See !documentation for this parameter.", array(
        '!documentation' => l(t('documentation'), 'http://keith-wood.name/countdownRef.html', array(
          'fragment' => 'format',
        )),
      )),
    );
    $settings_form['layout2'] = array(
      '#type' => 'textarea',
      '#rows' => 3,
      '#cols' => 60,
      '#title' => t('Layout for End date'),
      '#default_value' => $settings['layout2'],
      '#description' => t('See !documentation for this parameter.', array(
        '!documentation' => l(t('documentation'), 'http://keith-wood.name/countdownRef.html', array(
          'fragment' => 'layout',
        )),
      )),
    );
    $settings_form['compact2'] = array(
      '#type' => 'checkbox',
      '#title' => t('Display End date in compact format'),
      '#default_value' => $settings['compact2'],
    );
    $settings_form['significant2'] = array(
      '#type' => 'select',
      '#title' => t('Granularity for End date'),
      '#options' => range(0, 7),
      '#default_value' => $settings['significant2'],
    );
    $settings_form['timeSeparator2'] = array(
      '#type' => 'textfield',
      '#title' => t('Time separator for End date'),
      '#default_value' => $settings['timeSeparator2'],
    );
    $settings_form['padZeroes2'] = array(
      '#type' => 'checkbox',
      '#title' => t('Pad with zeroes for End date'),
      '#default_value' => $settings['padZeroes2'],
    );
    $settings_form['fromto'] = array(
      '#type' => 'select',
      '#title' => t('Display'),
      '#options' => $this
        ->formatterDisplays(),
      '#default_value' => $settings['fromto'],
    );
  }
  return $settings_form;
}