diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-01-20 03:18:41 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-01-20 03:18:41 +0000 |
commit | fcc8211ab1331a4c6fa501d6b1a23e3c82c75423 (patch) | |
tree | 380cde4e8b5f5f723a1830e1511333d29abd3622 | |
parent | 0ec23b9b431108365bba4792e034a0f151e88ddc (diff) | |
download | brdo-fcc8211ab1331a4c6fa501d6b1a23e3c82c75423.tar.gz brdo-fcc8211ab1331a4c6fa501d6b1a23e3c82c75423.tar.bz2 |
#203323 by JirkaRybka, robertgarrigos, thePanz, c960657, and sun: Fix undefined index locale in install.php and clean up crufty code.
-rw-r--r-- | includes/bootstrap.inc | 10 | ||||
-rw-r--r-- | includes/common.inc | 2 | ||||
-rw-r--r-- | install.php | 8 | ||||
-rw-r--r-- | modules/book/book.module | 2 | ||||
-rw-r--r-- | modules/color/color.module | 2 | ||||
-rw-r--r-- | modules/locale/locale.module | 11 | ||||
-rw-r--r-- | themes/garland/template.php | 2 |
7 files changed, 19 insertions, 18 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 35a53b01d..27cd8400e 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -194,6 +194,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. */ define('REQUEST_TIME', $_SERVER['REQUEST_TIME']); diff --git a/includes/common.inc b/includes/common.inc index a37bbf670..37a90e10a 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -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']; diff --git a/install.php b/install.php index 5a76f1bb4..334648896 100644 --- a/install.php +++ b/install.php @@ -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; + } } } diff --git a/modules/book/book.module b/modules/book/book.module index 64f02c450..e86bd94b1 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -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(); } diff --git a/modules/color/color.module b/modules/color/color.module index e09145003..50006afb3 100644 --- a/modules/color/color.module +++ b/modules/color/color.module @@ -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)) { diff --git a/modules/locale/locale.module b/modules/locale/locale.module index c44303292..7fa66b38b 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -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 diff --git a/themes/garland/template.php b/themes/garland/template.php index 016a1e4e7..16b4d2857 100644 --- a/themes/garland/template.php +++ b/themes/garland/template.php @@ -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"; } |