Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Added 'updateCMSFields' hook to File (fixes #7091)

  • Loading branch information...
commit 7c1b40d4a72e2553a34f78013a053104dcd17537 1 parent 6c91aa0
@chillu chillu authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 filesystem/File.php
View
8 filesystem/File.php
@@ -316,7 +316,10 @@ function canDelete($member = null) {
}
/**
- * Returns the fields to power the edit screen of files in the CMS
+ * Returns the fields to power the edit screen of files in the CMS.
+ * You can modify this FieldList by subclassing folder, or by creating a {@link DataExtension}
+ * and implemeting updateCMSFields(FieldList $fields) on that extension.
+ *
* @return FieldList
*/
function getCMSFields($params = null) {
@@ -383,6 +386,9 @@ function getCMSFields($params = null) {
)
);
+ // Folder has its own updateCMSFields hook
+ if(!($this instanceof Folder)) $this->extend('updateCMSFields', $fields);
+
return $fields;
}
Please sign in to comment.
Something went wrong with that request. Please try again.