You are here

function _commerce_message_message_submit_ajax_callback in Commerce Message 7

Ajax callback for the save button.

1 string reference to '_commerce_message_message_submit_ajax_callback'
commerce_message_message_form in includes/commerce_message.message.inc
Form callback: create/edit a message.

File

includes/commerce_message.message.inc, line 572

Code

function _commerce_message_message_submit_ajax_callback($form, $form_state) {
  $commands = array();
  $order_id = $form_state['values']['message_commerce_order'][LANGUAGE_NONE][0]['target_id'];
  $view = commerce_embed_view('commerce_message_messages', $form['#current_display']['#value'], array(
    $order_id,
  ));
  $commands[] = ajax_command_replace('.view-commerce-message-messages', $view);
  $commands[] = ajax_command_prepend('.view-commerce-message-messages', theme('status_messages'));
  return array(
    '#type' => 'ajax',
    '#commands' => $commands,
  );
}