mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merged revisions 54402 via svnmerge from
svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2.2 ........ r54402 | sminnee | 2008-05-13 15:07:43 +1200 (Tue, 13 May 2008) | 1 line #2501 + #2500 - Fixed notice-level errors in editable forms ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@56904 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
b11956268e
commit
b078262c1e
@ -44,7 +44,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] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,8 +69,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…
Reference in New Issue
Block a user