You are here

function cck_table_field_widget_settings_form in CCK Table Field 8

Same name and namespace in other branches
  1. 7 cck_table.module \cck_table_field_widget_settings_form()

Implements of hook_field_widget_settings_form().

File

./cck_table.module, line 137
Defines a field type that outputs data in a table.

Code

function cck_table_field_widget_settings_form($field, $instance) {
  $form = array();
  $form['rows'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of Rows'),
    '#default_value' => isset($instance['widget']['settings']['rows']) ? $instance['widget']['settings']['rows'] : CCK_TABLE_DEFAULT_ROWS,
    '#required' => TRUE,
    '#element_validate' => array(
      '_element_validate_integer_positive',
    ),
  );
  $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($instance['widget']['settings']['css_id']) ? $instance['widget']['settings']['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($instance['widget']['settings']['css_class']) ? $instance['widget']['settings']['css_class'] : '',
  );
  return $form;
}