You are here

function ajax_form_entity_field_collection_cancel in Ajax form entity 7

Same name and namespace in other branches
  1. 7.x ajax_form_entity_field_collection/ajax_form_entity_field_collection.module \ajax_form_entity_field_collection_cancel()
1 string reference to 'ajax_form_entity_field_collection_cancel'
ajax_form_entity_field_collection_menu in ajax_form_entity_field_collection/ajax_form_entity_field_collection.module
Implements hook_menu().

File

ajax_form_entity_field_collection/ajax_form_entity_field_collection.module, line 129
Provide formatter for ajax add / edition field collection.

Code

function ajax_form_entity_field_collection_cancel($type = 'ajax') {
  $commands = array();
  $form_build_id = arg(2);
  $commands[] = ajax_command_css('a.cancel-' . $form_build_id, array(
    'display' => 'none',
  ));
  $commands[] = ajax_command_css('form#' . $form_build_id, array(
    'display' => 'none',
  ));
  $commands[] = ajax_command_css('a#open-form' . $form_build_id, array(
    'display' => 'block',
  ));
  $page = array(
    '#type' => 'ajax',
    '#commands' => $commands,
  );
  ajax_deliver($page);
}