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

This commit is contained in:
Ingo Schommer 2012-03-30 16:55:35 +02:00
parent 6c91aa0ec5
commit 7c1b40d4a7

View File

@ -316,7 +316,10 @@ class File extends DataObject {
}
/**
* 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 @@ class File extends DataObject {
)
);
// Folder has its own updateCMSFields hook
if(!($this instanceof Folder)) $this->extend('updateCMSFields', $fields);
return $fields;
}