You are here

function goBack in Entity Embed 7

Same name and namespace in other branches
  1. 7.3 entity_embed.admin.inc \goBack()
  2. 7.2 entity_embed.admin.inc \goBack()

Form submission handler to go back to the previous step of the form.

Parameters

$form: An associative array containing the structure of the form.

$form_state: An associative array containing the current state of the form.

1 string reference to 'goBack'
entity_embed_dialog_form in ./entity_embed.admin.inc
Form constructor for the entity embed dialog form.

File

./entity_embed.admin.inc, line 383
Admin page callbacks for the entity_embed module.

Code

function goBack(&$form, $form_state) {
  $form_state['step'] = 'select';
  $form_state['rebuild'] = TRUE;
  $rebuild_form = drupal_rebuild_form('entity_embed_dialog_form', $form_state, $form);
  unset($rebuild_form['#prefix'], $rebuild_form['#suffix']);
  $status_messages = array(
    '#theme' => 'status_messages',
  );
  $output = drupal_render($rebuild_form);
  drupal_process_attached($rebuild_form);
  $output = '<div>' . drupal_render($status_messages) . $output . '</div>';
  $commands[] = ajax_command_html('#entity-embed-dialog-form', $output);
  return array(
    '#type' => 'ajax',
    '#commands' => $commands,
  );
}