Total Complexity | 5 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | class HistoryViewerField extends FormField |
||
11 | { |
||
12 | /** |
||
13 | * Default to using the SiteTree component |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $schemaComponent = 'PageHistoryViewer'; |
||
18 | |||
19 | public function __construct($name, $title = null, $value = null) |
||
20 | { |
||
21 | Requirements::javascript('silverstripe/versioned-admin:client/dist/js/bundle.js'); |
||
22 | Requirements::css('silverstripe/versioned-admin:client/dist/styles/bundle.css'); |
||
23 | |||
24 | parent::__construct($name, $title, $value); |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Get the source record to view history for |
||
29 | * |
||
30 | * @return DataObject|null |
||
31 | */ |
||
32 | public function getSourceRecord() |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Get whether the record is previewable |
||
39 | * |
||
40 | * @return boolean |
||
41 | */ |
||
42 | public function getPreviewEnabled() |
||
49 |