Changeset 966
- Timestamp:
- 05/30/08 23:49:18 (6 months ago)
- Files:
-
- branches/experimental/jforms-groups/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php (modified) (3 diffs)
- branches/experimental/jforms-groups/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php (modified) (3 diffs)
- branches/experimental/jforms-groups/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php (modified) (3 diffs)
- branches/experimental/jforms-groups/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php (modified) (3 diffs)
- branches/experimental/jforms-groups/lib/jelix/forms/jFormsDatasource.class.php (modified) (8 diffs)
- branches/experimental/jforms-groups/lib/jelix/forms/jFormsDatasource.class.php (modified) (8 diffs)
- branches/experimental/jforms-groups/lib/jelix/forms/jFormsDatasource.class.php (modified) (8 diffs)
- branches/experimental/jforms-groups/lib/jelix/forms/jFormsDatasource.class.php (modified) (8 diffs)
- branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/block.form.php (modified) (4 diffs)
- branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/block.form.php (modified) (4 diffs)
- branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/block.form.php (modified) (4 diffs)
- branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/block.form.php (modified) (4 diffs)
- branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/cfunction.formfull.php (modified) (3 diffs)
- branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/cfunction.formfull.php (modified) (3 diffs)
- branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/cfunction.formfull.php (modified) (3 diffs)
- branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/cfunction.formfull.php (modified) (3 diffs)
- branches/experimental/jforms-groups/testapp/modules/jelix_tests/tests/jforms.compiler_1_1.html_cli.php (modified) (7 diffs)
- branches/experimental/jforms-groups/testapp/modules/jelix_tests/tests/jforms.compiler_1_1.html_cli.php (modified) (7 diffs)
- branches/experimental/jforms-groups/testapp/modules/jelix_tests/tests/jforms.compiler_1_1.html_cli.php (modified) (7 diffs)
- branches/experimental/jforms-groups/testapp/modules/jelix_tests/tests/jforms.compiler_1_1.html_cli.php (modified) (7 diffs)
- branches/experimental/jforms-groups/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html_cli.php (modified) (3 diffs)
- branches/experimental/jforms-groups/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html_cli.php (modified) (3 diffs)
- branches/experimental/jforms-groups/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html_cli.php (modified) (3 diffs)
- branches/experimental/jforms-groups/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html_cli.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/experimental/jforms-groups/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php
r920 r966 7 7 * @contributor Uriel Corfa Emotic SARL 8 8 * @copyright 2006-2008 Laurent Jouanneau 9 * @copyright 2007 Loic Mathaud, 2007 Dominique Papin9 * @copyright 2007 Loic Mathaud, 2007-2008 Dominique Papin 10 10 * @copyright 2007 Emotic SARL 11 11 * @link http://www.jelix.org … … 142 142 143 143 if(isset($attrs['dao'])) { 144 if ( isset($attrs['profile'])) 145 $profile = '\''.$attrs['profile'].'\''; 146 else 147 $profile = '\'\''; 144 148 if(isset($attrs['valueproperty'])) { 145 149 $daovalue = $attrs['valueproperty']; … … 159 163 160 164 $source[]='$ctrl->datasource = new jFormsDaoDatasource(\''.$attrs['dao'].'\',\''. 161 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\' '.$criteria.');';165 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\','.$profile.$criteria.');'; 162 166 if($controltype == 'submit'){ 163 167 $source[]='$ctrl->standalone=false;'; branches/experimental/jforms-groups/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php
r920 r966 7 7 * @contributor Uriel Corfa Emotic SARL 8 8 * @copyright 2006-2008 Laurent Jouanneau 9 * @copyright 2007 Loic Mathaud, 2007 Dominique Papin9 * @copyright 2007 Loic Mathaud, 2007-2008 Dominique Papin 10 10 * @copyright 2007 Emotic SARL 11 11 * @link http://www.jelix.org … … 142 142 143 143 if(isset($attrs['dao'])) { 144 if ( isset($attrs['profile'])) 145 $profile = '\''.$attrs['profile'].'\''; 146 else 147 $profile = '\'\''; 144 148 if(isset($attrs['valueproperty'])) { 145 149 $daovalue = $attrs['valueproperty']; … … 159 163 160 164 $source[]='$ctrl->datasource = new jFormsDaoDatasource(\''.$attrs['dao'].'\',\''. 161 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\' '.$criteria.');';165 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\','.$profile.$criteria.');'; 162 166 if($controltype == 'submit'){ 163 167 $source[]='$ctrl->standalone=false;'; branches/experimental/jforms-groups/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php
r920 r966 7 7 * @contributor Uriel Corfa Emotic SARL 8 8 * @copyright 2006-2008 Laurent Jouanneau 9 * @copyright 2007 Loic Mathaud, 2007 Dominique Papin9 * @copyright 2007 Loic Mathaud, 2007-2008 Dominique Papin 10 10 * @copyright 2007 Emotic SARL 11 11 * @link http://www.jelix.org … … 142 142 143 143 if(isset($attrs['dao'])) { 144 if ( isset($attrs['profile'])) 145 $profile = '\''.$attrs['profile'].'\''; 146 else 147 $profile = '\'\''; 144 148 if(isset($attrs['valueproperty'])) { 145 149 $daovalue = $attrs['valueproperty']; … … 159 163 160 164 $source[]='$ctrl->datasource = new jFormsDaoDatasource(\''.$attrs['dao'].'\',\''. 161 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\' '.$criteria.');';165 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\','.$profile.$criteria.');'; 162 166 if($controltype == 'submit'){ 163 167 $source[]='$ctrl->standalone=false;'; branches/experimental/jforms-groups/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php
r920 r966 7 7 * @contributor Uriel Corfa Emotic SARL 8 8 * @copyright 2006-2008 Laurent Jouanneau 9 * @copyright 2007 Loic Mathaud, 2007 Dominique Papin9 * @copyright 2007 Loic Mathaud, 2007-2008 Dominique Papin 10 10 * @copyright 2007 Emotic SARL 11 11 * @link http://www.jelix.org … … 142 142 143 143 if(isset($attrs['dao'])) { 144 if ( isset($attrs['profile'])) 145 $profile = '\''.$attrs['profile'].'\''; 146 else 147 $profile = '\'\''; 144 148 if(isset($attrs['valueproperty'])) { 145 149 $daovalue = $attrs['valueproperty']; … … 159 163 160 164 $source[]='$ctrl->datasource = new jFormsDaoDatasource(\''.$attrs['dao'].'\',\''. 161 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\' '.$criteria.');';165 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\','.$profile.$criteria.');'; 162 166 if($controltype == 'submit'){ 163 167 $source[]='$ctrl->standalone=false;'; branches/experimental/jforms-groups/lib/jelix/forms/jFormsDatasource.class.php
r895 r966 4 4 * @subpackage forms 5 5 * @author Laurent Jouanneau 6 * @contributor 6 * @contributor Dominique Papin 7 7 * @copyright 2006-2007 Laurent Jouanneau 8 * @copyright 2008 Dominique Papin 8 9 * @link http://www.jelix.org 9 10 * @licence http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file … … 18 19 interface jIFormsDatasource { 19 20 /** 20 * load and returns data to fill a control. The returned array should be 21 * load and returns data to fill a control. The returned array should be 21 22 * an associative array key => label 22 23 * @param jFormsBase $form the form … … 27 28 /** 28 29 * Return the label corresponding to the given key 29 * @param string $key the key 30 * @param string $key the key 30 31 * @return string the label 31 32 */ … … 80 81 protected $labelProperty; 81 82 protected $keyProperty; 83 protected $profile; 82 84 83 85 protected $criteria; … … 86 88 protected $dao = null; 87 89 88 function __construct ($selector ,$method , $label, $key, $ criteria=null, $criteriaFrom=null){90 function __construct ($selector ,$method , $label, $key, $profile='', $criteria=null, $criteriaFrom=null){ 89 91 $this->selector = $selector; 92 $this->profile = $profile; 90 93 $this->method = $method ; 91 94 $this->labelProperty = $label; … … 93 96 $this->criteriaFrom = $criteriaFrom; 94 97 if($key == ''){ 95 $rec = jDao::createRecord($this->selector );98 $rec = jDao::createRecord($this->selector, $this->profile); 96 99 $pfields = $rec->getPrimaryKeyNames(); 97 100 $key = $pfields[0]; … … 102 105 public function getData($form){ 103 106 if($this->dao === null) 104 $this->dao = jDao::get($this->selector );107 $this->dao = jDao::get($this->selector, $this->profile); 105 108 if($this->criteria !== null) { 106 109 $found = $this->dao->{$this->method}($this->criteria); … … 118 121 119 122 public function getLabel($key){ 120 if($this->dao === null) $this->dao = jDao::get($this->selector );123 if($this->dao === null) $this->dao = jDao::get($this->selector, $this->profile); 121 124 $rec = $this->dao->get($key); 122 125 if($rec) branches/experimental/jforms-groups/lib/jelix/forms/jFormsDatasource.class.php
r895 r966 4 4 * @subpackage forms 5 5 * @author Laurent Jouanneau 6 * @contributor 6 * @contributor Dominique Papin 7 7 * @copyright 2006-2007 Laurent Jouanneau 8 * @copyright 2008 Dominique Papin 8 9 * @link http://www.jelix.org 9 10 * @licence http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file … … 18 19 interface jIFormsDatasource { 19 20 /** 20 * load and returns data to fill a control. The returned array should be 21 * load and returns data to fill a control. The returned array should be 21 22 * an associative array key => label 22 23 * @param jFormsBase $form the form … … 27 28 /** 28 29 * Return the label corresponding to the given key 29 * @param string $key the key 30 * @param string $key the key 30 31 * @return string the label 31 32 */ … … 80 81 protected $labelProperty; 81 82 protected $keyProperty; 83 protected $profile; 82 84 83 85 protected $criteria; … … 86 88 protected $dao = null; 87 89 88 function __construct ($selector ,$method , $label, $key, $ criteria=null, $criteriaFrom=null){90 function __construct ($selector ,$method , $label, $key, $profile='', $criteria=null, $criteriaFrom=null){ 89 91 $this->selector = $selector; 92 $this->profile = $profile; 90 93 $this->method = $method ; 91 94 $this->labelProperty = $label; … … 93 96 $this->criteriaFrom = $criteriaFrom; 94 97 if($key == ''){ 95 $rec = jDao::createRecord($this->selector );98 $rec = jDao::createRecord($this->selector, $this->profile); 96 99 $pfields = $rec->getPrimaryKeyNames(); 97 100 $key = $pfields[0]; … … 102 105 public function getData($form){ 103 106 if($this->dao === null) 104 $this->dao = jDao::get($this->selector );107 $this->dao = jDao::get($this->selector, $this->profile); 105 108 if($this->criteria !== null) { 106 109 $found = $this->dao->{$this->method}($this->criteria); … … 118 121 119 122 public function getLabel($key){ 120 if($this->dao === null) $this->dao = jDao::get($this->selector );123 if($this->dao === null) $this->dao = jDao::get($this->selector, $this->profile); 121 124 $rec = $this->dao->get($key); 122 125 if($rec) branches/experimental/jforms-groups/lib/jelix/forms/jFormsDatasource.class.php
r895 r966 4 4 * @subpackage forms 5 5 * @author Laurent Jouanneau 6 * @contributor 6 * @contributor Dominique Papin 7 7 * @copyright 2006-2007 Laurent Jouanneau 8 * @copyright 2008 Dominique Papin 8 9 * @link http://www.jelix.org 9 10 * @licence http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file … … 18 19 interface jIFormsDatasource { 19 20 /** 20 * load and returns data to fill a control. The returned array should be 21 * load and returns data to fill a control. The returned array should be 21 22 * an associative array key => label 22 23 * @param jFormsBase $form the form … … 27 28 /** 28 29 * Return the label corresponding to the given key 29 * @param string $key the key 30 * @param string $key the key 30 31 * @return string the label 31 32 */ … … 80 81 protected $labelProperty; 81 82 protected $keyProperty; 83 protected $profile; 82 84 83 85 protected $criteria; … … 86 88 protected $dao = null; 87 89 88 function __construct ($selector ,$method , $label, $key, $ criteria=null, $criteriaFrom=null){90 function __construct ($selector ,$method , $label, $key, $profile='', $criteria=null, $criteriaFrom=null){ 89 91 $this->selector = $selector; 92 $this->profile = $profile; 90 93 $this->method = $method ; 91 94 $this->labelProperty = $label; … … 93 96 $this->criteriaFrom = $criteriaFrom; 94 97 if($key == ''){ 95 $rec = jDao::createRecord($this->selector );98 $rec = jDao::createRecord($this->selector, $this->profile); 96 99 $pfields = $rec->getPrimaryKeyNames(); 97 100 $key = $pfields[0]; … … 102 105 public function getData($form){ 103 106 if($this->dao === null) 104 $this->dao = jDao::get($this->selector );107 $this->dao = jDao::get($this->selector, $this->profile); 105 108 if($this->criteria !== null) { 106 109 $found = $this->dao->{$this->method}($this->criteria); … … 118 121 119 122 public function getLabel($key){ 120 if($this->dao === null) $this->dao = jDao::get($this->selector );123 if($this->dao === null) $this->dao = jDao::get($this->selector, $this->profile); 121 124 $rec = $this->dao->get($key); 122 125 if($rec) branches/experimental/jforms-groups/lib/jelix/forms/jFormsDatasource.class.php
r895 r966 4 4 * @subpackage forms 5 5 * @author Laurent Jouanneau 6 * @contributor 6 * @contributor Dominique Papin 7 7 * @copyright 2006-2007 Laurent Jouanneau 8 * @copyright 2008 Dominique Papin 8 9 * @link http://www.jelix.org 9 10 * @licence http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file … … 18 19 interface jIFormsDatasource { 19 20 /** 20 * load and returns data to fill a control. The returned array should be 21 * load and returns data to fill a control. The returned array should be 21 22 * an associative array key => label 22 23 * @param jFormsBase $form the form … … 27 28 /** 28 29 * Return the label corresponding to the given key 29 * @param string $key the key 30 * @param string $key the key 30 31 * @return string the label 31 32 */ … … 80 81 protected $labelProperty; 81 82 protected $keyProperty; 83 protected $profile; 82 84 83 85 protected $criteria; … … 86 88 protected $dao = null; 87 89 88 function __construct ($selector ,$method , $label, $key, $ criteria=null, $criteriaFrom=null){90 function __construct ($selector ,$method , $label, $key, $profile='', $criteria=null, $criteriaFrom=null){ 89 91 $this->selector = $selector; 92 $this->profile = $profile; 90 93 $this->method = $method ; 91 94 $this->labelProperty = $label; … … 93 96 $this->criteriaFrom = $criteriaFrom; 94 97 if($key == ''){ 95 $rec = jDao::createRecord($this->selector );98 $rec = jDao::createRecord($this->selector, $this->profile); 96 99 $pfields = $rec->getPrimaryKeyNames(); 97 100 $key = $pfields[0]; … … 102 105 public function getData($form){ 103 106 if($this->dao === null) 104 $this->dao = jDao::get($this->selector );107 $this->dao = jDao::get($this->selector, $this->profile); 105 108 if($this->criteria !== null) { 106 109 $found = $this->dao->{$this->method}($this->criteria); … … 118 121 119 122 public function getLabel($key){ 120 if($this->dao === null) $this->dao = jDao::get($this->selector );123 if($this->dao === null) $this->dao = jDao::get($this->selector, $this->profile); 121 124 $rec = $this->dao->get($key); 122 125 if($rec) branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/block.form.php
r880 r966 4 4 * @subpackage jtpl_plugin 5 5 * @author Jouanneau Laurent 6 * @contributor Julien Issler, Bastien Jaillot 6 7 * @copyright 2006-2008 Jouanneau laurent 8 * @copyright 2008 Julien Issler, 2008 Bastien Jaillot 7 9 * @link http://www.jelix.org 8 10 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 27 29 * 4=>name of your javascript object for help listener 28 30 * 5=>name of the method : 'post' or 'get' 31 * 6=>name of the builder : default is html 29 32 * @return string the php code corresponding to the begin or end of the block 30 33 * @see jForms … … 40 43 } 41 44 42 if(count($param) < 2 || count($param) > 6){43 $compiler->doError2('errors.tplplugin.block.bad.argument.number','form','2- 6');45 if(count($param) < 2 || count($param) > 7){ 46 $compiler->doError2('errors.tplplugin.block.bad.argument.number','form','2-7'); 44 47 return ''; 45 48 } … … 62 65 $method='post'; 63 66 67 $method = isset($param[5])?$param[5]:'\'post\''; 68 69 if(isset($param[6]) && $param[6] != '""' && $param[6] != "''") 70 $builder = $param[6]; 71 else 72 $builder = "'html'"; 73 64 74 $content = ' $t->_privateVars[\'__form\'] = '.$param[0].'; 65 $t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder( \'html\');75 $t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder('.$builder.'); 66 76 $t->_privateVars[\'__formbuilder\']->setAction('.$param[1].','.$param[2].'); 67 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.', \''.$method.'\'));77 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.','.$method.')); 68 78 $t->_privateVars[\'__displayed_ctrl\'] = array(); 69 79 '; 70 $compiler->addMetaContent('if(isset('.$param[0].')) { '.$param[0].'->getBuilder(\'html\')->outputMetaContent($t);}');80 $compiler->addMetaContent('if(isset('.$param[0].')) { '.$param[0].'->getBuilder('.$builder.')->outputMetaContent($t);}'); 71 81 72 82 return $content; branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/block.form.php
r880 r966 4 4 * @subpackage jtpl_plugin 5 5 * @author Jouanneau Laurent 6 * @contributor Julien Issler, Bastien Jaillot 6 7 * @copyright 2006-2008 Jouanneau laurent 8 * @copyright 2008 Julien Issler, 2008 Bastien Jaillot 7 9 * @link http://www.jelix.org 8 10 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 27 29 * 4=>name of your javascript object for help listener 28 30 * 5=>name of the method : 'post' or 'get' 31 * 6=>name of the builder : default is html 29 32 * @return string the php code corresponding to the begin or end of the block 30 33 * @see jForms … … 40 43 } 41 44 42 if(count($param) < 2 || count($param) > 6){43 $compiler->doError2('errors.tplplugin.block.bad.argument.number','form','2- 6');45 if(count($param) < 2 || count($param) > 7){ 46 $compiler->doError2('errors.tplplugin.block.bad.argument.number','form','2-7'); 44 47 return ''; 45 48 } … … 62 65 $method='post'; 63 66 67 $method = isset($param[5])?$param[5]:'\'post\''; 68 69 if(isset($param[6]) && $param[6] != '""' && $param[6] != "''") 70 $builder = $param[6]; 71 else 72 $builder = "'html'"; 73 64 74 $content = ' $t->_privateVars[\'__form\'] = '.$param[0].'; 65 $t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder( \'html\');75 $t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder('.$builder.'); 66 76 $t->_privateVars[\'__formbuilder\']->setAction('.$param[1].','.$param[2].'); 67 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.', \''.$method.'\'));77 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.','.$method.')); 68 78 $t->_privateVars[\'__displayed_ctrl\'] = array(); 69 79 '; 70 $compiler->addMetaContent('if(isset('.$param[0].')) { '.$param[0].'->getBuilder(\'html\')->outputMetaContent($t);}');80 $compiler->addMetaContent('if(isset('.$param[0].')) { '.$param[0].'->getBuilder('.$builder.')->outputMetaContent($t);}'); 71 81 72 82 return $content; branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/block.form.php
r880 r966 4 4 * @subpackage jtpl_plugin 5 5 * @author Jouanneau Laurent 6 * @contributor Julien Issler, Bastien Jaillot 6 7 * @copyright 2006-2008 Jouanneau laurent 8 * @copyright 2008 Julien Issler, 2008 Bastien Jaillot 7 9 * @link http://www.jelix.org 8 10 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 27 29 * 4=>name of your javascript object for help listener 28 30 * 5=>name of the method : 'post' or 'get' 31 * 6=>name of the builder : default is html 29 32 * @return string the php code corresponding to the begin or end of the block 30 33 * @see jForms … … 40 43 } 41 44 42 if(count($param) < 2 || count($param) > 6){43 $compiler->doError2('errors.tplplugin.block.bad.argument.number','form','2- 6');45 if(count($param) < 2 || count($param) > 7){ 46 $compiler->doError2('errors.tplplugin.block.bad.argument.number','form','2-7'); 44 47 return ''; 45 48 } … … 62 65 $method='post'; 63 66 67 $method = isset($param[5])?$param[5]:'\'post\''; 68 69 if(isset($param[6]) && $param[6] != '""' && $param[6] != "''") 70 $builder = $param[6]; 71 else 72 $builder = "'html'"; 73 64 74 $content = ' $t->_privateVars[\'__form\'] = '.$param[0].'; 65 $t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder( \'html\');75 $t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder('.$builder.'); 66 76 $t->_privateVars[\'__formbuilder\']->setAction('.$param[1].','.$param[2].'); 67 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.', \''.$method.'\'));77 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.','.$method.')); 68 78 $t->_privateVars[\'__displayed_ctrl\'] = array(); 69 79 '; 70 $compiler->addMetaContent('if(isset('.$param[0].')) { '.$param[0].'->getBuilder(\'html\')->outputMetaContent($t);}');80 $compiler->addMetaContent('if(isset('.$param[0].')) { '.$param[0].'->getBuilder('.$builder.')->outputMetaContent($t);}'); 71 81 72 82 return $content; branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/block.form.php
r880 r966 4 4 * @subpackage jtpl_plugin 5 5 * @author Jouanneau Laurent 6 * @contributor Julien Issler, Bastien Jaillot 6 7 * @copyright 2006-2008 Jouanneau laurent 8 * @copyright 2008 Julien Issler, 2008 Bastien Jaillot 7 9 * @link http://www.jelix.org 8 10 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 27 29 * 4=>name of your javascript object for help listener 28 30 * 5=>name of the method : 'post' or 'get' 31 * 6=>name of the builder : default is html 29 32 * @return string the php code corresponding to the begin or end of the block 30 33 * @see jForms … … 40 43 } 41 44 42 if(count($param) < 2 || count($param) > 6){43 $compiler->doError2('errors.tplplugin.block.bad.argument.number','form','2- 6');45 if(count($param) < 2 || count($param) > 7){ 46 $compiler->doError2('errors.tplplugin.block.bad.argument.number','form','2-7'); 44 47 return ''; 45 48 } … … 62 65 $method='post'; 63 66 67 $method = isset($param[5])?$param[5]:'\'post\''; 68 69 if(isset($param[6]) && $param[6] != '""' && $param[6] != "''") 70 $builder = $param[6]; 71 else 72 $builder = "'html'"; 73 64 74 $content = ' $t->_privateVars[\'__form\'] = '.$param[0].'; 65 $t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder( \'html\');75 $t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder('.$builder.'); 66 76 $t->_privateVars[\'__formbuilder\']->setAction('.$param[1].','.$param[2].'); 67 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.', \''.$method.'\'));77 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.','.$method.')); 68 78 $t->_privateVars[\'__displayed_ctrl\'] = array(); 69 79 '; 70 $compiler->addMetaContent('if(isset('.$param[0].')) { '.$param[0].'->getBuilder(\'html\')->outputMetaContent($t);}');80 $compiler->addMetaContent('if(isset('.$param[0].')) { '.$param[0].'->getBuilder('.$builder.')->outputMetaContent($t);}'); 71 81 72 82 return $content; branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/cfunction.formfull.php
r885 r966 4 4 * @subpackage jtpl_plugin 5 5 * @author Laurent Jouanneau 6 * @contributor Dominique Papin 6 * @contributor Dominique Papin, Julien Issler, Bastien Jaillot 7 7 * @copyright 2007-2008 Laurent Jouanneau, 2007 Dominique Papin 8 * @copyright 2008 Julien Issler, 2008 Bastien Jaillot 8 9 * @link http://www.jelix.org 9 10 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 25 26 * 4=>name of your javascript object for help listener 26 27 * 5=>name of the method : POST or GET 28 * 6=>name of the builder : default is html 27 29 * @return string the php code corresponding to the begin or end of the block 28 30 */ 29 31 function jtpl_cfunction_html_formfull($compiler, $params=array()) 30 32 { 31 if (count($params) < 2 || count($params) > 6) {32 $compiler->doError2('errors.tplplugin.cfunction.bad.argument.number','formfull','2- 6');33 if (count($params) < 2 || count($params) > 7) { 34 $compiler->doError2('errors.tplplugin.cfunction.bad.argument.number','formfull','2-7'); 33 35 } 34 36 35 $compiler->addMetaContent('if(isset('.$params[0].')) { '.$params[0].'->getBuilder(\'html\')->outputMetaContent($t);}'); 37 if(isset($params[6]) && $params[6] != '""' && $params[6] != "''") 38 $builder = $params[6]; 39 else 40 $builder = "'html'"; 41 42 $compiler->addMetaContent('if(isset('.$params[0].')) { '.$params[0].'->getBuilder('.$builder.')->outputMetaContent($t);}'); 36 43 37 44 if(count($params) == 2){ … … 48 55 $helpdecorator = "'jFormsHelpDecoratorAlert'"; 49 56 50 $method = strtolower(isset($params[5])?$params[5]:'post'); 51 if($method!='get' && $method!='post') 52 $method='post'; 57 $method = isset($params[5])?$params[5]:'\'post\''; 53 58 54 59 $content = ' $formfull = '.$params[0].'; 55 $formfullBuilder = $formfull->getBuilder( \'html\');60 $formfullBuilder = $formfull->getBuilder('.$builder.'); 56 61 $formfullBuilder->setAction('.$params[1].','.$params[2].'); 57 $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.', \''.$method.'\'));62 $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.','.$method.')); 58 63 $formfullBuilder->outputAllControls(); 59 64 $formfullBuilder->outputFooter();'; branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/cfunction.formfull.php
r885 r966 4 4 * @subpackage jtpl_plugin 5 5 * @author Laurent Jouanneau 6 * @contributor Dominique Papin 6 * @contributor Dominique Papin, Julien Issler, Bastien Jaillot 7 7 * @copyright 2007-2008 Laurent Jouanneau, 2007 Dominique Papin 8 * @copyright 2008 Julien Issler, 2008 Bastien Jaillot 8 9 * @link http://www.jelix.org 9 10 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 25 26 * 4=>name of your javascript object for help listener 26 27 * 5=>name of the method : POST or GET 28 * 6=>name of the builder : default is html 27 29 * @return string the php code corresponding to the begin or end of the block 28 30 */ 29 31 function jtpl_cfunction_html_formfull($compiler, $params=array()) 30 32 { 31 if (count($params) < 2 || count($params) > 6) {32 $compiler->doError2('errors.tplplugin.cfunction.bad.argument.number','formfull','2- 6');33 if (count($params) < 2 || count($params) > 7) { 34 $compiler->doError2('errors.tplplugin.cfunction.bad.argument.number','formfull','2-7'); 33 35 } 34 36 35 $compiler->addMetaContent('if(isset('.$params[0].')) { '.$params[0].'->getBuilder(\'html\')->outputMetaContent($t);}'); 37 if(isset($params[6]) && $params[6] != '""' && $params[6] != "''") 38 $builder = $params[6]; 39 else 40 $builder = "'html'"; 41 42 $compiler->addMetaContent('if(isset('.$params[0].')) { '.$params[0].'->getBuilder('.$builder.')->outputMetaContent($t);}'); 36 43 37 44 if(count($params) == 2){ … … 48 55 $helpdecorator = "'jFormsHelpDecoratorAlert'"; 49 56 50 $method = strtolower(isset($params[5])?$params[5]:'post'); 51 if($method!='get' && $method!='post') 52 $method='post'; 57 $method = isset($params[5])?$params[5]:'\'post\''; 53 58 54 59 $content = ' $formfull = '.$params[0].'; 55 $formfullBuilder = $formfull->getBuilder( \'html\');60 $formfullBuilder = $formfull->getBuilder('.$builder.'); 56 61 $formfullBuilder->setAction('.$params[1].','.$params[2].'); 57 $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.', \''.$method.'\'));62 $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.','.$method.')); 58 63 $formfullBuilder->outputAllControls(); 59 64 $formfullBuilder->outputFooter();'; branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/cfunction.formfull.php
r885 r966 4 4 * @subpackage jtpl_plugin 5 5 * @author Laurent Jouanneau 6 * @contributor Dominique Papin 6 * @contributor Dominique Papin, Julien Issler, Bastien Jaillot 7 7 * @copyright 2007-2008 Laurent Jouanneau, 2007 Dominique Papin 8 * @copyright 2008 Julien Issler, 2008 Bastien Jaillot 8 9 * @link http://www.jelix.org 9 10 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 25 26 * 4=>name of your javascript object for help listener 26 27 * 5=>name of the method : POST or GET 28 * 6=>name of the builder : default is html 27 29 * @return string the php code corresponding to the begin or end of the block 28 30 */ 29 31 function jtpl_cfunction_html_formfull($compiler, $params=array()) 30 32 { 31 if (count($params) < 2 || count($params) > 6) {32 $compiler->doError2('errors.tplplugin.cfunction.bad.argument.number','formfull','2- 6');33 if (count($params) < 2 || count($params) > 7) { 34 $compiler->doError2('errors.tplplugin.cfunction.bad.argument.number','formfull','2-7'); 33 35 } 34 36 35 $compiler->addMetaContent('if(isset('.$params[0].')) { '.$params[0].'->getBuilder(\'html\')->outputMetaContent($t);}'); 37 if(isset($params[6]) && $params[6] != '""' && $params[6] != "''") 38 $builder = $params[6]; 39 else 40 $builder = "'html'"; 41 42 $compiler->addMetaContent('if(isset('.$params[0].')) { '.$params[0].'->getBuilder('.$builder.')->outputMetaContent($t);}'); 36 43 37 44 if(count($params) == 2){ … … 48 55 $helpdecorator = "'jFormsHelpDecoratorAlert'"; 49 56 50 $method = strtolower(isset($params[5])?$params[5]:'post'); 51 if($method!='get' && $method!='post') 52 $method='post'; 57 $method = isset($params[5])?$params[5]:'\'post\''; 53 58 54 59 $content = ' $formfull = '.$params[0].'; 55 $formfullBuilder = $formfull->getBuilder( \'html\');60 $formfullBuilder = $formfull->getBuilder('.$builder.'); 56 61 $formfullBuilder->setAction('.$params[1].','.$params[2].'); 57 $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.', \''.$method.'\'));62 $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.','.$method.')); 58 63 $formfullBuilder->outputAllControls(); 59 64 $formfullBuilder->outputFooter();'; branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/cfunction.formfull.php
r885 r966 4 4 * @subpackage jtpl_plugin 5 5 * @author Laurent Jouanneau 6 * @contributor Dominique Papin 6 * @contributor Dominique Papin, Julien Issler, Bastien Jaillot 7 7 * @copyright 2007-2008 Laurent Jouanneau, 2007 Dominique Papin 8 * @copyright 2008 Julien Issler, 2008 Bastien Jaillot 8 9 * @link http://www.jelix.org 9 10 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 25 26 * 4=>name of your javascript object for help listener 26 27 * 5=>name of the method : POST or GET 28 * 6=>name of the builder : default is html 27 29 * @return string the php code corresponding to the begin or end of the block 28 30 */ 29 31 function jtpl_cfunction_html_formfull($compiler, $params=array()) 30 32 { 31 if (count($params) < 2 || count($params) > 6) {32 $compiler->doError2('errors.tplplugin.cfunction.bad.argument.number','formfull','2- 6');33 if (count($params) < 2 || count($params) > 7) { 34 $compiler->doError2('errors.tplplugin.cfunction.bad.argument.number','formfull','2-7'); 33 35 } 34 36 35 $compiler->addMetaContent('if(isset('.$params[0].')) { '.$params[0].'->getBuilder(\'html\')->outputMetaContent($t);}'); 37 if(isset($params[6]) && $params[6] != '""' && $params[6] != "''") 38 $builder = $params[6]; 39 else 40 $builder = "'html'"; 41 42 $compiler->addMetaContent('if(isset('.$params[0].')) { '.$params[0].'->getBuilder('.$builder.')->outputMetaContent($t);}'); 36 43 37 44 if(count($params) == 2){ … … 48 55 $helpdecorator = "'jFormsHelpDecoratorAlert'"; 49 56 50 $method = strtolower(isset($params[5])?$params[5]:'post'); 51 if($method!='get' && $method!='post') 52 $method='post'; 57 $method = isset($params[5])?$params[5]:'\'post\''; 53 58 54 59 $content = ' $formfull = '.$params[0].'; 55 $formfullBuilder = $formfull->getBuilder( \'html\');60 $formfullBuilder = $formfull->getBuilder('.$builder.'); 56 61 $formfullBuilder->setAction('.$params[1].','.$params[2].'); 57 $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.', \''.$method.'\'));62
