Browse files

MINOR Fixed history panel non-ajax loading and version links in "comp…

…aring X and Y" titles
  • Loading branch information...
1 parent 8722398 commit 10e76830c4bcf351eba76bbfe241fe9ed1d63611 @chillu chillu committed Sep 19, 2011
Showing with 20 additions and 12 deletions.
  1. +20 −12 code/controllers/CMSPageHistoryController.php
View
32 code/controllers/CMSPageHistoryController.php
@@ -23,24 +23,32 @@ class CMSPageHistoryController extends CMSMain {
/**
* @return array
*/
- function show() {
- return array(
- 'EditForm' => $this->ShowVersionForm(
- $this->request->param('VersionID')
- )
+ function show($request) {
+ $form = $this->ShowVersionForm(
+ $request->param('VersionID')
);
+ if($this->isAjax()) {
+ $content = $form->forTemplate();
+ } else {
+ $content = $this->customise(array('EditForm' => $form))->renderWith($this->getViewer('show'));
+ }
+ return $content;
}
/**
* @return array
*/
- function compare() {
- return array(
- 'EditForm' => $this->CompareVersionsForm(
- $this->request->param('VersionID'),
- $this->request->param('OtherVersionID')
- )
+ function compare($request) {
+ $form = $this->CompareVersionsForm(
+ $request->param('VersionID'),
+ $request->param('OtherVersionID')
);
+ if($this->isAjax()) {
+ $content = $form->forTemplate();
+ } else {
+ $content = $this->customise(array('EditForm' => $form))->renderWith($this->getViewer('show'));
+ }
+ return $content;
}
/**
@@ -92,7 +100,7 @@ function getEditForm($id = null, $fields = null, $versionID = null, $compareID =
if($compareID) {
$link = Controller::join_links(
- $this->Link('version'),
+ $this->Link('show'),
$id
);

0 comments on commit 10e7683

Please sign in to comment.