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 #592: 592-jForms-GET-method.3.diff

File 592-jForms-GET-method.3.diff, 3.0 KB (added by Julien, 14 years ago)

the third one is always the good one ;)

  • lib/jelix/plugins/tpl/html/block.form.php

     
    5757    else
    5858        $helpdecorator = "'jFormsHelpDecoratorAlert'";
    5959
    60     $method = strtolower(isset($param[5])?$param[5]:'post');
    61     if($method!='get' && $method!='post')
    62         $method='post';
     60    $method = isset($param[5])?strtolower($param[5]):'\'post\'';
    6361
    6462    $content = ' $t->_privateVars[\'__form\'] = '.$param[0].';
    6563$t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder(\'html\');
    6664$t->_privateVars[\'__formbuilder\']->setAction('.$param[1].','.$param[2].');
    67 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.',\''.$method.'\'));
     65$t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.','.$method.'));
    6866$t->_privateVars[\'__displayed_ctrl\'] = array();
    6967';
    7068        $compiler->addMetaContent('if(isset('.$param[0].')) { '.$param[0].'->getBuilder(\'html\')->outputMetaContent($t);}');
  • lib/jelix/plugins/tpl/html/cfunction.formfull.php

     
    4747    else
    4848        $helpdecorator = "'jFormsHelpDecoratorAlert'";
    4949
    50     $method = strtolower(isset($params[5])?$params[5]:'post');
    51     if($method!='get' && $method!='post')
    52         $method='post';
     50    $method = isset($params[5])?strtolower($params[5]):'\'post\'';
    5351
    5452    $content = ' $formfull = '.$params[0].';
    5553    $formfullBuilder = $formfull->getBuilder(\'html\');
    5654    $formfullBuilder->setAction('.$params[1].','.$params[2].');
    57     $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.',\''.$method.'\'));
     55    $formfullBuilder->outputHeader(array('.$errdecorator.','.$helpdecorator.','.$method.'));
    5856    $formfullBuilder->outputAllControls();
    5957    $formfullBuilder->outputFooter();';
    6058
  • lib/jelix/plugins/jforms/html/html.jformsbuilder.php

     
    8080     *    2=> name of method
    8181     */
    8282    public function outputHeader($params){
     83        $method = ($params[2]=='get')?'get':'post';
    8384        $url = jUrl::get($this->_action, $this->_actionParams, 2); // retourne le jurl correspondant
    84         echo '<form action="',$url->scriptName,$url->pathInfo,'" method="'.$params[2].'" id="', $this->_name,'"';
     85        echo '<form action="',$url->scriptName,$url->pathInfo,'" method="'.$method.'" id="', $this->_name,'"';
    8586        if($this->_form->hasUpload())
    8687            echo ' enctype="multipart/form-data">';
    8788        else