X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fhtml.php;h=b82dc5eefd9ad3ddebfaea305037f383cb5bbed3;hb=3379969eccbecc4c856ec1845f663688ca82e855;hp=b926f736960cc7cceb57e4a5f828fd22134a4d9c;hpb=59be1a7538a2b77a6a763c1da258edf92667fce3;p=squirrelmail.git diff --git a/functions/html.php b/functions/html.php index b926f736..b82dc5ee 100644 --- a/functions/html.php +++ b/functions/html.php @@ -3,7 +3,7 @@ /** * html.php * - * Copyright (c) 1999-2002 The SquirrelMail Project Team + * Copyright (c) 1999-2003 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 @@ -11,10 +11,21 @@ * html outputs. * * $Id$ + * @package squirrelmail */ - function html_tag( $tag, // Tag to output - $val = '', // Value between tags (if empty only start tag is issued) +/** + * Generate html tags + * + * @param string $tag Tag to output + * @param string $val Value between tags + * @param string $align Alignment (left, center, etc) + * @param string $bgcolor Back color in hexadecimal + * @param string $xtra Extra options + * @return string HTML ready for output + */ +function html_tag( $tag, // Tag to output + $val = '', // Value between tags $align = '', // Alignment $bgcolor = '', // Back color $xtra = '' ) { // Extra options @@ -23,10 +34,10 @@ $align = strtolower( $align ); $bgc = ''; - $tag = strtoupper( $tag ); + $tag = strtolower( $tag ); if ( isset( $languages[$squirrelmail_language]['DIR']) ) { - $dir = $languages[$squirrelmail_language]['DIR']; + $dir = $languages[$squirrelmail_language]['DIR']; } else { $dir = 'ltr'; } @@ -40,7 +51,7 @@ } if ( $bgcolor <> '' ) { - $bgc = " BGCOLOR=\"$bgcolor\""; + $bgc = " bgcolor=\"$bgcolor\""; } switch ( $align ) { @@ -48,31 +59,32 @@ $alg = ''; break; case 'right': - $alg = " ALIGN=\"$rgt\""; + $alg = " align=\"$rgt\""; break; case 'left': - $alg = " ALIGN=\"$lft\""; + $alg = " align=\"$lft\""; break; default: - $alg = " ALIGN=\"$align\""; + $alg = " align=\"$align\""; break; } $ret = "<$tag"; if ( $dir <> 'ltr' ) { - $ret .= " DIR=\"$dir\""; + $ret .= " dir=\"$dir\""; } - $ret .= "$bgc$alg"; + $ret .= $bgc . $alg; if ( $xtra <> '' ) { $ret .= " $xtra"; } - $ret .= '>'; if ( $val <> '' ) { - $ret .= "$val"; - } + $ret .= ">$val"; + } else { + $ret .= '>'; + } return( $ret ); }