update to 7.22

Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
bachy
2013-05-24 13:03:57 +02:00
parent d5097a4bc6
commit 5658794f17
265 changed files with 5551 additions and 8808 deletions

View File

@@ -1041,7 +1041,21 @@ function install_select_profile(&$install_state) {
}
/**
* Selects an installation profile from a list or from a $_POST submission.
* Selects an installation profile.
*
* A profile will be selected if:
* - Only one profile is available,
* - A profile was submitted through $_POST,
* - Exactly one of the profiles is marked as "exclusive".
* If multiple profiles are marked as "exclusive" then no profile will be
* selected.
*
* @param array $profiles
* An associative array of profiles with the machine-readable names as keys.
*
* @return
* The machine-readable name of the selected profile or NULL if no profile was
* selected.
*/
function _install_select_profile($profiles) {
if (sizeof($profiles) == 0) {
@@ -1061,6 +1075,23 @@ function _install_select_profile($profiles) {
}
}
}
// Check for a profile marked as "exclusive" and ensure that only one
// profile is marked as such.
$exclusive_profile = NULL;
foreach ($profiles as $profile) {
$profile_info = install_profile_info($profile->name);
if (!empty($profile_info['exclusive'])) {
if (empty($exclusive_profile)) {
$exclusive_profile = $profile->name;
}
else {
// We found a second "exclusive" profile. There's no way to choose
// between them, so we ignore the property.
return;
}
}
}
return $exclusive_profile;
}
/**