@@ -52,7 +52,6 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
52
52
'getshowdeletedsubtree ' ,
53
53
'getfilteredsubtree ' ,
54
54
'batchactions ' ,
55
- 'rollback ' , // see http://open.silverstripe.org/ticket/6291
56
55
);
57
56
58
57
/**
@@ -390,11 +389,15 @@ function save_siteconfig($data, $form) {
390
389
* Get a database record to be managed by the CMS
391
390
*/
392
391
public function getRecord ($ id ) {
393
-
394
392
$ treeClass = $ this ->stat ('tree_class ' );
395
393
396
394
if ($ id && is_numeric ($ id )) {
397
- $ record = DataObject::get_one ( $ treeClass , "\"$ treeClass \". \"ID \" = $ id " );
395
+ $ version = isset ($ _REQUEST ['Version ' ]) ? $ _REQUEST ['Version ' ] : null ;
396
+ if (is_numeric ($ version )) {
397
+ $ record = Versioned::get_version ($ treeClass , $ id , $ version );
398
+ } else {
399
+ $ record = DataObject::get_one ($ treeClass , "\"$ treeClass \". \"ID \" = $ id " );
400
+ }
398
401
399
402
// Then, try getting a record from the live site
400
403
if (!$ record ) {
@@ -902,10 +905,7 @@ function getversion() {
902
905
'Root '
903
906
);
904
907
905
- $ actions = new FieldSet (
906
- new FormAction ("email " , _t ('CMSMain.EMAIL ' ,"Email " )),
907
- new FormAction ("rollback " , _t ('CMSMain.ROLLBACK ' ,"Roll back to this version " ))
908
- );
908
+ $ actions = $ record ->getCMSActions ();
909
909
910
910
// encode the message to appear in the body of the email
911
911
$ archiveURL = Director::absoluteBaseURL () . $ record ->URLSegment . '?archiveDate= ' . $ record ->obj ('LastEdited ' )->URLDatetime ();
0 commit comments