install_select_locale
./install.php, строка 445
- Версии
- 5 – 6
install_select_locale($profilename)
Find all .po files for the current profile and allow admin to select which to use.
Возвращаемое значение
The selected language.
Код
<?php
function install_select_locale($profilename) {
include_once './includes/file.inc';
include_once './includes/form.inc';
// Collect possible locales, add default
$locales = file_scan_directory('./profiles/' . $profilename, '\.po$', array('.', '..', 'CVS'), 0, FALSE);
array_unshift($locales, (object) array('name' => 'en'));
// Don't need to choose locale if only one (English) is available.
if (sizeof($locales) == 1) {
return FALSE;
} else {
foreach ($locales as $locale) {
if ($_POST['locale'] == $locale->name) {
return $locale->name;
}
}
drupal_maintenance_theme();
drupal_set_title(st('Choose your preferred language'));
print theme('install_page', drupal_get_form('install_select_locale_form', $locales));
exit;
}
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии