You are here

function jst_clock_form_alter in Javascript Timer 6

Same name and namespace in other branches
  1. 7 widgets/jst_clock.module \jst_clock_form_alter()

Implementation of hook_form_alter(). Add the clock widget specific settings to admin screen.

File

widgets/jst_clock.module, line 212
Embeddable clock widget (optional).

Code

function jst_clock_form_alter(&$form, $form_state, $form_id) {
  switch ($form_id) {

    //change this to form_id of the form you want to alter
    case 'jstimer_admin_settings':
      $form['jst_clock'] = array(
        '#type' => 'fieldset',
        '#title' => t('Clock widget'),
        '#weight' => 1,
      );
      $form['jst_clock']['jstimer_jst_clock_type'] = array(
        '#type' => 'radios',
        '#title' => t('Clock type') . ' (<span class="ct_clock"></span>)',
        '#default_value' => variable_get('jstimer_jst_clock_type', DEFAULT_CLOCK_TYPE),
        '#options' => array(
          0 => t('12-hour plain text'),
          1 => t('24-hour plain text'),
          2 => t('Analog plain'),
        ),
        '#description' => t("The analog clock is experimental and only works on Firefox, Opera, and Safari.  IE will degrade to the 12-hour text clock."),
      );
      $form['buttons']['#weight'] = 2;
      break;
  }
}