1 installer.manager.inc installer_manager_install_modal_callback($form, $form_state)

AJAX callback to update the add/remove queue on bulk add.

Related topics

File

core/modules/installer/installer.manager.inc, line 578
Administrative screens and processing functions of the Installer module.

Code

function installer_manager_install_modal_callback($form, $form_state) {
  $commands = array();
  $commands[] = ajax_command_close_modal_dialog();

  // If errors occurred in the dialog, show messages and re-display.
  if (form_get_errors()) {
    $html = '';
    $html .= theme('status_messages');
    $html .= backdrop_render($form);
    $title = isset($form['#title']) ? $form['#title'] : 'Manual installation';
    $commands[] = ajax_command_open_modal_dialog($title, $html, array('width' => 700, 'dialogClass' => 'layout-dialog'));
  }
  elseif (!empty($form_state['redirect'])) {
    if (is_array($form_state['redirect'])) {
      $url = call_user_func_array('url', $form_state['redirect']);
    }
    else {
      $url = url($form_state['redirect'], array('absolute' => TRUE));
    }
    $commands[] = ajax_command_redirect($url);
  }

  return array(
    '#type' => 'ajax',
    '#commands' => $commands,
  );
}