mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2.2@54395 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
fb6bab202b
commit
2b576d5d36
@ -50,7 +50,7 @@ class EditableDropdown extends EditableFormField {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(isset($data[$option->ID])) {
|
if(isset($data[$option->ID])) {
|
||||||
$option->setField( 'Default', $option->ID == $data['Default'] );
|
$option->setField( 'Default', isset($data['Default']) ? ($option->ID == $data['Default']) : false );
|
||||||
$option->populateFromPostData( $data[$option->ID] );
|
$option->populateFromPostData( $data[$option->ID] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,8 +75,7 @@ class EditableDropdownOption extends DataObject {
|
|||||||
function DefaultSelect() {
|
function DefaultSelect() {
|
||||||
$disabled = ($this->readonly) ? " disabled=\"disabled\"" : '';
|
$disabled = ($this->readonly) ? " disabled=\"disabled\"" : '';
|
||||||
|
|
||||||
if( $this->Parent()->getField('Default') == $this->ID )
|
$default = ($this->Parent()->getField('Default') == $this->ID) ? " checked=\"checked\"" : "";
|
||||||
$default = " checked=\"checked\"";
|
|
||||||
|
|
||||||
return "<input class=\"radio\" type=\"radio\" name=\"Fields[{$this->ParentID}][Default]\" value=\"{$this->ID}\"".$disabled.$default." />";
|
return "<input class=\"radio\" type=\"radio\" name=\"Fields[{$this->ParentID}][Default]\" value=\"{$this->ID}\"".$disabled.$default." />";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user