From d404a53569718adb2bbaf3c7350c69ee11e5d535 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 16 Feb 2010 03:28:35 +0000 Subject: [PATCH] FEATURE set file metadata on upload. (from r97780) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99106 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- filesystem/File.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/filesystem/File.php b/filesystem/File.php index 3aa9e5ed8..5e17bad8c 100755 --- a/filesystem/File.php +++ b/filesystem/File.php @@ -652,6 +652,20 @@ class File extends DataObject { } return new ValidationResult(true); } + + /** + * Allow custom fields for uploads in {@link AssetAdmin}. + * Similar to {@link getCMSFields()}, but a more restricted + * set of fields which can be reliably set on any file type. + * + * @return FieldSet + */ + function uploadMetadataFields() { + $fields = new FieldSet(); + $fields->push(new TextField('Title')); + $this->extend('updateUploadMetadataFields', $fields); + return $fields; + } }