function cck_table_field_settings in CCK Table Field 5
Same name and namespace in other branches
- 6 cck_table.module \cck_table_field_settings()
Implementation of hook_field_settings().
File
- ./
cck_table.module, line 20 - Defines a field type that outputs data in a table.
Code
function cck_table_field_settings($op, $field) {
switch ($op) {
case 'form':
$form = array();
$form['css_id'] = array(
'#type' => 'textfield',
'#title' => t('CSS ID'),
'#description' => t('Specify an ID to be assigned to the table element.') . '<br />' . t('The node ID will be appended to keep the ID unique.'),
'#default_value' => isset($field['css_id']) ? $field['css_id'] : '',
'#field_suffix' => '-##',
);
$form['css_class'] = array(
'#type' => 'textfield',
'#title' => t('CSS Class'),
'#description' => t('Specify a class to be added to the table element.'),
'#default_value' => isset($field['css_class']) ? $field['css_class'] : '',
);
return $form;
case 'validate':
break;
case 'save':
return array(
'css_id',
'css_class',
);
case 'database columns':
if ($field['type'] == 'tablefield') {
return array(
'value' => array(
'type' => 'text',
'not null' => FALSE,
'default' => NULL,
'sortable' => FALSE,
),
);
}
case 'filters':
break;
}
}