[Phplib-commit] CVS: php-lib-stable/php table.inc,1.2,1.3
Brought to you by:
nhruby,
richardarcher
From: Richard A. <ric...@us...> - 2002-04-25 02:32:14
|
Update of /cvsroot/phplib/php-lib-stable/php In directory usw-pr-cvs1:/tmp/cvs-serv2960 Modified Files: table.inc Log Message: Merge changes from Lindsay Haisley: Fix undefined variable warnings Assume $row = 0 for header Fixed typo - changed $cell=0 to $col=0 Index: table.inc =================================================================== RCS file: /cvsroot/phplib/php-lib-stable/php/table.inc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** table.inc 12 Jul 2000 18:22:35 -0000 1.2 --- table.inc 25 Apr 2002 02:32:10 -0000 1.3 *************** *** 289,295 **** --- 289,298 ---- # Comments : # History : 990618 - Fixed return on select_colnames (JSG). + # : 020424 - Assume $row = 0 for header. Avoid PHP uninitialized + # variable error (LEH). #========================================================================== function table_heading_row($data, $class="") { + $row = 0; if (!is_array($data)) return; *************** *** 302,306 **** # call virtual function ! if ($this->add_extra) $this->table_heading_row_add_extra($data, $class); --- 305,309 ---- # call virtual function ! if (isset($this->add_extra) && $this->add_extra) $this->table_heading_row_add_extra($data, $class); *************** *** 479,483 **** # call virtual function ! if ($this->add_extra) $this->table_row_add_extra($row, $row_key, $data, $class); --- 482,486 ---- # call virtual function ! if (isset($this->add_extra) && $this->add_extra) $this->table_row_add_extra($row, $row_key, $data, $class); *************** *** 509,513 **** ## Checkbox handling... ! if ($this->check) $this->table_heading_cell(0, " ", $class); } --- 512,516 ---- ## Checkbox handling... ! if (isset($this->check) && $this->check) $this->table_heading_cell(0, " ", $class); } *************** *** 534,538 **** ## Checkbox handling... ! if ($this->check) $this->table_checkbox_cell($row, $row_key, $data, $class); } --- 537,541 ---- ## Checkbox handling... ! if (isset($this->check) && $this->check) $this->table_checkbox_cell($row, $row_key, $data, $class); } *************** *** 548,551 **** --- 551,555 ---- # Comments : # History : 990618 - Fixed problem with filtering headers (JSG). + # : 020424 - Fixed code typo - changed $cell=0 to $col=0 (LEH). #========================================================================== function show_table_heading_cells($data, $class="") *************** *** 559,563 **** return 0; ! $cell = 0; $d = $this->select_colnames($data); --- 563,567 ---- return 0; ! $col = 0; $d = $this->select_colnames($data); *************** *** 602,606 **** while(list($key, $val) = each($d)) { ! $this->table_cell($row, $cell++, $val, $data[$val], $class); } --- 606,611 ---- while(list($key, $val) = each($d)) { ! if (isset($data[$val])) ! $this->table_cell($row, $cell++, $val, $data[$val], $class); } *************** *** 655,659 **** ## Check for column name remapping ! if ($this->verify_array($this->map_cols)) { reset($this->map_cols); --- 660,664 ---- ## Check for column name remapping ! if (isset($this->map_cols) && $this->verify_array($this->map_cols)) { reset($this->map_cols); *************** *** 834,838 **** printf("<p>select_colnames()<br>\n"); ! if (!is_array($this->fields) && is_array($data)) { reset($data); --- 839,843 ---- printf("<p>select_colnames()<br>\n"); ! if (!(isset($this->fields) && is_array($this->fields)) && is_array($data)) { reset($data); |