Changeset 608
- Timestamp:
- 10/05/07 22:41:43 (1 year ago)
- Files:
-
- trunk/lib/jelix/forms/jFormsBuilderBase.class.php (modified) (1 diff)
- trunk/lib/jelix/forms/jFormsBuilderBase.class.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/block.form.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/block.form.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/function.formfull.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/function.formfull.php (modified) (1 diff)
- trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html.php (modified) (2 diffs)
- trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix/forms/jFormsBuilderBase.class.php
r606 r608 105 105 * @param array $params some parameters 0=>name of the javascript error decorator 106 106 * 1=> name of the javascript help decorator 107 * 2=> name of method 107 108 */ 108 109 public function outputHeader($params){ 109 110 $url = jUrl::get($this->_action, $this->_actionParams, 2); // retourne le jurl correspondant 110 echo '<form action="',$url->scriptName,$url->pathInfo,'" method=" POST" name="', $this->_name,'" onsubmit="return jForms.verifyForm(this)"';111 echo '<form action="',$url->scriptName,$url->pathInfo,'" method="'.$params[2].'" name="', $this->_name,'" onsubmit="return jForms.verifyForm(this)"'; 111 112 if($this->_form->hasUpload()) 112 113 echo ' enctype="multipart/form-data">'; trunk/lib/jelix/forms/jFormsBuilderBase.class.php
r606 r608 105 105 * @param array $params some parameters 0=>name of the javascript error decorator 106 106 * 1=> name of the javascript help decorator 107 * 2=> name of method 107 108 */ 108 109 public function outputHeader($params){ 109 110 $url = jUrl::get($this->_action, $this->_actionParams, 2); // retourne le jurl correspondant 110 echo '<form action="',$url->scriptName,$url->pathInfo,'" method=" POST" name="', $this->_name,'" onsubmit="return jForms.verifyForm(this)"';111 echo '<form action="',$url->scriptName,$url->pathInfo,'" method="'.$params[2].'" name="', $this->_name,'" onsubmit="return jForms.verifyForm(this)"'; 111 112 if($this->_form->hasUpload()) 112 113 echo ' enctype="multipart/form-data">'; trunk/lib/jelix/plugins/tpl/html/block.form.php
r602 r608 21 21 * 3=>name of your javascript object for error listener 22 22 * 4=>name of your javascript object for help listener 23 * 5=>name of the method : POST or GET 23 24 * @return string the php code corresponding to the begin or end of the block 24 25 * @see jForms … … 52 53 $helpdecorator = "'jFormsHelpDecoratorAlert'"; 53 54 55 $method = strtoupper(isset($param[5])?$param[5]:'POST'); 56 if($method!='GET' && $method!='POST') 57 $method='POST'; 58 54 59 $content = ' $t->_privateVars[\'__form\'] = '.$param[0].'; 55 60 $t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder(\'html\', '.$param[1].','.$param[2].'); 56 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.' ));61 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.',\''.$method.'\')); 57 62 $t->_privateVars[\'__displayed_ctrl\'] = array(); 58 63 if($GLOBALS[\'gJCoord\']->response!= null){ trunk/lib/jelix/plugins/tpl/html/block.form.php
r602 r608 21 21 * 3=>name of your javascript object for error listener 22 22 * 4=>name of your javascript object for help listener 23 * 5=>name of the method : POST or GET 23 24 * @return string the php code corresponding to the begin or end of the block 24 25 * @see jForms … … 52 53 $helpdecorator = "'jFormsHelpDecoratorAlert'"; 53 54 55 $method = strtoupper(isset($param[5])?$param[5]:'POST'); 56 if($method!='GET' && $method!='POST') 57 $method='POST'; 58 54 59 $content = ' $t->_privateVars[\'__form\'] = '.$param[0].'; 55 60 $t->_privateVars[\'__formbuilder\'] = $t->_privateVars[\'__form\']->getBuilder(\'html\', '.$param[1].','.$param[2].'); 56 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.' ));61 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.',\''.$method.'\')); 57 62 $t->_privateVars[\'__displayed_ctrl\'] = array(); 58 63 if($GLOBALS[\'gJCoord\']->response!= null){ trunk/lib/jelix/plugins/tpl/html/function.formfull.php
r547 r608 19 19 * @param string $helpDecorator name of your javascript object for help listener 20 20 */ 21 function jtpl_function_html_formfull($tpl, $form, $action, $params=array(), $errDecorator='jFormsErrorDecoratorAlert', $helpDecorator='jFormsHelpDecoratorAlert') 21 function jtpl_function_html_formfull($tpl, $form, $action, $params=array(), 22 $errDecorator='jFormsErrorDecoratorAlert', $helpDecorator='jFormsHelpDecoratorAlert', $method='POST') 22 23 { 23 24 24 25 $formBuilder = $form->getBuilder('html', $action, $params); 25 $formBuilder->outputHeader(array($errDecorator, $helpDecorator ));26 $formBuilder->outputHeader(array($errDecorator, $helpDecorator, $method)); 26 27 27 28 if($GLOBALS['gJCoord']->response!= null){ trunk/lib/jelix/plugins/tpl/html/function.formfull.php
r547 r608 19 19 * @param string $helpDecorator name of your javascript object for help listener 20 20 */ 21 function jtpl_function_html_formfull($tpl, $form, $action, $params=array(), $errDecorator='jFormsErrorDecoratorAlert', $helpDecorator='jFormsHelpDecoratorAlert') 21 function jtpl_function_html_formfull($tpl, $form, $action, $params=array(), 22 $errDecorator='jFormsErrorDecoratorAlert', $helpDecorator='jFormsHelpDecoratorAlert', $method='POST') 22 23 { 23 24 24 25 $formBuilder = $form->getBuilder('html', $action, $params); 25 $formBuilder->outputHeader(array($errDecorator, $helpDecorator ));26 $formBuilder->outputHeader(array($errDecorator, $helpDecorator, $method)); 26 27 27 28 if($GLOBALS['gJCoord']->response!= null){ trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html.php
r605 r608 78 78 $formname = $builder->getName(); 79 79 ob_start(); 80 $builder->outputHeader(array('','' ));80 $builder->outputHeader(array('','','POST')); 81 81 $out = ob_get_clean(); 82 82 $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="POST" name="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="module" value="jelix_tests"/> 83 83 <input type="hidden" name="action" value="urlsig_url1"/> 84 84 </div><script type="text/javascript"> 85 //< [CDATA[85 //<![CDATA[ 86 86 87 87 //]]> … … 92 92 $formname = $builder->getName(); 93 93 ob_start(); 94 $builder->outputHeader(array('','' ));94 $builder->outputHeader(array('','','GET')); 95 95 $out = ob_get_clean(); 96 $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method=" POST" name="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="foo" value="b>ar"/>96 $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="GET" name="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="foo" value="b>ar"/> 97 97 <input type="hidden" name="module" value="jelix_tests"/> 98 98 <input type="hidden" name="action" value="urlsig_url1"/> 99 99 </div><script type="text/javascript"> 100 //< [CDATA[100 //<![CDATA[ 101 101 102 102 //]]> trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html.php
r605 r608 78 78 $formname = $builder->getName(); 79 79 ob_start(); 80 $builder->outputHeader(array('','' ));80 $builder->outputHeader(array('','','POST')); 81 81 $out = ob_get_clean(); 82 82 $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="POST" name="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="module" value="jelix_tests"/> 83 83 <input type="hidden" name="action" value="urlsig_url1"/> 84 84 </div><script type="text/javascript"> 85 //< [CDATA[85 //<![CDATA[ 86 86 87 87 //]]> … … 92 92 $formname = $builder->getName(); 93 93 ob_start(); 94 $builder->outputHeader(array('','' ));94 $builder->outputHeader(array('','','GET')); 95 95 $out = ob_get_clean(); 96 $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method=" POST" name="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="foo" value="b>ar"/>96 $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="GET" name="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="foo" value="b>ar"/> 97 97 <input type="hidden" name="module" value="jelix_tests"/> 98 98 <input type="hidden" name="action" value="urlsig_url1"/> 99 99 </div><script type="text/javascript"> 100 //< [CDATA[100 //<![CDATA[ 101 101 102 102 //]]>
