浏览代码

Hebrew step 2

philippe_mingo 23 年之前
父节点
当前提交
d9cdf9c751
共有 2 个文件被更改,包括 59 次插入3 次删除
  1. 54 0
      functions/html.php
  2. 5 3
      functions/mailbox_display.php

+ 54 - 0
functions/html.php

@@ -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>" );
+    }
+
+
+?>

+ 5 - 3
functions/mailbox_display.php

@@ -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 */