function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $AttachmentField = new CustomUploadField('LegalDocumentFile', 'Attach a PDF or DOC file');
     $AttachmentField->setAllowedExtensions(array('doc', 'pdf'));
     $fields->addFieldToTab('Root.Main', $AttachmentField);
     return $fields;
 }
예제 #2
0
 function getCMSFields()
 {
     $fields = new FieldList();
     $attach = new CustomUploadField('Attachment', 'File');
     $attach->setFolderName('marketing/event_material');
     $attach->setAllowedExtensions(array('doc', 'docx', 'txt', 'rtf', 'xls', 'xlsx', 'pages', 'ppt', 'pptx', 'pps', 'csv', 'html', 'htm', 'xhtml', 'xml', 'pdf', 'ai', 'key'));
     $fields->push(new TextField('Name'));
     $fields->push($attach);
     return $fields;
 }