#203323 by JirkaRybka, robertgarrigos, thePanz, c960657, and sun: Fix undefined index locale in install.php and clean up crufty code.

merge-requests/26/head
Angie Byron 2009-01-20 03:18:41 +00:00
parent 0ec23b9b43
commit fcc8211ab1
7 changed files with 19 additions and 18 deletions

View File

@ -193,6 +193,16 @@ define('LANGUAGE_NEGOTIATION_PATH', 2);
*/
define('LANGUAGE_NEGOTIATION_DOMAIN', 3);
/**
* Language written left to right. Possible value of $language->direction.
*/
define('LANGUAGE_LTR', 0);
/**
* Language written right to left. Possible value of $language->direction.
*/
define('LANGUAGE_RTL', 1);
/**
* For convenience, define a short form of the request time global.
*/

View File

@ -2058,7 +2058,7 @@ function drupal_add_css($path = NULL, $options = NULL, $reset = FALSE) {
$css[$media][$type][$path] = $options['preprocess'];
// If the current language is RTL, add the CSS file with RTL overrides.
if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) {
if ($language->direction == LANGUAGE_RTL) {
$rtl_path = str_replace('.css', '-rtl.css', $path);
if (file_exists($rtl_path)) {
$css[$media][$type][$rtl_path] = $options['preprocess'];

View File

@ -554,9 +554,11 @@ function install_select_locale($profilename) {
}
}
foreach ($locales as $locale) {
if ($_POST['locale'] == $locale->name) {
return $locale->name;
if (!empty($_POST['locale'])) {
foreach ($locales as $locale) {
if ($_POST['locale'] == $locale->name) {
return $locale->name;
}
}
}

View File

@ -998,7 +998,7 @@ function template_preprocess_book_export_html(&$variables) {
$variables['title'] = check_plain($variables['title']);
$variables['base_url'] = $base_url;
$variables['language'] = $language;
$variables['language_rtl'] = defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL;
$variables['language_rtl'] = ($language->direction == LANGUAGE_RTL);
$variables['head'] = drupal_get_html_head();
}

View File

@ -94,7 +94,7 @@ function _color_page_alter(&$vars) {
// If the current language is RTL and the CSS file had an RTL variant,
// pull out the non-colored and add rewritten RTL stylesheet.
if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) {
if ($language->direction == LANGUAGE_RTL) {
$rtl_old_path = str_replace('.css', '-rtl.css', $old_path);
$rtl_color_path = str_replace('.css', '-rtl.css', $color_path);
if (file_exists($rtl_color_path)) {

View File

@ -12,17 +12,6 @@
* Gettext portable object files are supported.
*/
/**
* Language written left to right. Possible value of $language->direction.
*/
define('LANGUAGE_LTR', 0);
/**
* Language written right to left. Possible value of $language->direction.
*/
define('LANGUAGE_RTL', 1);
// ---------------------------------------------------------------------------------
// Hook implementations

View File

@ -92,7 +92,7 @@ function garland_get_ie_styles() {
global $language;
$ie_styles = '<link type="text/css" rel="stylesheet" media="all" href="' . base_path() . path_to_theme() . '/fix-ie.css" />'. "\n";
if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) {
if ($language->direction == LANGUAGE_RTL) {
$ie_styles .= ' <style type="text/css" media="all">@import "' . base_path() . path_to_theme() . '/fix-ie-rtl.css";</style>'. "\n";
}