You are here

function finder_element_ajax in Finder 7.2

Menu callback; get finder ajax output.

Parameters

$finder: The finder object.

$element_id: The element id.

Return value

Finder ajax output.

1 string reference to 'finder_element_ajax'
finder_menu in ./finder.module
Implements hook_menu().

File

./finder.module, line 163
The finder module.

Code

function finder_element_ajax($finder, $element_id) {
  finder_inc('form');
  $finder
    ->build();
  $finder->ajax = TRUE;
  $element = $finder->elements[$element_id];
  $form_state['values'] = $_POST;
  $finder->form_state = $form_state;
  $form_element = finder_form_element($finder, $element, $form_state);
  drupal_json_output(array(
    'output' => render($form_element),
    'finder' => $finder->name,
    'element' => $element_id,
  ));
  exit;
}