You are here

function jst_timer_formatter_settings_form in Javascript Timer 7

Settings for the default formatter.

File

widgets/jst_timer.module, line 18
Default widget implementation for an up and down timer. This widget does not use hook_ctwidget as it is always included.

Code

function jst_timer_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $formatter = $display['type'];
  $form = array();
  $form['dir'] = array(
    '#title' => t('Countdown or countup timer'),
    '#type' => 'select',
    '#options' => array(
      'up' => t('Up'),
      'down' => t('Down'),
    ),
    '#default_value' => $settings['dir'],
    '#weight' => 0,
  );
  $form['format_txt'] = array(
    '#type' => 'textarea',
    '#title' => t('Format of the timer:'),
    '#default_value' => $settings['format_txt'],
    '#weight' => 1,
  );
  return $form;
}