function cck_table_field_settings in CCK Table Field 6
Same name and namespace in other branches
- 5 cck_table.module \cck_table_field_settings()
Implementation of hook_field_settings().
File
- ./
cck_table.module, line 52 - 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['separator'] = array(
'#type' => 'textfield',
'#title' => t('Separator'),
'#description' => t('Separator to distingush the cells in each row'),
'#default_value' => isset($field['separator']) ? $field['separator'] : CCK_TABLE_DEFAULT_SEPARATOR,
'#size' => 5,
'#required' => TRUE,
);
$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(
'separator',
'css_id',
'css_class',
);
case 'database columns':
$columns['value'] = array(
'type' => 'text',
'not null' => FALSE,
'default' => NULL,
'sortable' => FALSE,
);
return $columns;
case 'filters':
break;
}
}