You are here

function button_field_dummy_form in Button Field 7

Same name and namespace in other branches
  1. 8 button_field.module \button_field_dummy_form()

Form builder callback for the dummy form used to render button field's on a display that is not editable.

2 string references to 'button_field_dummy_form'
button_field_field_formatter_view in ./button_field.module
Implements hook_field_formatter_view().
_button_field_get_dummy_form in ./button_field.module
Gets the dummy form to be used with button fields on a view form.

File

./button_field.module, line 21
Defines a field, widget and formatter for the button field type.

Code

function button_field_dummy_form($form, &$form_state) {

  // Set the form's language.
  $langcode = field_language($form_state['#entity_type'], $form_state['#' . $form_state['#entity_type']], $form_state['#field']['field_name']);
  $form['language']['#value'] = $langcode;

  // Add the field and the instance to the form state.
  $field_name = $form_state['#field']['field_name'];
  $form_state['field'][$field_name][$langcode]['field'] =& $form_state['#field'];
  $form_state['field'][$field_name][$langcode]['instance'] =& $form_state['#instance'];

  // Add the field element to the form.
  $form[$field_name][$langcode][0] = $form_state['#element'];
  return $form;
}