Here's the complete code example:
/**
* Defines the Audiofile DataObject
*/
class AudioFile extends DataObject {
static $db = array (
'Title' => 'Text',
'Mood' => 'Text',
'Rating' => 'Int'
);
static $has_one = array (
'Attachment' => 'File',
'AudioPage' => 'AudioFilePage'
);
public function getCMSFields_forPopup() {
return new FieldSet(
new TextField('Title','Title For Song',$this->Attachment()->Filename),
new FileIFrameField('Attachment'),
new Dropdownfield('Mood','Mood',
array('blue'=>'Blue','pink'=>'Pink','green'=>'Green','orange'=>'Orange')
)
);
}
}