cvs: phpweb /include layout.inc

[email protected] ("Hannes Magnusson")
Newsgroups php.webmaster
Message-ID <cvsbjori1204459546@cvsserver>
bjori		Sun Mar  2 12:05:46 2008 UTC

  Modified files:              
    /phpweb/include	layout.inc 
  Log:
  Fixed bug#44243 (rtl documents being desplayed ltr.)
  
  
http://cvs.php.net/viewvc.cgi/phpweb/include/layout.inc?r1=1.277&r2=1.278&diff_format=u
Index: phpweb/include/layout.inc
diff -u phpweb/include/layout.inc:1.277 phpweb/include/layout.inc:1.278
--- phpweb/include/layout.inc:1.277	Mon Feb 25 15:49:21 2008
+++ phpweb/include/layout.inc	Sun Mar  2 12:05:46 2008
@@ -1,5 +1,5 @@
 <?php
-/* $Id: layout.inc,v 1.277 2008/02/25 15:49:21 bjori Exp $ */
+/* $Id: layout.inc,v 1.278 2008/03/02 12:05:46 bjori Exp $ */
 
 // Set the static content root differently on php.net
 $_SERVER['STATIC_ROOT'] = ($MYSITE == 'http://www.php.net/') ?
@@ -60,7 +60,7 @@
 
 function site_header($title = '', $config = array())
 {
-    global $EXPL_LANG, $SIDEBAR_DATA, $RSIDEBAR_DATA, $PAGE_COLUMNS;
+    global $EXPL_LANG, $SIDEBAR_DATA, $RSIDEBAR_DATA, $PAGE_COLUMNS, $PGI;
     
     // Default to empty array if improper parameter passed
     if (!is_array($config)) { $config = array(); }
@@ -142,6 +142,19 @@
         }
     }
 
+    // Right-to-left support
+    $rtl = "";
+    if (isset($PGI, $PGI['head'], $PGI['head'][1])) {
+        switch (language_convert($PGI['head'][1])) {
+            case "he":
+            case "ar":
+                $rtl = ' style="direction: rtl"';
+                break;
+        }
+    }
+
+ 
+
     print <<<END_HEADER
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -229,7 +242,7 @@
     }
 
     // Start main page content
-    echo "\n <div id=\"content\" class=\"$classname\">\n";
+    echo "\n <div id=\"content\" class=\"$classname\"{$rtl}>\n";
 }
 
 // Stats pages still need this
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.