Changeset 877
- Timestamp:
- 04/12/08 17:15:23 (8 months ago)
- Files:
-
- trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.ISO-8859-1.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.ISO-8859-1.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.ISO-8859-1.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.ISO-8859-1.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.ISO-8859-15.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.ISO-8859-15.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.ISO-8859-15.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.ISO-8859-15.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.UTF-8.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.UTF-8.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.UTF-8.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.UTF-8.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.ISO-8859-1.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.ISO-8859-1.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.ISO-8859-1.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.ISO-8859-1.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.ISO-8859-15.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.ISO-8859-15.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.ISO-8859-15.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.ISO-8859-15.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.UTF-8.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.UTF-8.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.UTF-8.properties (modified) (1 diff)
- trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.UTF-8.properties (modified) (1 diff)
- trunk/lib/jelix/forms/jFormsBase.class.php (modified) (5 diffs)
- trunk/lib/jelix/forms/jFormsBase.class.php (modified) (5 diffs)
- trunk/lib/jelix/forms/jFormsBase.class.php (modified) (5 diffs)
- trunk/lib/jelix/forms/jFormsBase.class.php (modified) (5 diffs)
- trunk/lib/jelix/forms/jFormsBuilderBase.class.php (modified) (3 diffs)
- trunk/lib/jelix/forms/jFormsBuilderBase.class.php (modified) (3 diffs)
- trunk/lib/jelix/forms/jFormsBuilderBase.class.php (modified) (3 diffs)
- trunk/lib/jelix/forms/jFormsBuilderBase.class.php (modified) (3 diffs)
- trunk/lib/jelix/forms/jFormsCompiler.class.php (modified) (1 diff)
- trunk/lib/jelix/forms/jFormsCompiler.class.php (modified) (1 diff)
- trunk/lib/jelix/forms/jFormsCompiler.class.php (modified) (1 diff)
- trunk/lib/jelix/forms/jFormsCompiler.class.php (modified) (1 diff)
- trunk/lib/jelix/forms/jFormsControl.class.php (modified) (1 diff)
- trunk/lib/jelix/forms/jFormsControl.class.php (modified) (1 diff)
- trunk/lib/jelix/forms/jFormsControl.class.php (modified) (1 diff)
- trunk/lib/jelix/forms/jFormsControl.class.php (modified) (1 diff)
- trunk/lib/jelix/forms/jFormsDataContainer.class.php (modified) (2 diffs)
- trunk/lib/jelix/forms/jFormsDataContainer.class.php (modified) (2 diffs)
- trunk/lib/jelix/forms/jFormsDataContainer.class.php (modified) (2 diffs)
- trunk/lib/jelix/forms/jFormsDataContainer.class.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/jforms/html/html.jformsbuilder.php (modified) (3 diffs)
- trunk/lib/jelix/plugins/jforms/html/html.jformsbuilder.php (modified) (3 diffs)
- trunk/lib/jelix/plugins/jforms/html/html.jformsbuilder.php (modified) (3 diffs)
- trunk/lib/jelix/plugins/jforms/html/html.jformsbuilder.php (modified) (3 diffs)
- trunk/lib/jelix/plugins/jforms/html/html.jformscompiler.php (modified) (1 diff)
- trunk/lib/jelix/plugins/jforms/html/html.jformscompiler.php (modified) (1 diff)
- trunk/lib/jelix/plugins/jforms/html/html.jformscompiler.php (modified) (1 diff)
- trunk/lib/jelix/plugins/jforms/html/html.jformscompiler.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/block.form.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/block.form.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/block.form.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/block.form.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/block.formcontrols.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/block.formcontrols.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/block.formcontrols.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/block.formcontrols.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/block.formdata.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/block.formdata.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/block.formdata.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/block.formdata.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/block.formsubmits.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/block.formsubmits.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/block.formsubmits.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/block.formsubmits.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/cfunction.formfull.php (modified) (3 diffs)
- trunk/lib/jelix/plugins/tpl/html/cfunction.formfull.php (modified) (3 diffs)
- trunk/lib/jelix/plugins/tpl/html/cfunction.formfull.php (modified) (3 diffs)
- trunk/lib/jelix/plugins/tpl/html/cfunction.formfull.php (modified) (3 diffs)
- trunk/lib/jelix/plugins/tpl/html/function.ctrl_control.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/function.ctrl_control.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/function.ctrl_control.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/function.ctrl_control.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/function.ctrl_label.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/function.ctrl_label.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/function.ctrl_label.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/function.ctrl_label.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/function.ctrl_value.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/function.ctrl_value.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/function.ctrl_value.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/function.ctrl_value.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/function.formdatafull.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/function.formdatafull.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/function.formdatafull.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/function.formdatafull.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/function.formreset.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/function.formreset.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/function.formreset.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/function.formreset.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/function.formsubmit.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/function.formsubmit.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/function.formsubmit.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/function.formsubmit.php (modified) (1 diff)
- trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html_cli.php (modified) (6 diffs)
- trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html_cli.php (modified) (6 diffs)
- trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html_cli.php (modified) (6 diffs)
- trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html_cli.php (modified) (6 diffs)
- trunk/testapp/modules/testapp/controllers/sampleform.classic.php (modified) (2 diffs)
- trunk/testapp/modules/testapp/controllers/sampleform.classic.php (modified) (2 diffs)
- trunk/testapp/modules/testapp/controllers/sampleform.classic.php (modified) (2 diffs)
- trunk/testapp/modules/testapp/controllers/sampleform.classic.php (modified) (2 diffs)
- trunk/testapp/modules/testapp/forms/sample.form.xml (modified) (1 diff)
- trunk/testapp/modules/testapp/forms/sample.form.xml (modified) (1 diff)
- trunk/testapp/modules/testapp/forms/sample.form.xml (modified) (1 diff)
- trunk/testapp/modules/testapp/forms/sample.form.xml (modified) (1 diff)
- trunk/testapp/modules/testapp/templates/forms_edit.tpl (modified) (2 diffs)
- trunk/testapp/modules/testapp/templates/forms_edit.tpl (modified) (2 diffs)
- trunk/testapp/modules/testapp/templates/forms_edit.tpl (modified) (2 diffs)
- trunk/testapp/modules/testapp/templates/forms_edit.tpl (modified) (2 diffs)
- trunk/testapp/modules/testapp/templates/sampleform.tpl (modified) (1 diff)
- trunk/testapp/modules/testapp/templates/sampleform.tpl (modified) (1 diff)
- trunk/testapp/modules/testapp/templates/sampleform.tpl (modified) (1 diff)
- trunk/testapp/modules/testapp/templates/sampleform.tpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.ISO-8859-1.properties
r571 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.ISO-8859-1.properties
r571 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.ISO-8859-1.properties
r571 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.ISO-8859-1.properties
r571 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.ISO-8859-15.properties
r791 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.ISO-8859-15.properties
r791 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.ISO-8859-15.properties
r791 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.ISO-8859-15.properties
r791 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.UTF-8.properties
r571 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.UTF-8.properties
r571 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.UTF-8.properties
r571 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_EN/crud.UTF-8.properties
r571 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.ISO-8859-1.properties
r571 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.ISO-8859-1.properties
r571 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.ISO-8859-1.properties
r571 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.ISO-8859-1.properties
r571 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.ISO-8859-15.properties
r791 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.ISO-8859-15.properties
r791 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.ISO-8859-15.properties
r791 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.ISO-8859-15.properties
r791 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.UTF-8.properties
r571 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.UTF-8.properties
r571 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.UTF-8.properties
r571 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/core-modules/jelix/locales/en_US/crud.UTF-8.properties
r571 r877 7 7 link.view.record = View 8 8 link.create.record = Create a new record 9 link.edit.record = Edit e9 link.edit.record = Edit 10 10 link.delete.record = Delete 11 11 trunk/lib/jelix/forms/jFormsBase.class.php
r861 r877 133 133 $this->_modifiedControls=array(); 134 134 foreach($this->_controls as $name=>$ctrl){ 135 if(!$this->_container->isActivated($name)) 136 continue; 135 137 $value = $req->getParam($name); 136 138 //@todo à prevoir un meilleur test, pour les formulaires sur plusieurs pages … … 173 175 $this->_container->errors = array(); 174 176 foreach($this->_controls as $name=>$ctrl){ 177 if(!$this->_container->isActivated($name)) 178 continue; 175 179 $err = $ctrl->check($this); 176 180 if($err !== null) … … 298 302 return compact("daorec", "dao", "toInsert"); 299 303 } 300 301 304 302 305 /** 303 306 * save data using a dao. … … 505 508 * @deprecated since 1.1 506 509 */ 507 public function getDatas(){ return $this->_container->data; } 510 public function getDatas(){ 511 trigger_error('jFormsBase::getDatas is deprecated, use getAllData instead',E_USER_NOTICE); 512 return $this->_container->data; 513 } 514 515 /** 516 * deactivate (or reactivate) a control 517 * When a control is deactivated, it is not displayes anymore in the output form 518 * @param string $name the name of the control 519 * @param boolean $deactivation TRUE to deactivate, or FALSE to reactivate 520 */ 521 public function deactivate($name, $deactivation=true) { 522 if($deactivation) { 523 $this->_container->deactivate($name); 524 } 525 else { 526 $this->_container->deactivate($name, false); 527 } 528 } 529 530 /** 531 * check if a control is activated 532 * @param $name the control name 533 * @return boolean true if it is activated 534 */ 535 public function isActivated($name) { 536 return $this->_container->isActivated($name); 537 } 538 508 539 /** 509 540 * @return jFormsDataContainer … … 563 594 /** 564 595 * @param string $buildertype the type name of a form builder 565 * @param string $action action selector where form will be submit566 * @param array $actionParams parameters for the action567 596 * @return jFormsBuilderBase 568 597 */ 569 public function getBuilder($buildertype , $action, $actionParams){598 public function getBuilder($buildertype){ 570 599 if(isset($this->_builders[$buildertype])){ 600 if(isset($this->_builders[$buildertype]['inst'])) 601 return $this->_builders[$buildertype]['inst']; 571 602 include_once(JELIX_LIB_PATH.'forms/jFormsBuilderBase.class.php'); 572 603 include_once ($this->_builders[$buildertype][0]); 573 604 $c = $this->_builders[$buildertype][1]; 574 return new $c($this, $action, $actionParams); 605 $o = $this->_builders[$buildertype]['inst'] = new $c($this); 606 return $o; 575 607 }else{ 576 608 throw new jExceptionForms('jelix~formserr.invalid.form.builder', array($buildertype, $this->_sel)); trunk/lib/jelix/forms/jFormsBase.class.php
r861 r877 133 133 $this->_modifiedControls=array(); 134 134 foreach($this->_controls as $name=>$ctrl){ 135 if(!$this->_container->isActivated($name)) 136 continue; 135 137 $value = $req->getParam($name); 136 138 //@todo à prevoir un meilleur test, pour les formulaires sur plusieurs pages … … 173 175 $this->_container->errors = array(); 174 176 foreach($this->_controls as $name=>$ctrl){ 177 if(!$this->_container->isActivated($name)) 178 continue; 175 179 $err = $ctrl->check($this); 176 180 if($err !== null) … … 298 302 return compact("daorec", "dao", "toInsert"); 299 303 } 300 301 304 302 305 /** 303 306 * save data using a dao. … … 505 508 * @deprecated since 1.1 506 509 */ 507 public function getDatas(){ return $this->_container->data; } 510 public function getDatas(){ 511 trigger_error('jFormsBase::getDatas is deprecated, use getAllData instead',E_USER_NOTICE); 512 return $this->_container->data; 513 } 514 515 /** 516 * deactivate (or reactivate) a control 517 * When a control is deactivated, it is not displayes anymore in the output form 518 * @param string $name the name of the control 519 * @param boolean $deactivation TRUE to deactivate, or FALSE to reactivate 520 */ 521 public function deactivate($name, $deactivation=true) { 522 if($deactivation) { 523 $this->_container->deactivate($name); 524 } 525 else { 526 $this->_container->deactivate($name, false); 527 } 528 } 529 530 /** 531 * check if a control is activated 532 * @param $name the control name 533 * @return boolean true if it is activated 534 */ 535 public function isActivated($name) { 536 return $this->_container->isActivated($name); 537 } 538 508 539 /** 509 540 * @return jFormsDataContainer … … 563 594 /** 564 595 * @param string $buildertype the type name of a form builder 565 * @param string $action action selector where form will be submit566 * @param array $actionParams parameters for the action567 596 * @return jFormsBuilderBase 568 597 */ 569 public function getBuilder($buildertype , $action, $actionParams){598 public function getBuilder($buildertype){ 570 599 if(isset($this->_builders[$buildertype])){ 600 if(isset($this->_builders[$buildertype]['inst'])) 601 return $this->_builders[$buildertype]['inst']; 571 602 include_once(JELIX_LIB_PATH.'forms/jFormsBuilderBase.class.php'); 572 603 include_once ($this->_builders[$buildertype][0]); 573 604 $c = $this->_builders[$buildertype][1]; 574 return new $c($this, $action, $actionParams); 605 $o = $this->_builders[$buildertype]['inst'] = new $c($this); 606 return $o; 575 607 }else{ 576 608 throw new jExceptionForms('jelix~formserr.invalid.form.builder', array($buildertype, $this->_sel)); trunk/lib/jelix/forms/jFormsBase.class.php
r861 r877 133 133 $this->_modifiedControls=array(); 134 134 foreach($this->_controls as $name=>$ctrl){ 135 if(!$this->_container->isActivated($name)) 136 continue; 135 137 $value = $req->getParam($name); 136 138 //@todo à prevoir un meilleur test, pour les formulaires sur plusieurs pages … … 173 175 $this->_container->errors = array(); 174 176 foreach($this->_controls as $name=>$ctrl){ 177 if(!$this->_container->isActivated($name)) 178 continue; 175 179 $err = $ctrl->check($this); 176 180 if($err !== null) … … 298 302 return compact("daorec", "dao", "toInsert"); 299 303 } 300 301 304 302 305 /** 303 306 * save data using a dao. … … 505 508 * @deprecated since 1.1 506 509 */ 507 public function getDatas(){ return $this->_container->data; } 510 public function getDatas(){ 511 trigger_error('jFormsBase::getDatas is deprecated, use getAllData instead',E_USER_NOTICE); 512 return $this->_container->data; 513 } 514 515 /** 516 * deactivate (or reactivate) a control 517 * When a control is deactivated, it is not displayes anymore in the output form 518 * @param string $name the name of the control 519 * @param boolean $deactivation TRUE to deactivate, or FALSE to reactivate 520 */ 521 public function deactivate($name, $deactivation=true) { 522 if($deactivation) { 523 $this->_container->deactivate($name); 524 } 525 else { 526 $this->_container->deactivate($name, false); 527 } 528 } 529 530 /** 531 * check if a control is activated 532 * @param $name the control name 533 * @return boolean true if it is activated 534 */ 535 public function isActivated($name) { 536 return $this->_container->isActivated($name); 537 } 538 508 539 /** 509 540 * @return jFormsDataContainer … … 563 594 /** 564 595 * @param string $buildertype the type name of a form builder 565 * @param string $action action selector where form will be submit566 * @param array $actionParams parameters for the action567 596 * @return jFormsBuilderBase 568 597 */ 569 public function getBuilder($buildertype , $action, $actionParams){598 public function getBuilder($buildertype){ 570 599 if(isset($this->_builders[$buildertype])){ 600 if(isset($this->_builders[$buildertype]['inst'])) 601 return $this->_builders[$buildertype]['inst']; 571 602 include_once(JELIX_LIB_PATH.'forms/jFormsBuilderBase.class.php'); 572 603 include_once ($this->_builders[$buildertype][0]); 573 604 $c = $this->_builders[$buildertype][1]; 574 return new $c($this, $action, $actionParams); 605 $o = $this->_builders[$buildertype]['inst'] = new $c($this); 606 return $o; 575 607 }else{ 576 608 throw new jExceptionForms('jelix~formserr.invalid.form.builder', array($buildertype, $this->_sel)); trunk/lib/jelix/forms/jFormsBase.class.php
r861 r877 133 133 $this->_modifiedControls=array(); 134 134 foreach($this->_controls as $name=>$ctrl){ 135 if(!$this->_container->isActivated($name)) 136 continue; 135 137 $value = $req->getParam($name); 136 138 //@todo à prevoir un meilleur test, pour les formulaires sur plusieurs pages … … 173 175 $this->_container->errors = array(); 174 176 foreach($this->_controls as $name=>$ctrl){ 177 if(!$this->_container->isActivated($name)) 178 continue; 175 179 $err = $ctrl->check($this); 176 180 if($err !== null) … … 298 302 return compact("daorec", "dao", "toInsert"); 299 303 } 300 301 304 302 305 /** 303 306 * save data using a dao. … … 505 508 * @deprecated since 1.1 506 509 */ 507 public function getDatas(){ return $this->_container->data; } 510 public function getDatas(){ 511 trigger_error('jFormsBase::getDatas is deprecated, use getAllData instead',E_USER_NOTICE); 512 return $this->_container->data; 513 } 514 515 /** 516 * deactivate (or reactivate) a control 517 * When a control is deactivated, it is not displayes anymore in the output form 518 * @param string $name the name of the control 519 * @param boolean $deactivation TRUE to deactivate, or FALSE to reactivate 520 */ 521 public function deactivate($name, $deactivation=true) { 522 if($deactivation) { 523 $this->_container->deactivate($name); 524 } 525 else { 526 $this->_container->deactivate($name, false); 527 } 528 } 529 530 /** 531 * check if a control is activated 532 * @param $name the control name 533 * @return boolean true if it is activated 534 */ 535 public function isActivated($name) { 536 return $this->_container->isActivated($name); 537 } 538 508 539 /** 509 540 * @return jFormsDataContainer … … 563 594 /** 564 595 * @param string $buildertype the type name of a form builder 565 * @param string $action action selector where form will be submit566 * @param array $actionParams parameters for the action567 596 * @return jFormsBuilderBase 568 597 */ 569 public function getBuilder($buildertype , $action, $actionParams){598 public function getBuilder($buildertype){ 570 599 if(isset($this->_builders[$buildertype])){ 600 if(isset($this->_builders[$buildertype]['inst'])) 601 return $this->_builders[$buildertype]['inst']; 571 602 include_once(JELIX_LIB_PATH.'forms/jFormsBuilderBase.class.php'); 572 603 include_once ($this->_builders[$buildertype][0]); 573 604 $c = $this->_builders[$buildertype][1]; 574 return new $c($this, $action, $actionParams); 605 $o = $this->_builders[$buildertype]['inst'] = new $c($this); 606 return $o; 575 607 }else{ 576 608 throw new jExceptionForms('jelix~formserr.invalid.form.builder', array($buildertype, $this->_sel)); trunk/lib/jelix/forms/jFormsBuilderBase.class.php
r836 r877 46 46 /** 47 47 * @param jFormsBase $form a form object 48 */ 49 public function __construct($form){ 50 $this->_form = $form; 51 } 52 53 /** 48 54 * @param string $action action selector where form will be submit 49 55
