Changeset 906
- Timestamp:
- 04/26/08 15:40:57 (4 months ago)
- Files:
-
- trunk/lib/jelix-www/design/jform.css (modified) (1 diff)
- trunk/lib/jelix-www/design/jform.css (modified) (1 diff)
- trunk/lib/jelix-www/design/jform.css (modified) (1 diff)
- trunk/lib/jelix-www/design/jform.css (modified) (1 diff)
- trunk/lib/jelix/forms/jFormsBase.class.php (modified) (4 diffs)
- trunk/lib/jelix/forms/jFormsBase.class.php (modified) (4 diffs)
- trunk/lib/jelix/forms/jFormsBase.class.php (modified) (4 diffs)
- trunk/lib/jelix/forms/jFormsBase.class.php (modified) (4 diffs)
- trunk/lib/jelix/forms/jFormsCompiler.class.php (modified) (19 diffs)
- trunk/lib/jelix/forms/jFormsCompiler.class.php (modified) (19 diffs)
- trunk/lib/jelix/forms/jFormsCompiler.class.php (modified) (19 diffs)
- trunk/lib/jelix/forms/jFormsCompiler.class.php (modified) (19 diffs)
- trunk/lib/jelix/forms/jFormsControl.class.php (modified) (5 diffs)
- trunk/lib/jelix/forms/jFormsControl.class.php (modified) (5 diffs)
- trunk/lib/jelix/forms/jFormsControl.class.php (modified) (5 diffs)
- trunk/lib/jelix/forms/jFormsControl.class.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix-www/design/jform.css
r891 r906 8 8 .jforms-value {} 9 9 10 label.jforms-required { font-weight:bold; }11 label.jforms-required:after { content:"*"; font-weight:bold; color:red; }10 span.jforms-required, label.jforms-required { font-weight:bold; } 11 label.jforms-required:after, span.jforms-required:after { content:"*"; font-weight:bold; color:red; } 12 12 13 13 .jforms-error-list { color:red; border:1px solid red;} trunk/lib/jelix-www/design/jform.css
r891 r906 8 8 .jforms-value {} 9 9 10 label.jforms-required { font-weight:bold; }11 label.jforms-required:after { content:"*"; font-weight:bold; color:red; }10 span.jforms-required, label.jforms-required { font-weight:bold; } 11 label.jforms-required:after, span.jforms-required:after { content:"*"; font-weight:bold; color:red; } 12 12 13 13 .jforms-error-list { color:red; border:1px solid red;} trunk/lib/jelix-www/design/jform.css
r891 r906 8 8 .jforms-value {} 9 9 10 label.jforms-required { font-weight:bold; }11 label.jforms-required:after { content:"*"; font-weight:bold; color:red; }10 span.jforms-required, label.jforms-required { font-weight:bold; } 11 label.jforms-required:after, span.jforms-required:after { content:"*"; font-weight:bold; color:red; } 12 12 13 13 .jforms-error-list { color:red; border:1px solid red;} trunk/lib/jelix-www/design/jform.css
r891 r906 8 8 .jforms-value {} 9 9 10 label.jforms-required { font-weight:bold; }11 label.jforms-required:after { content:"*"; font-weight:bold; color:red; }10 span.jforms-required, label.jforms-required { font-weight:bold; } 11 label.jforms-required:after, span.jforms-required:after { content:"*"; font-weight:bold; color:red; } 12 12 13 13 .jforms-error-list { color:red; border:1px solid red;} trunk/lib/jelix/forms/jFormsBase.class.php
r895 r906 6 6 * @contributor Dominique Papin 7 7 * @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 10 9 * @link http://www.jelix.org 11 10 * @licence http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file … … 136 135 continue; 137 136 $value = $req->getParam($name); 137 138 138 //@todo à prevoir un meilleur test, pour les formulaires sur plusieurs pages 139 139 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 164 143 if($this->_container->data[$name] != $value) 165 144 $this->_modifiedControls[$name] = $this->_container->data[$name]; … … 206 185 foreach($this->_controls as $name=>$ctrl){ 207 186 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']); 235 188 } 236 189 } … … 238 191 239 192 /** 240 * prepare a dao w hith filled byall controls193 * prepare a dao with values of all controls 241 194 * @param string $daoSelector the selector of a dao file 242 195 * @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 6 6 * @contributor Dominique Papin 7 7 * @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 10 9 * @link http://www.jelix.org 11 10 * @licence http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file … … 136 135 continue; 137 136 $value = $req->getParam($name); 137 138 138 //@todo à prevoir un meilleur test, pour les formulaires sur plusieurs pages 139 139 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 164 143 if($this->_container->data[$name] != $value) 165 144 $this->_modifiedControls[$name] = $this->_container->data[$name]; … … 206 185 foreach($this->_controls as $name=>$ctrl){ 207 186 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']); 235 188 } 236 189 } … … 238 191 239 192 /** 240 * prepare a dao w hith filled byall controls193 * prepare a dao with values of all controls 241 194 * @param string $daoSelector the selector of a dao file 242 195 * @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 6 6 * @contributor Dominique Papin 7 7 * @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 10 9 * @link http://www.jelix.org 11 10 * @licence http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file … … 136 135 continue; 137 136 $value = $req->getParam($name); 137 138 138 //@todo à prevoir un meilleur test, pour les formulaires sur plusieurs pages 139 139 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 164 143 if($this->_container->data[$name] != $value) 165 144 $this->_modifiedControls[$name] = $this->_container->data[$name]; … … 206 185 foreach($this->_controls as $name=>$ctrl){ 207 186 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']); 235 188 } 236 189 } … … 238 191 239 192 /** 240 * prepare a dao w hith filled byall controls193 * prepare a dao with values of all controls 241 194 * @param string $daoSelector the selector of a dao file 242 195 * @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 6 6 * @contributor Dominique Papin 7 7 * @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 10 9 * @link http://www.jelix.org 11 10 * @licence http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file … … 136 135 continue; 137 136 $value = $req->getParam($name); 137 138 138 //@todo à prevoir un meilleur test, pour les formulaires sur plusieurs pages 139 139 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 164 143 if($this->_container->data[$name] != $value) 165 144 $this->_modifiedControls[$name] = $this->_container->data[$name]; … … 206 185 foreach($this->_controls as $name=>$ctrl){ 207 186 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']); 235 188 } 236 189 } … … 238 191 239 192 /** 240 * prepare a dao w hith filled byall controls193 * prepare a dao with values of all controls 241 194 * @param string $daoSelector the selector of a dao file 242 195 * @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 24 24 protected $sourceFile; 25 25 26 protected $doubleControl;27 28 26 public function compile($selector){ 29 27 global $gJCoord; … … 101 99 102 100 protected function generatePHPControl($controltype, $control){ 103 $this->doubleControl = false;104 101 $source = array(); 105 102 $class = 'jFormsControl'.$controltype; … … 122 119 unset($attributes['ref']); 123 120 124 $name='generate'.$controltype; 125 $this->$name($source, $control, $attributes); 121 $doublecontrol = $this->{'generate'.$controltype}($source, $control, $attributes); 126 122 127 123 if(count($attributes)) { … … 131 127 132 128 $source[]='$this->addControl($ctrl);'; 133 if ($ this->doubleControl)129 if ($doublecontrol) 134 130 $source[]='$this->addControl($ctrl2);'; 135 131 return implode("\n", $source); … … 170 166 $this->readHelpHintAlert($source, $control); 171 167 $this->attrSize($source, $attributes); 168 return false; 172 169 } 173 170 … … 180 177 unset($attributes['type']); 181 178 } 182 $this->_generateTextareaHtmlEditor($source, $control, $attributes);179 return $this->_generateTextareaHtmlEditor($source, $control, $attributes); 183 180 } 184 181 … … 211 208 unset($attributes['cols']); 212 209 } 210 return false; 213 211 } 214 212 … … 224 222 unset($attributes['skin']); 225 223 } 224 return false; 226 225 } 227 226 … … 230 229 $this->readLabel($source, $control, 'output'); 231 230 $this->readHelpHintAlert($source, $control); 231 return false; 232 232 } 233 233 … … 236 236 $this->readHelpHintAlert($source, $control); 237 237 $this->readDatasource($source, $control, 'submit', $attributes); 238 return false; 238 239 } 239 240 … … 243 244 $this->readLabel($source, $control, 'reset'); 244 245 $this->readHelpHintAlert($source, $control); 246 return false; 245 247 } 246 248 … … 259 261 unset($attributes['valueonuncheck']); 260 262 } 263 return false; 261 264 } 262 265 263 266 protected function generateHidden(&$source, $control, &$attributes) { 264 267 $this->attrDefaultvalue($source, $attributes); 268 return false; 265 269 } 266 270 … … 272 276 $hasSelectedValues = $this->readSelectedValue($source, $control, 'checkboxes', $attributes); 273 277 $this->readDatasource($source, $control, 'checkboxes', $attributes, $hasSelectedValues); 278 return false; 274 279 } 275 280 … … 281 286 $hasSelectedValues = $this->readSelectedValue($source, $control, 'radiobuttons', $attributes); 282 287 $this->readDatasource($source, $control, 'radiobuttons', $attributes, $hasSelectedValues); 288 return false; 283 289 } 284 290 … … 290 296 $hasSelectedValues = $this->readSelectedValue($source, $control, 'menulist', $attributes); 291 297 $this->readDatasource($source, $control, 'menulist', $attributes, $hasSelectedValues); 298 return false; 292 299 } 293 300 … … 305 312 unset($attributes['multiple']); 306 313 } 314 return false; 307 315 } 308 316 … … 342 350 $source[]='$ctrl2->size=$ctrl->size;'; 343 351 } 344 $this->doubleControl = true; 345 } 352 return true; 353 } 354 return false; 346 355 } 347 356 … … 363 372 unset($attributes['mimetype']); 364 373 } 374 return false; 365 375 } 366 376 … … 368 378 $this->readLabel($source, $control, 'captcha'); 369 379 $this->readHelpHintAlert($source, $control); 380 return false; 370 381 } 371 382 trunk/lib/jelix/forms/jFormsCompiler.class.php
r895 r906 24 24 protected $sourceFile; 25 25 26 protected $doubleControl;27 28 26 public function compile($selector){ 29 27 global $gJCoord; … … 101 99 102 100 protected function generatePHPControl($controltype, $control){ 103 $this->doubleControl = false;104 101 $source = array(); 105 102 $class = 'jFormsControl'.$controltype; … … 122 119 unset($attributes['ref']); 123 120 124 $name='generate'.$controltype; 125 $this->$name($source, $control, $attributes); 121 $doublecontrol = $this->{'generate'.$controltype}($source, $control, $attributes); 126 122 127 123 if(count($attributes)) { … … 131 127 132 128 $source[]='$this->addControl($ctrl);'; 133 if ($ this->doubleControl)129 if ($doublecontrol) 134 130 $source[]='$this->addControl($ctrl2);'; 135 131 return implode("\n", $source); … … 170 166 $this->readHelpHintAlert($source, $control); 171 167 $this->attrSize($source, $attributes); 168 return false; 172 169 } 173 170 … … 180 177 unset($attributes['type']); 181 178 } 182 $this->_generateTextareaHtmlEditor($source, $control, $attributes);179 return $this->_generateTextareaHtmlEditor($source, $control, $attributes); 183 180 } 184 181 … … 211 208 unset($attributes['cols']); 212 209 } 210 return false; 213 211 } 214 212 … … 224 222 unset($attributes['skin']); 225 223 } 224 return false; 226 225 } 227 226 … … 230 229 $this->readLabel($source, $control, 'output'); 231 230 $this->readHelpHintAlert($source, $control); 231 return false; 232 232 } 233 233 … … 236 236 $this->readHelpHintAlert($source, $control); 237 237 $this->readDatasource($source, $control, 'submit', $attributes); 238 return false; 238 239 } 239 240 … … 243 244 $this->readLabel($source, $control, 'reset'); 244 245 $this->readHelpHintAlert($source, $control); 246 return false; 245 247 } 246 248 … … 259 261 unset($attributes['valueonuncheck']); 260 262 } 263 return false; 261 264 } 262 265 263 266 protected function generateHidden(&$source, $control, &$attributes) { 264 267 $this->attrDefaultvalue($source, $attributes); 268 return false; 265 269 } 266 270 … … 272 276 $hasSelectedValues = $this->readSelectedValue($source, $control, 'checkboxes', $attributes); 273 277 $this->readDatasource($source, $control, 'checkboxes', $attributes, $hasSelectedValues); 278 return false; 274 279 } 275 280 … … 281 286 $hasSelectedValues = $this->readSelectedValue($source, $control, 'radiobuttons', $attributes); 282 287 $this->readDatasource($source, $control, 'radiobuttons', $attributes, $hasSelectedValues); 288 return false; 283 289 } 284 290 … … 290 296 $hasSelectedValues = $this->readSelectedValue($source, $control, 'menulist', $attributes); 291 297 $this->readDatasource($source, $control, 'menulist', $attributes, $hasSelectedValues); 298 return false; 292 299 } 293 300 … … 305 312 unset($attributes['multiple']); 306 313 } 314 return false; 307 315 } 308 316 … … 342 350 $source[]='$ctrl2->size=$ctrl->size;'; 343 351 } 344 $this->doubleControl = true; 345 } 352 return true; 353 } 354 return false; 346 355 } 347 356 … … 363 372 unset($attributes['mimetype']); 364 373 } 374 return false; 365 375 } 366 376 … … 368 378 $this->readLabel($source, $control, 'captcha'); 369 379 $this->readHelpHintAlert($source, $control); 380 return false; 370 381 } 371 382 trunk/lib/jelix/forms/jFormsCompiler.class.php
r895 r906 24 24 protected $sourceFile; 25 25 26 protected $doubleControl;27 28 26 public function compile($selector){ 29 27 global $gJCoord; … … 101 99 102 100 protected function generatePHPControl($controltype, $control){ 103 $this->doubleControl = false;104 101 $source = array(); 105 102 $class = 'jFormsControl'.$controltype; … … 122 119 unset($attributes['ref']); 123 120 124 $name='generate'.$controltype; 125 $this->$name($source, $control, $attributes); 121 $doublecontrol = $this->{'generate'.$controltype}($source, $control, $attributes); 126 122 127 123 if(count($attributes)) { … … 131 127 132 128 $source[]='$this->addControl($ctrl);'; 133 if ($ this->doubleControl)129 if ($doublecontrol) 134 130 $source[]='$this->addControl($ctrl2);'; 135 131 return implode("\n", $source); … … 170 166 $this->readHelpHintAlert($source, $control); 171 167 $this->attrSize($source, $attributes); 168 return false; 172 169 } 173 170 … … 180 177 unset($attributes['type']); 181 178 } 182 $this->_generateTextareaHtmlEditor($source, $control, $attributes);179 return $this->_generateTextareaHtmlEditor($source, $control, $attributes); 183 180 } 184 181 … … 211 208 unset($attributes['cols']); 212 209 } 210 return false; 213 211 } 214 212 … … 224 222 unset($attributes['skin']); 225 223 } 224 return false; 226 225 } 227 226 … … 230 229 $this->readLabel($source, $control, 'output'); 231 230 $this->readHelpHintAlert($source, $control); 231 return false; 232 232 } 233 233 … … 236 236 $this->readHelpHintAlert($source, $control); 237 237 $this->readDatasource($source, $control, 'submit', $attributes); 238 return false; 238 239 } 239 240 … … 243 244 $this->readLabel($source, $control, 'reset'); 244 245 $this->readHelpHintAlert($source, $control); 246 return false; 245 247 } 246 248 … … 259 261 unset($attributes['valueonuncheck']); 260 262 } 263 return false; 261 264 } 262 265 263 266 protected function generateHidden(&$source, $control, &$attributes) { 264 267 $this->attrDefaultvalue($source, $attributes); 268 return false; 265 269 } 266 270 … … 272 276 $hasSelectedValues = $this->readSelectedValue($source, $control, 'checkboxes', $attributes); 273 277 $this->readDatasource($source, $control, 'checkboxes', $attributes, $hasSelectedValues); 278 return false; 274 279 } 275 280 … … 281 286 $hasSelectedValues = $this->readSelectedValue($source, $control, 'radiobuttons', $attributes); 282 287 $this->readDatasource($source, $control, 'radiobuttons', $attributes, $hasSelectedValues); 288 return false; 283 289 } 284 290 … … 290 296 $hasSelectedValues = $this->readSelectedValue($source, $control, 'menulist', $attributes); 291 297 $this->readDatasource($source, $control, 'menulist', $attributes, $hasSelectedValues); 298 return false; 292 299 } 293 300 … … 305 312 unset($attributes['multiple']); 306 313 } 314 return false; 307 315 } 308 316 … … 342 350 $source[]='$ctrl2->size=$ctrl->size;'; 343 351 } 344 $this->doubleControl = true; 345 } 352 return true; 353 } 354 return false; 346 355 } 347 356 … … 363 372 unset($attributes['mimetype']); 364 373 } 374 return false; 365 375 } 366 376 … … 368 378 $this->readLabel($source, $control, 'captcha'); 369 379 $this->readHelpHintAlert($source, $control); 380 return false; 370 381 } 371 382 trunk/lib/jelix/forms/jFormsCompiler.class.php
r895 r906 24 24 protected $sourceFile; 25 25 26 protected $doubleControl;27 28 26 public function compile($selector){ 29 27 global $gJCoord; … … 101 99 102 100 protected function generatePHPControl($controltype, $control){ 103 $this->doubleControl = false;104 101 $source = array(); 105 102 $class = 'jFormsControl'.$controltype; … … 122 119 unset($attributes['ref']); 123 120 124 $name='generate'.$controltype; 125 $this->$name($source, $control, $attributes); 121 $doublecontrol = $this->{'generate'.$controltype}($source, $control, $attributes); 126 122 127 123 if(count($attributes)) { … … 131 127 132 128 $source[]='$this->addControl($ctrl);'; 133 if ($ this->doubleControl)129 if ($doublecontrol) 134 130 $source[]='$this->addControl($ctrl2);'; 135 131 return implode("\n", $source); … … 170 166 $this->readHelpHintAlert($source, $control); 171 167 $this->attrSize($source, $attributes); 168 return false; 172 169 } 173 170 … … 180 177 unset($attributes['type']); 181 178 } 182 $this->_generateTextareaHtmlEditor($source, $control, $attributes);179 return $this->_generateTextareaHtmlEditor($source, $control, $attributes); 183 180 } 184 181 … … 211 208 unset($attributes['cols']); 212 209 } 210 return false; 213 211 } 214 212 … … 224 222 unset($attributes['skin']); 225 223 } 224 &n
