/[phpcompta]/phpcompta/include/class_widget.php
ViewVC logotype

Diff of /phpcompta/include/class_widget.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by sparkyx, Thu Nov 25 23:30:14 2004 UTC revision 1.2 by stanpinte, Sun Mar 6 17:33:44 2005 UTC
# Line 35  class widget { Line 35  class widget {
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;
# Line 45  class widget { Line 46  class widget {
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;
# Line 64  class widget { Line 66  class widget {
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) {
# Line 131  class widget { Line 134  class widget {
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>";
# Line 151  class widget { Line 154  class widget {
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>";
# Line 167  class widget { Line 170  class widget {
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>";
# Line 185  class widget { Line 188  class widget {
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>";

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26