X-Git-Url: http://git.pk910.de/?p=PHP-P10.git;a=blobdiff_plain;f=Tools%2FTable.class.php;h=761c59c8b74a42e001d6cd51a2d624585521ed36;hp=3d01798b016d5415f8b5510dc71284e7df18f172;hb=7f51193ddac01b0540000c756c50167ff015e02a;hpb=ddffd103502359153b425495e8834ebcb1e157f0 diff --git a/Tools/Table.class.php b/Tools/Table.class.php index 3d01798..761c59c 100644 --- a/Tools/Table.class.php +++ b/Tools/Table.class.php @@ -1,8 +1,30 @@ . * + * * + ************************************************************************ + * + * Tools/Table.class.php + * + * IRC Table Class + */ class Table { private $table; - + public function Table($colums) { $this->table = array(); $this->table['set'] = array(); @@ -14,11 +36,11 @@ class Table { $this->table['set']['bold'][$i] = false; } } - + public function setBold($colum) { $this->table['set']['bold'][$colum] = true; } - + public function add() { $args = func_get_args(); $row = array(); @@ -26,12 +48,12 @@ class Table { if(count($args) <= $i) $args[$i]= ""; $row[] = $args[$i]; if(count($args) >= $i) - if(strlen($args[$i]) > $this->table['set']['max'.$i]) $this->table['set']['max'.$i] = strlen($args[$i]); + if(strlen($args[$i]) > $this->table['set']['max'.$i]) $this->table['set']['max'.$i] = strlen($args[$i]); } $this->table['data'][] = $row; return true; } - + public function end() { $space = " "; $output = array(); @@ -39,7 +61,7 @@ class Table { $out = ""; for($i = 0; $i < $this->table['set']['col']; $i++) { if($i < $this->table['set']['col'] - 1) - $this->table['data'][$row][$i] .= substr($space,0,$this->table['set']['max'.$i] - strlen($this->table['data'][$row][$i]) + 1); + $this->table['data'][$row][$i] .= substr($space,0,$this->table['set']['max'.$i] - strlen($this->table['data'][$row][$i]) + 1); $bold = $this->table['set']['bold'][$i]; $out .= ($bold ? "\002" : "").$this->table['data'][$row][$i].($bold ? "\002" : ""); } @@ -47,7 +69,7 @@ class Table { } return $output; } - + } ?> \ No newline at end of file