You are here

aet_insert.ajax.inc in Advanced Entity Tokens 7

This file contains all the functions required for the AET Insert ajax.

File

aet_insert/aet_insert.ajax.inc
View source
<?php

/**
 * @file
 * This file contains all the functions required for the AET Insert ajax.
 */

/**
 * The callback for the AET Insert ajax field.
 */
function aet_insert_field_ajax() {
  if (isset($_GET['entity_type']) && isset($_GET['target'])) {
    $aet_insert_field = array(
      '#type' => 'aet_insert_field',
      '#id' => isset($_GET['id']) ? $_GET['id'] : 'aet_insert_field',
      '#theme' => 'aet_insert_field',
      '#target' => $_GET['target'],
      '#entity_type' => $_GET['entity_type'],
      '#entity_key' => $_GET['entity_key'],
      '#entity_id' => isset($_GET['entity_id']) ? $_GET['entity_id'] : FALSE,
      '#entity_uuid' => isset($_GET['entity_uuid']) ? $_GET['entity_uuid'] : FALSE,
      '#bundle' => isset($_GET['bundle']) ? $_GET['bundle'] : FALSE,
      '#data' => isset($_GET['data']) ? $_GET['data'] : array(),
    );
  }
  die(render($aet_insert_field));
}

Functions

Namesort descending Description
aet_insert_field_ajax The callback for the AET Insert ajax field.