X-Git-Url: http://git.pk910.de/?p=PHP-P10.git;a=blobdiff_plain;f=Tools%2FTable.class.php;h=761c59c8b74a42e001d6cd51a2d624585521ed36;hp=239de460afa3180b09b53d79a9183bd099230d64;hb=7f51193ddac01b0540000c756c50167ff015e02a;hpb=811bc0c7a1f583fb624a0f8c3601146e063c5a25 diff --git a/Tools/Table.class.php b/Tools/Table.class.php index 239de46..761c59c 100644 --- a/Tools/Table.class.php +++ b/Tools/Table.class.php @@ -6,7 +6,7 @@ * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * - * * + * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * @@ -16,7 +16,7 @@ * along with this program. If not, see . * * * ************************************************************************ - * + * * Tools/Table.class.php * * IRC Table Class @@ -24,7 +24,7 @@ class Table { private $table; - + public function Table($colums) { $this->table = array(); $this->table['set'] = array(); @@ -36,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(); @@ -48,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(); @@ -61,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" : ""); } @@ -69,7 +69,7 @@ class Table { } return $output; } - + } ?> \ No newline at end of file