From 7186c4433e85f4f307466e9706b2a62e30a9b173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Thu, 24 Jan 2008 09:42:53 +0000 Subject: #208768 by dvessel, Arancaytar: language direction should be in the HTML source, so it is more accessible even without CSS --- includes/theme.inc | 1 + includes/theme.maintenance.inc | 1 + modules/system/maintenance-page.tpl.php | 2 +- modules/system/page.tpl.php | 3 ++- themes/bluemarine/page.tpl.php | 2 +- themes/chameleon/chameleon.theme | 5 +++-- themes/garland/maintenance-page.tpl.php | 2 +- themes/garland/page.tpl.php | 2 +- themes/pushbutton/page.tpl.php | 2 +- 9 files changed, 12 insertions(+), 8 deletions(-) diff --git a/includes/theme.inc b/includes/theme.inc index 31cda3a80..4e13f93c2 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1748,6 +1748,7 @@ function template_preprocess_page(&$variables) { $variables['head'] = drupal_get_html_head(); $variables['help'] = theme('help'); $variables['language'] = $GLOBALS['language']; + $variables['language']->dir = $GLOBALS['language']->direction ? 'rtl' : 'ltr'; $variables['logo'] = theme_get_setting('logo'); $variables['messages'] = $variables['show_messages'] ? theme('status_messages') : ''; $variables['mission'] = isset($mission) ? $mission : ''; diff --git a/includes/theme.maintenance.inc b/includes/theme.maintenance.inc index b4cc24940..c513a00b5 100644 --- a/includes/theme.maintenance.inc +++ b/includes/theme.maintenance.inc @@ -247,6 +247,7 @@ function template_preprocess_maintenance_page(&$variables) { $variables['head'] = drupal_get_html_head(); $variables['help'] = ''; $variables['language'] = $GLOBALS['language']; + $variables['language']->dir = $GLOBALS['language']->direction ? 'rtl' : 'ltr'; $variables['logo'] = theme_get_setting('logo'); $variables['messages'] = $variables['show_messages'] ? theme('status_messages') : ''; $variables['mission'] = ''; diff --git a/modules/system/maintenance-page.tpl.php b/modules/system/maintenance-page.tpl.php index 12037ab93..e29f2cb10 100644 --- a/modules/system/maintenance-page.tpl.php +++ b/modules/system/maintenance-page.tpl.php @@ -16,7 +16,7 @@ ?> - + <?php print $head_title; ?> diff --git a/modules/system/page.tpl.php b/modules/system/page.tpl.php index 4b1cf7228..95a53db44 100644 --- a/modules/system/page.tpl.php +++ b/modules/system/page.tpl.php @@ -21,6 +21,7 @@ * Page metadata: * - $language: (object) The language the site is being displayed in. * $language->language contains its textual representation. + * $language->dir contains the language direction. It will either be 'ltr' or 'rtl'. * - $head_title: A modified version of the page title, for use in the TITLE tag. * - $head: Markup for the HEAD section (including meta tags, keyword tags, and * so on). @@ -76,7 +77,7 @@ ?> - + <?php print $head_title; ?> diff --git a/themes/bluemarine/page.tpl.php b/themes/bluemarine/page.tpl.php index c8d07c3e6..b83111aa1 100644 --- a/themes/bluemarine/page.tpl.php +++ b/themes/bluemarine/page.tpl.php @@ -1,7 +1,7 @@ - + <?php print $head_title ?> diff --git a/themes/chameleon/chameleon.theme b/themes/chameleon/chameleon.theme index 4536ec282..8f3a51904 100644 --- a/themes/chameleon/chameleon.theme +++ b/themes/chameleon/chameleon.theme @@ -14,7 +14,8 @@ function chameleon_theme($existing, $type, $theme, $path) { } function chameleon_page($content, $show_blocks = TRUE, $show_messages = TRUE) { - $language = isset($GLOBALS['language']) ? $GLOBALS['language']->language : NULL; + $language = $GLOBALS['language']->language; + $direction = $GLOBALS['language']->direction ? 'rtl' : 'ltr'; if (theme_get_setting('toggle_favicon')) { drupal_set_html_head(''); @@ -27,7 +28,7 @@ function chameleon_page($content, $show_blocks = TRUE, $show_messages = TRUE) { $blocks_right = theme_blocks('right'); $output = "\n"; - $output .= "\n"; + $output .= "\n"; $output .= "\n"; $output .= " ". ($title ? strip_tags($title) ." | ". variable_get("site_name", "Drupal") : variable_get("site_name", "Drupal") ." | ". variable_get("site_slogan", "")) ."\n"; $output .= drupal_get_html_head(); diff --git a/themes/garland/maintenance-page.tpl.php b/themes/garland/maintenance-page.tpl.php index 3621dbead..e3d1b9d66 100644 --- a/themes/garland/maintenance-page.tpl.php +++ b/themes/garland/maintenance-page.tpl.php @@ -13,7 +13,7 @@ */ ?> - + <?php print $head_title ?> diff --git a/themes/garland/page.tpl.php b/themes/garland/page.tpl.php index eb88470d6..92559d814 100644 --- a/themes/garland/page.tpl.php +++ b/themes/garland/page.tpl.php @@ -2,7 +2,7 @@ // $Id$ ?> - + <?php print $head_title ?> diff --git a/themes/pushbutton/page.tpl.php b/themes/pushbutton/page.tpl.php index 946d11c9e..8fd960d66 100644 --- a/themes/pushbutton/page.tpl.php +++ b/themes/pushbutton/page.tpl.php @@ -1,7 +1,7 @@ - + <?php print $head_title ?> -- cgit v1.2.3