mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
8dd644d25d
Namespace all templates Move difflib and BBCodeParser2 to thirdparty Remove deprecated API marked for removal in 4.0
28 lines
772 B
PHP
28 lines
772 B
PHP
<?php
|
|
|
|
namespace SilverStripe\ORM\Versioning;
|
|
|
|
use SilverStripe\Control\RequestHandler;
|
|
use SilverStripe\Core\Extension;
|
|
use SilverStripe\Forms\GridField\GridField;
|
|
use SilverStripe\ORM\DataObject;
|
|
|
|
/**
|
|
* Extends {@see GridFieldDetailForm}
|
|
*/
|
|
class VersionedGridFieldDetailForm extends Extension {
|
|
|
|
/**
|
|
* @param string $class
|
|
* @param GridField $gridField
|
|
* @param DataObject $record
|
|
* @param RequestHandler $requestHandler
|
|
*/
|
|
public function updateItemRequestClass(&$class, $gridField, $record, $requestHandler) {
|
|
// Conditionally use a versioned item handler
|
|
if($record && $record->has_extension('SilverStripe\ORM\Versioning\Versioned')) {
|
|
$class = 'SilverStripe\ORM\Versioning\VersionedGridFieldItemRequest';
|
|
}
|
|
}
|
|
}
|