You are here

function _button_field_get_dummy_form in Button Field 7

Gets the dummy form to be used with button fields on a view form.

Parameters

string $entity_type: The type of entity that the button field is being rendered for.

stdClass $entity: The entity that the button field is being rendered for.

array $field: The button field that is being rendered.

array $instance: The current instance of the button field that is being rendered.

array $element: The renderable array element for the button field.

Return value

array The form as a renderable array.

1 call to _button_field_get_dummy_form()
button_field_field_formatter_view in ./button_field.module
Implements hook_field_formatter_view().

File

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

Code

function _button_field_get_dummy_form($entity_type, $entity, $field, $instance, $element) {
  $form_state = array(
    'build_info' => array(
      'args' => array(
        &$entity,
      ),
    ),
    '#entity_type' => $entity_type,
    '#' . $entity_type => &$entity,
    '#field' => &$field,
    '#instance' => &$instance,
    '#element' => $element,
  );

  // Build the form and add it to the cache.
  $form = drupal_build_form('button_field_dummy_form', $form_state);
  form_set_cache($form['#build_id'], $form, $form_state);
  return $form;
}