install_select_profile
function install_select_profile
install_select_profile(&$install_state)
Selects which profile to install.
Parameters
$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 value
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.
File
- includes/install.core.inc, line 1052
- API functions for installing Drupal.
Code
function install_select_profile(&$install_state) { $install_state['profiles'] += install_find_profiles(); if (empty($install_state['parameters']['profile'])) { // Try to find a profile. $profile = _install_select_profile($install_state['profiles']); 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 DRUPAL_ROOT . '/includes/form.inc'; drupal_set_title(st('Select an installation profile')); $form = drupal_get_form('install_select_profile_form', $install_state['profiles']); return drupal_render($form); } else { throw new Exception(install_no_profile_error()); } } else { $install_state['parameters']['profile'] = $profile; } } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!install.core.inc/function/install_select_profile/7.x