Permalink
Browse files

FEATURE set file metadata on upload. (from r97780) (from r99106)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102849 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
chillu committed Apr 14, 2010
1 parent c3e001f commit 195e341c8818e1ee9fbb72969dade555a49f0908
Showing with 14 additions and 0 deletions.
  1. +14 −0 filesystem/File.php
View
@@ -652,6 +652,20 @@ function validate() {
}
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;
+ }
}

0 comments on commit 195e341

Please sign in to comment.