Changeset 966

Show
Ignore:
Timestamp:
05/30/08 23:49:18 (6 months ago)
Author:
laurentj
Message:

applied patches of jforms on the experimental branch from the trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/experimental/jforms-groups/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php

    r920 r966  
    77* @contributor Uriel Corfa Emotic SARL 
    88* @copyright   2006-2008 Laurent Jouanneau 
    9 * @copyright   2007 Loic Mathaud, 2007 Dominique Papin 
     9* @copyright   2007 Loic Mathaud, 2007-2008 Dominique Papin 
    1010* @copyright   2007 Emotic SARL 
    1111* @link        http://www.jelix.org 
     
    142142 
    143143            if(isset($attrs['dao'])) { 
     144                if ( isset($attrs['profile'])) 
     145                    $profile = '\''.$attrs['profile'].'\''; 
     146                else 
     147                    $profile = '\'\''; 
    144148                if(isset($attrs['valueproperty'])) { 
    145149                    $daovalue = $attrs['valueproperty']; 
     
    159163 
    160164                $source[]='$ctrl->datasource = new jFormsDaoDatasource(\''.$attrs['dao'].'\',\''. 
    161                                 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\''.$criteria.');'; 
     165                                $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\','.$profile.$criteria.');'; 
    162166                if($controltype == 'submit'){ 
    163167                    $source[]='$ctrl->standalone=false;'; 
  • branches/experimental/jforms-groups/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php

    r920 r966  
    77* @contributor Uriel Corfa Emotic SARL 
    88* @copyright   2006-2008 Laurent Jouanneau 
    9 * @copyright   2007 Loic Mathaud, 2007 Dominique Papin 
     9* @copyright   2007 Loic Mathaud, 2007-2008 Dominique Papin 
    1010* @copyright   2007 Emotic SARL 
    1111* @link        http://www.jelix.org 
     
    142142 
    143143            if(isset($attrs['dao'])) { 
     144                if ( isset($attrs['profile'])) 
     145                    $profile = '\''.$attrs['profile'].'\''; 
     146                else 
     147                    $profile = '\'\''; 
    144148                if(isset($attrs['valueproperty'])) { 
    145149                    $daovalue = $attrs['valueproperty']; 
     
    159163 
    160164                $source[]='$ctrl->datasource = new jFormsDaoDatasource(\''.$attrs['dao'].'\',\''. 
    161                                 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\''.$criteria.');'; 
     165                                $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\','.$profile.$criteria.');'; 
    162166                if($controltype == 'submit'){ 
    163167                    $source[]='$ctrl->standalone=false;'; 
  • branches/experimental/jforms-groups/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php

    r920 r966  
    77* @contributor Uriel Corfa Emotic SARL 
    88* @copyright   2006-2008 Laurent Jouanneau 
    9 * @copyright   2007 Loic Mathaud, 2007 Dominique Papin 
     9* @copyright   2007 Loic Mathaud, 2007-2008 Dominique Papin 
    1010* @copyright   2007 Emotic SARL 
    1111* @link        http://www.jelix.org 
     
    142142 
    143143            if(isset($attrs['dao'])) { 
     144                if ( isset($attrs['profile'])) 
     145                    $profile = '\''.$attrs['profile'].'\''; 
     146                else 
     147                    $profile = '\'\''; 
    144148                if(isset($attrs['valueproperty'])) { 
    145149                    $daovalue = $attrs['valueproperty']; 
     
    159163 
    160164                $source[]='$ctrl->datasource = new jFormsDaoDatasource(\''.$attrs['dao'].'\',\''. 
    161                                 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\''.$criteria.');'; 
     165                                $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\','.$profile.$criteria.');'; 
    162166                if($controltype == 'submit'){ 
    163167                    $source[]='$ctrl->standalone=false;'; 
  • branches/experimental/jforms-groups/lib/jelix/forms/jFormsCompiler_jf_1_1.class.php

    r920 r966  
    77* @contributor Uriel Corfa Emotic SARL 
    88* @copyright   2006-2008 Laurent Jouanneau 
    9 * @copyright   2007 Loic Mathaud, 2007 Dominique Papin 
     9* @copyright   2007 Loic Mathaud, 2007-2008 Dominique Papin 
    1010* @copyright   2007 Emotic SARL 
    1111* @link        http://www.jelix.org 
     
    142142 
    143143            if(isset($attrs['dao'])) { 
     144                if ( isset($attrs['profile'])) 
     145                    $profile = '\''.$attrs['profile'].'\''; 
     146                else 
     147                    $profile = '\'\''; 
    144148                if(isset($attrs['valueproperty'])) { 
    145149                    $daovalue = $attrs['valueproperty']; 
     
    159163 
    160164                $source[]='$ctrl->datasource = new jFormsDaoDatasource(\''.$attrs['dao'].'\',\''. 
    161                                 $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\''.$criteria.');'; 
     165                                $attrs['method'].'\',\''.$attrs['labelproperty'].'\',\''.$daovalue.'\','.$profile.$criteria.');'; 
    162166                if($controltype == 'submit'){ 
    163167                    $source[]='$ctrl->standalone=false;'; 
  • branches/experimental/jforms-groups/lib/jelix/forms/jFormsDatasource.class.php

    r895 r966  
    44* @subpackage  forms 
    55* @author      Laurent Jouanneau 
    6 * @contributor 
     6* @contributor Dominique Papin 
    77* @copyright   2006-2007 Laurent Jouanneau 
     8* @copyright   2008 Dominique Papin 
    89* @link        http://www.jelix.org 
    910* @licence     http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 
     
    1819interface jIFormsDatasource { 
    1920    /** 
    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 
    2122     * an associative array  key => label 
    2223     * @param jFormsBase $form  the form 
     
    2728    /** 
    2829     * Return the label corresponding to the given key 
    29      * @param string $key the key  
     30     * @param string $key the key 
    3031     * @return string the label 
    3132     */ 
     
    8081    protected $labelProperty; 
    8182    protected $keyProperty; 
     83    protected $profile; 
    8284 
    8385    protected $criteria; 
     
    8688    protected $dao = null; 
    8789 
    88     function __construct ($selector ,$method , $label, $key, $criteria=null, $criteriaFrom=null){ 
     90    function __construct ($selector ,$method , $label, $key, $profile='', $criteria=null, $criteriaFrom=null){ 
    8991        $this->selector  = $selector; 
     92        $this->profile = $profile; 
    9093        $this->method = $method ; 
    9194        $this->labelProperty = $label; 
     
    9396        $this->criteriaFrom = $criteriaFrom; 
    9497        if($key == ''){ 
    95             $rec = jDao::createRecord($this->selector); 
     98            $rec = jDao::createRecord($this->selector, $this->profile); 
    9699            $pfields = $rec->getPrimaryKeyNames(); 
    97100            $key = $pfields[0]; 
     
    102105    public function getData($form){ 
    103106        if($this->dao === null) 
    104             $this->dao = jDao::get($this->selector); 
     107            $this->dao = jDao::get($this->selector, $this->profile); 
    105108        if($this->criteria !== null) { 
    106109            $found = $this->dao->{$this->method}($this->criteria); 
     
    118121 
    119122    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); 
    121124        $rec = $this->dao->get($key); 
    122125        if($rec) 
  • branches/experimental/jforms-groups/lib/jelix/forms/jFormsDatasource.class.php

    r895 r966  
    44* @subpackage  forms 
    55* @author      Laurent Jouanneau 
    6 * @contributor 
     6* @contributor Dominique Papin 
    77* @copyright   2006-2007 Laurent Jouanneau 
     8* @copyright   2008 Dominique Papin 
    89* @link        http://www.jelix.org 
    910* @licence     http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 
     
    1819interface jIFormsDatasource { 
    1920    /** 
    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 
    2122     * an associative array  key => label 
    2223     * @param jFormsBase $form  the form 
     
    2728    /** 
    2829     * Return the label corresponding to the given key 
    29      * @param string $key the key  
     30     * @param string $key the key 
    3031     * @return string the label 
    3132     */ 
     
    8081    protected $labelProperty; 
    8182    protected $keyProperty; 
     83    protected $profile; 
    8284 
    8385    protected $criteria; 
     
    8688    protected $dao = null; 
    8789 
    88     function __construct ($selector ,$method , $label, $key, $criteria=null, $criteriaFrom=null){ 
     90    function __construct ($selector ,$method , $label, $key, $profile='', $criteria=null, $criteriaFrom=null){ 
    8991        $this->selector  = $selector; 
     92        $this->profile = $profile; 
    9093        $this->method = $method ; 
    9194        $this->labelProperty = $label; 
     
    9396        $this->criteriaFrom = $criteriaFrom; 
    9497        if($key == ''){ 
    95             $rec = jDao::createRecord($this->selector); 
     98            $rec = jDao::createRecord($this->selector, $this->profile); 
    9699            $pfields = $rec->getPrimaryKeyNames(); 
    97100            $key = $pfields[0]; 
     
    102105    public function getData($form){ 
    103106        if($this->dao === null) 
    104             $this->dao = jDao::get($this->selector); 
     107            $this->dao = jDao::get($this->selector, $this->profile); 
    105108        if($this->criteria !== null) { 
    106109            $found = $this->dao->{$this->method}($this->criteria); 
     
    118121 
    119122    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); 
    121124        $rec = $this->dao->get($key); 
    122125        if($rec) 
  • branches/experimental/jforms-groups/lib/jelix/forms/jFormsDatasource.class.php

    r895 r966  
    44* @subpackage  forms 
    55* @author      Laurent Jouanneau 
    6 * @contributor 
     6* @contributor Dominique Papin 
    77* @copyright   2006-2007 Laurent Jouanneau 
     8* @copyright   2008 Dominique Papin 
    89* @link        http://www.jelix.org 
    910* @licence     http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 
     
    1819interface jIFormsDatasource { 
    1920    /** 
    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 
    2122     * an associative array  key => label 
    2223     * @param jFormsBase $form  the form 
     
    2728    /** 
    2829     * Return the label corresponding to the given key 
    29      * @param string $key the key  
     30     * @param string $key the key 
    3031     * @return string the label 
    3132     */ 
     
    8081    protected $labelProperty; 
    8182    protected $keyProperty; 
     83    protected $profile; 
    8284 
    8385    protected $criteria; 
     
    8688    protected $dao = null; 
    8789 
    88     function __construct ($selector ,$method , $label, $key, $criteria=null, $criteriaFrom=null){ 
     90    function __construct ($selector ,$method , $label, $key, $profile='', $criteria=null, $criteriaFrom=null){ 
    8991        $this->selector  = $selector; 
     92        $this->profile = $profile; 
    9093        $this->method = $method ; 
    9194        $this->labelProperty = $label; 
     
    9396        $this->criteriaFrom = $criteriaFrom; 
    9497        if($key == ''){ 
    95             $rec = jDao::createRecord($this->selector); 
     98            $rec = jDao::createRecord($this->selector, $this->profile); 
    9699            $pfields = $rec->getPrimaryKeyNames(); 
    97100            $key = $pfields[0]; 
     
    102105    public function getData($form){ 
    103106        if($this->dao === null) 
    104             $this->dao = jDao::get($this->selector); 
     107            $this->dao = jDao::get($this->selector, $this->profile); 
    105108        if($this->criteria !== null) { 
    106109            $found = $this->dao->{$this->method}($this->criteria); 
     
    118121 
    119122    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); 
    121124        $rec = $this->dao->get($key); 
    122125        if($rec) 
  • branches/experimental/jforms-groups/lib/jelix/forms/jFormsDatasource.class.php

    r895 r966  
    44* @subpackage  forms 
    55* @author      Laurent Jouanneau 
    6 * @contributor 
     6* @contributor Dominique Papin 
    77* @copyright   2006-2007 Laurent Jouanneau 
     8* @copyright   2008 Dominique Papin 
    89* @link        http://www.jelix.org 
    910* @licence     http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 
     
    1819interface jIFormsDatasource { 
    1920    /** 
    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 
    2122     * an associative array  key => label 
    2223     * @param jFormsBase $form  the form 
     
    2728    /** 
    2829     * Return the label corresponding to the given key 
    29      * @param string $key the key  
     30     * @param string $key the key 
    3031     * @return string the label 
    3132     */ 
     
    8081    protected $labelProperty; 
    8182    protected $keyProperty; 
     83    protected $profile; 
    8284 
    8385    protected $criteria; 
     
    8688    protected $dao = null; 
    8789 
    88     function __construct ($selector ,$method , $label, $key, $criteria=null, $criteriaFrom=null){ 
     90    function __construct ($selector ,$method , $label, $key, $profile='', $criteria=null, $criteriaFrom=null){ 
    8991        $this->selector  = $selector; 
     92        $this->profile = $profile; 
    9093        $this->method = $method ; 
    9194        $this->labelProperty = $label; 
     
    9396        $this->criteriaFrom = $criteriaFrom; 
    9497        if($key == ''){ 
    95             $rec = jDao::createRecord($this->selector); 
     98            $rec = jDao::createRecord($this->selector, $this->profile); 
    9699            $pfields = $rec->getPrimaryKeyNames(); 
    97100            $key = $pfields[0]; 
     
    102105    public function getData($form){ 
    103106        if($this->dao === null) 
    104             $this->dao = jDao::get($this->selector); 
     107            $this->dao = jDao::get($this->selector, $this->profile); 
    105108        if($this->criteria !== null) { 
    106109            $found = $this->dao->{$this->method}($this->criteria); 
     
    118121 
    119122    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); 
    121124        $rec = $this->dao->get($key); 
    122125        if($rec) 
  • branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/block.form.php

    r880 r966  
    44* @subpackage  jtpl_plugin 
    55* @author      Jouanneau Laurent 
     6* @contributor Julien Issler, Bastien Jaillot 
    67* @copyright   2006-2008 Jouanneau laurent 
     8* @copyright   2008 Julien Issler, 2008 Bastien Jaillot 
    79* @link        http://www.jelix.org 
    810* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    2729 *                     4=>name of your javascript object for help listener 
    2830 *                     5=>name of the method : 'post' or 'get' 
     31 *                     6=>name of the builder : default is html 
    2932 * @return string the php code corresponding to the begin or end of the block 
    3033 * @see jForms 
     
    4043    } 
    4144 
    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'); 
    4447        return ''; 
    4548    } 
     
    6265        $method='post'; 
    6366 
     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 
    6474    $content = ' $t->_privateVars[\'__form\'] = '.$param[0].'; 
    65 $t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder(\'html\'); 
     75$t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder('.$builder.'); 
    6676$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.')); 
    6878$t->_privateVars[\'__displayed_ctrl\'] = array(); 
    6979'; 
    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);}'); 
    7181 
    7282    return $content; 
  • branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/block.form.php

    r880 r966  
    44* @subpackage  jtpl_plugin 
    55* @author      Jouanneau Laurent 
     6* @contributor Julien Issler, Bastien Jaillot 
    67* @copyright   2006-2008 Jouanneau laurent 
     8* @copyright   2008 Julien Issler, 2008 Bastien Jaillot 
    79* @link        http://www.jelix.org 
    810* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    2729 *                     4=>name of your javascript object for help listener 
    2830 *                     5=>name of the method : 'post' or 'get' 
     31 *                     6=>name of the builder : default is html 
    2932 * @return string the php code corresponding to the begin or end of the block 
    3033 * @see jForms 
     
    4043    } 
    4144 
    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'); 
    4447        return ''; 
    4548    } 
     
    6265        $method='post'; 
    6366 
     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 
    6474    $content = ' $t->_privateVars[\'__form\'] = '.$param[0].'; 
    65 $t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder(\'html\'); 
     75$t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder('.$builder.'); 
    6676$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.')); 
    6878$t->_privateVars[\'__displayed_ctrl\'] = array(); 
    6979'; 
    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);}'); 
    7181 
    7282    return $content; 
  • branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/block.form.php

    r880 r966  
    44* @subpackage  jtpl_plugin 
    55* @author      Jouanneau Laurent 
     6* @contributor Julien Issler, Bastien Jaillot 
    67* @copyright   2006-2008 Jouanneau laurent 
     8* @copyright   2008 Julien Issler, 2008 Bastien Jaillot 
    79* @link        http://www.jelix.org 
    810* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    2729 *                     4=>name of your javascript object for help listener 
    2830 *                     5=>name of the method : 'post' or 'get' 
     31 *                     6=>name of the builder : default is html 
    2932 * @return string the php code corresponding to the begin or end of the block 
    3033 * @see jForms 
     
    4043    } 
    4144 
    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'); 
    4447        return ''; 
    4548    } 
     
    6265        $method='post'; 
    6366 
     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 
    6474    $content = ' $t->_privateVars[\'__form\'] = '.$param[0].'; 
    65 $t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder(\'html\'); 
     75$t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder('.$builder.'); 
    6676$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.')); 
    6878$t->_privateVars[\'__displayed_ctrl\'] = array(); 
    6979'; 
    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);}'); 
    7181 
    7282    return $content; 
  • branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/block.form.php

    r880 r966  
    44* @subpackage  jtpl_plugin 
    55* @author      Jouanneau Laurent 
     6* @contributor Julien Issler, Bastien Jaillot 
    67* @copyright   2006-2008 Jouanneau laurent 
     8* @copyright   2008 Julien Issler, 2008 Bastien Jaillot 
    79* @link        http://www.jelix.org 
    810* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    2729 *                     4=>name of your javascript object for help listener 
    2830 *                     5=>name of the method : 'post' or 'get' 
     31 *                     6=>name of the builder : default is html 
    2932 * @return string the php code corresponding to the begin or end of the block 
    3033 * @see jForms 
     
    4043    } 
    4144 
    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'); 
    4447        return ''; 
    4548    } 
     
    6265        $method='post'; 
    6366 
     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 
    6474    $content = ' $t->_privateVars[\'__form\'] = '.$param[0].'; 
    65 $t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder(\'html\'); 
     75$t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder('.$builder.'); 
    6676$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.')); 
    6878$t->_privateVars[\'__displayed_ctrl\'] = array(); 
    6979'; 
    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);}'); 
    7181 
    7282    return $content; 
  • branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/cfunction.formfull.php

    r885 r966  
    44* @subpackage   jtpl_plugin 
    55* @author       Laurent Jouanneau 
    6 * @contributor  Dominique Papin 
     6* @contributor  Dominique Papin, Julien Issler, Bastien Jaillot 
    77* @copyright    2007-2008 Laurent Jouanneau, 2007 Dominique Papin 
     8* @copyright    2008 Julien Issler, 2008 Bastien Jaillot 
    89* @link         http://www.jelix.org 
    910* @licence      GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    2526 *                     4=>name of your javascript object for help listener 
    2627 *                     5=>name of the method : POST or GET 
     28 *                     6=>name of the builder : default is html 
    2729 * @return string the php code corresponding to the begin or end of the block 
    2830 */ 
    2931function jtpl_cfunction_html_formfull($compiler, $params=array()) 
    3032{ 
    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'); 
    3335    } 
    3436 
    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);}'); 
    3643 
    3744    if(count($params) == 2){ 
     
    4855        $helpdecorator = "'jFormsHelpDecoratorAlert'"; 
    4956 
    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\''; 
    5358 
    5459    $content = ' $formfull = '.$params[0].'; 
    55     $formfullBuilder = $formfull->getBuilder(\'html\'); 
     60    $formfullBuilder = $formfull->getBuilder('.$builder.'); 
    5661    $formfullBuilder->setAction('.$params[1].','.$params[2].'); 
    57     $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.',\''.$method.'\')); 
     62    $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.','.$method.')); 
    5863    $formfullBuilder->outputAllControls(); 
    5964    $formfullBuilder->outputFooter();'; 
  • branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/cfunction.formfull.php

    r885 r966  
    44* @subpackage   jtpl_plugin 
    55* @author       Laurent Jouanneau 
    6 * @contributor  Dominique Papin 
     6* @contributor  Dominique Papin, Julien Issler, Bastien Jaillot 
    77* @copyright    2007-2008 Laurent Jouanneau, 2007 Dominique Papin 
     8* @copyright    2008 Julien Issler, 2008 Bastien Jaillot 
    89* @link         http://www.jelix.org 
    910* @licence      GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    2526 *                     4=>name of your javascript object for help listener 
    2627 *                     5=>name of the method : POST or GET 
     28 *                     6=>name of the builder : default is html 
    2729 * @return string the php code corresponding to the begin or end of the block 
    2830 */ 
    2931function jtpl_cfunction_html_formfull($compiler, $params=array()) 
    3032{ 
    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'); 
    3335    } 
    3436 
    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);}'); 
    3643 
    3744    if(count($params) == 2){ 
     
    4855        $helpdecorator = "'jFormsHelpDecoratorAlert'"; 
    4956 
    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\''; 
    5358 
    5459    $content = ' $formfull = '.$params[0].'; 
    55     $formfullBuilder = $formfull->getBuilder(\'html\'); 
     60    $formfullBuilder = $formfull->getBuilder('.$builder.'); 
    5661    $formfullBuilder->setAction('.$params[1].','.$params[2].'); 
    57     $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.',\''.$method.'\')); 
     62    $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.','.$method.')); 
    5863    $formfullBuilder->outputAllControls(); 
    5964    $formfullBuilder->outputFooter();'; 
  • branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/cfunction.formfull.php

    r885 r966  
    44* @subpackage   jtpl_plugin 
    55* @author       Laurent Jouanneau 
    6 * @contributor  Dominique Papin 
     6* @contributor  Dominique Papin, Julien Issler, Bastien Jaillot 
    77* @copyright    2007-2008 Laurent Jouanneau, 2007 Dominique Papin 
     8* @copyright    2008 Julien Issler, 2008 Bastien Jaillot 
    89* @link         http://www.jelix.org 
    910* @licence      GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    2526 *                     4=>name of your javascript object for help listener 
    2627 *                     5=>name of the method : POST or GET 
     28 *                     6=>name of the builder : default is html 
    2729 * @return string the php code corresponding to the begin or end of the block 
    2830 */ 
    2931function jtpl_cfunction_html_formfull($compiler, $params=array()) 
    3032{ 
    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'); 
    3335    } 
    3436 
    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);}'); 
    3643 
    3744    if(count($params) == 2){ 
     
    4855        $helpdecorator = "'jFormsHelpDecoratorAlert'"; 
    4956 
    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\''; 
    5358 
    5459    $content = ' $formfull = '.$params[0].'; 
    55     $formfullBuilder = $formfull->getBuilder(\'html\'); 
     60    $formfullBuilder = $formfull->getBuilder('.$builder.'); 
    5661    $formfullBuilder->setAction('.$params[1].','.$params[2].'); 
    57     $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.',\''.$method.'\')); 
     62    $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.','.$method.')); 
    5863    $formfullBuilder->outputAllControls(); 
    5964    $formfullBuilder->outputFooter();'; 
  • branches/experimental/jforms-groups/lib/jelix/plugins/tpl/html/cfunction.formfull.php

    r885 r966  
    44* @subpackage   jtpl_plugin 
    55* @author       Laurent Jouanneau 
    6 * @contributor  Dominique Papin 
     6* @contributor  Dominique Papin, Julien Issler, Bastien Jaillot 
    77* @copyright    2007-2008 Laurent Jouanneau, 2007 Dominique Papin 
     8* @copyright    2008 Julien Issler, 2008 Bastien Jaillot 
    89* @link         http://www.jelix.org 
    910* @licence      GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
     
    2526 *                     4=>name of your javascript object for help listener 
    2627 *                     5=>name of the method : POST or GET 
     28 *                     6=>name of the builder : default is html 
    2729 * @return string the php code corresponding to the begin or end of the block 
    2830 */ 
    2931function jtpl_cfunction_html_formfull($compiler, $params=array()) 
    3032{ 
    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'); 
    3335    } 
    3436 
    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);}'); 
    3643 
    3744    if(count($params) == 2){ 
     
    4855        $helpdecorator = "'jFormsHelpDecoratorAlert'"; 
    4956 
    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\''; 
    5358 
    5459    $content = ' $formfull = '.$params[0].'; 
    55     $formfullBuilder = $formfull->getBuilder(\'html\'); 
     60    $formfullBuilder = $formfull->getBuilder('.$builder.'); 
    5661    $formfullBuilder->setAction('.$params[1].','.$params[2].'); 
    57     $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.',\''.$method.'\')); 
     62