Hebrew step 2
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 29 May 2002 16:09:01 +0000 (16:09 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 29 May 2002 16:09:01 +0000 (16:09 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2902 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/html.php [new file with mode: 0644]
functions/mailbox_display.php

diff --git a/functions/html.php b/functions/html.php
new file mode 100644 (file)
index 0000000..aeae3d8
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+
+/**
+ * imap.php
+ *
+ * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
+ * The idea is to inlcude here some functions to make easier
+ * the right to left implementation by "functionize" some
+ * html outputs.
+ *
+ * $Id$
+ */
+
+    function html_tag( $tag,
+                       $align = '', 
+                       $xtra = '' ) {
+                        
+       GLOBAL $languages, $language;
+       
+       $align = strtolower( $align );
+       $dir   = strtolower( $dir );
+       
+       if ( isset( $languages[$language]['DIR']) ) {
+           $dir = $languages[$language]['DIR'];
+       } else {
+           $dir = 'ltr';
+       }
+       
+       if ( $dir == 'ltr' ) {
+           $rgt = 'right';
+           $lft = 'left';              
+       } else {
+           $rgt = 'left';
+           $lft = 'right';     
+       }
+       
+       switch ( $align ) {
+       case '':
+           $alg = '';
+           break;
+       case 'right':
+           $alg = " ALIGN=\"$rgt\"";
+           break;
+       default:
+           $alg = " ALIGN=\"$lft\"";
+       }
+       
+        return( "<$tag DIR=\"$dir\"$alg $xtra>" );
+    }
+
+
+?>
index dd0aa61736ce8db0828c1b6e0019727fe8c6b860..13f185a37b5b08af6bdf10579da967d8d823c806 100644 (file)
@@ -14,6 +14,7 @@
 
 require_once('../functions/strings.php');
 require_once('../functions/imap_utf7_decode_local.php');
+require_once('../functions/html.php');
 
 /* Default value for page_selector_max. */
 define('PG_SEL_MAX', 10);
@@ -605,11 +606,12 @@ function displayMessageArray($imapConnection, $num_msgs, $start_msg,
   }
   
   echo '</table>'
-    . "<table bgcolor=\"$color[9]\" width=\"100%\" border=0 cellpadding=1 "
-    . "cellspacing=1><tr BGCOLOR=\"$color[4]\"><td>"
+    . html_tag( 'table', '', 
+                "bgcolor=\"$color[9]\" width=\"100%\" border=0 cellpadding=1 cellspacing=1" ) 
+    . "<tr BGCOLOR=\"$color[4]\"><td>"
     . "<table width=\"100%\" BGCOLOR=\"$color[4]\" border=0 cellpadding=1 "
     . "cellspacing=0><tr><td>$paginator_str</td>"
-    . "<td align=right>$msg_cnt_str</td></tr></table>"
+    . html_tag( 'td', 'right' ) . "$msg_cnt_str</td></tr></table>"
     . "</td></tr></table>";
   /* End of message-list table */