[Phplib-commit] CVS: php-lib-stable/php oohforms.inc,1.5,1.6
Brought to you by:
nhruby,
richardarcher
From: Layne W. <lay...@us...> - 2005-02-19 15:22:26
|
Update of /cvsroot/phplib/php-lib-stable/php In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6927/php Modified Files: oohforms.inc Log Message: fixed warning notices by better checking of variables remove use of non-existent $this->method Thanks to Frank Bax for catching these problems Index: oohforms.inc =================================================================== RCS file: /cvsroot/phplib/php-lib-stable/php/oohforms.inc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** oohforms.inc 28 Apr 2002 04:05:30 -0000 1.5 --- oohforms.inc 19 Feb 2005 15:22:16 -0000 1.6 *************** *** 69,76 **** reset($a); while (list($k, $v) = each($a)) { ! if ($cv_tab[$k]=="ignore") { continue; } else { ! $k = ($cv_tab[$k] ? $cv_tab[$k] : $k); } $this->$k = $v; --- 69,76 ---- reset($a); while (list($k, $v) = each($a)) { ! if (!empty($cv_tab[$k]) and ("ignore"==$cv_tab[$k])) { continue; } else { ! $k = ((!empty($cv_tab[$k])) ? $cv_tab[$k] : $k); } $this->$k = $v; *************** *** 82,86 **** class of_hidden extends of_element { ! var $hidden=1; function of_hidden($a) { --- 82,86 ---- class of_hidden extends of_element { ! var $hidden=array(); function of_hidden($a) { *************** *** 206,210 **** $str = ""; ! if ($this->hidden) { reset($this->hidden); while (list($k, $elname) = each($this->hidden)) { --- 206,210 ---- $str = ""; ! if (is_array($this->hidden) and !empty($this->hidden)) { reset($this->hidden); while (list($k, $elname) = each($this->hidden)) { *************** *** 228,232 **** while (list($k, $elrec) = each($this->elements)) { $el = $elrec["ob"]; ! $str .= $el->self_get_js($elrec["ndx_array"]); } if (strlen($after)) { --- 228,232 ---- while (list($k, $elrec) = each($this->elements)) { $el = $elrec["ob"]; ! $str .= $el->self_get_js((!empty($elrec["ndx_array"])) ? $elrec["ndx_array"] : array()); } if (strlen($after)) { *************** *** 250,254 **** $cv_tab = array("select multiple"=>"select", "image"=>"submit"); ! if ($t = $cv_tab[$el["type"]]) { $t = ("of_" . $t); } else { --- 250,254 ---- $cv_tab = array("select multiple"=>"select", "image"=>"submit"); ! if (!empty($cv_tab[$el["type"]]) and $t = $cv_tab[$el["type"]]) { $t = ("of_" . $t); } else { *************** *** 266,274 **** $el = new $t($el); $el->type = $t; # as suggested by Michael Graham (ma...@th...) ! if ($el->isfile) { $this->isfile = true; } $this->elements[$el->name]["ob"] = $el; ! if ($el->hidden) { $this->hidden[] = $el->name; } --- 266,274 ---- $el = new $t($el); $el->type = $t; # as suggested by Michael Graham (ma...@th...) ! if (isset($el->isfile) and $el->isfile) { $this->isfile = true; } $this->elements[$el->name]["ob"] = $el; ! if (isset($el->hidden) and is_array($el->hidden)) { $this->hidden[] = $el->name; } *************** *** 306,310 **** } ! if ($this->elements[$name]["frozen"]) { $str .= $el->self_get_frozen($value, $this->elements[$name]["which"]++, $x); } else { --- 306,310 ---- } ! if (!empty($this->elements[$name]["frozen"])) { $str .= $el->self_get_frozen($value, $this->elements[$name]["which"]++, $x); } else { *************** *** 343,347 **** while ($elrec) { $el = $elrec["ob"]; ! if ($res = $el->marshal_dispatch($this->method, "self_validate")) { return $res; } --- 343,347 ---- while ($elrec) { $el = $elrec["ob"]; ! if ($res = $el->marshal_dispatch("", "self_validate")) { return $res; } *************** *** 367,371 **** while ($elrec) { $el = $elrec["ob"]; ! $el->marshal_dispatch($this->method, "self_load_defaults"); $this->elements[$el->name]["ob"] = $el; // no refs -> must copy back if ($deflist) { --- 367,371 ---- while ($elrec) { $el = $elrec["ob"]; ! $el->marshal_dispatch("", "self_load_defaults"); $this->elements[$el->name]["ob"] = $el; // no refs -> must copy back if ($deflist) { |