/[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.1 by jonen, Sat Feb 22 21:07:48 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          return $this->_text;          $value = $this->get_value();
61            if ($value != NULL) {
62                return $this->_text;
63            } else {
64                return NULL;
65            }        
66      }      }
67    
68      /**      /**
# Line 93  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 108  class FECheckBoxList extends FEMultiList Line 114  class FECheckBoxList extends FEMultiList
114          }          }
115    
116          $attributes = $this->_build_element_attributes();          $attributes = $this->_build_element_attributes();
117            unset( $attributes["name"] );
118          $c = new DIVtag($attributes);          $c = new DIVtag($attributes);
119    
120          $element_name = $this->get_element_name();          $element_name = $this->get_element_name();
# Line 124  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" => "#",                  $checkbox->set_tag_attribute("disabled");
138                                    "onClick" => $js_action);                  $a = $text;
139              $a = new Atag($a_attributes, $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 139  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.1  
changed lines
  Added in v.1.3

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