You are here

function name_form_content_field_edit_form_alter in Name Field 6

Provides a hook into the theming of the field and instance settings, using #pre_render callbacks.

File

./name.module, line 12
Defines an API for displaying and inputing names.

Code

function name_form_content_field_edit_form_alter(&$form, &$form_state) {
  $field = $form['#field'];
  if ($field['module'] != 'name') {
    return;
  }

  // Moves the instance settings into a nicer table.
  if (!isset($form['widget']['instance_settings']['#pre_render'])) {
    $form['widget']['instance_settings']['#pre_render'] = array();
  }
  $form['widget']['instance_settings']['#pre_render'][] = 'name_field_instance_settings_pre_render';
  $form['widget']['instance_settings']['#field'] = $field;

  // Moves the instance settings into a nicer table.
  if (!isset($form['field']['field_settings']['#pre_render'])) {
    $form['field']['field_settings']['#pre_render'] = array();
  }
  $form['field']['field_settings']['#pre_render'][] = 'name_field_settings_pre_render';
  $form['field']['field_settings']['#field'] = $field;
}