Changeset 1067 for trunk/lib
- Timestamp:
- 08/27/08 00:42:48 (4 months ago)
- Files:
-
- trunk/lib/jelix/forms/jFormsBase.class.php (modified) (1 diff)
- trunk/lib/jelix/forms/jFormsCompiler_jf_1_0.class.php (modified) (1 diff)
- trunk/lib/jelix/forms/jFormsControl.class.php (modified) (1 diff)
- trunk/lib/jelix/plugins/jforms/html/html.jformsbuilder.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix/forms/jFormsBase.class.php
r1060 r1067 665 665 666 666 /** 667 * add a control to the form667 * declare a child control to the form. The given control should be a child of an other control 668 668 * @param $control jFormsControl 669 669 */ 670 p rotectedfunction addChildControl($control){670 public function addChildControl($control){ 671 671 $this->controls [$control->ref] = $control; 672 672 if($control->type =='submit') trunk/lib/jelix/forms/jFormsCompiler_jf_1_0.class.php
r1053 r1067 174 174 175 175 protected function generateCheckbox(&$source, $control, &$attributes) { 176 $source[]='$ctrl->datatype= new jDatatypeBoolean();';177 176 $this->attrDefaultvalue($source, $attributes); 178 177 $this->readLabel($source, $control, 'checkbox'); trunk/lib/jelix/forms/jFormsControl.class.php
r1063 r1067 216 216 public $valueOnUncheck='0'; 217 217 218 function __construct($ref){ 219 $this->ref = $ref; 220 $this->datatype = new jDatatypeBoolean(); 221 } 222 218 223 function check(){ 219 224 $value = $this->container->data[$this->ref]; trunk/lib/jelix/plugins/jforms/html/html.jformsbuilder.php
r1063 r1067 565 565 echo htmlspecialchars($ctrl->itemsNames[$itemName]),'</label> '; 566 566 567 $displayedControls = false; 567 568 foreach($listctrl as $ref=>$c) { 568 if(!$this->_form->isActivated($ref)) continue; 569 if(!$this->_form->isActivated($ref) || $c->type == 'hidden') continue; 570 $displayedControls = true; 569 571 echo ' <span class="jforms-item-controls">'; 570 572 // we remove readonly status so when a user change the choice and … … 579 581 $this->jsContent .="jForms.tControl2.addControl(jForms.tControl, '".str_replace("'","\\'",$itemName)."');\n"; 580 582 } 581 if(! count($listctrl)) {583 if(!$displayedControls) { 582 584 $this->jsContent .="jForms.tControl2.items['".str_replace("'","\\'",$itemName)."']=[];\n"; 583 585 }
