Minor cleanups
[squirrelmail.git] / functions / html.php
index 0aac1864f83ccc4f027eae9d6ac3d50ec09d821d..91acef9542da20b5b00dde4b667b2a8bb19f127f 100644 (file)
@@ -3,17 +3,28 @@
 /**
  * html.php
  *
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2004 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$
+ * @version $Id$
+ * @package squirrelmail
  */
 
-    function html_tag( $tag,                // Tag to output
+/**
+ * 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
@@ -40,7 +51,7 @@
         }
 
         if ( $bgcolor <> '' ) {
-            $bgc = " bgcolor=\"$bgcolor\""; 
+            $bgc = " bgcolor=\"$bgcolor\"";
         }
 
         switch ( $align ) {
@@ -72,8 +83,8 @@
         if ( $val <> '' ) {
             $ret .= ">$val</$tag>";
         } else {
-            $ret .= ' />';
-        } 
+            $ret .= '>';
+        }
 
         return( $ret );
     }
                        '/.+(\\?'.$var.')=(.*)$/AU',     /* at front and only var */
                        '/.+(\\&'.$var.')=(.*)$/AU'      /* at the end */
                      );
-       preg_replace('/&amp;/','&',$url);            
+       preg_replace('/&amp;/','&',$url);
         switch (true) {
             case (preg_match($pat_a[0],$url,$regs)):
                 $k = $regs[1];
     function echo_template_var($var, $format_ar = array() ) {
         $frm_last = count($format_ar) -1;
 
-        if (isset($format_ar[0])) echo $format_ar[0]; 
+        if (isset($format_ar[0])) echo $format_ar[0];
             $i = 1;
 
         switch (true) {
             echo $format_ar[$frm_last];
         }
     }
-?>
+?>
\ No newline at end of file