Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUG: Missing preview archive version button (fixes 7656)

Added missing preview button
  • Loading branch information...
commit 7c0e38707cf82900ac07d4a0b0764810a7f1b1bd 1 parent 7959642
Naomi Guyer adrexia authored
10 code/controllers/CMSPageHistoryController.php
View
@@ -97,8 +97,11 @@ function getEditForm($id = null, $fields = null, $versionID = null, $compareID =
// 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();
@@ -106,8 +109,9 @@ function getEditForm($id = null, $fields = null, $versionID = null, $compareID =
$fields->push(new HiddenField("ID"));
$fields->push(new HiddenField("Version"));
- $fields = $fields->makeReadonly();
-
+ $fields = $fields->makeReadonly();
+ $navField->setAllowHTML(true);
+
foreach($fields->dataFields() as $field) {
$field->dontEscape = true;
$field->reserveNL = true;
4 code/controllers/SilverStripeNavigator.php
View
@@ -308,10 +308,10 @@ 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() {
+ function getMessage() {
if($date = Versioned::current_archived_date()) {
$dateObj = Datetime::create();
$dateObj->setValue($date);
Please sign in to comment.
Something went wrong with that request. Please try again.