Changeset 580

Show
Ignore:
Timestamp:
09/13/07 20:23:31 (1 year ago)
Author:
laurentj
Message:

jForms : grammar of confirm element has changed. labellocale attribute has been renamed to locale, and the content of the label attribute should be store as the content of the element

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/jelix/core-modules/jelix/locales/en_EN/formserr.ISO-8859-1.properties

    r552 r580  
    1515invalid.form.builder = (814) The type "%s" of form constructor is invalid (form=%s) 
    1616invalid.upload.control.name = (815) The given control name "%s" is invalid or the corresponding control is not an upload (form=%s) 
     17content.missing=(816) content of %1$s tag is missing (file %2$s) 
    1718 
    1819js.err.invalid= "%s" field is invalid 
  • trunk/lib/jelix/core-modules/jelix/locales/en_EN/formserr.ISO-8859-1.properties

    r552 r580  
    1515invalid.form.builder = (814) The type "%s" of form constructor is invalid (form=%s) 
    1616invalid.upload.control.name = (815) The given control name "%s" is invalid or the corresponding control is not an upload (form=%s) 
     17content.missing=(816) content of %1$s tag is missing (file %2$s) 
    1718 
    1819js.err.invalid= "%s" field is invalid 
  • trunk/lib/jelix/core-modules/jelix/locales/en_EN/formserr.UTF-8.properties

    r552 r580  
    1515invalid.form.builder = (814) The type "%s" of form constructor is invalid (form=%s) 
    1616invalid.upload.control.name = (815) The given control name "%s" is invalid or the corresponding control is not an upload (form=%s) 
     17content.missing=(816) content of %1$s tag is missing (file %2$s) 
    1718 
    1819js.err.invalid= "%s" field is invalid 
  • trunk/lib/jelix/core-modules/jelix/locales/en_EN/formserr.UTF-8.properties

    r552 r580  
    1515invalid.form.builder = (814) The type "%s" of form constructor is invalid (form=%s) 
    1616invalid.upload.control.name = (815) The given control name "%s" is invalid or the corresponding control is not an upload (form=%s) 
     17content.missing=(816) content of %1$s tag is missing (file %2$s) 
    1718 
    1819js.err.invalid= "%s" field is invalid 
  • trunk/lib/jelix/core-modules/jelix/locales/en_US/formserr.ISO-8859-1.properties

    r552 r580  
    1515invalid.form.builder = (814) The type "%s" of form constructor is invalid (form=%s) 
    1616invalid.upload.control.name = (815) The given control name "%s" is invalid or the corresponding control is not an upload (form=%s) 
     17content.missing=(816) content of %1$s tag is missing (file %2$s) 
    1718 
    1819js.err.invalid= "%s" field is invalid 
  • trunk/lib/jelix/core-modules/jelix/locales/en_US/formserr.ISO-8859-1.properties

    r552 r580  
    1515invalid.form.builder = (814) The type "%s" of form constructor is invalid (form=%s) 
    1616invalid.upload.control.name = (815) The given control name "%s" is invalid or the corresponding control is not an upload (form=%s) 
     17content.missing=(816) content of %1$s tag is missing (file %2$s) 
    1718 
    1819js.err.invalid= "%s" field is invalid 
  • trunk/lib/jelix/core-modules/jelix/locales/en_US/formserr.UTF-8.properties

    r552 r580  
    1515invalid.form.builder = (814) The type "%s" of form constructor is invalid (form=%s) 
    1616invalid.upload.control.name = (815) The given control name "%s" is invalid or the corresponding control is not an upload (form=%s) 
     17content.missing=(816) content of %1$s tag is missing (file %2$s) 
    1718 
    1819js.err.invalid= "%s" field is invalid 
  • trunk/lib/jelix/core-modules/jelix/locales/en_US/formserr.UTF-8.properties

    r552 r580  
    1515invalid.form.builder = (814) The type "%s" of form constructor is invalid (form=%s) 
    1616invalid.upload.control.name = (815) The given control name "%s" is invalid or the corresponding control is not an upload (form=%s) 
     17content.missing=(816) content of %1$s tag is missing (file %2$s) 
    1718 
    1819js.err.invalid= "%s" field is invalid 
  • trunk/lib/jelix/core-modules/jelix/locales/fr_FR/formserr.ISO-8859-1.properties

    r552 r580  
    1515invalid.form.builder = (814) Le type "%s" de constructeur de formulaire est invalide (form=%s) 
    1616invalid.upload.control.name = (815) Le nom de controle indiqu�%s" est invalide ou le control n'est pas un upload (form=%s) 
     17content.missing=(816) le contenu de %1$s est manquant (fichier %2$s) 
    1718 
    1819js.err.invalid=La saisie de "%s" est invalide 
  • trunk/lib/jelix/core-modules/jelix/locales/fr_FR/formserr.ISO-8859-1.properties

    r552 r580  
    1515invalid.form.builder = (814) Le type "%s" de constructeur de formulaire est invalide (form=%s) 
    1616invalid.upload.control.name = (815) Le nom de controle indiqu�%s" est invalide ou le control n'est pas un upload (form=%s) 
     17content.missing=(816) le contenu de %1$s est manquant (fichier %2$s) 
    1718 
    1819js.err.invalid=La saisie de "%s" est invalide 
  • trunk/lib/jelix/core-modules/jelix/locales/fr_FR/formserr.UTF-8.properties

    r552 r580  
    1515invalid.form.builder = (814) Le type "%s" de constructeur de formulaire est invalide (form=%s) 
    1616invalid.upload.control.name = (815) Le nom de controle indiqué "%s" est invalide ou le control n'est pas un upload (form=%s) 
     17content.missing=(816) le contenu de %1$s est manquant (fichier %2$s) 
    1718 
    1819js.err.invalid=La saisie de "%s" est invalide 
  • trunk/lib/jelix/core-modules/jelix/locales/fr_FR/formserr.UTF-8.properties

    r552 r580  
    1515invalid.form.builder = (814) Le type "%s" de constructeur de formulaire est invalide (form=%s) 
    1616invalid.upload.control.name = (815) Le nom de controle indiqué "%s" est invalide ou le control n'est pas un upload (form=%s) 
     17content.missing=(816) le contenu de %1$s est manquant (fichier %2$s) 
    1718 
    1819js.err.invalid=La saisie de "%s" est invalide 
  • trunk/lib/jelix/docs/ns/jforms.rng

    r578 r580  
    6262       <optional> 
    6363          <element name="confirm"> 
    64                 <empty/> 
    65                 <choice> 
    66                     <attribute name="label" /> 
     64            <choice> 
     65                <text /> 
     66                <group> 
     67                    <emtpy/> 
    6768                    <attribute name="labellocale" /> 
    68                 </choice> 
     69                </group> 
     70            </choice> 
    6971          </element> 
    7072       </optional> 
  • trunk/lib/jelix/docs/ns/jforms.rng

    r578 r580  
    6262       <optional> 
    6363          <element name="confirm"> 
    64                 <empty/> 
    65                 <choice> 
    66                     <attribute name="label" /> 
     64            <choice> 
     65                <text /> 
     66                <group> 
     67                    <emtpy/> 
    6768                    <attribute name="labellocale" /> 
    68                 </choice> 
     69                </group> 
     70            </choice> 
    6971          </element> 
    7072       </optional> 
  • trunk/lib/jelix/forms/jFormsCompiler.class.php

    r578 r580  
    274274                if(isset($control->confirm)) { 
    275275                    $label=''; 
    276                     if(isset($control->confirm['label'])){ 
    277                         $label = "'".str_replace("'","\\'",(string)$control->confirm['label'])."';"; 
    278                     }elseif(isset($control->confirm['labellocale']))
    279                         $label = "jLocale::get('".(string)$control->confirm['labellocale']."');"; 
     276                    if(isset($control->confirm['locale'])){ 
     277                        $label = "jLocale::get('".(string)$control->confirm['locale']."');"; 
     278                    }elseif( "" != (string)$control->confirm)
     279                        $label = "'".str_replace("'","\\'",(string)$control->confirm)."';"; 
    280280                    }else{ 
    281                         throw new jException('jelix~formserr.attribute.missing',array('label','confirm',$this->sourceFile)); 
     281                        throw new jException('jelix~formserr.content.missing',array('confirm',$this->sourceFile)); 
    282282                    } 
    283283                    $source[]='$ctrl2 = new jFormsControlSecretConfirm(\''.(string)$control['ref'].'_confirm\');'; 
     
    381381            $source[]='$js.="jForms.tControl = new jFormsControl(\''.(string)$control['ref'].'\', \'".$label."\', \''.$dt.'\');\n";'; 
    382382            if($hasConfirm){ 
    383                 if(isset($control->confirm['label'])){ 
    384                     $source[]='$label2 = str_replace("\'","\\\'",\''.str_replace("'","\\'",(string)$control->confirm['label']).'\');'; 
     383                if(isset($control->confirm['locale'])){ 
     384                    $source[]='$label2 = str_replace("\'","\\\'",jLocale::get(\''.(string)$control->confirm['locale'].'\'));';                 
    385385                }else{ 
    386                     $source[]='$label2 = str_replace("\'","\\\'",jLocale::get(\''.(string)$control->confirm['labellocale'].'\'));'; 
     386                    $source[]='$label2 = str_replace("\'","\\\'",\''.str_replace("'","\\'",(string)$control->confirm).'\');'; 
    387387                } 
    388388                $source[]='$js.="jForms.tControl2 = new jFormsControl(\''.(string)$control['ref'].'_confirm\', \'".$label2."\', \''.$dt.'\');\n";'; 
  • trunk/lib/jelix/forms/jFormsCompiler.class.php

    r578 r580  
    274274                if(isset($control->confirm)) { 
    275275                    $label=''; 
    276                     if(isset($control->confirm['label'])){ 
    277                         $label = "'".str_replace("'","\\'",(string)$control->confirm['label'])."';"; 
    278                     }elseif(isset($control->confirm['labellocale']))
    279                         $label = "jLocale::get('".(string)$control->confirm['labellocale']."');"; 
     276                    if(isset($control->confirm['locale'])){ 
     277                        $label = "jLocale::get('".(string)$control->confirm['locale']."');"; 
     278                    }elseif( "" != (string)$control->confirm)
     279                        $label = "'".str_replace("'","\\'",(string)$control->confirm)."';"; 
    280280                    }else{ 
    281                         throw new jException('jelix~formserr.attribute.missing',array('label','confirm',$this->sourceFile)); 
     281                        throw new jException('jelix~formserr.content.missing',array('confirm',$this->sourceFile)); 
    282282                    } 
    283283                    $source[]='$ctrl2 = new jFormsControlSecretConfirm(\''.(string)$control['ref'].'_confirm\');'; 
     
    381381            $source[]='$js.="jForms.tControl = new jFormsControl(\''.(string)$control['ref'].'\', \'".$label."\', \''.$dt.'\');\n";'; 
    382382            if($hasConfirm){ 
    383                 if(isset($control->confirm['label'])){ 
    384                     $source[]='$label2 = str_replace("\'","\\\'",\''.str_replace("'","\\'",(string)$control->confirm['label']).'\');'; 
     383                if(isset($control->confirm['locale'])){ 
     384                    $source[]='$label2 = str_replace("\'","\\\'",jLocale::get(\''.(string)$control->confirm['locale'].'\'));';                 
    385385                }else{ 
    386                     $source[]='$label2 = str_replace("\'","\\\'",jLocale::get(\''.(string)$control->confirm['labellocale'].'\'));'; 
     386                    $source[]='$label2 = str_replace("\'","\\\'",\''.str_replace("'","\\'",(string)$control->confirm).'\');'; 
    387387                } 
    388388                $source[]='$js.="jForms.tControl2 = new jFormsControl(\''.(string)$control['ref'].'_confirm\', \'".$label2."\', \''.$dt.'\');\n";'; 
  • trunk/testapp/modules/jelix_tests/tests/jforms.compiler.html.php

    r578 r580  
    21621650=>'<secret ref="pwd" xmlns="http://jelix.org/ns/forms/1.0"> 
    217217    <label>Votre mot de passe</label> 
    218     <confirm label="confirmez" /
     218    <confirm>confirmez</confirm
    219219</secret>', 
    22022051=>'<secret ref="pwd" xmlns="http://jelix.org/ns/forms/1.0"> 
    221221    <label>Votre mot de passe</label> 
    222     <confirm labellocale="password.confirm" /> 
     222    <confirm locale="password.confirm" /> 
    223223</secret>', 
    22422452=>'<submit ref="validation" xmlns="http://jelix.org/ns/forms/1.0" 
     
    968968<confirm /> 
    969969</secret>', 
    970 'jelix~formserr.attribute.missing', 
    971 array('label','confirm','myfile') 
     970'jelix~formserr.content.missing', 
     971array('confirm','myfile') 
     972), 
     973array( 
     974'<secret ref="pwd"  xmlns="http://jelix.org/ns/forms/1.0"> 
     975<label>Votre mot de passe</label> 
     976<confirm></confirm> 
     977</secret>', 
     978'jelix~formserr.content.missing', 
     979array('confirm','myfile') 
    972980), 
    973981array( 
  • trunk/testapp/modules/jelix_tests/tests/jforms.compiler.html.php

    r578 r580  
    21621650=>'<secret ref="pwd" xmlns="http://jelix.org/ns/forms/1.0"> 
    217217    <label>Votre mot de passe</label> 
    218     <confirm label="confirmez" /
     218    <confirm>confirmez</confirm
    219219</secret>', 
    22022051=>'<secret ref="pwd" xmlns="http://jelix.org/ns/forms/1.0"> 
    221221    <label>Votre mot de passe</label> 
    222     <confirm labellocale="password.confirm" /> 
     222    <confirm locale="password.confirm" /> 
    223223</secret>', 
    22422452=>'<submit ref="validation" xmlns="http://jelix.org/ns/forms/1.0" 
     
    968968<confirm /> 
    969969</secret>', 
    970 'jelix~formserr.attribute.missing', 
    971 array('label','confirm','myfile') 
     970'jelix~formserr.content.missing', 
     971array('confirm','myfile') 
     972), 
     973array( 
     974'<secret ref="pwd"  xmlns="http://jelix.org/ns/forms/1.0"> 
     975<label>Votre mot de passe</label> 
     976<confirm></confirm> 
     977</secret>', 
     978'jelix~formserr.content.missing', 
     979array('confirm','myfile') 
    972980), 
    973981array( 
Download in other formats: Unified Diff Zip Archive