diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc old mode 100644 new mode 100755 index 32c0b49..53b7a5f --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -423,6 +423,11 @@ function install_begin_request(&$install_state) { require_once __DIR__ . '/cache.inc'; + // Allow a passed in theme key so the installer can use a theme of choice. + if (isset($install_state['theme'])) { + $conf['maintenance_theme'] = $install_state['theme']; + } + // Prepare for themed output. We need to run this at the beginning of the // page request to avoid a different theme accidentally getting set. (We also // need to run it even in the case of command-line installations, to prevent @@ -685,6 +690,7 @@ function install_tasks_to_perform($install_state) { * A list of tasks, with associated metadata. */ function install_tasks($install_state) { + global $settings; // Determine whether a translation file must be imported during the // 'install_import_translations' task. Import when a non-English language is // available and selected. @@ -694,11 +700,17 @@ function install_tasks($install_state) { // is selected, but no translation is yet in the translations directory. $needs_download = isset($install_state['parameters']['langcode']) && !isset($install_state['translations'][$install_state['parameters']['langcode']]) && $install_state['parameters']['langcode'] != 'en'; + // Determine whether we are hiding some options that can be pre-selected. + $multiple_profiles = count($install_state['profiles']) != 1; + $profile_preselected = isset($settings['parameters']['profile']) && !empty($settings['parameters']['profile']); + $language_preselected = isset($settings['parameters']['langcode']) && !empty($settings['parameters']['langcode']); + // Start with the core installation tasks that run before handing control // to the installation profile. $tasks = array( 'install_select_language' => array( 'display_name' => st('Choose language'), + 'display' => !$language_preselected, 'run' => INSTALL_TASK_RUN_IF_REACHED, ), 'install_download_translation' => array( @@ -706,7 +718,7 @@ function install_tasks($install_state) { ), 'install_select_profile' => array( 'display_name' => st('Choose profile'), - 'display' => count($install_state['profiles']) != 1, + 'display' => $multiple_profiles && !$profile_preselected, 'run' => INSTALL_TASK_RUN_IF_REACHED, ), 'install_load_profile' => array( diff --git a/core/install.php b/core/install.php old mode 100644 new mode 100755 index 1b921d6..f7418ae --- a/core/install.php +++ b/core/install.php @@ -26,6 +26,12 @@ exit; } +$settings = array(); +// Look for a distribution file. +if (is_readable(dirname(__DIR__) . '/profiles/distribution.php')) { + include dirname(__DIR__) . '/profiles/distribution.php'; +} + // Start the installer. require_once __DIR__ . '/includes/install.core.inc'; -install_drupal(); +install_drupal($settings); diff --git a/core/profiles/example.distribution.php b/core/profiles/example.distribution.php new file mode 100755 index 0000000..4e193b3 --- /dev/null +++ b/core/profiles/example.distribution.php @@ -0,0 +1,53 @@ + 'standard', + 'langcode' => 'en', +); +// An array of server variables that will be substituted into the global +// $_SERVER array via drupal_override_server_variables(). Used by +// non-interactive installations only. +$settings['server'] = array(); +// The server URL where the interface translation files can be downloaded. +// Tokens in the pattern will be replaced by appropriate values for the +// required translation file. +$settings['server_pattern'] = 'http://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po'; +// An array of translation files URIs available for the installation. Keyed +// by the translation language code. +$settings['translations'] = array(); +// The name of the default theme to use. +$settings['theme'] = 'stark';