function boolean_field_formatter_settings_form in Boolean Field 7
Implements hook_field_formatter_settings_form().
File
- ./
boolean.module, line 190 - Defines boolean field type.
Code
function boolean_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
$display = $instance['display'][$view_mode];
$settings = $display['settings'];
// @todo This is not treated as a setting; presence of labels is used.
$element['labels'] = array(
'#type' => 'checkbox',
'#title' => t('Labels'),
'#default_value' => $settings['labels'],
'#description' => t('Display the labels in place of delta.'),
);
$element['omit_unchecked'] = array(
'#type' => 'checkbox',
'#title' => t('Omit unchecked'),
'#default_value' => $settings['omit_unchecked'],
'#description' => t('Omit the value if not checked.'),
);
$element['prefix_suffix'] = array(
'#type' => 'checkbox',
'#title' => t('Display prefix and suffix.'),
'#default_value' => $settings['prefix_suffix'],
);
return $element;
}