Changeset 906

Show
Ignore:
Timestamp:
04/26/08 15:40:57 (4 months ago)
Author:
laurentj
Message:

improvements in the code of jFormsBase and jFormsCompiler. Fixed also a little bug in forms.css : span with jforms-required class was not styled

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/jelix-www/design/jform.css

    r891 r906  
    88.jforms-value {} 
    99 
    10 label.jforms-required { font-weight:bold; } 
    11 label.jforms-required:after { content:"*"; font-weight:bold; color:red; } 
     10span.jforms-required, label.jforms-required { font-weight:bold; } 
     11label.jforms-required:after, span.jforms-required:after { content:"*"; font-weight:bold; color:red; } 
    1212 
    1313.jforms-error-list { color:red; border:1px solid red;} 
  • trunk/lib/jelix-www/design/jform.css

    r891 r906  
    88.jforms-value {} 
    99 
    10 label.jforms-required { font-weight:bold; } 
    11 label.jforms-required:after { content:"*"; font-weight:bold; color:red; } 
     10span.jforms-required, label.jforms-required { font-weight:bold; } 
     11label.jforms-required:after, span.jforms-required:after { content:"*"; font-weight:bold; color:red; } 
    1212 
    1313.jforms-error-list { color:red; border:1px solid red;} 
  • trunk/lib/jelix-www/design/jform.css

    r891 r906  
    88.jforms-value {} 
    99 
    10 label.jforms-required { font-weight:bold; } 
    11 label.jforms-required:after { content:"*"; font-weight:bold; color:red; } 
     10span.jforms-required, label.jforms-required { font-weight:bold; } 
     11label.jforms-required:after, span.jforms-required:after { content:"*"; font-weight:bold; color:red; } 
    1212 
    1313.jforms-error-list { color:red; border:1px solid red;} 
  • trunk/lib/jelix-www/design/jform.css

    r891 r906  
    88.jforms-value {} 
    99 
    10 label.jforms-required { font-weight:bold; } 
    11 label.jforms-required:after { content:"*"; font-weight:bold; color:red; } 
     10span.jforms-required, label.jforms-required { font-weight:bold; } 
     11label.jforms-required:after, span.jforms-required:after { content:"*"; font-weight:bold; color:red; } 
    1212 
    1313.jforms-error-list { color:red; border:1px solid red;} 
  • trunk/lib/jelix/forms/jFormsBase.class.php

    r895 r906  
    66* @contributor Dominique Papin 
    77* @contributor Bastien Jaillot 
    8 * @copyright   2006-2007 Laurent Jouanneau, 2007 Dominique Papin, 2008 Bastien Jaillot 
    9 * @copyright   2006-2008 Laurent Jouanneau, 2007 Dominique Papin 
     8* @copyright   2006-2008 Laurent Jouanneau, 2007 Dominique Papin, 2008 Bastien Jaillot 
    109* @link        http://www.jelix.org 
    1110* @licence     http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 
     
    136135                continue; 
    137136            $value = $req->getParam($name); 
     137 
    138138            //@todo à prevoir un meilleur test, pour les formulaires sur plusieurs pages 
    139139            if($value === null) $value=''; 
    140             if($ctrl->type=='checkbox'){ 
    141                 if($value){ 
    142                     $value = $ctrl->valueOnCheck; 
    143                 }else{ 
    144                     $value = $ctrl->valueOnUncheck; 
    145                 } 
    146             }elseif($ctrl->type=='upload'){ 
    147                 if(isset($_FILES[$name])){ 
    148                     $value = $_FILES[$name]['name']; 
    149                 }else{ 
    150                     $value= ''; 
    151                 } 
    152             }elseif($ctrl->type=='submit' && $value && !$ctrl->standalone) { 
    153                 // because IE send the <button> content as value instead of the content of the 
    154                 // "value" attribute, we should verify it and get the real value 
    155                 // or when using <input type="submit">, we have only the label as value (in all browsers... 
    156                 $data = $ctrl->datasource->getData(); 
    157                 if(!isset($data[$value])) { 
    158                     $data=array_flip($data); 
    159                     if(isset($data[$value])) { 
    160                         $value = $data[$value]; 
    161                     } 
    162                 } 
    163             } 
     140 
     141            $value = $ctrl->getValueFromRequest($this, $value); 
     142 
    164143            if($this->_container->data[$name] != $value) 
    165144                $this->_modifiedControls[$name] = $this->_container->data[$name]; 
     
    206185        foreach($this->_controls as $name=>$ctrl){ 
    207186            if(isset($prop[$name])) { 
    208                 if($ctrl->datatype instanceof jDatatypeLocaleDateTime 
    209                    && $prop[$name]['datatype'] == 'datetime') { 
    210                     if($daorec->$name != '') { 
    211                         $dt = new jDateTime(); 
    212                         $dt->setFromString($daorec->$name, jDateTime::DB_DTFORMAT); 
    213                         $this->_container->data[$name] = $dt->toString(jDateTime::LANG_DTFORMAT); 
    214                     } else { 
    215                         $this->_container->data[$name] =''; 
    216                     } 
    217                 }elseif($ctrl->datatype instanceof jDatatypeLocaleDate 
    218                         && $prop[$name]['datatype'] == 'date') { 
    219                     if($daorec->$name != '') { 
    220                         $dt = new jDateTime(); 
    221                         $dt->setFromString($daorec->$name, jDateTime::DB_DFORMAT); 
    222                         $this->_container->data[$name] = $dt->toString(jDateTime::LANG_DFORMAT); 
    223                     } else { 
    224                         $this->_container->data[$name] =''; 
    225                     } 
    226                 }elseif($ctrl->type=='checkbox' && $prop[$name]['datatype'] == 'boolean') { 
    227                     if($daorec->$name == 'TRUE'||  $daorec->$name == 't'|| $daorec->$name == '1'||$daorec->$name == true){ 
    228                         $this->_container->data[$name] = $ctrl->valueOnCheck; 
    229                     }else { 
    230                         $this->_container->data[$name] = $ctrl->valueOnUncheck; 
    231                     } 
    232                 }else{ 
    233                     $this->_container->data[$name] = $daorec->$name; 
    234                 } 
     187                $this->_container->data[$name] = $ctrl->prepareValueFromDao($daorec->$name, $prop[$name]['datatype']); 
    235188            } 
    236189        } 
     
    238191 
    239192    /** 
    240      * prepare a dao whith filled by all controls 
     193     * prepare a dao with values of all controls 
    241194     * @param string $daoSelector the selector of a dao file 
    242195     * @param string $key the primary key for the dao. if null, takes the form ID as primary key 
  • trunk/lib/jelix/forms/jFormsBase.class.php

    r895 r906  
    66* @contributor Dominique Papin 
    77* @contributor Bastien Jaillot 
    8 * @copyright   2006-2007 Laurent Jouanneau, 2007 Dominique Papin, 2008 Bastien Jaillot 
    9 * @copyright   2006-2008 Laurent Jouanneau, 2007 Dominique Papin 
     8* @copyright   2006-2008 Laurent Jouanneau, 2007 Dominique Papin, 2008 Bastien Jaillot 
    109* @link        http://www.jelix.org 
    1110* @licence     http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 
     
    136135                continue; 
    137136            $value = $req->getParam($name); 
     137 
    138138            //@todo à prevoir un meilleur test, pour les formulaires sur plusieurs pages 
    139139            if($value === null) $value=''; 
    140             if($ctrl->type=='checkbox'){ 
    141                 if($value){ 
    142                     $value = $ctrl->valueOnCheck; 
    143                 }else{ 
    144                     $value = $ctrl->valueOnUncheck; 
    145                 } 
    146             }elseif($ctrl->type=='upload'){ 
    147                 if(isset($_FILES[$name])){ 
    148                     $value = $_FILES[$name]['name']; 
    149                 }else{ 
    150                     $value= ''; 
    151                 } 
    152             }elseif($ctrl->type=='submit' && $value && !$ctrl->standalone) { 
    153                 // because IE send the <button> content as value instead of the content of the 
    154                 // "value" attribute, we should verify it and get the real value 
    155                 // or when using <input type="submit">, we have only the label as value (in all browsers... 
    156                 $data = $ctrl->datasource->getData(); 
    157                 if(!isset($data[$value])) { 
    158                     $data=array_flip($data); 
    159                     if(isset($data[$value])) { 
    160                         $value = $data[$value]; 
    161                     } 
    162                 } 
    163             } 
     140 
     141            $value = $ctrl->getValueFromRequest($this, $value); 
     142 
    164143            if($this->_container->data[$name] != $value) 
    165144                $this->_modifiedControls[$name] = $this->_container->data[$name]; 
     
    206185        foreach($this->_controls as $name=>$ctrl){ 
    207186            if(isset($prop[$name])) { 
    208                 if($ctrl->datatype instanceof jDatatypeLocaleDateTime 
    209                    && $prop[$name]['datatype'] == 'datetime') { 
    210                     if($daorec->$name != '') { 
    211                         $dt = new jDateTime(); 
    212                         $dt->setFromString($daorec->$name, jDateTime::DB_DTFORMAT); 
    213                         $this->_container->data[$name] = $dt->toString(jDateTime::LANG_DTFORMAT); 
    214                     } else { 
    215                         $this->_container->data[$name] =''; 
    216                     } 
    217                 }elseif($ctrl->datatype instanceof jDatatypeLocaleDate 
    218                         && $prop[$name]['datatype'] == 'date') { 
    219                     if($daorec->$name != '') { 
    220                         $dt = new jDateTime(); 
    221                         $dt->setFromString($daorec->$name, jDateTime::DB_DFORMAT); 
    222                         $this->_container->data[$name] = $dt->toString(jDateTime::LANG_DFORMAT); 
    223                     } else { 
    224                         $this->_container->data[$name] =''; 
    225                     } 
    226                 }elseif($ctrl->type=='checkbox' && $prop[$name]['datatype'] == 'boolean') { 
    227                     if($daorec->$name == 'TRUE'||  $daorec->$name == 't'|| $daorec->$name == '1'||$daorec->$name == true){ 
    228                         $this->_container->data[$name] = $ctrl->valueOnCheck; 
    229                     }else { 
    230                         $this->_container->data[$name] = $ctrl->valueOnUncheck; 
    231                     } 
    232                 }else{ 
    233                     $this->_container->data[$name] = $daorec->$name; 
    234                 } 
     187                $this->_container->data[$name] = $ctrl->prepareValueFromDao($daorec->$name, $prop[$name]['datatype']); 
    235188            } 
    236189        } 
     
    238191 
    239192    /** 
    240      * prepare a dao whith filled by all controls 
     193     * prepare a dao with values of all controls 
    241194     * @param string $daoSelector the selector of a dao file 
    242195     * @param string $key the primary key for the dao. if null, takes the form ID as primary key 
  • trunk/lib/jelix/forms/jFormsBase.class.php

    r895 r906  
    66* @contributor Dominique Papin 
    77* @contributor Bastien Jaillot 
    8 * @copyright   2006-2007 Laurent Jouanneau, 2007 Dominique Papin, 2008 Bastien Jaillot 
    9 * @copyright   2006-2008 Laurent Jouanneau, 2007 Dominique Papin 
     8* @copyright   2006-2008 Laurent Jouanneau, 2007 Dominique Papin, 2008 Bastien Jaillot 
    109* @link        http://www.jelix.org 
    1110* @licence     http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 
     
    136135                continue; 
    137136            $value = $req->getParam($name); 
     137 
    138138            //@todo à prevoir un meilleur test, pour les formulaires sur plusieurs pages 
    139139            if($value === null) $value=''; 
    140             if($ctrl->type=='checkbox'){ 
    141                 if($value){ 
    142                     $value = $ctrl->valueOnCheck; 
    143                 }else{ 
    144                     $value = $ctrl->valueOnUncheck; 
    145                 } 
    146             }elseif($ctrl->type=='upload'){ 
    147                 if(isset($_FILES[$name])){ 
    148                     $value = $_FILES[$name]['name']; 
    149                 }else{ 
    150                     $value= ''; 
    151                 } 
    152             }elseif($ctrl->type=='submit' && $value && !$ctrl->standalone) { 
    153                 // because IE send the <button> content as value instead of the content of the 
    154                 // "value" attribute, we should verify it and get the real value 
    155                 // or when using <input type="submit">, we have only the label as value (in all browsers... 
    156                 $data = $ctrl->datasource->getData(); 
    157                 if(!isset($data[$value])) { 
    158                     $data=array_flip($data); 
    159                     if(isset($data[$value])) { 
    160                         $value = $data[$value]; 
    161                     } 
    162                 } 
    163             } 
     140 
     141            $value = $ctrl->getValueFromRequest($this, $value); 
     142 
    164143            if($this->_container->data[$name] != $value) 
    165144                $this->_modifiedControls[$name] = $this->_container->data[$name]; 
     
    206185        foreach($this->_controls as $name=>$ctrl){ 
    207186            if(isset($prop[$name])) { 
    208                 if($ctrl->datatype instanceof jDatatypeLocaleDateTime 
    209                    && $prop[$name]['datatype'] == 'datetime') { 
    210                     if($daorec->$name != '') { 
    211                         $dt = new jDateTime(); 
    212                         $dt->setFromString($daorec->$name, jDateTime::DB_DTFORMAT); 
    213                         $this->_container->data[$name] = $dt->toString(jDateTime::LANG_DTFORMAT); 
    214                     } else { 
    215                         $this->_container->data[$name] =''; 
    216                     } 
    217                 }elseif($ctrl->datatype instanceof jDatatypeLocaleDate 
    218                         && $prop[$name]['datatype'] == 'date') { 
    219                     if($daorec->$name != '') { 
    220                         $dt = new jDateTime(); 
    221                         $dt->setFromString($daorec->$name, jDateTime::DB_DFORMAT); 
    222                         $this->_container->data[$name] = $dt->toString(jDateTime::LANG_DFORMAT); 
    223                     } else { 
    224                         $this->_container->data[$name] =''; 
    225                     } 
    226                 }elseif($ctrl->type=='checkbox' && $prop[$name]['datatype'] == 'boolean') { 
    227                     if($daorec->$name == 'TRUE'||  $daorec->$name == 't'|| $daorec->$name == '1'||$daorec->$name == true){ 
    228                         $this->_container->data[$name] = $ctrl->valueOnCheck; 
    229                     }else { 
    230                         $this->_container->data[$name] = $ctrl->valueOnUncheck; 
    231                     } 
    232                 }else{ 
    233                     $this->_container->data[$name] = $daorec->$name; 
    234                 } 
     187                $this->_container->data[$name] = $ctrl->prepareValueFromDao($daorec->$name, $prop[$name]['datatype']); 
    235188            } 
    236189        } 
     
    238191 
    239192    /** 
    240      * prepare a dao whith filled by all controls 
     193     * prepare a dao with values of all controls 
    241194     * @param string $daoSelector the selector of a dao file 
    242195     * @param string $key the primary key for the dao. if null, takes the form ID as primary key 
  • trunk/lib/jelix/forms/jFormsBase.class.php

    r895 r906  
    66* @contributor Dominique Papin 
    77* @contributor Bastien Jaillot 
    8 * @copyright   2006-2007 Laurent Jouanneau, 2007 Dominique Papin, 2008 Bastien Jaillot 
    9 * @copyright   2006-2008 Laurent Jouanneau, 2007 Dominique Papin 
     8* @copyright   2006-2008 Laurent Jouanneau, 2007 Dominique Papin, 2008 Bastien Jaillot 
    109* @link        http://www.jelix.org 
    1110* @licence     http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 
     
    136135                continue; 
    137136            $value = $req->getParam($name); 
     137 
    138138            //@todo à prevoir un meilleur test, pour les formulaires sur plusieurs pages 
    139139            if($value === null) $value=''; 
    140             if($ctrl->type=='checkbox'){ 
    141                 if($value){ 
    142                     $value = $ctrl->valueOnCheck; 
    143                 }else{ 
    144                     $value = $ctrl->valueOnUncheck; 
    145                 } 
    146             }elseif($ctrl->type=='upload'){ 
    147                 if(isset($_FILES[$name])){ 
    148                     $value = $_FILES[$name]['name']; 
    149                 }else{ 
    150                     $value= ''; 
    151                 } 
    152             }elseif($ctrl->type=='submit' && $value && !$ctrl->standalone) { 
    153                 // because IE send the <button> content as value instead of the content of the 
    154                 // "value" attribute, we should verify it and get the real value 
    155                 // or when using <input type="submit">, we have only the label as value (in all browsers... 
    156                 $data = $ctrl->datasource->getData(); 
    157                 if(!isset($data[$value])) { 
    158                     $data=array_flip($data); 
    159                     if(isset($data[$value])) { 
    160                         $value = $data[$value]; 
    161                     } 
    162                 } 
    163             } 
     140 
     141            $value = $ctrl->getValueFromRequest($this, $value); 
     142 
    164143            if($this->_container->data[$name] != $value) 
    165144                $this->_modifiedControls[$name] = $this->_container->data[$name]; 
     
    206185        foreach($this->_controls as $name=>$ctrl){ 
    207186            if(isset($prop[$name])) { 
    208                 if($ctrl->datatype instanceof jDatatypeLocaleDateTime 
    209                    && $prop[$name]['datatype'] == 'datetime') { 
    210                     if($daorec->$name != '') { 
    211                         $dt = new jDateTime(); 
    212                         $dt->setFromString($daorec->$name, jDateTime::DB_DTFORMAT); 
    213                         $this->_container->data[$name] = $dt->toString(jDateTime::LANG_DTFORMAT); 
    214                     } else { 
    215                         $this->_container->data[$name] =''; 
    216                     } 
    217                 }elseif($ctrl->datatype instanceof jDatatypeLocaleDate 
    218                         && $prop[$name]['datatype'] == 'date') { 
    219                     if($daorec->$name != '') { 
    220                         $dt = new jDateTime(); 
    221                         $dt->setFromString($daorec->$name, jDateTime::DB_DFORMAT); 
    222                         $this->_container->data[$name] = $dt->toString(jDateTime::LANG_DFORMAT); 
    223                     } else { 
    224                         $this->_container->data[$name] =''; 
    225                     } 
    226                 }elseif($ctrl->type=='checkbox' && $prop[$name]['datatype'] == 'boolean') { 
    227                     if($daorec->$name == 'TRUE'||  $daorec->$name == 't'|| $daorec->$name == '1'||$daorec->$name == true){ 
    228                         $this->_container->data[$name] = $ctrl->valueOnCheck; 
    229                     }else { 
    230                         $this->_container->data[$name] = $ctrl->valueOnUncheck; 
    231                     } 
    232                 }else{ 
    233                     $this->_container->data[$name] = $daorec->$name; 
    234                 } 
     187                $this->_container->data[$name] = $ctrl->prepareValueFromDao($daorec->$name, $prop[$name]['datatype']); 
    235188            } 
    236189        } 
     
    238191 
    239192    /** 
    240      * prepare a dao whith filled by all controls 
     193     * prepare a dao with values of all controls 
    241194     * @param string $daoSelector the selector of a dao file 
    242195     * @param string $key the primary key for the dao. if null, takes the form ID as primary key 
  • trunk/lib/jelix/forms/jFormsCompiler.class.php

    r895 r906  
    2424    protected $sourceFile; 
    2525 
    26     protected $doubleControl; 
    27  
    2826    public function compile($selector){ 
    2927        global $gJCoord; 
     
    10199 
    102100    protected function generatePHPControl($controltype, $control){ 
    103         $this->doubleControl = false; 
    104101        $source = array(); 
    105102        $class = 'jFormsControl'.$controltype; 
     
    122119        unset($attributes['ref']); 
    123120 
    124         $name='generate'.$controltype; 
    125         $this->$name($source, $control, $attributes); 
     121        $doublecontrol = $this->{'generate'.$controltype}($source, $control, $attributes); 
    126122 
    127123        if(count($attributes)) { 
     
    131127 
    132128        $source[]='$this->addControl($ctrl);'; 
    133         if ($this->doubleControl) 
     129        if ($doublecontrol) 
    134130            $source[]='$this->addControl($ctrl2);'; 
    135131        return implode("\n", $source); 
     
    170166        $this->readHelpHintAlert($source, $control); 
    171167        $this->attrSize($source, $attributes); 
     168        return false; 
    172169    } 
    173170 
     
    180177            unset($attributes['type']); 
    181178        } 
    182         $this->_generateTextareaHtmlEditor($source, $control, $attributes); 
     179        return $this->_generateTextareaHtmlEditor($source, $control, $attributes); 
    183180    } 
    184181 
     
    211208            unset($attributes['cols']); 
    212209        } 
     210        return false; 
    213211    } 
    214212 
     
    224222            unset($attributes['skin']); 
    225223        } 
     224        return false; 
    226225    } 
    227226 
     
    230229        $this->readLabel($source, $control, 'output'); 
    231230        $this->readHelpHintAlert($source, $control); 
     231        return false; 
    232232    } 
    233233 
     
    236236        $this->readHelpHintAlert($source, $control); 
    237237        $this->readDatasource($source, $control, 'submit', $attributes); 
     238        return false; 
    238239    } 
    239240 
     
    243244        $this->readLabel($source, $control, 'reset'); 
    244245        $this->readHelpHintAlert($source, $control); 
     246        return false; 
    245247    } 
    246248 
     
    259261            unset($attributes['valueonuncheck']); 
    260262        } 
     263        return false; 
    261264    } 
    262265 
    263266    protected function generateHidden(&$source, $control, &$attributes) { 
    264267        $this->attrDefaultvalue($source, $attributes); 
     268        return false; 
    265269    } 
    266270 
     
    272276        $hasSelectedValues = $this->readSelectedValue($source, $control, 'checkboxes', $attributes); 
    273277        $this->readDatasource($source, $control, 'checkboxes', $attributes, $hasSelectedValues); 
     278        return false; 
    274279    } 
    275280 
     
    281286        $hasSelectedValues = $this->readSelectedValue($source, $control, 'radiobuttons', $attributes); 
    282287        $this->readDatasource($source, $control, 'radiobuttons', $attributes, $hasSelectedValues); 
     288        return false; 
    283289    } 
    284290 
     
    290296        $hasSelectedValues = $this->readSelectedValue($source, $control, 'menulist', $attributes); 
    291297        $this->readDatasource($source, $control, 'menulist', $attributes, $hasSelectedValues); 
     298        return false; 
    292299    } 
    293300 
     
    305312            unset($attributes['multiple']); 
    306313        } 
     314        return false; 
    307315    } 
    308316 
     
    342350                $source[]='$ctrl2->size=$ctrl->size;'; 
    343351            } 
    344             $this->doubleControl = true; 
    345         } 
     352            return true; 
     353        } 
     354        return false; 
    346355    } 
    347356 
     
    363372            unset($attributes['mimetype']); 
    364373        } 
     374        return false; 
    365375    } 
    366376 
     
    368378        $this->readLabel($source, $control, 'captcha'); 
    369379        $this->readHelpHintAlert($source, $control); 
     380        return false; 
    370381    } 
    371382 
  • trunk/lib/jelix/forms/jFormsCompiler.class.php

    r895 r906  
    2424    protected $sourceFile; 
    2525 
    26     protected $doubleControl; 
    27  
    2826    public function compile($selector){ 
    2927        global $gJCoord; 
     
    10199 
    102100    protected function generatePHPControl($controltype, $control){ 
    103         $this->doubleControl = false; 
    104101        $source = array(); 
    105102        $class = 'jFormsControl'.$controltype; 
     
    122119        unset($attributes['ref']); 
    123120 
    124         $name='generate'.$controltype; 
    125         $this->$name($source, $control, $attributes); 
     121        $doublecontrol = $this->{'generate'.$controltype}($source, $control, $attributes); 
    126122 
    127123        if(count($attributes)) { 
     
    131127 
    132128        $source[]='$this->addControl($ctrl);'; 
    133         if ($this->doubleControl) 
     129        if ($doublecontrol) 
    134130            $source[]='$this->addControl($ctrl2);'; 
    135131        return implode("\n", $source); 
     
    170166        $this->readHelpHintAlert($source, $control); 
    171167        $this->attrSize($source, $attributes); 
     168        return false; 
    172169    } 
    173170 
     
    180177            unset($attributes['type']); 
    181178        } 
    182         $this->_generateTextareaHtmlEditor($source, $control, $attributes); 
     179        return $this->_generateTextareaHtmlEditor($source, $control, $attributes); 
    183180    } 
    184181 
     
    211208            unset($attributes['cols']); 
    212209        } 
     210        return false; 
    213211    } 
    214212 
     
    224222            unset($attributes['skin']); 
    225223        } 
     224        return false; 
    226225    } 
    227226 
     
    230229        $this->readLabel($source, $control, 'output'); 
    231230        $this->readHelpHintAlert($source, $control); 
     231        return false; 
    232232    } 
    233233 
     
    236236        $this->readHelpHintAlert($source, $control); 
    237237        $this->readDatasource($source, $control, 'submit', $attributes); 
     238        return false; 
    238239    } 
    239240 
     
    243244        $this->readLabel($source, $control, 'reset'); 
    244245        $this->readHelpHintAlert($source, $control); 
     246        return false; 
    245247    } 
    246248 
     
    259261            unset($attributes['valueonuncheck']); 
    260262        } 
     263        return false; 
    261264    } 
    262265 
    263266    protected function generateHidden(&$source, $control, &$attributes) { 
    264267        $this->attrDefaultvalue($source, $attributes); 
     268        return false; 
    265269    } 
    266270 
     
    272276        $hasSelectedValues = $this->readSelectedValue($source, $control, 'checkboxes', $attributes); 
    273277        $this->readDatasource($source, $control, 'checkboxes', $attributes, $hasSelectedValues); 
     278        return false; 
    274279    } 
    275280 
     
    281286        $hasSelectedValues = $this->readSelectedValue($source, $control, 'radiobuttons', $attributes); 
    282287        $this->readDatasource($source, $control, 'radiobuttons', $attributes, $hasSelectedValues); 
     288        return false; 
    283289    } 
    284290 
     
    290296        $hasSelectedValues = $this->readSelectedValue($source, $control, 'menulist', $attributes); 
    291297        $this->readDatasource($source, $control, 'menulist', $attributes, $hasSelectedValues); 
     298        return false; 
    292299    } 
    293300 
     
    305312            unset($attributes['multiple']); 
    306313        } 
     314        return false; 
    307315    } 
    308316 
     
    342350                $source[]='$ctrl2->size=$ctrl->size;'; 
    343351            } 
    344             $this->doubleControl = true; 
    345         } 
     352            return true; 
     353        } 
     354        return false; 
    346355    } 
    347356 
     
    363372            unset($attributes['mimetype']); 
    364373        } 
     374        return false; 
    365375    } 
    366376 
     
    368378        $this->readLabel($source, $control, 'captcha'); 
    369379        $this->readHelpHintAlert($source, $control); 
     380        return false; 
    370381    } 
    371382 
  • trunk/lib/jelix/forms/jFormsCompiler.class.php

    r895 r906  
    2424    protected $sourceFile; 
    2525 
    26     protected $doubleControl; 
    27  
    2826    public function compile($selector){ 
    2927        global $gJCoord; 
     
    10199 
    102100    protected function generatePHPControl($controltype, $control){ 
    103         $this->doubleControl = false; 
    104101        $source = array(); 
    105102        $class = 'jFormsControl'.$controltype; 
     
    122119        unset($attributes['ref']); 
    123120 
    124         $name='generate'.$controltype; 
    125         $this->$name($source, $control, $attributes); 
     121        $doublecontrol = $this->{'generate'.$controltype}($source, $control, $attributes); 
    126122 
    127123        if(count($attributes)) { 
     
    131127 
    132128        $source[]='$this->addControl($ctrl);'; 
    133         if ($this->doubleControl) 
     129        if ($doublecontrol) 
    134130            $source[]='$this->addControl($ctrl2);'; 
    135131        return implode("\n", $source); 
     
    170166        $this->readHelpHintAlert($source, $control); 
    171167        $this->attrSize($source, $attributes); 
     168        return false; 
    172169    } 
    173170 
     
    180177            unset($attributes['type']); 
    181178        } 
    182         $this->_generateTextareaHtmlEditor($source, $control, $attributes); 
     179        return $this->_generateTextareaHtmlEditor($source, $control, $attributes); 
    183180    } 
    184181 
     
    211208            unset($attributes['cols']); 
    212209        } 
     210        return false; 
    213211    } 
    214212 
     
    224222            unset($attributes['skin']); 
    225223        } 
     224        return false; 
    226225    } 
    227226 
     
    230229        $this->readLabel($source, $control, 'output'); 
    231230        $this->readHelpHintAlert($source, $control); 
     231        return false; 
    232232    } 
    233233 
     
    236236        $this->readHelpHintAlert($source, $control); 
    237237        $this->readDatasource($source, $control, 'submit', $attributes); 
     238        return false; 
    238239    } 
    239240 
     
    243244        $this->readLabel($source, $control, 'reset'); 
    244245        $this->readHelpHintAlert($source, $control); 
     246        return false; 
    245247    } 
    246248 
     
    259261            unset($attributes['valueonuncheck']); 
    260262        } 
     263        return false; 
    261264    } 
    262265 
    263266    protected function generateHidden(&$source, $control, &$attributes) { 
    264267        $this->attrDefaultvalue($source, $attributes); 
     268        return false; 
    265269    } 
    266270 
     
    272276        $hasSelectedValues = $this->readSelectedValue($source, $control, 'checkboxes', $attributes); 
    273277        $this->readDatasource($source, $control, 'checkboxes', $attributes, $hasSelectedValues); 
     278        return false; 
    274279    } 
    275280 
     
    281286        $hasSelectedValues = $this->readSelectedValue($source, $control, 'radiobuttons', $attributes); 
    282287        $this->readDatasource($source, $control, 'radiobuttons', $attributes, $hasSelectedValues); 
     288        return false; 
    283289    } 
    284290 
     
    290296        $hasSelectedValues = $this->readSelectedValue($source, $control, 'menulist', $attributes); 
    291297        $this->readDatasource($source, $control, 'menulist', $attributes, $hasSelectedValues); 
     298        return false; 
    292299    } 
    293300 
     
    305312            unset($attributes['multiple']); 
    306313        } 
     314        return false; 
    307315    } 
    308316 
     
    342350                $source[]='$ctrl2->size=$ctrl->size;'; 
    343351            } 
    344             $this->doubleControl = true; 
    345         } 
     352            return true; 
     353        } 
     354        return false; 
    346355    } 
    347356 
     
    363372            unset($attributes['mimetype']); 
    364373        } 
     374        return false; 
    365375    } 
    366376 
     
    368378        $this->readLabel($source, $control, 'captcha'); 
    369379        $this->readHelpHintAlert($source, $control); 
     380        return false; 
    370381    } 
    371382 
  • trunk/lib/jelix/forms/jFormsCompiler.class.php

    r895 r906  
    2424    protected $sourceFile; 
    2525 
    26     protected $doubleControl; 
    27  
    2826    public function compile($selector){ 
    2927        global $gJCoord; 
     
    10199 
    102100    protected function generatePHPControl($controltype, $control){ 
    103         $this->doubleControl = false; 
    104101        $source = array(); 
    105102        $class = 'jFormsControl'.$controltype; 
     
    122119        unset($attributes['ref']); 
    123120 
    124         $name='generate'.$controltype; 
    125         $this->$name($source, $control, $attributes); 
     121        $doublecontrol = $this->{'generate'.$controltype}($source, $control, $attributes); 
    126122 
    127123        if(count($attributes)) { 
     
    131127 
    132128        $source[]='$this->addControl($ctrl);'; 
    133         if ($this->doubleControl) 
     129        if ($doublecontrol) 
    134130            $source[]='$this->addControl($ctrl2);'; 
    135131        return implode("\n", $source); 
     
    170166        $this->readHelpHintAlert($source, $control); 
    171167        $this->attrSize($source, $attributes); 
     168        return false; 
    172169    } 
    173170 
     
    180177            unset($attributes['type']); 
    181178        } 
    182         $this->_generateTextareaHtmlEditor($source, $control, $attributes); 
     179        return $this->_generateTextareaHtmlEditor($source, $control, $attributes); 
    183180    } 
    184181 
     
    211208            unset($attributes['cols']); 
    212209        } 
     210        return false; 
    213211    } 
    214212 
     
    224222            unset($attributes['skin']); 
    225223        } 
     224&n