Changeset 1050

Show
Ignore:
Timestamp:
08/16/08 00:45:43 (4 months ago)
Author:
laurentj
Message:

jforms: a form can now fully modified dynamically. remove the compiler part of a jforms plugin.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/experimental/jforms-groups/build/manifests/jelix-lib.mn

    r1041 r1050  
    358358  history.coord.ini.php.dist 
    359359 
    360 cd lib/jelix/plugins/jforms/html 
    361   html.jformscompiler.php 
    362   html.jformsbuilder.php 
    363  
    364  
    365360cd lib/jelix/plugins/db/intuition 
    366361  intuition.dbconnection.php 
     
    390385  oci.daobuilder.php 
    391386  oci.dbtools.php 
     387 
     388cd lib/jelix/plugins/jforms/html 
     389  html.jformsbuilder.php 
    392390 
    393391cd lib/jelix/plugins/tpl/common 
  • branches/experimental/jforms-groups/lib/jelix-www/js/jforms.js

    r1041 r1050  
    404404 * control with LocaleDateTime 
    405405 */ 
    406 function jFormsControlLocaledatetime(name, label) { 
     406function jFormsControlLocaleDatetime(name, label) { 
    407407    this.name = name; 
    408408    this.label = label; 
     
    413413    this.lang=''; 
    414414}; 
    415 jFormsControlLocaledatetime.prototype.check = function (val, jfrm) { 
     415jFormsControlLocaleDatetime.prototype.check = function (val, jfrm) { 
    416416    var yy, mm, dd, th, tm, ts; 
    417417    if(this.lang.indexOf('fr_') == 0) { 
     
    449449 * control with localedate 
    450450 */ 
    451 function jFormsControlLocaledate(name, label) { 
     451function jFormsControlLocaleDate(name, label) { 
    452452    this.name = name; 
    453453    this.label = label; 
     
    458458    this.lang=''; 
    459459}; 
    460 jFormsControlLocaledate.prototype.check = function (val, jfrm) { 
     460jFormsControlLocaleDate.prototype.check = function (val, jfrm) { 
    461461    var yy, mm, dd; 
    462462    if(this.lang.indexOf('fr_') == 0) { 
     
    551551    this.name = name; 
    552552    this.label = label; 
    553     this.required = true; 
     553    this.required = false; 
    554554    this.errInvalid = ''; 
    555555    this.errRequired = ''; 
     
    599599}; 
    600600 
    601  
    602  
    603601/** 
    604602 * Decorator to display errors in an alert dialog box 
  • branches/experimental/jforms-groups/lib/jelix/forms/jFormsCompiler.class.php

    r914 r1050  
    5454 
    5555        $srcBuilders=array(); 
    56         $buildersCompilers = array(); 
    5756        foreach($gJConfig->_pluginsPathList_jforms as $buildername => $pluginPath) { 
    58             require_once($pluginPath.$buildername.'.jformscompiler.php'); 
    59             $classname = $buildername.'JformsCompiler'; 
    60             $buildersCompilers[$buildername] = new $classname($compiler); 
    61  
    6257            $srcBuilders[$buildername]=array(); 
    6358            $srcBuilders[$buildername][] = '<?php '; 
    6459            $srcBuilders[$buildername][] = ' require_once(\''.$pluginPath.$buildername.'.jformsbuilder.php\'); '; 
    65             $srcBuilders[$buildername][] = ' class '.$selector->getClass().'_builder_'.$buildername.' extends '.$buildername.'JformsBuilder'.' {'; 
     60            $srcBuilders[$buildername][] = ' class '.$selector->getClass().'_builder_'.$buildername.' extends '.$buildername.'JformsBuilder {'; 
    6661            $srcBuilders[$buildername][] = ' public function __construct($form){'; 
    67             $srcBuilders[$buildername][] = '          parent::__construct($form); '; 
     62            $srcBuilders[$buildername][] = '          parent::__construct($form);'; 
    6863            $srcBuilders[$buildername][] = '  }'; 
    69             $srcBuilders[$buildername][] = $buildersCompilers[$buildername]->startCompile(); 
    70  
     64             
    7165            $source[]='    \''.$buildername.'\'=>array(\''.$selector->getCompiledBuilderFilePath($buildername).'\',\''.$selector->getClass().'_builder_'.$buildername.'\'), '; 
    7266        } 
     
    7468        $source[]='    );'; 
    7569        $source[]=' public function __construct($sel, &$container, $reset = false){'; 
    76         $source[]='          parent::__construct($sel, $container, $reset); '; 
     70        $source[]='          parent::__construct($sel, $container, $reset);'; 
    7771 
    78         $compiler->compile($doc, $source, $srcBuilders, $buildersCompilers); 
     72        $compiler->compile($doc, $source, $srcBuilders); 
    7973 
    8074        $source[]="  }\n} ?>"; 
     
    8276 
    8377        foreach($gJConfig->_pluginsPathList_jforms as $buildername => $pluginPath) { 
    84             $srcBuilders[$buildername][]= $buildersCompilers[$buildername]->endCompile(); 
    8578            $srcBuilders[$buildername][]= '} ?>'; 
    8679            jFile::write($selector->getCompiledBuilderFilePath($buildername), implode("\n", $srcBuilders[$buildername])); 
  • branches/experimental/jforms-groups/lib/jelix/forms/jFormsCompiler_jf_1_0.class.php

    r1022 r1050  
    2525 
    2626    protected $srcBuilders; 
    27     protected $buildersCompilers; 
    2827 
    2928    public function __construct($sourceFile) { 
     
    3130    } 
    3231 
    33     public function compile ($doc, &$source, &$srcBuilders, &$buildersCompilers) { 
     32    public function compile ($doc, &$source, &$srcBuilders) { 
    3433 
    3534        global $gJConfig; 
    3635 
    3736        $this->srcBuilders = &$srcBuilders; 
    38         $this->buildersCompilers = &$buildersCompilers; 
    3937 
    4038        $xml = simplexml_import_dom($doc); 
     
    4543        foreach ($xml->children() as $controltype=>$control) { 
    4644            $source[] = $this->generatePHPControl($controltype, $control); 
    47             //foreach($gJConfig->_pluginsPathList_jforms as $buildername => $pluginPath) { 
    48             //    $srcBuilders[$buildername][]= $buildersCompilers[$buildername]->generateControl($controltype, $control); 
    49             foreach($buildersCompilers as $buildername => $builder) { 
    50                 $srcBuilders[$buildername][]= $builder->generateControl($controltype, $control); 
    51             } 
    5245        } 
    5346    } 
     
    167160        $this->attrDefaultvalue($source, $attributes); 
    168161        $this->readLabel($source, $control, 'output'); 
    169         $this->readHelpHintAlert($source, $control); 
     162        //$this->readHelpHintAlert($source, $control); 
    170163        return false; 
    171164    } 
     
    274267 
    275268            if(isset($control->help)){ 
    276                 $source[]='$ctrl2->hasHelp=true;'; 
     269                $source[]='$ctrl2->help=$ctrl->help;'; 
    277270            } 
    278271            if(isset($control->hint)){ 
     
    359352    protected function readHelpHintAlert(&$source, $control) { 
    360353        if(isset($control->help)){ // help value is readed in the html compiler 
    361             $source[]='$ctrl->hasHelp=true;'; 
     354            if(isset($control->help['locale'])){ 
     355                $source[]='$ctrl->help=jLocale::get(\''.(string)$control->help['locale'].'\');'; 
     356            }else{ 
     357                $source[]='$ctrl->help=\''.str_replace("'","\\'",(string)$control->help).'\';'; 
     358            } 
    362359        } 
    363360        if(isset($control->hint)){ 
  • branches/experimental/jforms-groups/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php

    r1041 r1050  
    191191                $src[]='$topctrl->addChildControl($ctrl2'.$itemname.');'; 
    192192            $source[]= implode("\n", $src); 
    193             /*foreach($gJConfig->_pluginsPathList_jforms as $buildername => $pluginPath) { 
    194                 $this->srcBuilders[$buildername][]= $this->buildersCompilers[$buildername]->generateControl($ctrltype, $control); 
    195             }*/ 
    196193        } 
    197194        return $ctrlcount; 
  • branches/experimental/jforms-groups/lib/jelix/forms/jFormsControl.class.php

    r1041 r1050  
    2323    public $label=''; 
    2424    public $defaultValue=''; 
    25     public $hasHelp = false
     25    public $help = ''
    2626    public $hint=''; 
    2727    public $alertInvalid=''; 
     
    199199    public $type='secretconfirm'; 
    200200    public $size=0; 
     201    /** 
     202     * ref value of the associated secret control 
     203     */ 
    201204    public $primarySecret=''; 
    202205 
     
    265268class jFormsControlOutput extends jFormsControl { 
    266269    public $type='output'; 
     270 
     271    function setValueFromRequest($request) { 
     272    } 
    267273 
    268274    public function check(){ 
  • branches/experimental/jforms-groups/lib/jelix/plugins/jforms/html/html.jformsbuilder.php

    r1041 r1050  
    1717 */ 
    1818abstract class htmlJformsBuilder extends jFormsBuilderBase { 
     19 
     20    protected $options; 
     21 
     22    protected $isRootControl = true; 
    1923 
    2024    public function outputAllControls() { 
     
    8993     */ 
    9094    public function outputHeader($params){ 
    91         $params = array_merge(array('errorDecorator'=>'jFormsErrorDecoratorAlert', 
     95        $this->options = array_merge(array('errorDecorator'=>'jFormsErrorDecoratorAlert', 
    9296                 'helpDecorator'=>'jFormsHelpDecoratorAlert', 'method'=>'post'), $params); 
    9397 
    9498        $url = jUrl::get($this->_action, $this->_actionParams, 2); // retourne le jurl correspondant 
    95         echo '<form action="',$url->scriptName,$url->pathInfo,'" method="'.$params['method'].'" id="', $this->_name,'"'; 
     99        echo '<form action="',$url->getPath(),'" method="'.$this->options['method'].'" id="', $this->_name,'"'; 
    96100        if($this->_form->hasUpload()) 
    97101            echo ' enctype="multipart/form-data">'; 
     
    99103            echo '>'; 
    100104 
     105        echo '<script type="text/javascript"> 
     106//<![CDATA[ 
     107jForms.tForm = new jFormsForm(\''.$this->_name.'\'); 
     108jForms.tForm.setErrorDecorator(new '.$this->options['errorDecorator'].'()); 
     109jForms.tForm.setHelpDecorator(new '.$this->options['helpDecorator'].'()); 
     110jForms.declareForm(jForms.tForm); 
     111//]]> 
     112</script>'; 
     113 
     114 
    101115        if(count($url->params) || count($this->_form->getHiddens())){ 
    102116            echo '<div class="jforms-hiddens">'; 
     
    110124            echo '</div>'; 
    111125        } 
    112         echo '<script type="text/javascript"> 
    113 //<![CDATA[ 
    114 ', $this->getJavascriptCheck($params['errorDecorator'],$params['helpDecorator']),' 
    115 //]]> 
    116 </script>'; 
     126 
    117127        $errors = $this->_form->getContainer()->errors; 
    118128        if(count($errors)){ 
     
    143153    } 
    144154 
     155    protected $jsContent = ''; 
     156 
    145157    public function outputFooter(){ 
     158        echo '<script type="text/javascript"> 
     159//<![CDATA[ 
     160'.$this->jsContent.' 
     161//]]> 
     162</script>'; 
    146163        echo '</form>'; 
    147164    } 
     
    171188        $hint = ($ctrl->hint == ''?'':' title="'.htmlspecialchars($ctrl->hint).'"'); 
    172189        $this->{'output'.$ctrl->type}($ctrl, $id, $class, $readonly, $hint); 
     190        $this->{'js'.$ctrl->type}($ctrl); 
    173191        $this->outputHelp($ctrl); 
     192    } 
     193 
     194    protected function commonJs($ctrl) { 
     195        if($ctrl->help){ 
     196            $this->jsContent .="jForms.tControl.help='".str_replace("'","\\'",$ctrl->help)."';\n"; 
     197        } 
     198 
     199        if($ctrl->required){ 
     200            $this->jsContent .="jForms.tControl.required = true;\n"; 
     201            if($ctrl->alertRequired){ 
     202                $this->jsContent .="jForms.tControl.errRequired='".str_replace("'","\\'",$ctrl->alertRequired)."';\n"; 
     203            } 
     204            else { 
     205                $this->jsContent .="jForms.tControl.errRequired='".str_replace("'","\\'",jLocale::get('jelix~formserr.js.err.required', $ctrl->label))."';\n"; 
     206            } 
     207        } 
     208 
     209        if($ctrl->alertInvalid){ 
     210            $this->jsContent .="jForms.tControl.errInvalid='".str_replace("'","\\'",$ctrl->alertInvalid)."';\n"; 
     211        } 
     212        else { 
     213            $this->jsContent .="jForms.tControl.errInvalid='".str_replace("'","\\'",jLocale::get('jelix~formserr.js.err.invalid', $ctrl->label))."';\n"; 
     214        } 
     215 
     216        if ($this->isRootControl) $this->jsContent .="jForms.tForm.addControl(jForms.tControl);\n"; 
    174217    } 
    175218 
     
    185228    } 
    186229 
     230    protected function jsInput($ctrl) { 
     231 
     232        $datatype = array('jDatatypeBoolean'=>'Boolean','jDatatypeDecimal'=>'Decimal','jDatatypeInteger'=>'Integer','jDatatypeHexadecimal'=>'Hexadecimal', 
     233                        'jDatatypeDatetime'=>'Datetime','jDatatypeDate'=>'Date','jDatatypeTime'=>'Time', 
     234                        'jDatatypeUrl'=>'Url','jDatatypeEmail'=>'Email','jDatatypeIPv4'=>'Ipv4','jDatatypeIPv6'=>'Ipv6'); 
     235        $isLocale = false; 
     236        if(isset($datatype[get_class($ctrl)])) 
     237            $dt = $datatype[get_class($ctrl)]; 
     238        else if ($ctrl->datatype instanceof jDatatypeLocaleTime) 
     239            { $dt = 'Time'; $isLocale = true; } 
     240        else if ($ctrl->datatype instanceof jDatatypeLocaleDate) 
     241            { $dt = 'LocaleDate'; $isLocale = true; } 
     242        else if ($ctrl->datatype instanceof jDatatypeLocaleDateTime) 
     243            { $dt = 'LocaleDatetime'; $isLocale = true; } 
     244        else 
     245            $dt = 'String'; 
     246 
     247        $this->jsContent .="jForms.tControl = new jFormsControl".$dt."('".$ctrl->ref."', '".str_replace("'","\'",$ctrl->label)."');\n"; 
     248        if ($isLocale) 
     249            $this->jsContent .="jForms.tControl.lang='".$GLOBALS['gJConfig']->locale."';\n"; 
     250 
     251        $maxl= $ctrl->datatype->getFacet('maxLength'); 
     252        if($maxl !== null) 
     253            $this->jsContent .="jForms.tControl.maxLength = '$maxl';\n"; 
     254 
     255        $minl= $ctrl->datatype->getFacet('minLength'); 
     256        if($minl !== null) 
     257            $this->jsContent .="jForms.tControl.minLength = '$minl';\n"; 
     258 
     259        $this->commonJs($ctrl); 
     260    } 
     261 
    187262    protected function outputCheckbox($ctrl, $id, $class, $readonly, $hint) { 
    188263        $value = $this->_form->getData($ctrl->ref); 
     
    194269        } 
    195270        echo '<input type="checkbox"',$id,$readonly,$hint,$class,$v,' value="',$ctrl->valueOnCheck,'"',$this->_endt; 
     271    } 
     272 
     273    protected function jsCheckbox($ctrl) { 
     274 
     275        $this->jsContent .="jForms.tControl = new jFormsControlBoolean('".$ctrl->ref."', '".str_replace("'","\'",$ctrl->label)."');\n"; 
     276 
     277        $this->commonJs($ctrl); 
    196278    } 
    197279 
     
    225307    } 
    226308 
     309    protected function jsCheckboxes($ctrl) { 
     310 
     311        $this->jsContent .="jForms.tControl = new jFormsControlString('".$ctrl->ref."[]', '".str_replace("'","\'",$ctrl->label)."');\n"; 
     312 
     313        $this->commonJs($ctrl); 
     314    } 
     315 
    227316    protected function outputRadiobuttons($ctrl, $id, $class, $readonly, $hint) { 
    228317        $i=0; 
     
    243332    } 
    244333 
     334    protected function jsRadiobuttons($ctrl) { 
     335 
     336        $this->jsContent .="jForms.tControl = new jFormsControlString('".$ctrl->ref."', '".str_replace("'","\'",$ctrl->label)."');\n"; 
     337 
     338        $this->commonJs($ctrl); 
     339    } 
     340 
    245341    protected function outputMenulist($ctrl, $id, $class, $readonly, $hint) { 
    246342        echo '<select',$id,$hint,$class,' size="1">'; 
     
    259355        } 
    260356        echo '</select>'; 
     357    } 
     358 
     359    protected function jsMenulist($ctrl) { 
     360 
     361        $this->jsContent .="jForms.tControl = new jFormsControlString('".$ctrl->ref."', '".str_replace("'","\'",$ctrl->label)."');\n"; 
     362 
     363        $this->commonJs($ctrl); 
    261364    } 
    262365 
     
    297400    } 
    298401 
     402    protected function jsListbox($ctrl) { 
     403        if($ctrl->multiple){ 
     404            $this->jsContent .= "jForms.tControl = new jFormsControlString('".$ctrl->ref."[]', '".str_replace("'","\'",$ctrl->label)."');\n"; 
     405            $this->jsContent .= "jForms.tControl.multiple = true;\n"; 
     406        } else { 
     407            $this->jsContent .="jForms.tControl = new jFormsControlString('".$ctrl->ref."', '".str_replace("'","\'",$ctrl->label)."');\n"; 
     408        } 
     409 
     410        $this->commonJs($ctrl); 
     411    } 
     412 
    299413    protected function outputTextarea($ctrl, $id, $class, $readonly, $hint) { 
    300414        $value = $this->_form->getData($ctrl->ref); 
     
    303417    } 
    304418 
     419    protected function jsTextarea($ctrl) { 
     420        $this->jsContent .="jForms.tControl = new jFormsControlString('".$ctrl->ref."', '".str_replace("'","\'",$ctrl->label)."');\n"; 
     421 
     422        $maxl= $ctrl->datatype->getFacet('maxLength'); 
     423        if($maxl !== null) 
     424            $this->jsContent .="jForms.tControl.maxLength = '$maxl';\n"; 
     425 
     426        $minl= $ctrl->datatype->getFacet('minLength'); 
     427        if($minl !== null) 
     428            $this->jsContent .="jForms.tControl.minLength = '$minl';\n"; 
     429 
     430        $this->commonJs($ctrl); 
     431    } 
     432 
    305433    protected function outputHtmleditor($ctrl, $id, $class, $readonly, $hint) { 
    306         $engine = $GLOBALS['gJConfig']->htmleditors[$ctrl->config.'.engine.name']; 
    307         echo '<script type="text/javascript"> 
    308 //<![CDATA[ 
    309 jelix_',$engine,'_',$ctrl->config.'("',$this->_name,'_',$ctrl->ref,'","',$this->_name,'"); 
    310 //]]> 
    311 </script>'; 
    312  
    313434        $value = $this->_form->getData($ctrl->ref); 
    314435        $rows = ' rows="'.$ctrl->rows.'" cols="'.$ctrl->cols.'"'; 
    315436        echo '<textarea',$id,$readonly,$hint,$class,$rows,'>',htmlspecialchars($value),'</textarea>'; 
     437    } 
     438 
     439    protected function jsHtmleditor($ctrl) { 
     440        $this->jsTextarea($ctrl); 
     441        $engine = $GLOBALS['gJConfig']->htmleditors[$ctrl->config.'.engine.name']; 
     442        $this->jsContent .= 'jelix_'.$engine.'_'.$ctrl->config.'("'.$this->_name.'_'.$ctrl->ref.'","'.$this->_name."\");\n"; 
    316443    } 
    317444 
     
    321448    } 
    322449 
     450    protected function jsSecret($ctrl) { 
     451        $this->jsTextarea($ctrl); 
     452    } 
     453 
    323454    protected function outputSecretconfirm($ctrl, $id, $class, $readonly, $hint) { 
    324455        $size = ($ctrl->size == 0?'': ' size="'.$ctrl->size.'"'); 
     
    326457    } 
    327458 
     459    protected function jsSecretconfirm($ctrl) { 
     460        // we assume that a secret confirm control is just after a secret control in the list of controls 
     461        $this->jsContent .= "jForms.tControl.confirmField = new jFormsControlSecretConfirm('".$ctrl->ref."_confirm', '".str_replace("'","\\'",$ctrl->label)."');\n"; 
     462    } 
     463 
    328464    protected function outputOutput($ctrl, $id, $class, $readonly, $hint) { 
    329465        $value = $this->_form->getData($ctrl->ref); 
    330466        echo '<input type="hidden"',$id,' value="',htmlspecialchars($value),'"',$this->_endt; 
    331467        echo '<span class="jforms-value"',$hint,'>',htmlspecialchars($value),'</span>'; 
     468    } 
     469 
     470    protected function jsOutput($ctrl) { 
    332471    } 
    333472 
     
    338477        echo '<input type="file"',$id,$readonly,$hint,$class,' value=""',$this->_endt; // ',htmlspecialchars($this->_form->getData($ctrl->ref)),' 
    339478 
     479    } 
     480 
     481    protected function jsUpload($ctrl) { 
     482        $this->jsContent .="jForms.tControl = new jFormsControlString('".$ctrl->ref."', '".str_replace("'","\'",$ctrl->label)."');\n"; 
     483 
     484        $this->commonJs($ctrl); 
    340485    } 
    341486 
     
    352497    } 
    353498 
     499    protected function jsSubmit($ctrl) { 
     500        // no javascript 
     501    } 
     502 
    354503    protected function outputReset($ctrl, $id, $class, $readonly, $hint) { 
    355504        echo '<button type="reset"',$id,$hint,' class="jforms-reset">',htmlspecialchars($ctrl->label),'</button>'; 
     505    } 
     506 
     507    protected function jsReset($ctrl) { 
     508        // no javascript 
    356509    } 
    357510 
     
    360513        echo '<span class="jforms-captcha-question">',htmlspecialchars($ctrl->question),'</span> '; 
    361514        echo '<input type="text"',$id,$hint,$class,' value=""',$this->_endt; 
     515    } 
     516 
     517    protected function jsCaptcha($ctrl) { 
     518        $this->jsTextarea($ctrl); 
    362519    } 
    363520 
     
    377534    } 
    378535 
     536    protected function jsGroup($ctrl) { 
     537        //no javacript 
     538    } 
     539 
    379540    protected function outputChoice($ctrl, $id, $class, $readonly, $hint) { 
    380541        echo '<ul class="jforms-choice jforms-ctl-'.$ctrl->ref.'" >',"\n"; 
     
    390551        $i=0; 
    391552        $id=' name="'.$ctrl->ref.'" id="'.$this->_name.'_'.$ctrl->ref.'_'; 
     553        $this->jsChoiceInternal($ctrl); 
     554        $this->jsContent .="jForms.tControl2 = jForms.tControl;\n"; 
     555        $this->isRootControl = false; 
    392556        foreach( $ctrl->items as $itemName=>$listctrl){ 
    393557            echo '<li><label><input type="radio"',$id,$i,'" value="',htmlspecialchars($itemName),'"'; 
     
    401565                // we remove readonly status so when a user change the choice and  
    402566                // javascript is deactivated, it can still change the value of the control 
    403                 $ro = $c->isReadOnly() && $readonly != ''
    404                 if($ro) $c->setReadOnly(false); 
     567                $ro = $c->isReadOnly()
     568                if($ro && $readonly != '') $c->setReadOnly(false); 
    405569                $this->outputControlLabel($c); 
    406570                echo ' '; 
    407571                $this->outputControl($c); 
    408                 if($ro) $c->setReadOnly($ro); 
     572                if($ro) $c->setReadOnly(true); 
    409573                echo "</span>\n"; 
    410             } 
     574                $this->jsContent .="jForms.tControl2.addControl(jForms.tControl, '".str_replace("'","\\'",$itemName)."');\n"; 
     575            } 
     576            if(!count($listctrl)) { 
     577                $this->jsContent .="jForms.tControl2.items['".str_replace("'","\\'",$itemName)."']=[];\n"; 
     578            } 
     579 
    411580            echo "</li>\n"; 
    412581            $i++; 
    413582        } 
    414583        echo "</ul>\n"; 
    415  
    416         echo '<script type="text/javascript"> 
    417 //<![CDATA[ 
    418 jForms.getForm("',$this->_name,'").getControl("',$ctrl->ref,'").activate("',$value,'"); 
    419 //]]> 
    420 </script>'; 
    421     } 
    422  
     584        $this->isRootControl = true; 
     585    } 
     586 
     587    protected function jsChoice($ctrl) { 
     588        $value = $this->_form->getData($ctrl->ref); 
     589        if(is_array($value)){ 
     590            if(isset($value[0])) 
     591                $value = $value[0]; 
     592            else 
     593                $value=''; 
     594        } 
     595        $this->jsContent .= "jForms.tControl2.activate('".$value."');\n"; 
     596    } 
     597 
     598    protected function jsChoiceInternal($ctrl) { 
     599 
     600        $this->jsContent .="jForms.tControl = new jFormsControlChoice('".$ctrl->ref."', '".str_replace("'","\'",$ctrl->label)."');\n"; 
     601 
     602        $this->commonJs($ctrl); 
     603    } 
    423604 
    424605    protected function outputHelp($ctrl) { 
    425         if ($ctrl->hasHelp) { 
     606        if ($ctrl->help) { 
    426607            if($ctrl->type == 'checkboxes' || ($ctrl->type == 'listbox' && $ctrl->multiple)){ 
    427608                $name=$ctrl->ref.'[]'; 
     
    432613        } 
    433614    } 
    434  
    435     abstract public function getJavascriptCheck($errDecorator,$helpDecorator); 
    436615} 
  • branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/block.formcontrols.php

    r926 r1050  
    44* @subpackage  jtpl_plugin 
    55* @author      Jouanneau Laurent 
    6 * @contributor Mickaël Fradin, F.Fernandez, Dominique Papin 
    7 * @copyright   2007-2008 Jouanneau laurent, 2007 Mickaël Fradin, 2007 F.Fernandez, 2007 Dominique Papin 
     6* @contributor Mickaël Fradin, F.Fernandez, Dominique Papin, Alexis Métaireau 
     7* @copyright   2007-2008 Jouanneau laurent, 2007 Mickaël Fradin, 2007 F.Fernandez, 2007 Dominique Papin, 2008 Alexis Métaireau 
    88* @link        http://www.jelix.org 
    99* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    5151        } 
    5252        elseif(count($param) == 2){ 
    53             $content = 'if(is_array('.$param[0].')){ 
     53            $content = 'if(is_array('.$param[0].') || '.$param[0].' === null){ 
    5454                $ctrls_to_display = '.$param[0].'; 
    5555                $ctrls_notto_display = '.$param[1].'; 
     
    9595       && (  ($ctrls_to_display===null && $ctrls_notto_display === null) 
    9696          || ($ctrls_to_display===null && !in_array($ctrlref, $ctrls_notto_display)) 
    97           || in_array($ctrlref, $ctrls_to_display))) { 
     97          || (is_array($ctrls_to_display) && in_array($ctrlref, $ctrls_to_display) ))) { 
    9898        $t->_privateVars[\'__ctrlref\'] = $ctrlref; 
    9999        $t->_privateVars[\'__ctrl\'] = $ctrl; 
  • branches/experimental/jforms-groups/testapp/modules/jelix_tests/tests/jforms.compiler.html_cli.php

    r985 r1050  
    1616require_once(JELIX_LIB_PATH.'forms/jFormsDatasource.class.php'); 
    1717require_once(JELIX_LIB_UTILS_PATH.'jDatatype.class.php'); 
    18 require_once(JELIX_LIB_PATH.'plugins/jforms/html/html.jformscompiler.php'); 
    19  
    2018 
    2119 
     
    2725 
    2826    public function testPhpForm($doc){ 
    29         $dummysrc = $dummyBuilders = $dummyCompilers = array(); 
    30         return $this->compile($doc, $dummysrc, $dummyBuilders, $dummyCompilers); 
     27        $dummysrc = $dummyBuilders = array(); 
     28        return $this->compile($doc, $dummysrc, $dummyBuilders); 
    3129    } 
    3230 
     
    3533    } 
    3634} 
    37  
    38 class testHtmlJformsCompiler extends htmlJformsCompiler { 
    39    public function testControl($controltype, $control){ 
    40         return $this->generateControl($controltype, $control); 
    41    } 
    42 } 
    43  
    4435 
    4536class UTjformsCompiler extends jUnitTestCase { 
     
    51050142=>'$ctrl= new jFormsControlinput(\'nom\'); 
    511502$ctrl->label=\'Votre nom\'; 
    512 $ctrl->hasHelp=true
     503$ctrl->help=\'vous devez indiquer votre nom\'
    513504$this->addControl($ctrl);', 
    51450543=>'$ctrl= new jFormsControlinput(\'nom\'); 
     
    653644); 
    654645 
    655  
    656     protected $_JsControls = array( 
    657 0=>'$label = \'Votre nom\'; 
    658 $js.="jForms.tControl = new jFormsControlString(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    659 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    660 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    661 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    662 1=>'$label = \'Votre nom\'; 
    663 $js.="jForms.tControl = new jFormsControlString(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    664 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    665 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    666 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    667 2=>'$label = \'Votre nom\'; 
    668 $js.="jForms.tControl = new jFormsControlString(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    669 $js.="jForms.tControl.required = true;\n"; 
    670 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    671 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    672 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    673 3=>'$label = jLocale::get(\'foo~bar\'); 
    674 $js.="jForms.tControl = new jFormsControlString(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    675 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    676 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    677 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    678 4=>'$label = \'Votre nom\'; 
    679 $js.="jForms.tControl = new jFormsControlString(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    680 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    681 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    682 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    683 5=>'$label = \'Votre nom\'; 
    684 $js.="jForms.tControl = new jFormsControlSecret(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    685 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    686 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    687 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    688 6=>'$label = \'Votre nom\'; 
    689 $js.="jForms.tControl = new jFormsControlString(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    690 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    691 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    692 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    693 7=>'$label = \'Votre nom\'; 
    694 $js.="jForms.tControl = new jFormsControlString(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    695 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    696 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    697 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    698 /*8=>'$label = \'Votre nom\'; 
    699 $js.="jForms.tControl = new jFormsControlString(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    700 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    701 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    702 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    703 9=>'$label = \'Votre nom\'; 
    704 $js.="jForms.tControl = new jFormsControlString(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    705 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    706 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    707 $js.="jForms.tForm.addControl(jForms.tControl);\n";',*/ 
    708 10=>'', 
    709 11=>'$label = \'Votre nom\'; 
    710 $js.="jForms.tControl = new jFormsControlString(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    711 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    712 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    713 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    714 12=>'$label = \'Votre nom\'; 
    715 $js.="jForms.tControl = new jFormsControlBoolean(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    716 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    717 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    718 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    719 13=>'$label = \'Votre nom\'; 
    720 $js.="jForms.tControl = new jFormsControlDecimal(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    721 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    722 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    723 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    724 14=>'$label = \'Votre nom\'; 
    725 $js.="jForms.tControl = new jFormsControlInteger(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    726 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    727 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    728 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    729 15=>'$label = \'Votre nom\'; 
    730 $js.="jForms.tControl = new jFormsControlHexadecimal(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    731 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    732 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    733 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    734 16=>'$label = \'Votre nom\'; 
    735 $js.="jForms.tControl = new jFormsControlDatetime(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    736 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    737 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    738 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    739 17=>'$label = \'Votre nom\'; 
    740 $js.="jForms.tControl = new jFormsControlDate(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    741 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    742 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    743 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    744 18=>'$label = \'Votre nom\'; 
    745 $js.="jForms.tControl = new jFormsControlTime(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    746 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    747 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    748 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    749 19=>'$label = \'Votre nom\'; 
    750 $js.="jForms.tControl = new jFormsControlLocaledatetime(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    751 $js.="jForms.tControl.lang=\'".$GLOBALS[\'gJConfig\']->locale."\';\n"; 
    752 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    753 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    754 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    755 20=>'$label = \'Votre nom\'; 
    756 $js.="jForms.tControl = new jFormsControlLocaledate(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    757 $js.="jForms.tControl.lang=\'".$GLOBALS[\'gJConfig\']->locale."\';\n"; 
    758 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    759 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    760 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    761 21=>'$label = \'Votre nom\'; 
    762 $js.="jForms.tControl = new jFormsControlTime(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    763 $js.="jForms.tControl.lang=\'".$GLOBALS[\'gJConfig\']->locale."\';\n"; 
    764 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    765 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    766 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    767 22=>'$label = \'Votre nom\'; 
    768 $js.="jForms.tControl = new jFormsControlUrl(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    769 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    770 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    771 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    772 23=>'$label = \'Votre nom\'; 
    773 $js.="jForms.tControl = new jFormsControlEmail(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    774 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    775 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    776 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    777 24=>'$label = \'Votre nom\'; 
    778 $js.="jForms.tControl = new jFormsControlIpv4(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    779 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    780 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    781 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    782 25=>'$label = \'Votre nom\'; 
    783 $js.="jForms.tControl = new jFormsControlIpv6(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    784 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    785 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    786 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    787 26=>'$label = \'Avez-vous un nom ?\'; 
    788 $js.="jForms.tControl = new jFormsControlBoolean(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    789 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    790 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    791 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    792 27=>'$label = \'Votre nom\'; 
    793 $js.="jForms.tControl = new jFormsControlString(\'nom[]\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    794 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    795 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    796 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    797 28=>'$label = \'Votre nom\'; 
    798 $js.="jForms.tControl = new jFormsControlString(\'nom[]\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    799 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    800 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    801 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    802 29=>'$label = \'Votre nom\'; 
    803 $js.="jForms.tControl = new jFormsControlString(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    804 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    805 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    806 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    807 30=>'$label = \'Votre nom\'; 
    808 $js.="jForms.tControl = new jFormsControlString(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    809 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    810 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    811 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    812 31=>'$label = \'Votre nom\'; 
    813 $js.="jForms.tControl = new jFormsControlString(\'nom\', \'".str_replace("\'","\\\'",$label)."\');\n"; 
    814 $js.="jForms.tControl.errRequired=\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.required\',$label))."\';\n"; 
    815 $js.="jForms.tControl.errInvalid =\'".str_replace("\'","\\\'",jLocale::get(\'jelix~formserr.js.err.invalid\', $label))."\';\n"; 
    816 $js.="jForms.tForm.addControl(jForms.tControl);\n";', 
    817