35 |
var $selected; |
var $selected; |
36 |
var $table; |
var $table; |
37 |
var $label; |
var $label; |
38 |
|
var $disabled; |
39 |
function widget($p_type="") { |
function widget($p_type="") { |
40 |
$this->type=$p_type; |
$this->type=$p_type; |
41 |
$this->readonly=false; |
$this->readonly=false; |
46 |
$this->selected=""; |
$this->selected=""; |
47 |
$this->table=0; |
$this->table=0; |
48 |
$this->label=""; |
$this->label=""; |
49 |
|
$this->disabled=false; |
50 |
} |
} |
51 |
function SetReadOnly($p_read) { |
function SetReadOnly($p_read) { |
52 |
$this->readonly=$p_read; |
$this->readonly=$p_read; |
66 |
$this->label=($p_label == "")?$this->label:$p_label; |
$this->label=($p_label == "")?$this->label:$p_label; |
67 |
//echo "this->value =".$this->value; |
//echo "this->value =".$this->value; |
68 |
// Input text type |
// Input text type |
69 |
|
$disabled = $this->disabled ? "DISABLED" : ""; |
70 |
if (strtoupper($this->type)=="TEXT") { |
if (strtoupper($this->type)=="TEXT") { |
71 |
if ( $this->readonly==false) { |
if ( $this->readonly==false) { |
72 |
$r="<INPUT TYPE=\"TEXT\" NAME=\"$p_name\" VALUE=\"$p_value\" SIZE=\"$this->size\">";} else { |
$r="<INPUT TYPE=\"TEXT\" NAME=\"$p_name\" VALUE=\"$p_value\" SIZE=\"$this->size\" ".$disabled.">";} else { |
73 |
$r=$this->value; |
$r=$this->value; |
74 |
} |
} |
75 |
if ($this->table==1) { |
if ($this->table==1) { |
134 |
$check=( $this->selected==true )?"checked":"unchecked"; |
$check=( $this->selected==true )?"checked":"unchecked"; |
135 |
$r='<input type="CHECKBOX" name="'.$this->name.'"'; |
$r='<input type="CHECKBOX" name="'.$this->name.'"'; |
136 |
$r.=" $check"; |
$r.=" $check"; |
137 |
$r.='>'; |
$r.=' '.$disabled.'>'; |
138 |
} |
} |
139 |
if ($this->table==1) { |
if ($this->table==1) { |
140 |
$r="<TD> $this->label </TD><TD> $r </TD>"; |
$r="<TD> $this->label </TD><TD> $r </TD>"; |
154 |
$r='<input type="RADIO" name="'.$this->name.'"'; |
$r='<input type="RADIO" name="'.$this->name.'"'; |
155 |
$r.=" VALUE=\"$this->value\""; |
$r.=" VALUE=\"$this->value\""; |
156 |
$r.=" $check"; |
$r.=" $check"; |
157 |
$r.='>'; |
$r.=' '.$disabled.'>'; |
158 |
} |
} |
159 |
if ($this->table==1) { |
if ($this->table==1) { |
160 |
$r="<TD> $this->label </TD><TD> $r </TD>"; |
$r="<TD> $this->label </TD><TD> $r </TD>"; |
170 |
$r='<TEXTAREA name="'.$this->name.'"'; |
$r='<TEXTAREA name="'.$this->name.'"'; |
171 |
$r.=" rows=\"$this->heigh\" "; |
$r.=" rows=\"$this->heigh\" "; |
172 |
$r.=" cols=\"$this->width\" "; |
$r.=" cols=\"$this->width\" "; |
173 |
$r.='>'; |
$r.=' '.$disabled.'>'; |
174 |
$r.=$this->value; |
$r.=$this->value; |
175 |
|
|
176 |
$r.="</TEXTAREA>"; |
$r.="</TEXTAREA>"; |
188 |
//file |
//file |
189 |
if (strtoupper($this->type)=="FILE") { |
if (strtoupper($this->type)=="FILE") { |
190 |
if ( $this->readonly == false ) { |
if ( $this->readonly == false ) { |
191 |
$r='<INPUT TYPE="file" name="'.$this->name.'" >'; |
$r='<INPUT TYPE="file" name="'.$this->name.'" '.$disabled.'>'; |
192 |
|
|
193 |
} |
} |
194 |
if ( $this->table==1) $r="<TD>$this->label</TD><TD>$r</TD>"; |
if ( $this->table==1) $r="<TD>$this->label</TD><TD>$r</TD>"; |