Changeset 439
- Timestamp:
- 05/15/07 22:56:49 (2 years ago)
- Files:
-
- branches/experimental/jforms/build/manifests/jelix-lib.mn (modified) (6 diffs)
- branches/experimental/jforms/lib/jelix-modules/jelix/locales/en_EN/formserr.ISO-8859-1.properties (added)
- branches/experimental/jforms/lib/jelix-modules/jelix/locales/en_EN/formserr.UTF-8.properties (added)
- branches/experimental/jforms/lib/jelix-modules/jelix/locales/en_US/formserr.ISO-8859-1.properties (modified) (1 diff)
- branches/experimental/jforms/lib/jelix-modules/jelix/locales/en_US/formserr.UTF-8.properties (added)
- branches/experimental/jforms/lib/jelix-modules/jelix/locales/fr_FR/formserr.ISO-8859-1.properties (modified) (1 diff)
- branches/experimental/jforms/lib/jelix-modules/jelix/locales/fr_FR/formserr.UTF-8.properties (modified) (1 diff)
- branches/experimental/jforms/lib/jelix/forms/jFormsBase.class.php (modified) (1 diff)
- branches/experimental/jforms/lib/jelix/forms/jFormsCompiler.class.php (modified) (4 diffs)
- branches/experimental/jforms/testapp/modules/unittest/classes/utjforms.class.php (modified) (9 diffs)
- branches/experimental/jforms/testapp/modules/unittest/templates/menu.tpl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/experimental/jforms/build/manifests/jelix-lib.mn
r437 r439 223 223 common.ISO-8859-1.properties 224 224 format.ISO-8859-1.properties 225 formserr.ISO-8859-1.properties 225 226 jelix.ISO-8859-1.properties 226 227 errors.ISO-8859-1.properties … … 232 233 common.UTF-8.properties 233 234 format.UTF-8.properties 235 formserr.UTF-8.properties 234 236 jelix.UTF-8.properties 235 237 errors.UTF-8.properties … … 242 244 common.ISO-8859-1.properties 243 245 format.ISO-8859-1.properties 246 formserr.ISO-8859-1.properties 244 247 jelix.ISO-8859-1.properties 245 248 errors.ISO-8859-1.properties … … 251 254 common.UTF-8.properties 252 255 format.UTF-8.properties 256 formserr.UTF-8.properties 253 257 jelix.UTF-8.properties 254 258 errors.UTF-8.properties … … 261 265 common.ISO-8859-1.properties 262 266 format.ISO-8859-1.properties 267 formserr.ISO-8859-1.properties 263 268 jelix.ISO-8859-1.properties 264 269 errors.ISO-8859-1.properties … … 270 275 common.UTF-8.properties 271 276 format.UTF-8.properties 277 formserr.UTF-8.properties 272 278 jelix.UTF-8.properties 273 279 errors.UTF-8.properties branches/experimental/jforms/lib/jelix-modules/jelix/locales/en_US/formserr.ISO-8859-1.properties
r97 r439 2 2 unknow.tag=(801) unknow tag %1$s (file %2$s) 3 3 attribute.missing=(802) attribut %1$s is missing on %2$s (file %3$s) 4 datatype.unknow=(803) unknow datatype %1$s on %2$s (file %3$s) 4 attribute.not.allowed=(803) attribut %1$s not allowed on %2$s (file %3$s) 5 datatype.unknow=(804) unknow datatype %1$s on %2$s (file %3$s) 5 6 branches/experimental/jforms/lib/jelix-modules/jelix/locales/fr_FR/formserr.ISO-8859-1.properties
r97 r439 2 2 unknow.tag=(801) balise %1$s inconnue (fichier %2$s) 3 3 attribute.missing=(802) attribut %1$s manquant sur %2$s (fichier %3$s) 4 datatype.unknow=(803) datatype inconnu %1$s sur %2$s (fichier %3$s) 4 attribute.not.allowed=(803) attribut %1$s non permis sur %2$s (fichier %3$s) 5 datatype.unknow=(804) datatype inconnu %1$s sur %2$s (fichier %3$s) 5 6 7 branches/experimental/jforms/lib/jelix-modules/jelix/locales/fr_FR/formserr.UTF-8.properties
r112 r439 2 2 unknow.tag=(801) balise %1$s inconnue (fichier %2$s) 3 3 attribute.missing=(802) attribut %1$s manquant sur %2$s (fichier %3$s) 4 datatype.unknow=(803) datatype inconnu %1$s sur %2$s (fichier %3$s) 4 attribute.not.allowed=(803) attribut %1$s non permis sur %2$s (fichier %3$s) 5 datatype.unknow=(804) datatype inconnu %1$s sur %2$s (fichier %3$s) 5 6 branches/experimental/jforms/lib/jelix/forms/jFormsBase.class.php
r437 r439 51 51 protected $_builders = array(); 52 52 53 54 55 53 /** 56 54 * @param jFormsDataContainer $container the datas container branches/experimental/jforms/lib/jelix/forms/jFormsCompiler.class.php
r437 r439 105 105 $source[]='$ctrl= new '.$class.'(\''.(string)$control['ref'].'\');'; 106 106 if(isset($control['type'])){ 107 if($controltype != 'input'){ 108 throw new jException('jelix~formserr.attribute.not.allowed',array('type',$controltype,$this->sourceFile)); 109 } 110 107 111 $dt = (string)$control['type']; 108 112 if(!in_array(strtolower($dt), array('string','boolean','decimal','integer','hexadecimal','datetime','date','time','localedatetime','localedate','localetime', 'url','email','ipv4','ipv6'))){ … … 139 143 140 144 switch($controltype){ 141 case 'input':142 break;143 case 'textarea':144 break;145 case 'secret':146 break;147 case 'output':148 //attr value149 break;150 case 'upload':151 // attr mediatype152 break;153 145 case 'select1': 154 146 case 'select': … … 179 171 } 180 172 break; 181 case 'submit':182 // attr value183 break;184 173 } 185 174 $source[]='$this->addControl($ctrl);'; … … 218 207 219 208 switch($controltype){ 220 case 'input':221 break;222 case 'textarea':223 break;224 209 case 'secret': 225 210 break; branches/experimental/jforms/testapp/modules/unittest/classes/utjforms.class.php
r437 r439 30 30 31 31 protected $_XmlControls = array( 32 '<input ref="nom" xmlns="http://jelix.org/ns/forms/1.0">33 <label>Votre nom</label> 34 </input>', 35 '<input ref="nom" readonly="true" xmlns="http://jelix.org/ns/forms/1.0">36 <label>Votre nom</label> 37 </input>', 38 '<input ref="nom" required="true" xmlns="http://jelix.org/ns/forms/1.0">39 <label>Votre nom</label> 40 </input>', 41 '<input ref="nom" xmlns="http://jelix.org/ns/forms/1.0">32 0=>'<input ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 33 <label>Votre nom</label> 34 </input>', 35 1=>'<input ref="nom" readonly="true" xmlns="http://jelix.org/ns/forms/1.0"> 36 <label>Votre nom</label> 37 </input>', 38 2=>'<input ref="nom" required="true" xmlns="http://jelix.org/ns/forms/1.0"> 39 <label>Votre nom</label> 40 </input>', 41 3=>'<input ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 42 42 <label locale="foo~bar"/> 43 43 </input>', 44 44 45 '<textarea ref="nom" xmlns="http://jelix.org/ns/forms/1.0">45 4=>'<textarea ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 46 46 <label>Votre nom</label> 47 47 </textarea>', 48 48 49 '<secret ref="nom" xmlns="http://jelix.org/ns/forms/1.0">49 5=>'<secret ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 50 50 <label>Votre nom</label> 51 51 </secret>', 52 52 53 '<output ref="nom" xmlns="http://jelix.org/ns/forms/1.0">53 6=>'<output ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 54 54 <label>Votre nom</label> 55 55 </output>', 56 56 57 '<upload ref="nom" xmlns="http://jelix.org/ns/forms/1.0">57 7=>'<upload ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 58 58 <label>Votre nom</label> 59 59 </upload>', 60 60 61 '<select1 ref="nom" xmlns="http://jelix.org/ns/forms/1.0"61 8=>'<select1 ref="nom" xmlns="http://jelix.org/ns/forms/1.0" 62 62 dao="foo" daomethod="bar" daolabelproperty="baz" daovalueproperty="plop"> 63 63 <label>Votre nom</label> 64 64 </select1>', 65 65 66 '<select ref="nom" xmlns="http://jelix.org/ns/forms/1.0">66 9=>'<select ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 67 67 <label>Votre nom</label> 68 68 <item label="1aa" value="aaa" /> … … 71 71 </select>', 72 72 73 '<submit ref="nom" xmlns="http://jelix.org/ns/forms/1.0">73 10=>'<submit ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 74 74 <label>Votre nom</label> 75 75 </submit>', 76 76 77 11=>'<input ref="nom" type="string" xmlns="http://jelix.org/ns/forms/1.0"> 78 <label>Votre nom</label> 79 </input>', 80 12=>'<input ref="nom" type="boolean" xmlns="http://jelix.org/ns/forms/1.0"> 81 <label>Votre nom</label> 82 </input>', 83 13=>'<input ref="nom" type="decimal" xmlns="http://jelix.org/ns/forms/1.0"> 84 <label>Votre nom</label> 85 </input>', 86 14=>'<input ref="nom" type="integer" xmlns="http://jelix.org/ns/forms/1.0"> 87 <label>Votre nom</label> 88 </input>', 89 15=>'<input ref="nom" type="hexadecimal" xmlns="http://jelix.org/ns/forms/1.0"> 90 <label>Votre nom</label> 91 </input>', 92 16=>'<input ref="nom" type="datetime" xmlns="http://jelix.org/ns/forms/1.0"> 93 <label>Votre nom</label> 94 </input>', 95 17=>'<input ref="nom" type="date" xmlns="http://jelix.org/ns/forms/1.0"> 96 <label>Votre nom</label> 97 </input>', 98 18=>'<input ref="nom" type="time" xmlns="http://jelix.org/ns/forms/1.0"> 99 <label>Votre nom</label> 100 </input>', 101 19=>'<input ref="nom" type="localedatetime" xmlns="http://jelix.org/ns/forms/1.0"> 102 <label>Votre nom</label> 103 </input>', 104 20=>'<input ref="nom" type="localedate" xmlns="http://jelix.org/ns/forms/1.0"> 105 <label>Votre nom</label> 106 </input>', 107 21=>'<input ref="nom" type="localetime" xmlns="http://jelix.org/ns/forms/1.0"> 108 <label>Votre nom</label> 109 </input>', 110 22=>'<input ref="nom" type="url" xmlns="http://jelix.org/ns/forms/1.0"> 111 <label>Votre nom</label> 112 </input>', 113 23=>'<input ref="nom" type="email" xmlns="http://jelix.org/ns/forms/1.0"> 114 <label>Votre nom</label> 115 </input>', 116 24=>'<input ref="nom" type="ipv4" xmlns="http://jelix.org/ns/forms/1.0"> 117 <label>Votre nom</label> 118 </input>', 119 25=>'<input ref="nom" type="ipv6" xmlns="http://jelix.org/ns/forms/1.0"> 120 <label>Votre nom</label> 121 </input>', 77 122 ); 78 123 79 124 protected $_PhpControls = array( 80 125 81 '$ctrl= new jFormsControlinput(\'nom\');82 $ctrl->datatype= new jDatatypeString(); 83 $ctrl->label=\'Votre nom\'; 84 $this->addControl($ctrl);', 85 86 '$ctrl= new jFormsControlinput(\'nom\');126 0=>'$ctrl= new jFormsControlinput(\'nom\'); 127 $ctrl->datatype= new jDatatypeString(); 128 $ctrl->label=\'Votre nom\'; 129 $this->addControl($ctrl);', 130 131 1=>'$ctrl= new jFormsControlinput(\'nom\'); 87 132 $ctrl->datatype= new jDatatypeString(); 88 133 $ctrl->readonly=true; … … 90 135 $this->addControl($ctrl);', 91 136 92 '$ctrl= new jFormsControlinput(\'nom\');137 2=>'$ctrl= new jFormsControlinput(\'nom\'); 93 138 $ctrl->datatype= new jDatatypeString(); 94 139 $ctrl->required=true; … … 96 141 $this->addControl($ctrl);', 97 142 98 '$ctrl= new jFormsControlinput(\'nom\');143 3=>'$ctrl= new jFormsControlinput(\'nom\'); 99 144 $ctrl->datatype= new jDatatypeString(); 100 145 $ctrl->labellocale=\'foo~bar\'; … … 102 147 103 148 104 '$ctrl= new jFormsControltextarea(\'nom\');105 $ctrl->datatype= new jDatatypeString(); 106 $ctrl->label=\'Votre nom\'; 107 $this->addControl($ctrl);', 108 109 110 '$ctrl= new jFormsControlsecret(\'nom\');111 $ctrl->datatype= new jDatatypeString(); 112 $ctrl->label=\'Votre nom\'; 113 $this->addControl($ctrl);', 114 115 '$ctrl= new jFormsControloutput(\'nom\');116 $ctrl->datatype= new jDatatypeString(); 117 $ctrl->label=\'Votre nom\'; 118 $this->addControl($ctrl);', 119 120 121 '$ctrl= new jFormsControlupload(\'nom\');122 $ctrl->datatype= new jDatatypeString(); 123 $ctrl->label=\'Votre nom\'; 124 $this->addControl($ctrl);', 125 126 127 '$ctrl= new jFormsControlselect1(\'nom\');149 4=>'$ctrl= new jFormsControltextarea(\'nom\'); 150 $ctrl->datatype= new jDatatypeString(); 151 $ctrl->label=\'Votre nom\'; 152 $this->addControl($ctrl);', 153 154 155 5=>'$ctrl= new jFormsControlsecret(\'nom\'); 156 $ctrl->datatype= new jDatatypeString(); 157 $ctrl->label=\'Votre nom\'; 158 $this->addControl($ctrl);', 159 160 6=>'$ctrl= new jFormsControloutput(\'nom\'); 161 $ctrl->datatype= new jDatatypeString(); 162 $ctrl->label=\'Votre nom\'; 163 $this->addControl($ctrl);', 164 165 166 7=>'$ctrl= new jFormsControlupload(\'nom\'); 167 $ctrl->datatype= new jDatatypeString(); 168 $ctrl->label=\'Votre nom\'; 169 $this->addControl($ctrl);', 170 171 172 8=>'$ctrl= new jFormsControlselect1(\'nom\'); 128 173 $ctrl->datatype= new jDatatypeString(); 129 174 $ctrl->label=\'Votre nom\'; … … 131 176 $this->addControl($ctrl);', 132 177 133 '$ctrl= new jFormsControlselect(\'nom\');178 9=>'$ctrl= new jFormsControlselect(\'nom\'); 134 179 $ctrl->datatype= new jDatatypeString(); 135 180 $ctrl->label=\'Votre nom\'; … … 142 187 $this->addControl($ctrl);', 143 188 144 '$ctrl= new jFormsControlsubmit(\'nom\'); 145 $ctrl->datatype= new jDatatypeString(); 189 10=>'$ctrl= new jFormsControlsubmit(\'nom\'); 190 $ctrl->datatype= new jDatatypeString(); 191 $ctrl->label=\'Votre nom\'; 192 $this->addControl($ctrl);', 193 194 11=>'$ctrl= new jFormsControlinput(\'nom\'); 195 $ctrl->datatype= new jDatatypestring(); 196 $ctrl->label=\'Votre nom\'; 197 $this->addControl($ctrl);', 198 12=>'$ctrl= new jFormsControlinput(\'nom\'); 199 $ctrl->datatype= new jDatatypeboolean(); 200 $ctrl->label=\'Votre nom\'; 201 $this->addControl($ctrl);', 202 13=>'$ctrl= new jFormsControlinput(\'nom\'); 203 $ctrl->datatype= new jDatatypedecimal(); 204 $ctrl->label=\'Votre nom\'; 205 $this->addControl($ctrl);', 206 14=>'$ctrl= new jFormsControlinput(\'nom\'); 207 $ctrl->datatype= new jDatatypeinteger(); 208 $ctrl->label=\'Votre nom\'; 209 $this->addControl($ctrl);', 210 15=>'$ctrl= new jFormsControlinput(\'nom\'); 211 $ctrl->datatype= new jDatatypehexadecimal(); 212 $ctrl->label=\'Votre nom\'; 213 $this->addControl($ctrl);', 214 16=>'$ctrl= new jFormsControlinput(\'nom\'); 215 $ctrl->datatype= new jDatatypedatetime(); 216 $ctrl->label=\'Votre nom\'; 217 $this->addControl($ctrl);', 218 17=>'$ctrl= new jFormsControlinput(\'nom\'); 219 $ctrl->datatype= new jDatatypedate(); 220 $ctrl->label=\'Votre nom\'; 221 $this->addControl($ctrl);', 222 18=>'$ctrl= new jFormsControlinput(\'nom\'); 223 $ctrl->datatype= new jDatatypetime(); 224 $ctrl->label=\'Votre nom\'; 225 $this->addControl($ctrl);', 226 19=>'$ctrl= new jFormsControlinput(\'nom\'); 227 $ctrl->datatype= new jDatatypelocaledatetime(); 228 $ctrl->label=\'Votre nom\'; 229 $this->addControl($ctrl);', 230 20=>'$ctrl= new jFormsControlinput(\'nom\'); 231 $ctrl->datatype= new jDatatypelocaledate(); 232 $ctrl->label=\'Votre nom\'; 233 $this->addControl($ctrl);', 234 21=>'$ctrl= new jFormsControlinput(\'nom\'); 235 $ctrl->datatype= new jDatatypelocaletime(); 236 $ctrl->label=\'Votre nom\'; 237 $this->addControl($ctrl);', 238 22=>'$ctrl= new jFormsControlinput(\'nom\'); 239 $ctrl->datatype= new jDatatypeurl(); 240 $ctrl->label=\'Votre nom\'; 241 $this->addControl($ctrl);', 242 23=>'$ctrl= new jFormsControlinput(\'nom\'); 243 $ctrl->datatype= new jDatatypeemail(); 244 $ctrl->label=\'Votre nom\'; 245 $this->addControl($ctrl);', 246 24=>'$ctrl= new jFormsControlinput(\'nom\'); 247 $ctrl->datatype= new jDatatypeipv4(); 248 $ctrl->label=\'Votre nom\'; 249 $this->addControl($ctrl);', 250 25=>'$ctrl= new jFormsControlinput(\'nom\'); 251 $ctrl->datatype= new jDatatypeipv6(); 146 252 $ctrl->label=\'Votre nom\'; 147 253 $this->addControl($ctrl);', … … 150 256 151 257 protected $_JsControls = array( 152 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n";153 $js.="gForm.addControl( gControl);\n";', 154 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n";258 0=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 259 $js.="gForm.addControl( gControl);\n";', 260 1=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 155 261 $js.="gControl.readonly = true;\n"; 156 262 $js.="gForm.addControl( gControl);\n";', 157 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n";263 2=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 158 264 $js.="gControl.required = true;\n"; 159 265 $js.="gForm.addControl( gControl);\n";', 160 '$js.="gControl = new jFormsControl(\'nom\', \'".str_replace("\'","\\\'",jLocale::get(\'foo~bar\'))."\', \'string\');\n"; 161 $js.="gForm.addControl( gControl);\n";', 162 163 164 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 165 $js.="gForm.addControl( gControl);\n";', 166 167 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 168 $js.="gForm.addControl( gControl);\n";', 169 170 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 171 $js.="gForm.addControl( gControl);\n";', 172 173 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 174 $js.="gForm.addControl( gControl);\n";', 175 176 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 177 $js.="gForm.addControl( gControl);\n";', 178 179 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 180 $js.="gForm.addControl( gControl);\n";', 181 182 '$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 183 $js.="gForm.addControl( gControl);\n";', 184 266 3=>'$js.="gControl = new jFormsControl(\'nom\', \'".str_replace("\'","\\\'",jLocale::get(\'foo~bar\'))."\', \'string\');\n"; 267 $js.="gForm.addControl( gControl);\n";', 268 269 270 4=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 271 $js.="gForm.addControl( gControl);\n";', 272 273 5=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 274 $js.="gForm.addControl( gControl);\n";', 275 276 6=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 277 $js.="gForm.addControl( gControl);\n";', 278 279 7=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 280 $js.="gForm.addControl( gControl);\n";', 281 282 8=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 283 $js.="gForm.addControl( gControl);\n";', 284 285 9=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 286 $js.="gForm.addControl( gControl);\n";', 287 288 10=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 289 $js.="gForm.addControl( gControl);\n";', 290 291 11=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'string\');\n"; 292 $js.="gForm.addControl( gControl);\n";', 293 12=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'boolean\');\n"; 294 $js.="gForm.addControl( gControl);\n";', 295 13=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'decimal\');\n"; 296 $js.="gForm.addControl( gControl);\n";', 297 14=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'integer\');\n"; 298 $js.="gForm.addControl( gControl);\n";', 299 15=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'hexadecimal\');\n"; 300 $js.="gForm.addControl( gControl);\n";', 301 16=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'datetime\');\n"; 302 $js.="gForm.addControl( gControl);\n";', 303 17=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'date\');\n"; 304 $js.="gForm.addControl( gControl);\n";', 305 18=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'time\');\n"; 306 $js.="gForm.addControl( gControl);\n";', 307 19=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'localedatetime\');\n"; 308 $js.="gForm.addControl( gControl);\n";', 309 20=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'localedate\');\n"; 310 $js.="gForm.addControl( gControl);\n";', 311 21=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'localetime\');\n"; 312 $js.="gForm.addControl( gControl);\n";', 313 22=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'url\');\n"; 314 $js.="gForm.addControl( gControl);\n";', 315 23=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'email\');\n"; 316 $js.="gForm.addControl( gControl);\n";', 317 24=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'ipv4\');\n"; 318 $js.="gForm.addControl( gControl);\n";', 319 25=>'$js.="gControl = new jFormsControl(\'nom\', \'Votre nom\', \'ipv6\');\n"; 320 $js.="gForm.addControl( gControl);\n";', 185 321 186 322 ); … … 216 352 217 353 354 355 protected $_BadXmlControls = array( 356 array( 357 '<foo ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 358 <label>Votre nom</label> 359 </foo>', 360 'jelix~formserr.unknow.tag', 361 array('foo','myfile') 362 ), 363 array( 364 '<input xmlns="http://jelix.org/ns/forms/1.0"> 365 <label>Votre nom</label> 366 </input>', 367 'jelix~formserr.attribute.missing', 368 array('ref','input','myfile') 369 ), 370 array( 371 '<textarea ref="nom" type="boolean" xmlns="http://jelix.org/ns/forms/1.0"> 372 <label>Votre nom</label> 373 </textarea>', 374 'jelix~formserr.attribute.not.allowed', 375 array('type','textarea','myfile') 376 ), 377 array( 378 '<input ref="nom" type="foo" xmlns="http://jelix.org/ns/forms/1.0"> 379 <label>Votre nom</label> 380 </input>', 381 'jelix~formserr.datatype.unknow', 382 array('foo','input','myfile') 383 ), 384 array( 385 '<input ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 386 </input>', 387 'jelix~formserr.tag.missing', 388 array('label','input','myfile') 389 ), 390 /*array( 391 '<input ref="nom" xmlns="http://jelix.org/ns/forms/1.0"> 392 <label>Votre nom</label> 393 </input>', 394 '', 395 array('','','myfile') 396 ),*/ 397 ); 398 399 function testBadControl(){ 400 $jfc = new testJFormsCompiler(); 401 402 foreach($this->_BadXmlControls as $k=>$control){ 403 $xml = simplexml_load_string( $control[0]); 404 if(!$xml){ 405 $this->fail("Can't load bad xml test content ($k)"); 406 }else{ 407 try { 408 $ct = $jfc->testPhpControl($xml->getName(), $xml); 409 $this->fail("no exception during bad xml test content $k"); 410 }catch(jException $e){ 411 $this->assertEqualOrDiff($control[1], $e->getMessage()); 412 $this->assertEqual($control[2], $e->localeParams); 413 }catch(Exception $e){ 414 $this->fail("Unexpected exception for bad xml test content $k :". $e->getMessage()); 415 } 416 } 417 } 418 } 218 419 } 219 420 branches/experimental/jforms/testapp/modules/unittest/templates/menu.tpl
r437 r439 4 4 5 5 <p><a href="?">Retour à l'accueil</a></p> 6 <h3>Core</h3> 6 <ul> 7 <li>core 7 8 <ul> 8 9 <li><a href="?module=unittest&action=default_testselectormod">selecteurs normaux</a></li> <!--{jurl 'unittest~testselectormod'} --> … … 20 21 </li>{/if} 21 22 </ul> 22 23 < h3>jEvent</h3>23 </li> 24 <li>jEvent 24 25 <ul> 25 26 <li><a href="?module=unittest&action=testevent">lancer deux évènements</a></li> 26 27 </ul> 28 </li> 27 29 28 < h3>jUrl</h3>30 <li>jUrl 29 31 <ul> 30 32 <li><a href="?module=unittest&action=testurlcreate">Tester la création d'url</a></li> 31 33 <li><a href="?module=unittest&action=testurlparse">Tester l'analyse d'url</a></li> 32 34 </ul> 35 </li> 33 36 34 < h3>jTpl</h3>37 <li>jTpl 35 38 <ul> 36 39 <li><a href="?module=unittest&action=tpl_parseExpression">expressions</a></li> 37 40 </ul> 41 </li> 38 42 39 < h3>jDao</h3>43 <li>jDao 40 44 <ul> 41 45 <li><a href="?module=unittest&action=dao_parser">Parser</a></li> … … 43 47 <li><a href="?module=unittest&action=dao_conditions">jDaoConditions</a></li> 44 48 </ul> 45 <h3>jAcl</h3> 49 </li> 50 <li>jAcl 46 51 <ul> 47 52 <li><a href="?module=unittest&action=acl_usergroup">jAclUserGroup</a></li> … … 49 54 <li><a href="?module=unittest&action=acl_index">jAcl</a></li> 50 55 </ul> 56 </li> 51 57 52 < h3>jForms</h3>58 <li>jForms 53 59 <ul> 54 60 <li><a href="?module=unittest&action=jforms_parseControls">compilateur</a></li> 55 61 </ul> 62 </li> 56 63 57 58 <h3>Utilitaires</h3> 64 <li>Utilitaires 59 65 <ul> 60 66 <li><a href="?module=unittest&action=testfilter">jFilter</a></li> 61 67 </ul> 68 </li> 69 </ul>
