Merge remote-tracking branch 'origin/2.0' into 2.0-class-loading

This commit is contained in:
Jose Lorenzo Rodriguez 2011-03-15 21:13:45 -04:00
commit 2e2f5ea2a5
4 changed files with 40 additions and 2 deletions

View file

@ -1041,6 +1041,7 @@ class FormHelper extends AppHelper {
public function radio($fieldName, $options = array(), $attributes = array()) {
$attributes = $this->_initInputField($fieldName, $attributes);
$legend = false;
$disabled = array();
if (isset($attributes['legend'])) {
$legend = $attributes['legend'];
@ -1066,6 +1067,11 @@ class FormHelper extends AppHelper {
} else {
$value = $this->value($fieldName);
}
if (isset($attributes['disabled'])) {
$disabled = $attributes['disabled'];
}
$out = array();
$hiddenField = isset($attributes['hiddenField']) ? $attributes['hiddenField'] : true;
@ -1077,6 +1083,9 @@ class FormHelper extends AppHelper {
if (isset($value) && $optValue == $value) {
$optionsHere['checked'] = 'checked';
}
if (!empty($disabled) && in_array($optValue, $disabled)) {
$optionsHere['disabled'] = true;
}
$tagName = Inflector::camelize(
$attributes['id'] . '_' . Inflector::slug($optValue)
);