1.20.x ajax.inc ajax_footer()

Performs end-of-Ajax-request tasks.

This function is the equivalent of backdrop_page_footer(), but for Ajax requests.

See also

backdrop_page_footer()

Related topics

File

includes/ajax.inc, line 665
Functions for use with Backdrop's Ajax framework.

Code

function ajax_footer() {
  // Even for Ajax requests, invoke hook_exit() implementations. There may be
  // modules that need very fast Ajax responses, and therefore, run Ajax
  // requests with an early bootstrap.
  if (backdrop_get_bootstrap_phase() == BACKDROP_BOOTSTRAP_FULL && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update')) {
    module_invoke_all('exit');
  }

  // Commit the user session. See above comment about the possibility of this
  // function running without session.inc loaded.
  if (function_exists('backdrop_session_commit')) {
    backdrop_session_commit();
  }
}