mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
ed6a697b57
FEATURE: add the "Documents" tab to page CMS fields, make the displayed fields customisable by DMSDocument subclass
23 lines
556 B
PHP
23 lines
556 B
PHP
<?php
|
|
class DMSSiteTreeExtension extends DataExtension {
|
|
|
|
static $belongs_many_many = array(
|
|
'Documents' => 'DMSDocument'
|
|
);
|
|
|
|
function updateCMSFields(&$fields){
|
|
$documentsListConfig = GridFieldConfig_RecordEditor::create();
|
|
$modelClass = DMS::$modelClass;
|
|
$documentsListConfig->getComponentByType('GridFieldDataColumns')->setDisplayFields($modelClass::$display_fields);
|
|
|
|
$fields->addFieldToTab(
|
|
'Root.Documents',
|
|
GridField::create(
|
|
'Documents',
|
|
false,
|
|
$this->owner->Documents(),
|
|
$documentsListConfig
|
|
)
|
|
);
|
|
}
|
|
} |