2016-01-26 04:56:07 +01:00
|
|
|
<?php
|
|
|
|
|
2016-06-15 06:03:16 +02:00
|
|
|
namespace SilverStripe\ORM\Versioning;
|
|
|
|
|
|
|
|
use Extension;
|
|
|
|
|
2016-01-26 04:56:07 +01:00
|
|
|
/**
|
|
|
|
* Extends {@see GridFieldDetailForm}
|
|
|
|
*/
|
|
|
|
class VersionedGridFieldDetailForm extends Extension {
|
|
|
|
public function updateItemRequestClass(&$class, $gridField, $record, $requestHandler) {
|
|
|
|
// Conditionally use a versioned item handler
|
2016-06-15 06:03:16 +02:00
|
|
|
if($record && $record->has_extension('SilverStripe\ORM\Versioning\Versioned')) {
|
|
|
|
$class = 'SilverStripe\ORM\Versioning\VersionedGridFieldItemRequest';
|
2016-01-26 04:56:07 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|