developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Ticket #696: trunk-defaultformbuilder-#696.patch

File trunk-defaultformbuilder-#696.patch, 8.2 KB (added by bibo, 13 years ago)
  • lib/jelix-scripts/templates/var/config/defaultconfig.ini.php.tpl

     
    1919theme = default
    2020
    2121#if ENABLE_OLD_ACTION_SELECTOR
    22 enableOldActionSelector = 
     22enableOldActionSelector =
    2323#endif
    2424
    2525[coordplugins]
    2626;nom = nom_fichier_ini
    2727
     28[tplplugins]
     29defaultJformsBuilder = html
     30
    2831[responses]
    2932html=myHtmlResponse
    3033
     
    7073
    7174; basePath corresponds to the path to the base directory of your application.
    7275; so if the url to access to your application is http://foo.com/aaa/bbb/www/index.php, you should
    73 ; set basePath = "/aaa/bbb/www/". 
     76; set basePath = "/aaa/bbb/www/".
    7477; if it is http://foo.com/index.php, set basePath="/"
    7578; Jelix can guess the basePath, so you can keep basePath empty. But in the case where there are some
    76 ; entry points which are not in the same directory (ex: you have two entry point : http://foo.com/aaa/index.php 
     79; entry points which are not in the same directory (ex: you have two entry point : http://foo.com/aaa/index.php
    7780; and http://foo.com/aaa/bbb/other.php ), you MUST set the basePath (ex here, the higher entry point is index.php so
    7881; : basePath="/aaa/" )
    7982basePath = ""
  • lib/jelix/core/defaultconfig.ini.php

     
    88
    99; see http://www.php.net/manual/en/timezones.php for supported values
    1010; if empty, jelix will try to get the default timezone
    11 timeZone = 
     11timeZone =
    1212
    1313checkTrustedModules = off
    1414
     
    2727
    2828[coordplugins]
    2929
     30[tplplugins]
     31defaultJformsBuilder = html
     32
    3033[responses]
    3134html = jResponseHtml
    3235redirect = jResponseRedirect
     
    117120; which contains "/foo/index.php"
    118121; This name can be SCRIPT_NAME, ORIG_SCRIPT_NAME, PHP_SELF or REDIRECT_SCRIPT_URL
    119122; it is detected automatically by jelix but it can fail sometime, so you could have to setup it
    120 scriptNameServerVariable = 
     123scriptNameServerVariable =
    121124
    122125
    123126; If you have a rewrite rules which move the pathinfo into a queryparameter
     
    130133
    131134; basePath corresponds to the path to the base directory of your application.
    132135; so if the url to access to your application is http://foo.com/aaa/bbb/www/index.php, you should
    133 ; set basePath = "/aaa/bbb/www/". 
     136; set basePath = "/aaa/bbb/www/".
    134137; if it is http://foo.com/index.php, set basePath="/"
    135138; Jelix can guess the basePath, so you can keep basePath empty. But in the case where there are some
    136 ; entry points which are not in the same directory (ex: you have two entry point : http://foo.com/aaa/index.php 
     139; entry points which are not in the same directory (ex: you have two entry point : http://foo.com/aaa/index.php
    137140; and http://foo.com/aaa/bbb/other.php ), you MUST set the basePath (ex here, the higher entry point is index.php so
    138141; : basePath="/aaa/" )
    139142basePath = ""
     
    259262default.engine.file[] = jelix/wymeditor/jquery.wymeditor.js
    260263default.config = jelix/wymeditor/config/default.js
    261264default.skin.default  = jelix/wymeditor/skins/default/screen.css
    262 
  • lib/jelix/plugins/tpl/html/block.form.php

     
    1818 * You can add this others parameters :<ul>
    1919 *   <li>string $builderName  (default is 'html')</li>
    2020 *   <li>array  $options for the builder. Example, for the 'html' builder : <ul>
    21  *      <li>"errDecorator"=>"name of your javascript object for error listener"</li>
     21 *      <li>"errorDecorator"=>"name of your javascript object for error listener"</li>
    2222 *      <li>"helpDecorator"=>"name of your javascript object for help listener"</li>
    2323 *      <li>"method" => "post" or "get". default is "post"</li>
    2424 *      </ul>
     
    2727 *
    2828 * @param jTplCompiler $compiler the template compiler
    2929 * @param boolean $begin true if it is the begin of block, else false
    30  * @param array $param 0=>form object 
    31  *                     1=>selector of submit action 
    32  *                     2=>array of parameters for submit action 
     30 * @param array $param 0=>form object
     31 *                     1=>selector of submit action
     32 *                     2=>array of parameters for submit action
    3333 *                     3=>name of the builder : default is html
    3434 *                     4=>array of options for the builder
    3535 * @return string the php code corresponding to the begin or end of the block
     
    3838function jtpl_block_html_form($compiler, $begin, $param=array())
    3939{
    4040
     41    global $gJConfig;
     42
    4143    if(!$begin){
    42         return '$t->_privateVars[\'__formbuilder\']->outputFooter(); 
    43 unset($t->_privateVars[\'__form\']); 
     44        return '$t->_privateVars[\'__formbuilder\']->outputFooter();
     45unset($t->_privateVars[\'__form\']);
    4446unset($t->_privateVars[\'__formbuilder\']);
    4547unset($t->_privateVars[\'__displayed_ctrl\']);';
    4648    }
     
    5355        $param[2] = 'array()';
    5456    }
    5557
    56     if(isset($param[3]) && $param[3] != '""'  && $param[3] != "''")
    57         $builder = $param[3];
     58    if(isset($param[3]) && trim($param[3]) != '""'  && trim($param[3]) != "''")
     59        $builder = trim($param[3]);
    5860    else
    59         $builder = "'html'";
     61        $builder = "'".$gJConfig->tplplugins['defaultJformsBuilder']."'";
    6062
    6163    if(isset($param[4]))
    62         $options = $param[4];
     64        $options = trim($param[4]);
    6365    else
    6466        $options = "array()";
    6567
     
    7375
    7476    return $content;
    7577}
    76 
  • lib/jelix/plugins/tpl/html/cfunction.formfull.php

     
    1313/**
    1414 * Display a full form without the use of other plugins.
    1515 * usage : {formfull $theformobject,'submit_action', $submit_action_params}
    16  * 
     16 *
    1717 * You can add this others parameters :<ul>
    1818 *   <li>string $builderName  (default is 'html')</li>
    1919 *   <li>array  $options for the builder. Example, for the 'html' builder : <ul>
    20  *      <li>"errDecorator"=>"name of your javascript object for error listener"</li>
     20 *      <li>"errorDecorator"=>"name of your javascript object for error listener"</li>
    2121 *      <li>"helpDecorator"=>"name of your javascript object for help listener"</li>
    2222 *      <li>"method" => "post" or "get". default is "post"</li>
    2323 *      </ul>
    2424 *    </li>
    2525 *  </ul>
    2626 * @param jTplCompiler $compiler the template compiler
    27  * @param array $param 0=>form object 
    28  *                     1=>selector of submit action 
    29  *                     2=>array of parameters for submit action 
     27 * @param array $param 0=>form object
     28 *                     1=>selector of submit action
     29 *                     2=>array of parameters for submit action
    3030 *                     3=>name of the builder : default is html
    3131 *                     4=>array of options for the builder
    3232 * @return string the php code corresponding to the begin or end of the block
    3333 */
    3434function jtpl_cfunction_html_formfull($compiler, $params=array())
    3535{
     36
     37    global $gJConfig;
     38
    3639    if (count($params) < 2 || count($params) > 5) {
    3740        $compiler->doError2('errors.tplplugin.cfunction.bad.argument.number','formfull','2-5');
    3841    }
    3942
    40     if(isset($params[3]) && $params[3] != '""'  && $params[3] != "''")
    41         $builder = $params[3];
     43    if(isset($params[3]) && trim($params[3]) != '""'  && trim($params[3]) != "''")
     44        $builder = trim($params[3]);
    4245    else
    43         $builder = "'html'";
     46        $builder = "'".$gJConfig->tplplugins['defaultJformsBuilder']."'";
    4447
    4548    $compiler->addMetaContent('if(isset('.$params[0].')) { '.$params[0].'->getBuilder('.$builder.')->outputMetaContent($t);}');
    4649
     
    4952    }
    5053
    5154    if(isset($params[4]))
    52         $options = $params[4];
     55        $options = trim($params[4]);
    5356    else
    5457        $options = "array()";
    5558
     
    6265
    6366    return $content;
    6467}
    65