function timefield_field_settings_form in Timefield 7
Implements hook_field_settings_form().
File
- ./
timefield.module, line 105 - Defines a Field API field for time
Code
function timefield_field_settings_form($field, $instance, $has_data) {
$settings = $field['settings'];
$form['totime'] = array(
'#type' => 'select',
'#title' => t('To Time'),
'#options' => array(
'' => t('Never'),
'optional' => t('Optional'),
'required' => t('Required'),
),
'#description' => t('Whether this field should include an end time.'),
'#default_value' => $settings['totime'],
'#disabled' => $has_data,
);
$form['weekly_summary'] = array(
'#type' => 'checkbox',
'#title' => t('Add Weekly Repeat Checkboxes'),
'#description' => t('Should this field include options to specify the days on which it repeats.'),
'#default_value' => $settings['weekly_summary'],
'#disabled' => $has_data,
);
$form['weekly_summary_with_label'] = array(
'#type' => 'checkbox',
'#title' => t('Add Weekly Repeat Checkboxes with Label for each Time'),
'#description' => t('Same as above with an additional label field for describing times.'),
'#default_value' => $settings['weekly_summary_with_label'],
'#disabled' => $has_data,
);
return $form;
}