Changeset 1067
- Timestamp:
- 08/27/08 00:42:48 (3 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)
- trunk/testapp/modules/jelix_tests/tests/jforms.compiler.html_cli.php (modified) (2 diffs)
- trunk/testapp/modules/jelix_tests/tests/jforms.compiler_1_1.html_cli.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 } trunk/testapp/modules/jelix_tests/tests/jforms.compiler.html_cli.php
r1062 r1067 377 377 $this->addControl($ctrl);', 378 378 26=>'$ctrl= new jFormsControlcheckbox(\'nom\'); 379 $ctrl->datatype= new jDatatypeBoolean();380 379 $ctrl->label=\'Avez-vous un nom ?\'; 381 380 $this->addControl($ctrl);', … … 529 528 $this->addControl($ctrl);', 530 529 49=>'$ctrl= new jFormsControlcheckbox(\'nom\'); 531 $ctrl->datatype= new jDatatypeBoolean();532 530 $ctrl->label=\'Avez-vous un nom ?\'; 533 531 $ctrl->valueOnCheck=\'oui\'; trunk/testapp/modules/jelix_tests/tests/jforms.compiler_1_1.html_cli.php
r1063 r1067 472 472 $this->addControl($ctrl);', 473 473 24=>'$ctrl= new jFormsControlcheckbox(\'nom\'); 474 $ctrl->datatype= new jDatatypeBoolean();475 474 $ctrl->label=\'Avez-vous un nom ?\'; 476 475 $this->addControl($ctrl);', … … 603 602 $this->addControl($ctrl);', 604 603 42=>'$ctrl= new jFormsControlcheckbox(\'nom\'); 605 $ctrl->datatype= new jDatatypeBoolean();606 604 $ctrl->label=\'Avez-vous un nom ?\'; 607 605 $ctrl->valueOnCheck=\'oui\';
