1 installer.pages.inc installer_browser_installation_install_dependencies_page()

Task page for the Install Dependencies installation task.

Show a form which lets the user select which version of dependencies to install.

File

core/modules/installer/installer.pages.inc, line 469
Page callbacks used by the Installer browse pages.

Code

function installer_browser_installation_install_dependencies_page() {
  module_load_include('inc', 'installer', 'installer.browser');
  $projects = installer_browser_get_installed_projects();
  $missing = installer_browser_get_missing_dependencies($projects);

  if (count($missing) > 0) {
    $missing_projects = array();
    // Add the project data in the array as best we can.
    foreach ($missing as $project_shortname => $dependencies) {
      foreach ($dependencies as $dependency_shortname) {
        $missing_projects[$dependency_shortname] = array(
          'name' => $dependency_shortname,
          'type' => 'module',
          'title' => $dependency_shortname,
          'includes' => array(),
        );
        // Make an assumption that the dependencies will have the same update
        // status URL as the project. This may not be true in the future if
        // we have decide to have more than one update server, but for now this
        // is necessary to test dependencies installation.
        if (isset($projects[$project_shortname]['project status url'])) {
          // Replace the dependent project short name with the parent short
          // name, as is needed with Backdrop's default update server.
          $status_url = preg_replace('/\/' . preg_quote($project_shortname, '/') . '([.\/]?)/', '/' . $dependency_shortname . '$1', $projects[$project_shortname]['project status url']);
          $missing_projects[$dependency_shortname]['project status url'] = $status_url;
        }
      }
    }

    return backdrop_get_form('installer_browser_installation_select_versions_form', $missing_projects);
  }
  else {
    backdrop_goto('admin/installer/install/enable');
    return NULL;
  }
}