Hewbrew
[squirrelmail.git] / functions / html.php
1 <?php
2
3 /**
4 * imap.php
5 *
6 * Copyright (c) 1999-2002 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * The idea is to inlcude here some functions to make easier
10 * the right to left implementation by "functionize" some
11 * html outputs.
12 *
13 * $Id$
14 */
15
16 function html_tag( $tag,
17 $align = '',
18 $xtra = '' ) {
19
20 GLOBAL $languages, $language;
21
22 $align = strtolower( $align );
23 $dir = strtolower( $dir );
24
25 if ( isset( $languages[$language]['DIR']) ) {
26 $dir = $languages[$language]['DIR'];
27 } else {
28 $dir = 'ltr';
29 }
30
31 if ( $dir == 'ltr' ) {
32 $rgt = 'right';
33 $lft = 'left';
34 } else {
35 $rgt = 'left';
36 $lft = 'right';
37 }
38
39 switch ( $align ) {
40 case '':
41 $alg = '';
42 break;
43 case 'right':
44 $alg = " ALIGN=\"$rgt\"";
45 break;
46 default:
47 $alg = " ALIGN=\"$lft\"";
48 }
49
50 return( "<$tag DIR=\"$dir\"$alg $xtra>" );
51 }
52
53
54 ?>