mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT: SSF-30 adding the ability to set the parent folder of a file.
This commit is contained in:
parent
5967a1c135
commit
550cb7df9c
@ -326,7 +326,11 @@ class File extends DataObject {
|
||||
)->setName("FilePreview")->addExtraClass('cms-file-info');
|
||||
$urlField->dontEscape = true;
|
||||
|
||||
return new FieldList(
|
||||
//get a tree listing with only folder, no files
|
||||
$folderTree = new TreeDropdownField("ParentID", _t('AssetTableField.FOLDER','Folder'), 'Folder');
|
||||
$folderTree->setChildrenMethod('ChildFolders');
|
||||
|
||||
$fields = new FieldList(
|
||||
new TabSet('Root',
|
||||
new Tab('Main',
|
||||
$filePreview,
|
||||
@ -334,11 +338,15 @@ class File extends DataObject {
|
||||
// $uploadField,
|
||||
new TextField("Title", _t('AssetTableField.TITLE','Title')),
|
||||
new TextField("Name", _t('AssetTableField.FILENAME','Filename')),
|
||||
new DropdownField("OwnerID", _t('AssetTableField.OWNER','Owner'), Member::mapInCMSGroups())
|
||||
new DropdownField("OwnerID", _t('AssetTableField.OWNER','Owner'), Member::mapInCMSGroups()),
|
||||
$folderTree
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a category based on the file extension.
|
||||
|
Loading…
Reference in New Issue
Block a user