You are here

function cck_list_field_settings in CCK List 6

Implementation of hook_field_settings().

File

./cck_list.module, line 49
Defines a field type that outputs data in a list.

Code

function cck_list_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 list 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 list 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':
      $columns['value'] = array(
        'type' => 'text',
        'not null' => FALSE,
        'default' => NULL,
        'sortable' => FALSE,
      );
      return $columns;
    case 'filters':
      break;
  }
}