mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Explicitly mark the section as previewable.
Picked up by the forntend side-by-side preview JS.
This commit is contained in:
parent
772961cb5e
commit
aaae8c97e6
@ -660,6 +660,11 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
// if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
|
||||
$form->setAttribute('data-pjax-fragment', 'CurrentForm');
|
||||
|
||||
// Announce the capability so the frontend can decide whether to allow preview or not.
|
||||
if(in_array('CMSPreviewable', class_implements($record))) {
|
||||
$form->addExtraClass('cms-previewable');
|
||||
}
|
||||
|
||||
if(!$record->canEdit() || $deletedFromStage) {
|
||||
$readonlyFields = $form->Fields()->makeReadonly();
|
||||
$form->setFields($readonlyFields);
|
||||
|
Loading…
Reference in New Issue
Block a user