Changeset 1067 for trunk/lib

Show
Ignore:
Timestamp:
08/27/08 00:42:48 (4 months ago)
Author:
laurentj
Message:

little improvements in jforms

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/jelix/forms/jFormsBase.class.php

    r1060 r1067  
    665665 
    666666    /** 
    667     * add a control to the form 
     667    * declare a child control to the form. The given control should be a child of an other control 
    668668    * @param $control jFormsControl 
    669669    */ 
    670     protected function addChildControl($control){ 
     670    public function addChildControl($control){ 
    671671        $this->controls [$control->ref] = $control; 
    672672        if($control->type =='submit') 
  • trunk/lib/jelix/forms/jFormsCompiler_jf_1_0.class.php

    r1053 r1067  
    174174 
    175175    protected function generateCheckbox(&$source, $control, &$attributes) { 
    176         $source[]='$ctrl->datatype= new jDatatypeBoolean();'; 
    177176        $this->attrDefaultvalue($source, $attributes); 
    178177        $this->readLabel($source, $control, 'checkbox'); 
  • trunk/lib/jelix/forms/jFormsControl.class.php

    r1063 r1067  
    216216    public $valueOnUncheck='0'; 
    217217 
     218    function __construct($ref){ 
     219        $this->ref = $ref; 
     220        $this->datatype = new jDatatypeBoolean(); 
     221    } 
     222 
    218223    function check(){ 
    219224        $value = $this->container->data[$this->ref]; 
  • trunk/lib/jelix/plugins/jforms/html/html.jformsbuilder.php

    r1063 r1067  
    565565            echo htmlspecialchars($ctrl->itemsNames[$itemName]),'</label> '; 
    566566 
     567            $displayedControls = false; 
    567568            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; 
    569571                echo ' <span class="jforms-item-controls">'; 
    570572                // we remove readonly status so when a user change the choice and  
     
    579581                $this->jsContent .="jForms.tControl2.addControl(jForms.tControl, '".str_replace("'","\\'",$itemName)."');\n"; 
    580582            } 
    581             if(!count($listctrl)) { 
     583            if(!$displayedControls) { 
    582584                $this->jsContent .="jForms.tControl2.items['".str_replace("'","\\'",$itemName)."']=[];\n"; 
    583585            } 
Download in other formats: Unified Diff Zip Archive