updating FormHelper, #1860

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4282 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-01-11 00:11:55 +00:00
parent bd50a860f8
commit 86c344917d

View file

@ -354,8 +354,12 @@ class FormHelper extends AppHelper {
if(isset($options['rows']) || isset($options['cols'])) {
$options['type'] = 'textarea';
}
$empty = (isset($options['empty']) ? $options['empty'] : '');
$empty = false;
if(isset($options['empty'])) {
$empty = $options['empty'];
unset($options['empty']);
}
$type = $options['type'];
unset($options['type']);
@ -378,18 +382,21 @@ class FormHelper extends AppHelper {
$out .= $this->Html->file($tagName);
break;
case 'select':
$list = (isset($options['options']) ? $options['options'] : array());
unset($options['options'], $options['empty']);
$list = array();
if(isset($options['options'])) {
$list = $options['options'];
unset($options['options']);
}
$out .= $this->select($tagName, $list, $selected, $options, $empty);
break;
case 'time':
$out .= $this->dateTimeOptionTag($tagName, null, '12', $selected, $options, null, false);
$out .= $this->Html->dateTimeOptionTag($tagName, null, '12', $selected, $options, null, $empty);
break;
case 'date':
$out .= $this->Html->dateTimeOptionTag($tagName, 'MDY', null, $selected, $options, null, false);
$out .= $this->Html->dateTimeOptionTag($tagName, 'MDY', null, $selected, $options, null, $empty);
break;
case 'datetime':
$out .= $this->Html->dateTimeOptionTag($tagName, 'MDY', '12', $selected, $options, null, false);
$out .= $this->Html->dateTimeOptionTag($tagName, 'MDY', '12', $selected, $options, null, $empty);
break;
case 'textarea':
default: