You are here

function tmgmt_local_translation_form_update_state_ajax in Translation Management Tool 7

Ajax callback for the job item review form.

1 string reference to 'tmgmt_local_translation_form_update_state_ajax'
tmgmt_local_translation_form_element in translators/tmgmt_local/includes/tmgmt_local.pages.inc
Builds a translation form element.

File

translators/tmgmt_local/includes/tmgmt_local.pages.inc, line 386
Provides page and forms callbacks.

Code

function tmgmt_local_translation_form_update_state_ajax($form, &$form_state) {
  $key = array_slice($form_state['triggering_element']['#array_parents'], 0, 3);
  $commands = array();
  $render_data = drupal_array_get_nested_value($form, $key);
  $commands[] = ajax_command_replace(NULL, drupal_render($render_data));
  tmgmt_ui_write_request_messages($form_state['job_item']
    ->getJob());
  $commands[] = ajax_command_html('#tmgmt-status-messages-' . strtolower($render_data['#parent_label'][0]), theme('status_messages'));
  return array(
    '#type' => 'ajax',
    '#commands' => $commands,
  );
}