mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
bd50a860f8
commit
86c344917d
1 changed files with 14 additions and 7 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue