function isbn_field_settings in ISBN Field 6
Implementation of hook_field_settings().
File
- ./
isbn.module, line 163 - Defines ISBN field types.
Code
function isbn_field_settings($op, $field) {
switch ($op) {
case 'form':
$form = array();
$form['isbn_format'] = array(
'#type' => 'radios',
'#title' => t('ISBN Number Format'),
'#default_value' => is_numeric($field['isbn_format']) ? $field['isbn_format'] : ISSN_8_DIGIT,
'#options' => array(
ISSN_8_DIGIT => t('ISSN 8 Digit'),
ISBN_10_DIGIT => t('ISBN 10 Digit'),
ISBN_13_DIGIT => t('ISBN 13 Digit'),
),
);
$form['isbn_validation'] = array(
'#type' => 'radios',
'#title' => t('ISBN Validation'),
'#default_value' => is_numeric($field['isbn_validation']) ? $field['isbn_validation'] : ISBN_NO_VALIDATION,
'#options' => array(
ISBN_NO_VALIDATION => t('No validation'),
ISBN_SUBMIT_VALIDATION => t('Validation on Submit (confirms check digit)'),
ISBN_JS_VALIDATION => t('Validation with Javascript (Confirms check digit. Also validates on Submit)'),
),
);
return $form;
case 'save':
return array(
'isbn_format',
'isbn_validation',
);
case 'database columns':
$columns['value'] = array(
'type' => 'varchar',
'length' => 20,
'not null' => FALSE,
'sortable' => TRUE,
'views' => TRUE,
);
return $columns;
case 'views data':
}
}