You are here

function birthdays_field_widget_settings_form in Birthdays 7

Implements hook_field_widget_settings_form().

File

./birthdays.module, line 564
The Birthdays module allows users to add their birthday to their profile. It lists birthdays on a seperate page and in different blocks. Users can receive an email on their birthday automatically, and the administrator can receive daily reminders of…

Code

function birthdays_field_widget_settings_form($field, $instance) {
  $widget = $instance['widget'];
  $settings = $widget['settings'];
  switch ($widget['type']) {
    case 'birthdays_textfield':
      $form['dateformat'] = array(
        '#type' => 'select',
        '#title' => t('Date format'),
        '#required' => TRUE,
        '#description' => t('Dates the user enters must have this format.'),
        '#options' => drupal_map_assoc(array(
          'Y/m/d',
          'd/m/Y',
          'Y-m-d',
          'd-m-Y',
          'd.m.Y',
        )),
        '#default_value' => $settings['dateformat'],
      );
      $form['datepicker'] = array(
        '#type' => 'checkbox',
        '#title' => t('Use a datepicker'),
        '#description' => t('Show a datepicker when the user clicks on the field.'),
        '#default_value' => $settings['datepicker'],
      );
      return $form;
  }
}