|
@@ 62-75 (lines=14) @@
|
| 59 |
|
* @param HTTPRequest $request |
| 60 |
|
* @return array |
| 61 |
|
*/ |
| 62 |
|
public function show($request) { |
| 63 |
|
$form = $this->ShowVersionForm($request->param('VersionID')); |
| 64 |
|
|
| 65 |
|
$negotiator = $this->getResponseNegotiator(); |
| 66 |
|
$controller = $this; |
| 67 |
|
$negotiator->setCallback('CurrentForm', function() use(&$controller, &$form) { |
| 68 |
|
return $form ? $form->forTemplate() : $controller->renderWith($controller->getTemplatesWithSuffix('_Content')); |
| 69 |
|
}); |
| 70 |
|
$negotiator->setCallback('default', function() use(&$controller, &$form) { |
| 71 |
|
return $controller->customise(array('EditForm' => $form))->renderWith($controller->getViewer('show')); |
| 72 |
|
}); |
| 73 |
|
|
| 74 |
|
return $negotiator->respond($request); |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
/** |
| 78 |
|
* @param HTTPRequest $request |
|
@@ 81-97 (lines=17) @@
|
| 78 |
|
* @param HTTPRequest $request |
| 79 |
|
* @return array |
| 80 |
|
*/ |
| 81 |
|
public function compare($request) { |
| 82 |
|
$form = $this->CompareVersionsForm( |
| 83 |
|
$request->param('VersionID'), |
| 84 |
|
$request->param('OtherVersionID') |
| 85 |
|
); |
| 86 |
|
|
| 87 |
|
$negotiator = $this->getResponseNegotiator(); |
| 88 |
|
$controller = $this; |
| 89 |
|
$negotiator->setCallback('CurrentForm', function() use(&$controller, &$form) { |
| 90 |
|
return $form ? $form->forTemplate() : $controller->renderWith($controller->getTemplatesWithSuffix('_Content')); |
| 91 |
|
}); |
| 92 |
|
$negotiator->setCallback('default', function() use(&$controller, &$form) { |
| 93 |
|
return $controller->customise(array('EditForm' => $form))->renderWith($controller->getViewer('show')); |
| 94 |
|
}); |
| 95 |
|
|
| 96 |
|
return $negotiator->respond($request); |
| 97 |
|
} |
| 98 |
|
|
| 99 |
|
public function getSilverStripeNavigator() { |
| 100 |
|
$record = $this->getRecord($this->currentPageID(), $this->getRequest()->param('VersionID')); |