Permalink
Browse files

ENHANCEMENT: SSF-30 adding the ability to set the parent folder of a …

…file.
  • Loading branch information...
1 parent 5967a1c commit 550cb7df9c0c9cefa5d2077cacb6e838abdfaf73 Julian Seidenberg committed Mar 7, 2012
Showing with 10 additions and 2 deletions.
  1. +10 −2 filesystem/File.php
View
@@ -326,19 +326,27 @@ function getCMSFields() {
)->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,
//TODO: make the uploadField replace the existing file
// $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.

0 comments on commit 550cb7d

Please sign in to comment.