[PHPVortex-Commit] phpvortex FT_Base.class.php,1.5,1.6
Brought to you by:
nop144666
From: Thiago R. <nop...@us...> - 2004-09-30 19:33:16
|
Update of /cvsroot/phpvortex/phpvortex In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5279 Modified Files: FT_Base.class.php Log Message: Fixed a circular reference problem and some bugs in FT_Base Index: FT_Base.class.php =================================================================== RCS file: /cvsroot/phpvortex/phpvortex/FT_Base.class.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FT_Base.class.php 30 Sep 2004 14:26:01 -0000 1.5 --- FT_Base.class.php 30 Sep 2004 19:33:06 -0000 1.6 *************** *** 19,27 **** { /** ! * Table which the field comes from. * ! * @var TB_Base */ ! var $table; /** --- 19,27 ---- { /** ! * Database where the field is. * ! * @var DB_Base */ ! var $db; /** *************** *** 80,89 **** * Constructor: Load all parameters into member variables. * ! * @param TB_Base $table Table which the field comes from. * @param array $opts Parameters for the object, as 'var' => 'value'. */ ! function FT_Base(&$table, $opts = array()) { ! $this->table =& $table; foreach ($opts as $key => $value) { $this->$key = $value; --- 80,89 ---- * Constructor: Load all parameters into member variables. * ! * @param DB_Base $db Database where the field is. * @param array $opts Parameters for the object, as 'var' => 'value'. */ ! function FT_Base(&$db, $opts = array()) { ! $this->db =& $db; foreach ($opts as $key => $value) { $this->$key = $value; *************** *** 97,108 **** * Output the field as a HTML Form or just for display. * * @param bool $form Show field as a INPUT object? */ ! function Show($form = TRUE) { ! if (empty($this->table->data) || !isset($this->table->data[$this->name_form])) { $value = $this->default; } else { ! $value = $this->table->data[$this->name_form]; } if ($form) { --- 97,109 ---- * Output the field as a HTML Form or just for display. * + * @param TB_Base $table Table where the field is. * @param bool $form Show field as a INPUT object? */ ! function Show(&$table, $form = TRUE) { ! if (empty($table->data) || !isset($table->data[$this->name_form])) { $value = $this->default; } else { ! $value = $table->data[$this->name_form]; } if ($form) { *************** *** 161,166 **** } $field =& $vars[$this->name_form]; ! if (!ConsistTest($field)) return FALSE; ! return ConsistFormat($field); } --- 162,167 ---- } $field =& $vars[$this->name_form]; ! if (!$this->ConsistTest($field)) return FALSE; ! return $this->ConsistFormat($field); } *************** *** 184,188 **** function ConsistFormat(&$field) { ! return "'".$this->table->db->AddSlashes($field)."'"; } } --- 185,189 ---- function ConsistFormat(&$field) { ! return "'".$this->db->AddSlashes($field)."'"; } } |