mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Merge pull request #174 from adrexia/add-archive
BUG: Missing preview archive version button (fixes 7656)
This commit is contained in:
commit
24ce0c199a
@ -97,8 +97,11 @@ class CMSPageHistoryController extends CMSMain {
|
||||
// Respect permission failures from parent implementation
|
||||
if(!($form instanceof Form)) return $form;
|
||||
|
||||
$nav = new SilverStripeNavigatorItem_ArchiveLink($record);
|
||||
|
||||
$form->setActions(new FieldList(
|
||||
$revert = FormAction::create('doRollback', _t('CMSPageHistoryController.REVERTTOTHISVERSION', 'Revert to this version'))->setUseButtonTag(true)
|
||||
$revert = FormAction::create('doRollback', _t('CMSPageHistoryController.REVERTTOTHISVERSION', 'Revert to this version'))->setUseButtonTag(true),
|
||||
$navField = new LiteralField('ArchivedLink', $nav->getHTML())
|
||||
));
|
||||
|
||||
$fields = $form->Fields();
|
||||
@ -107,6 +110,7 @@ class CMSPageHistoryController extends CMSMain {
|
||||
$fields->push(new HiddenField("Version"));
|
||||
|
||||
$fields = $fields->makeReadonly();
|
||||
$navField->setAllowHTML(true);
|
||||
|
||||
foreach($fields->dataFields() as $field) {
|
||||
$field->dontEscape = true;
|
||||
|
@ -308,7 +308,7 @@ class SilverStripeNavigatorItem_ArchiveLink extends SilverStripeNavigatorItem {
|
||||
|
||||
function getHTML() {
|
||||
$this->recordLink = $this->record->AbsoluteLink();
|
||||
return "<a href=\"$this->recordLink?archiveDate={$this->record->LastEdited}\" target=\"_blank\">". _t('ContentController.ARCHIVEDSITE', 'Archived Site') ."</a>";
|
||||
return "<a class=\"ss-ui-button\" href=\"$this->recordLink?archiveDate={$this->record->LastEdited}\" target=\"_blank\">". _t('ContentController.ARCHIVEDSITE', 'Preview version') ."</a>";
|
||||
}
|
||||
|
||||
function getMessage() {
|
||||
|
Loading…
Reference in New Issue
Block a user