Been using uploadify with DOM and it is great! However, some of the more fine grained features are not working for me when I'm using uploadify with a FileDOM. I cannot get the allowFolderSelection, setuploadFolder, or setFileTypes settings to work with a fileDOM. Also the button text doesn't change with the FileDOM.
DOM example field definition:
$imageUploadField = new ImageUploadField(
'Photo',
'Upload a Photo',
array(
'buttonText' => 'Upload an Image'
)
);
$imageUploadField->setuploadFolder('Images/UsedEquipment');
$imageUploadField->allowFolderSelection = false;
DOM definition:
{
$fields = parent::getCMSFields();
$datamanager = new DataObjectManager(
$this, // Controller
'UsedEquips', // Source name
'UsedEquip', // Source class
array(
'Name' => 'Name',
'Overview' => 'Overview',
'Description' => 'Description',
'Material' => 'Material',
'Tanks' => 'Tanks',
'MaterialHandling' => 'MaterialHandling',
'Thumbnail' => 'Photo',
'URLSegment' => 'URLSegment'
), // Headings
'getCMSFields_forPopup'// Detail fields (function name or FieldSet object)
// Filter clause
// Sort clause
// Join clause
);
$datamanager->setPopupWidth('675');
$fields->addFieldToTab("Root.Content.Equipment",$datamanager);
return $fields;
}
FileDOM example field definition:
$resourceUploadField = new FileUploadField(
'Attachment',
'Upload a File',
array(
'buttonText' => 'Upload a PDF'
)
);
$resourceUploadField->setuploadFolder('PDFs/MSDS');
$resourceUploadField->setFileTypes(array('pdf'));
$resourceUploadField->allowFolderSelection = false;
File DOM definition:
{
$fields = parent::getCMSFields();
$manager = new FileDataObjectManager(
$this, // Controller
'Resources', // Source name
'Resource', // Source class
'Attachment', // File name on DataObject
array(
'Name' => 'Name',
), // Headings
'getCMSFields_forPopup' // Detail fields (function name or FieldSet object)
// Filter clause
// Sort clause
// Join clause
);
$manager->setuploadFolder('PDFs/MSDS'); //This actually works in Uploadify when put here, the other settings dont
$fields->addFieldToTab("Root.Content.Resources",$manager);
return $fields;
}
Thanks in advance!