Merge pull request #49 from silverstripe-scienceninjas/story/ssf-94-asset-admin

Story/ssf 94 asset admin
This commit is contained in:
Sam Minnée 2012-01-09 20:30:13 -08:00
commit 2587a4abee

View File

@ -85,6 +85,15 @@ JS
CMSBatchActionHandler::register('delete', 'AssetAdmin_DeleteBatchAction', 'Folder');
}
/**
* Return the root 'asset' folder CMSFields
*
* @return FieldList
*/
public function RootForm() {
return $this->getEditForm(singleton('Folder'));
}
/**
* Show the content of the upload iframe. The form is specified by a template.
*/
@ -193,8 +202,11 @@ JS
}
$processedData = array_reverse($processedData);
if($data['FolderID'] && $data['FolderID'] != '') $folder = DataObject::get_by_id("Folder", $data['FolderID']);
else $folder = singleton('Folder');
if(isset($data['FolderID']) && is_numeric($data['FolderID'])) {
$folder = DataObject::get_by_id("Folder", $data['FolderID']);
} else {
$folder = singleton('Folder');
}
foreach($processedFiles as $filePostId => $tmpFile) {
if($tmpFile['error'] == UPLOAD_ERR_NO_TMP_DIR) {