/[cvs]/nfo/php/libs/com.newsblob.phphtmllib/form/form_elements/FECheckBox.inc
ViewVC logotype

Diff of /nfo/php/libs/com.newsblob.phphtmllib/form/form_elements/FECheckBox.inc

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

revision 1.2 by jonen, Sat Sep 20 00:20:15 2003 UTC revision 1.3 by jonen, Thu May 6 16:27:26 2004 UTC
# Line 54  class FECheckBox extends FormElement { Line 54  class FECheckBox extends FormElement {
54       * associated with a field.       * associated with a field.
55       * It is used during Confirmation       * It is used during Confirmation
56       *       *
      * @param mixed - the value to look up  
57       * @return string - the text associated       * @return string - the text associated
58       */       */
59      function get_value_text($value) {      function get_value_text() {
60            $value = $this->get_value();
61          if ($value != NULL) {          if ($value != NULL) {
62              return $this->_text;              return $this->_text;
63          } else {          } else {
# Line 97  class FECheckBox extends FormElement { Line 97  class FECheckBox extends FormElement {
97   */   */
98  class FECheckBoxList extends FEMultiListBox {  class FECheckBoxList extends FEMultiListBox {
99    
100        
101    
102      /**      /**
103       * This function builds and returns the       * This function builds and returns the
104       * form element object       * form element object
# Line 129  class FECheckBoxList extends FEMultiList Line 131  class FECheckBoxList extends FEMultiList
131              if (is_array($selected_values) && in_array($value, $selected_values))              if (is_array($selected_values) && in_array($value, $selected_values))
132                  $attributes[] = "checked";                  $attributes[] = "checked";
133    
               
134              $checkbox = new INPUTtag($attributes);              $checkbox = new INPUTtag($attributes);
135    
136              $js_action = "javascript:elements['" . $name . "'].checked=!elements['".$name."'].checked;";              if (isset($this->_disabled_items[$text])) {
137              $a_attributes = array("href" => "javascript:void(0)",                  $checkbox->set_tag_attribute("disabled");
138                                    "onClick" => $js_action);                  $a = $text;
139              $a = new Atag($a_attributes, htmlspecialchars($text), FALSE);              } else {
140                    $js_action = "javascript:elements['" . $name . "'].checked=!elements['".$name."'].checked;";
141                    $a_attributes = array("href" => "javascript:void(0)",
142                                          "onClick" => $js_action);
143                    $a = new Atag($a_attributes, htmlspecialchars($text), FALSE);
144                }            
145    
146              $check = container( $checkbox, $a );              $check = container( $checkbox, $a );
147              $check->set_collapse();              $check->set_collapse();
# Line 144  class FECheckBoxList extends FEMultiList Line 150  class FECheckBoxList extends FEMultiList
150          }          }
151    
152          return $c;          return $c;
153      }      }    
154    
155  }  }
156  ?>  ?>

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

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed