Changeset 1065

Show
Ignore:
Timestamp:
08/26/08 22:32:11 (4 months ago)
Author:
laurentj
Message:

jforms: group and choice is now allowed to not have children in the xml file

Files:

Legend:

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

    r1063 r1065  
    125125        $source[]='$topctrl = $ctrl;'; 
    126126        $ctrlcount = $this->readChildControls($source, 'group', $control, array('label')); 
    127         if ($ctrlcount == 0) { 
     127        /*if ($ctrlcount == 0) { 
    128128             throw new jException('jelix~formserr.no.child.control',array('group',$this->sourceFile)); 
    129         } 
     129        }*/ 
    130130        $source[]='$ctrl = $topctrl;'; 
    131131        return false; 
     
    146146        } 
    147147 
    148         $itemCount = 0; 
     148        //$itemCount = 0; 
    149149        foreach($control->item as $item){ 
    150150            if(!isset($item['value'])){ 
     
    177177 
    178178            $ctrlcount = $this->readChildControls($source, 'choice', $item, array('label'), str_replace("'","\\'",$value)); 
    179             $itemCount ++; 
    180         } 
    181  
    182         if ($itemCount == 0) { 
     179            //$itemCount ++; 
     180        } 
     181 
     182        /*if ($itemCount == 0) { 
    183183            throw new jException('jelix~formserr.no.child.control',array('choice',$this->sourceFile)); 
    184         } 
     184        }*/ 
    185185 
    186186        $source[]='$topctrl->defaultValue=\''.str_replace('\'','\\\'',$selectedvalue).'\';'; 
Download in other formats: Unified Diff Zip Archive