Changeset 914

Show
Ignore:
Timestamp:
04/29/08 16:15:04 (3 months ago)
Author:
laurentj
Message:

jforms-groups: work in progress #3

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/experimental/jforms-groups/lib/jelix-modules/junittests/classes/junittestcase.class.php

    r483 r914  
    143143                        $n = (string)$child['p']; 
    144144                        $v = $value->$n; 
    145                     }elseif(isset($child['method'])){ 
     145                    }elseif(isset($child['method'])){  // attribute method contain the method name and arguments 
    146146                        $n = (string)$child['method']; 
    147147                        eval('$v=$value->'.$n.';'); 
     
    180180                            $n = $key ++; 
    181181                        } 
    182 /*$this->dump($n, 'n='); 
    183 $this->dump($value, 'value'); 
    184 if(isset($value[$n])) 
    185 $this->dump($value[$n],'value de n OK'); 
    186 else 
    187 $this->dump('!!!!! value de n  pas ok');*/ 
    188182                        if($this->assertTrue(array_key_exists($n,$value),$name.'['.$n.'] doesn\'t exist arrrg'.$errormessage)){ 
    189183                            $v = $value[$n]; 
  • branches/experimental/jforms-groups/lib/jelix-modules/junittests/classes/junittestcase.class.php

    r483 r914  
    143143                        $n = (string)$child['p']; 
    144144                        $v = $value->$n; 
    145                     }elseif(isset($child['method'])){ 
     145                    }elseif(isset($child['method'])){  // attribute method contain the method name and arguments 
    146146                        $n = (string)$child['method']; 
    147147                        eval('$v=$value->'.$n.';'); 
     
    180180                            $n = $key ++; 
    181181                        } 
    182 /*$this->dump($n, 'n='); 
    183 $this->dump($value, 'value'); 
    184 if(isset($value[$n])) 
    185 $this->dump($value[$n],'value de n OK'); 
    186 else 
    187 $this->dump('!!!!! value de n  pas ok');*/ 
    188182                        if($this->assertTrue(array_key_exists($n,$value),$name.'['.$n.'] doesn\'t exist arrrg'.$errormessage)){ 
    189183                            $v = $value[$n]; 
  • branches/experimental/jforms-groups/lib/jelix-modules/junittests/classes/junittestcase.class.php

    r483 r914  
    143143                        $n = (string)$child['p']; 
    144144                        $v = $value->$n; 
    145                     }elseif(isset($child['method'])){ 
     145                    }elseif(isset($child['method'])){  // attribute method contain the method name and arguments 
    146146                        $n = (string)$child['method']; 
    147147                        eval('$v=$value->'.$n.';'); 
     
    180180                            $n = $key ++; 
    181181                        } 
    182 /*$this->dump($n, 'n='); 
    183 $this->dump($value, 'value'); 
    184 if(isset($value[$n])) 
    185 $this->dump($value[$n],'value de n OK'); 
    186 else 
    187 $this->dump('!!!!! value de n  pas ok');*/ 
    188182                        if($this->assertTrue(array_key_exists($n,$value),$name.'['.$n.'] doesn\'t exist arrrg'.$errormessage)){ 
    189183                            $v = $value[$n]; 
  • branches/experimental/jforms-groups/lib/jelix-modules/junittests/classes/junittestcase.class.php

    r483 r914  
    143143                        $n = (string)$child['p']; 
    144144                        $v = $value->$n; 
    145                     }elseif(isset($child['method'])){ 
     145                    }elseif(isset($child['method'])){  // attribute method contain the method name and arguments 
    146146                        $n = (string)$child['method']; 
    147147                        eval('$v=$value->'.$n.';'); 
     
    180180                            $n = $key ++; 
    181181                        } 
    182 /*$this->dump($n, 'n='); 
    183 $this->dump($value, 'value'); 
    184 if(isset($value[$n])) 
    185 $this->dump($value[$n],'value de n OK'); 
    186 else 
    187 $this->dump('!!!!! value de n  pas ok');*/ 
    188182                        if($this->assertTrue(array_key_exists($n,$value),$name.'['.$n.'] doesn\'t exist arrrg'.$errormessage)){ 
    189183                            $v = $value[$n]; 
  • branches/experimental/jforms-groups/lib/jelix-www/js/jforms.js

    r862 r914  
    315315    this.datatype = datatype; 
    316316    this.required = false; 
    317     this.readonly = false; 
    318317    this.errInvalid = ''; 
    319318    this.errRequired = ''; 
  • branches/experimental/jforms-groups/lib/jelix-www/js/jforms.js

    r862 r914  
    315315    this.datatype = datatype; 
    316316    this.required = false; 
    317     this.readonly = false; 
    318317    this.errInvalid = ''; 
    319318    this.errRequired = ''; 
  • branches/experimental/jforms-groups/lib/jelix-www/js/jforms.js

    r862 r914  
    315315    this.datatype = datatype; 
    316316    this.required = false; 
    317     this.readonly = false; 
    318317    this.errInvalid = ''; 
    319318    this.errRequired = ''; 
  • branches/experimental/jforms-groups/lib/jelix-www/js/jforms.js

    r862 r914  
    315315    this.datatype = datatype; 
    316316    this.required = false; 
    317     this.readonly = false; 
    318317    this.errInvalid = ''; 
    319318    this.errRequired = ''; 
  • branches/experimental/jforms-groups/lib/jelix/forms/jFormsBase.class.php

    r911 r914  
    4040     * @see jFormsControl 
    4141     */ 
    42     protected $_controls = array(); 
     42    protected $controls = array(); 
    4343 
    4444    /** 
     
    4848     * @see jFormsControl 
    4949     */ 
    50     protected $_topControls = array(); 
     50    protected $topControls = array(); 
    5151 
    5252    /** 
     
    5656     * @see jFormsControl 
    5757     */ 
    58     protected $_submits = array(); 
     58    protected $submits = array(); 
    5959 
    6060    /** 
     
    6464     * @since 1.0 
    6565     */ 
    66     protected $_reset = null; 
     66    protected $reset = null; 
    6767 
    6868    /** 
     
    7272     * @see jFormsControl 
    7373     */ 
    74     protected $_uploads = array(); 
     74    protected $uploads = array(); 
    7575 
    7676    /** 
     
    8080     * @see jFormsControl 
    8181     */ 
    82     protected $_hiddens = array(); 
     82    protected $hiddens = array(); 
    8383 
    8484    /** 
     
    8888     * @see jFormsControl 
    8989     */ 
    90     protected $_htmleditors = array(); 
     90    protected $htmleditors = array(); 
    9191 
    9292    /** 
     
    9494     * @var jFormsDataContainer 
    9595     */ 
    96     protected $_container = null; 
     96    protected $container = null; 
    9797 
    9898    /** 
     
    100100     * @var boolean 
    101101     */ 
    102     protected $_builders = array(); 
     102    protected $builders = array(); 
    103103 
    104104    /** 
     
    107107     * @var array  
    108108     */ 
    109     protected $_modifiedControls = array(); 
     109    protected $modifiedControls = array(); 
    110110    /** 
    111111     * the form selector 
    112112     * @var string 
    113113     */ 
    114     protected $_sel; 
     114    protected $sel; 
    115115 
    116116    /** 
     
    120120     */ 
    121121    public function __construct($sel, &$container, $reset = false){ 
    122         $this->_container = & $container; 
     122        $this->container = & $container; 
    123123        if($reset){ 
    124             $this->_container->clear(); 
    125         } 
    126         $this->_container->updatetime = time(); 
    127         $this->_sel = $sel; 
     124            $this->container->clear(); 
     125        } 
     126        $this->container->updatetime = time(); 
     127        $this->sel = $sel; 
    128128    } 
    129129 
     
    133133    public function initFromRequest(){ 
    134134        $req = $GLOBALS['gJCoord']->request; 
    135         $this->_modifiedControls=array(); 
    136         foreach($this->_topControls as $name=>$ctrl){ 
    137             if(!$this->_container->isActivated($name) || $this->_container->isReadonly($name)) 
     135        $this->modifiedControls=array(); 
     136        foreach($this->topControls as $name=>$ctrl){ 
     137            if(!$this->container->isActivated($name) || $this->container->isReadOnly($name)) 
    138138                continue; 
    139             $this->setData($name, $ctrl->getValueFromRequest($req), true); 
     139            $ctrl->setValueFromRequest($req); 
    140140        } 
    141141    } 
     
    146146     */ 
    147147    public function check(){ 
    148         $this->_container->errors = array(); 
    149         foreach($this->_controls as $name=>$ctrl){ 
    150             if(!$this->_container->isActivated($name)) 
    151                 continue; 
    152             $err = $ctrl->check(); 
    153             if($err !== null) 
    154                 $this->_container->errors[$name]= $err; 
    155         } 
    156         return count($this->_container->errors) == 0; 
     148        $this->container->errors = array(); 
     149        foreach($this->controls as $name=>$ctrl){ 
     150            if($this->container->isActivated($name)) 
     151                $ctrl->check(); 
     152        } 
     153        return count($this->container->errors) == 0; 
    157154    } 
    158155 
     
    166163    public function initFromDao($daoSelector, $key = null, $dbProfil=''){ 
    167164        if($key === null) 
    168             $key = $this->_container->formId; 
     165            $key = $this->container->formId; 
    169166        $dao = jDao::create($daoSelector, $dbProfil); 
    170167        $daorec = $dao->get($key); 
     
    173170                $key = var_export($key,true); 
    174171            throw new jExceptionForms('jelix~formserr.bad.formid.for.dao', 
    175                                       array($daoSelector, $key, $this->_sel)); 
     172                                      array($daoSelector, $key, $this->sel)); 
    176173        } 
    177174 
    178175        $prop = $dao->getProperties(); 
    179         foreach($this->_controls as $name=>$ctrl){ 
     176        foreach($this->controls as $name=>$ctrl){ 
    180177            if(isset($prop[$name])) { 
    181                 $this->_container->data[$name] = $ctrl->prepareValueFromDao($daorec->$name, $prop[$name]['datatype']); 
     178                $ctrl->setDataFromDao($daorec->$name, $prop[$name]['datatype']); 
    182179            } 
    183180        } 
     
    196193 
    197194        if($key === null) 
    198             $key = $this->_container->formId; 
     195            $key = $this->container->formId; 
    199196 
    200197        if($key != null && ($daorec = $dao->get($key))) { 
     
    208205 
    209206        $prop = $dao->getProperties(); 
    210         foreach($this->_controls as $name=>$ctrl){ 
     207        foreach($this->controls as $name=>$ctrl){ 
    211208            if(!isset($prop[$name])) 
    212209                continue; 
    213210 
    214             if(is_array($this->_container->data[$name])){ 
    215                 if( count ($this->_container->data[$name]) ==1){ 
    216                     $daorec->$name = $this->_container->data[$name][0]; 
     211            if(is_array($this->container->data[$name])){ 
     212                if( count ($this->container->data[$name]) ==1){ 
     213                    $daorec->$name = $this->container->data[$name][0]; 
    217214                }else{ 
    218215                    // do nothing for arrays ? 
     
    220217                } 
    221218            }else{ 
    222                 $daorec->$name = $this->_container->data[$name]; 
     219                $daorec->$name = $this->container->data[$name]; 
    223220            } 
    224221 
     
    283280     * in this order : properties for the formId, followed by the property which contains 
    284281     * the value. 
    285      * @param string $controlName  the name of the control 
     282     * @param string $name  the name of the control 
    286283     * @param string $daoSelector the selector of a dao file 
    287284     * @param mixed  $primaryKey the primary key if the form have no id. (optional) 
     
    290287     * @see jDao 
    291288     */ 
    292     public function initControlFromDao($controlName, $daoSelector, $primaryKey = null, $primaryKeyNames=null, $dbProfil=''){ 
    293  
    294         if(!$this->_controls[$controlName]->isContainer()){ 
    295             throw new jExceptionForms('jelix~formserr.control.not.container', array($controlName, $this->_sel)); 
    296         } 
    297  
    298         if(!$this->_container->formId) 
    299             throw new jExceptionForms('jelix~formserr.formid.undefined.for.dao', array($controlName, $this->_sel)); 
     289    public function initControlFromDao($name, $daoSelector, $primaryKey = null, $primaryKeyNames=null, $dbProfil=''){ 
     290 
     291        if(!$this->controls[$name]->isContainer()){ 
     292            throw new jExceptionForms('jelix~formserr.control.not.container', array($name, $this->sel)); 
     293        } 
     294 
     295        if(!$this->container->formId) 
     296            throw new jExceptionForms('jelix~formserr.formid.undefined.for.dao', array($name, $this->sel)); 
    300297 
    301298        if($primaryKey === null) 
    302             $primaryKey = $this->_container->formId; 
     299            $primaryKey = $this->container->formId; 
    303300 
    304301        if(!is_array($primaryKey)) 
     
    323320            $val[]=$res->$valuefield; 
    324321        } 
    325         $this->_container->data[$controlName]=$val
     322        $this->controls[$name]->setData($val)
    326323    } 
    327324 
     
    355352    public function saveControlToDao($controlName, $daoSelector, $primaryKey = null, $primaryKeyNames=null, $dbProfil=''){ 
    356353 
    357         if(!$this->_controls[$controlName]->isContainer()){ 
    358             throw new jExceptionForms('jelix~formserr.control.not.container', array($controlName, $this->_sel)); 
    359         } 
    360  
    361         $values = $this->_container->data[$controlName]; 
     354        if(!$this->controls[$controlName]->isContainer()){ 
     355            throw new jExceptionForms('jelix~formserr.control.not.container', array($controlName, $this->sel)); 
     356        } 
     357 
     358        $values = $this->container->data[$controlName]; 
    362359        if(!is_array($values) && $values != '') 
    363             throw new jExceptionForms('jelix~formserr.value.not.array', array($controlName, $this->_sel)); 
    364  
    365         if(!$this->_container->formId && !$primaryKey) 
    366             throw new jExceptionForms('jelix~formserr.formid.undefined.for.dao', array($controlName, $this->_sel)); 
     360            throw new jExceptionForms('jelix~formserr.value.not.array', array($controlName, $this->sel)); 
     361 
     362        if(!$this->container->formId && !$primaryKey) 
     363            throw new jExceptionForms('jelix~formserr.formid.undefined.for.dao', array($controlName, $this->sel)); 
    367364 
    368365        if($primaryKey === null) 
    369             $primaryKey = $this->_container->formId; 
     366            $primaryKey = $this->container->formId; 
    370367 
    371368        if(!is_array($primaryKey)) 
     
    401398     * @see jFormsBase::check 
    402399     */ 
    403     public function getErrors(){  return $this->_container->errors;  } 
     400    public function getErrors(){  return $this->container->errors;  } 
    404401 
    405402    /** 
     
    409406     */ 
    410407    public function setErrorOn($field, $mesg){ 
    411         $this->_container->errors[$field]=$mesg; 
     408        $this->container->errors[$field]=$mesg; 
    412409    } 
    413410 
     
    417414     * @param string $value the data value 
    418415     */ 
    419     public function setData($name, $value, $registerInModified = false){ 
    420         if($this->_controls[$name]->type == 'checkbox') { 
    421             if($value != $this->_controls[$name]->valueOnCheck){ 
    422                 if($value =='on') 
    423                     $value = $this->_controls[$name]->valueOnCheck; 
    424                 else 
    425                     $value = $this->_controls[$name]->valueOnUncheck; 
    426             } 
    427         } 
    428         if($registerInModified && $this->_container->data[$name] != $value) 
    429             $this->_modifiedControls[$name] = $this->_container->data[$name]; 
    430         $this->_container->data[$name]=$value; 
     416    public function setData($name, $value) { 
     417        $this->controls[$name]->setData($value); 
    431418    } 
    432419 
    433420    /** 
    434421     * 
    435      * @param string $name the name of the control/data 
     422     * @param string $name the name of the control/data 
    436423     * @return string the data value 
    437424     */ 
    438     public function getData($name)
    439         if(isset($this->_container->data[$name])) 
    440             return $this->_container->data[$name]; 
     425    public function getData($name)
     426        if(isset($this->container->data[$name])) 
     427            return $this->container->data[$name]; 
    441428        else return null; 
    442429    } 
     
    445432     * @return array form data 
    446433     */ 
    447     public function getAllData(){ return $this->_container->data; } 
     434    public function getAllData(){ return $this->container->data; } 
     435 
    448436    /** 
    449437     * DEPRECATED, use getAllData() instead. 
     
    453441    public function getDatas(){ 
    454442        trigger_error('jFormsBase::getDatas is deprecated, use getAllData instead',E_USER_NOTICE); 
    455         return $this->_container->data; 
    456     } 
     443        return $this->container->data; 
     444    } 
     445 
     446 
     447    function setModifiedFlag($name){ 
     448        $this->modifiedControls[$name] = $this->container->data[$name]; 
     449    } 
     450 
    457451 
    458452    /** 
     
    463457     */ 
    464458    public function deactivate($name, $deactivation=true) { 
    465         $this->_container->deactivate($name, $deactivation); 
    466         if($this->_controls[$name] implements jFormsControlGroups) { 
    467             $this->_controls[$name]->deactivate($this, $r); 
    468         } 
     459        $this->controls[$name]->deactivate($deactivation); 
    469460    } 
    470461 
     
    475466    */ 
    476467    public function isActivated($name) { 
    477         return $this->_container->isActivated($name); 
     468        return $this->container->isActivated($name); 
    478469    } 
    479470 
     
    484475     */ 
    485476    public function setReadOnly($name, $r = true) { 
    486         $this->_container->setReadOnly($name, $r); 
    487         if($this->_controls[$name] implements jFormsControlGroups) { 
    488             $this->_controls[$name]->setReadOnly($this, $r); 
    489         } 
     477        $this->controls[$name]->setReadOnly($r); 
    490478    } 
    491479 
     
    495483     */ 
    496484    public function isReadOnly($name) { 
    497         return $this->_container->isReadOnly($name); 
     485        return $this->container->isReadOnly($name); 
    498486    } 
    499487 
     
    502490     * @return jFormsDataContainer 
    503491     */ 
    504     public function getContainer(){ return $this->_container; } 
     492    public function getContainer(){ return $this->container; } 
    505493 
    506494    /** 
    507495     * @return array of jFormsControl objects 
    508496     */ 
    509     public function getControls(){ return $this->_controls; } 
     497    public function getControls(){ return $this->controls; } 
    510498 
    511499    /** 
     
    514502     * @since jelix 1.0 
    515503     */ 
    516     public function getControl($name){ return $this->_controls[$name]; } 
     504    public function getControl($name){ return $this->controls[$name]; } 
    517505 
    518506    /** 
    519507     * @return array of jFormsControl objects 
    520508     */ 
    521     public function getSubmits(){ return $this->_submits; } 
     509    public function getSubmits(){ return $this->submits; } 
    522510 
    523511     /** 
     
    525513     * @since 1.1 
    526514     */ 
    527     public function getHiddens(){ return $this->_hiddens; } 
     515    public function getHiddens(){ return $this->hiddens; } 
    528516 
    529517     /** 
     
    531519     * @since 1.1 
    532520     */ 
    533     public function getHtmlEditors(){ return $this->_htmleditors; } 
     521    public function getHtmlEditors(){ return $this->htmleditors; } 
    534522 
    535523     /** 
     
    537525     * @since 1.1 
    538526     */ 
    539     public function getModifiedControls(){ return $this->_modifiedControls; } 
     527    public function getModifiedControls(){ return $this->modifiedControls; } 
    540528 
    541529    /** 
    542530     * @return array of jFormsControl objects 
    543531     */ 
    544     public function getReset(){ return $this->_reset; } 
     532    public function getReset(){ return $this->reset; } 
    545533 
    546534    /** 
    547535     * @return string the formId 
    548536     */ 
    549     public function id(){ return $this->_container->formId; } 
     537    public function id(){ return $this->container->formId; } 
    550538 
    551539    /** 
    552540     * @return boolean 
    553541     */ 
    554     public function hasUpload() { return count($this->_uploads)>0; } 
     542    public function hasUpload() { return count($this->uploads)>0; } 
    555543 
    556544    /** 
     
    559547     */ 
    560548    public function getBuilder($buildertype){ 
    561         if(isset($this->_builders[$buildertype])){ 
    562             if(isset($this->_builders[$buildertype]['inst'])) 
    563                 return $this->_builders[$buildertype]['inst']; 
     549        if(isset($this->builders[$buildertype])){ 
     550            if(isset($this->builders[$buildertype]['inst'])) 
     551                return $this->builders[$buildertype]['inst']; 
    564552            include_once(JELIX_LIB_PATH.'forms/jFormsBuilderBase.class.php'); 
    565             include_once ($this->_builders[$buildertype][0]); 
    566             $c = $this->_builders[$buildertype][1]; 
    567             $o = $this->_builders[$buildertype]['inst'] = new $c($this); 
     553            include_once ($this->builders[$buildertype][0]); 
     554            $c = $this->builders[$buildertype][1]; 
     555            $o = $this->builders[$buildertype]['inst'] = new $c($this); 
    568556            return $o; 
    569557        }else{ 
    570             throw new jExceptionForms('jelix~formserr.invalid.form.builder', array($buildertype, $this->_sel)); 
     558            throw new jExceptionForms('jelix~formserr.invalid.form.builder', array($buildertype, $this->sel)); 
    571559        } 
    572560    } 
     
    584572    public function saveFile($controlName, $path='', $alternateName='') { 
    585573        if ($path == '') { 
    586             $path = JELIX_APP_VAR_PATH.'uploads/'.$this->_sel.'/'; 
     574            $path = JELIX_APP_VAR_PATH.'uploads/'.$this->sel.'/'; 
    587575        } else if (substr($path, -1, 1) != '/') { 
    588576            $path.='/'; 
    589577        } 
    590578 
    591         if(!isset($this->_controls[$controlName]) || $this->_controls[$controlName]->type != 'upload') 
    592             throw new jExceptionForms('jelix~formserr.invalid.upload.control.name', array($controlName, $this->_sel)); 
     579        if(!isset($this->controls[$controlName]) || $this->controls[$controlName]->type != 'upload') 
     580            throw new jExceptionForms('jelix~formserr.invalid.upload.control.name', array($controlName, $this->sel)); 
    593581 
    594582        if(!isset($_FILES[$controlName]) || $_FILES[$controlName]['error']!= UPLOAD_ERR_OK) 
    595583            return false; 
    596584 
    597         if($this->_controls[$controlName]->maxsize && $_FILES[$controlName]['size'] > $this->_controls[$controlName]->maxsize){ 
     585        if($this->controls[$controlName]->maxsize && $_FILES[$controlName]['size'] > $this->controls[$controlName]->maxsize){ 
    598586            return false; 
    599587        } 
     
    615603    public function saveAllFiles($path='') { 
    616604        if ($path == '') { 
    617             $path = JELIX_APP_VAR_PATH.'uploads/'.$this->_sel.'/'; 
     605            $path = JELIX_APP_VAR_PATH.'uploads/'.$this->sel.'/'; 
    618606        } else if (substr($path, -1, 1) != '/') { 
    619607            $path.='/'; 
    620608        } 
    621609 
    622         if(count($this->_uploads)) 
     610        if(count($this->uploads)) 
    623611            jFile::createDir($path); 
    624612 
    625         foreach($this->_uploads as $ref=>$ctrl){ 
     613        foreach($this->uploads as $ref=>$ctrl){ 
    626614 
    627615            if(!isset($_FILES[$ref]) || $_FILES[$ref]['error']!= UPLOAD_ERR_OK) 
     
    639627    */ 
    640628    protected function addControl($control){ 
    641         if(!$subcontrol) { 
    642             $this->_topControls [$control->ref] = $control; 
    643         } 
     629        $this->topControls [$control->ref] = $control; 
    644630        $this->addChildControl($control); 
    645631 
     
    655641    */ 
    656642    protected function addChildControl($control){ 
    657         $this->_controls [$control->ref] = $control; 
     643        $this->controls [$control->ref] = $control; 
    658644        if($control->type =='submit') 
    659             $this->_submits [$control->ref] = $control; 
     645            $this->submits [$control->ref] = $control; 
    660646        else if($control->type =='reset') 
    661             $this->_reset = $control; 
     647            $this->reset = $control; 
    662648        else if($control->type =='upload') 
    663             $this->_uploads [$control->ref] = $control; 
     649            $this->uploads [$control->ref] = $control; 
    664650        else if($control->type =='hidden') 
    665             $this->_hiddens [$control->ref] = $control; 
     651            $this->hiddens [$control->ref] = $control; 
    666652        else if($control->type == 'htmleditor') 
    667             $this->_htmleditors [$control->ref] = $control; 
     653            $this->htmleditors [$control->ref] = $control; 
    668654 
    669655        $control->setForm($this); 
    670656 
    671         if(!isset($this->_container->data[$control->ref])){ 
     657        if(!isset($this->container->data[$control->ref])){ 
    672658            if ( $control->datatype instanceof jDatatypeDateTime && $control->defaultValue == 'now') { 
    673659                $dt = new jDateTime(); 
    674660                $dt->now(); 
    675                 $this->_container->data[$control->ref] = $dt->toString($control->datatype->getFormat()); 
     661                $this->container->data[$control->ref] = $dt->toString($control->datatype->getFormat()); 
    676662            } 
    677663            else { 
    678                 $this->_container->data[$control->ref] = $control->defaultValue; 
     664                $this->container->data[$control->ref] = $control->defaultValue; 
    679665            } 
    680666        } 
  • branches/experimental/jforms-groups/lib/jelix/forms/jFormsBase.class.php

    r911 r914  
    4040     * @see jFormsControl 
    4141     */ 
    42     protected $_controls = array(); 
     42    protected $controls = array(); 
    4343 
    4444    /** 
     
    4848     * @see jFormsControl 
    4949     */ 
    50     protected $_topControls = array(); 
     50    protected $topControls = array(); 
    5151 
    5252    /** 
     
    5656     * @see jFormsControl 
    5757     */ 
    58     protected $_submits = array(); 
     58    protected $submits = array(); 
    5959 
    6060    /** 
     
    6464     * @since 1.0 
    6565     */ 
    66     protected $_reset = null; 
     66    protected $reset = null; 
    6767 
    6868    /** 
     
    7272     * @see jFormsControl 
    7373     */ 
    74     protected $_uploads = array(); 
     74    protected $uploads = array(); 
    7575 
    7676    /** 
     
    8080     * @see jFormsControl 
    8181     */ 
    82     protected $_hiddens = array(); 
     82    protected $hiddens = array(); 
    8383 
    8484    /** 
     
    8888     * @see jFormsControl 
    8989     */ 
    90     protected $_htmleditors = array(); 
     90    protected $htmleditors = array(); 
    9191 
    9292    /** 
     
    9494     * @var jFormsDataContainer 
    9595     */ 
    96     protected $_container = null; 
     96    protected $container = null; 
    9797 
    9898    /** 
     
    100100     * @var boolean 
    101101     */ 
    102     protected $_builders = array(); 
     102    protected $builders = array(); 
    103103 
    104104    /** 
     
    107107     * @var array  
    108108     */ 
    109     protected $_modifiedControls = array(); 
     109    protected $modifiedControls = array(); 
    110110    /** 
    111111     * the form selector 
    112112     * @var string 
    113113     */ 
    114     protected $_sel; 
     114    protected $sel; 
    115115 
    116<