Changing where the from token holding the fields from the form is created

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4973 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-05-01 13:35:33 +00:00
parent 29511659a2
commit 9c0d0216bc

View file

@ -213,10 +213,6 @@ class FormHelper extends AppHelper {
* @return string A closing FORM tag.
*/
function end($options = null) {
$out = null;
if(isset($this->params['_Token']) && !empty($this->params['_Token'])) {
$out = $this->secure($this->fields);
}
if (!empty($this->params['models'])) {
$models = $this->params['models'][0];
}
@ -243,6 +239,7 @@ class FormHelper extends AppHelper {
if(!is_array($submitOptions)) {
$submitOptions = array();
}
$out = null;
if(isset($submit)) {
$out .= $this->submit($submit, $submitOptions);
@ -669,7 +666,10 @@ class FormHelper extends AppHelper {
*/
function submit($caption = 'Submit', $options = array()) {
$options['value'] = $caption;
$secured = null;
if(isset($this->params['_Token']) && !empty($this->params['_Token'])) {
$secured = $this->secure($this->fields);
}
$div = true;
if (isset($options['div'])) {
$div = $options['div'];
@ -687,9 +687,9 @@ class FormHelper extends AppHelper {
$divOptions = am(array('class' => 'submit'), $div);
}
$out = $this->output(sprintf($this->Html->tags['submit'], $this->_parseAttributes($options, null, '', ' ')));
$out = $secured . $this->output(sprintf($this->Html->tags['submit'], $this->_parseAttributes($options, null, '', ' ')));
if (isset($divOptions)) {
$out = $this->Html->div($divOptions['class'], $out, $divOptions);
$out = $secured . $this->Html->div($divOptions['class'], $out, $divOptions);
}
return $out;