summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2008-01-24 09:42:53 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2008-01-24 09:42:53 +0000
commit7186c4433e85f4f307466e9706b2a62e30a9b173 (patch)
tree033ae5873052a6108a346da9e259fcdeef3a9ecd
parentff4fd98430669b6355d91c2a5042b116d840d3da (diff)
downloadbrdo-7186c4433e85f4f307466e9706b2a62e30a9b173.tar.gz
brdo-7186c4433e85f4f307466e9706b2a62e30a9b173.tar.bz2
#208768 by dvessel, Arancaytar: language direction should be in the HTML source, so it is more accessible even without CSS
-rw-r--r--includes/theme.inc1
-rw-r--r--includes/theme.maintenance.inc1
-rw-r--r--modules/system/maintenance-page.tpl.php2
-rw-r--r--modules/system/page.tpl.php3
-rw-r--r--themes/bluemarine/page.tpl.php2
-rw-r--r--themes/chameleon/chameleon.theme5
-rw-r--r--themes/garland/maintenance-page.tpl.php2
-rw-r--r--themes/garland/page.tpl.php2
-rw-r--r--themes/pushbutton/page.tpl.php2
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 @@
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
<head>
<title><?php print $head_title; ?></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 @@
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
<head>
<title><?php print $head_title; ?></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
// $Id$
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language->language ?>" xml:lang="<?php print $language->language ?>">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language->language ?>" xml:lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
<head>
<title><?php print $head_title ?></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('<link rel="shortcut icon" href="'. check_url(theme_get_setting('favicon')) .'" type="image/x-icon" />');
@@ -27,7 +28,7 @@ function chameleon_page($content, $show_blocks = TRUE, $show_messages = TRUE) {
$blocks_right = theme_blocks('right');
$output = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
- $output .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"$language\" xml:lang=\"$language\">\n";
+ $output .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"$language\" xml:lang=\"$language\" dir=\"$direction\">\n";
$output .= "<head>\n";
$output .= " <title>". ($title ? strip_tags($title) ." | ". variable_get("site_name", "Drupal") : variable_get("site_name", "Drupal") ." | ". variable_get("site_slogan", "")) ."</title>\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 @@
*/
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
<head>
<title><?php print $head_title ?></title>
<?php print $head ?>
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$
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
<head>
<title><?php print $head_title ?></title>
<?php print $head ?>
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
// $Id$
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language->language ?>" xml:lang="<?php print $language->language ?>">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language->language ?>" xml:lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
<head>
<title><?php print $head_title ?></title>
<meta http-equiv="Content-Style-Type" content="text/css" />