You are here

function editablefields_form_builder in Editable Fields 6

Same name and namespace in other branches
  1. 6.3 editablefields.module \editablefields_form_builder()
  2. 6.2 editablefields.module \editablefields_form_builder()

Form builder callback.

1 string reference to 'editablefields_form_builder'
editablefields_forms in ./editablefields.module
Implementation of hook_forms().

File

./editablefields.module, line 144
Editable fields module.

Code

function editablefields_form_builder(&$form_state, $node, $field_name, $delta) {
  $field = content_fields($field_name);
  $form = array(
    '#node' => $node,
  );

  //  $form_state = array('values' => array($field['field_name'] => $default_value));
  module_load_include('inc', 'content', 'includes/content.node_form');
  $form['#field_info'] = array(
    $field['field_name'] => $field,
  );
  $form = content_field_form($form, $form_state, $field, $delta);
  unset($form[$field_name]['#title']);
  if (is_array($form[$field_name][0]) && !is_array($form[$field_name][1])) {
    unset($form[$field_name][0]['#title']);
  }
  $form['#field_info'] = array(
    $field['field_name'] => $field,
  );
  return $form;
}