MINOR Avoid nesting metadata properties in TreeDropdownField, setting classname in metadata even if no record is pre-selected

This commit is contained in:
Ingo Schommer 2011-10-29 21:56:00 +02:00
parent 7924ce9f74
commit 7e01c40770

View File

@ -151,11 +151,10 @@ class TreeDropdownField extends FormField {
} }
// TODO Implement for TreeMultiSelectField // TODO Implement for TreeMultiSelectField
if($record) { $metadata = array(
$metadata = array('id' => $record->ID, 'metadata' => array('ClassName' => $record->ClassName)); 'id' => $record ? $record->ID : null,
} else { 'ClassName' => $record ? $record->ClassName : $this->sourceObject
$metadata = null; );
}
return $this->createTag( return $this->createTag(
'div', 'div',