diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index b45eefa..7c7ea6f 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -801,10 +801,11 @@ function install_tasks($install_state) { 'install_download_translation' => array( 'run' => $needs_download ? INSTALL_TASK_RUN_IF_REACHED : INSTALL_TASK_SKIP, ), - 'install_select_profile' => array( + 'install_select_profile_form' => array( + 'type' => 'form', 'display_name' => t('Choose profile'), 'display' => empty($install_state['parameters']['profile']) && count($install_state['profiles']) != 1, - 'run' => INSTALL_TASK_RUN_IF_REACHED, + 'run' => empty($install_state['parameters']['profile']) ? INSTALL_TASK_RUN_IF_REACHED : INSTALL_TASK_SKIP, ), 'install_load_profile' => array( 'run' => INSTALL_TASK_RUN_IF_REACHED, @@ -828,7 +829,7 @@ function install_tasks($install_state) { 'run' => INSTALL_TASK_RUN_IF_REACHED, ), 'install_profile_modules' => array( - 'display_name' => count($install_state['profiles']) == 1 ? t('Install site') : t('Installation profile'), + 'display_name' => t('Install site'), 'type' => 'batch', ), 'install_import_translations' => array( @@ -1299,45 +1300,6 @@ function install_settings_form_submit($form, &$form_state) { } /** - * Selects which profile to install. - * - * @param $install_state - * An array of information about the current installation state. The chosen - * profile will be added here, if it was not already selected previously, as - * will a list of all available profiles. - * - * @return - * For interactive installations, a form allowing the profile to be selected, - * if the user has a choice that needs to be made. Otherwise, an exception is - * thrown if a profile cannot be chosen automatically. - */ -function install_select_profile(&$install_state) { - if (empty($install_state['parameters']['profile'])) { - // Try to find a profile. - $profile = _install_select_profile($install_state); - if (empty($profile)) { - // We still don't have a profile, so display a form for selecting one. - // Only do this in the case of interactive installations, since this is - // not a real form with submit handlers (the database isn't even set up - // yet), rather just a convenience method for setting parameters in the - // URL. - if ($install_state['interactive']) { - include_once __DIR__ . '/form.inc'; - drupal_set_title(t('Select an installation profile')); - $form = drupal_get_form('install_select_profile_form', $install_state); - return drupal_render($form); - } - else { - throw new Exception(install_no_profile_error()); - } - } - else { - $install_state['parameters']['profile'] = $profile; - } - } -} - -/** * Determines the installation profile to use in the installer. * * A profile will be selected in the following order of conditions: @@ -1385,6 +1347,8 @@ function _install_select_profile(&$install_state) { * @ingroup forms */ function install_select_profile_form($form, &$form_state, $install_state) { + drupal_set_title(t('Select an installation profile')); + $profiles = array(); $names = array(); @@ -1447,6 +1411,14 @@ function install_select_profile_form($form, &$form_state, $install_state) { } /** + * Form submission handler for install_select_profile_form(). + */ +function install_select_profile_form_submit($form, &$form_state) { + global $install_state; + $install_state['parameters']['profile'] = $form_state['values']['profile']; +} + +/** * Finds all .po files that are useful to the installer. * * @return