SilverStripe\VersionedAdmin\Controllers\HistoryViewerController
The HistoryViewerController provides AJAX endpoints for React to enable functionality, such as retrieving the form schema.
Synopsis
class HistoryViewerController
extends LeftAndMain
{
- // constants
- const FORM_NAME_VERSION = 'versionForm';
- const FORM_NAME_COMPARE = 'compareForm';
- // members
- private static string $url_segment = 'historyviewer';
- private static string $url_rule = '/$Action';
- private static integer $url_priority = 10;
- private static string $required_permission_codes = 'CMS_ACCESS_CMSMain';
- private static array $allowed_actions = ;
- protected array $formNames = ;
- // methods
- public void getClientConfig()
- public HTTPResponse schema()
- protected HTTPResponse generateSchemaForForm()
- public Form getVersionForm()
- protected Form|null getVersionFormByDate()
- protected Form getVersionFormByVersion()
- protected DataObject|null getRecordVersion()
- public Form getCompareForm()
- public void versionForm()
- public void compareForm()
- protected bool validateInput()
- protected Form scaffoldForm()
Hierarchy
Extends
- SilverStripe\Admin\LeftAndMain
Constants
Name | Value |
---|---|
FORM_NAME_VERSION | 'versionForm' |
FORM_NAME_COMPARE | 'compareForm' |
Members
private
- $allowed_actions
- $required_permission_codes
- $url_priority
- $url_rule
- $url_segment
protected
- $formNames
—
array
An array of supported form names that can be requested through the schema
Methods
protected
- generateSchemaForForm() — Checks the requested schema name and returns a scaffolded {@link Form}. An exception is thrown if an unexpected value is provided.
- getRecordVersion() — Fetches record version and checks canView permission for result
- getVersionFormByDate()
- getVersionFormByVersion()
- scaffoldForm() — Given some context, scaffold a form using the FormFactory and return it
- validateInput() — Perform some centralised validation checks on the input request and data within it
public
- compareForm()
- getClientConfig()
- getCompareForm() — Returns a {@link Form} containing the comparison {@link DiffTransformation} view for a record between two specified versions.
- getVersionForm() — Returns a {@link Form} showing the version details for a given version of a record
- schema() — Gets a JSON schema representing the current version detail form.
- versionForm()