2012-07-17 07:58:33 +02:00
|
|
|
<?php
|
|
|
|
class DMSSiteTreeExtension extends DataExtension {
|
|
|
|
|
|
|
|
static $belongs_many_many = array(
|
|
|
|
'Documents' => 'DMSDocument'
|
|
|
|
);
|
2012-07-27 05:38:42 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
2012-07-17 07:58:33 +02:00
|
|
|
}
|