|
@@ 48-61 (lines=14) @@
|
| 45 |
|
* @param SS_HTTPRequest $request |
| 46 |
|
* @return array |
| 47 |
|
*/ |
| 48 |
|
public function show($request) { |
| 49 |
|
$form = $this->ShowVersionForm($request->param('VersionID')); |
| 50 |
|
|
| 51 |
|
$negotiator = $this->getResponseNegotiator(); |
| 52 |
|
$controller = $this; |
| 53 |
|
$negotiator->setCallback('CurrentForm', function() use(&$controller, &$form) { |
| 54 |
|
return $form ? $form->forTemplate() : $controller->renderWith($controller->getTemplatesWithSuffix('_Content')); |
| 55 |
|
}); |
| 56 |
|
$negotiator->setCallback('default', function() use(&$controller, &$form) { |
| 57 |
|
return $controller->customise(array('EditForm' => $form))->renderWith($controller->getViewer('show')); |
| 58 |
|
}); |
| 59 |
|
|
| 60 |
|
return $negotiator->respond($request); |
| 61 |
|
} |
| 62 |
|
|
| 63 |
|
/** |
| 64 |
|
* @param SS_HTTPRequest $request |
|
@@ 67-83 (lines=17) @@
|
| 64 |
|
* @param SS_HTTPRequest $request |
| 65 |
|
* @return array |
| 66 |
|
*/ |
| 67 |
|
public function compare($request) { |
| 68 |
|
$form = $this->CompareVersionsForm( |
| 69 |
|
$request->param('VersionID'), |
| 70 |
|
$request->param('OtherVersionID') |
| 71 |
|
); |
| 72 |
|
|
| 73 |
|
$negotiator = $this->getResponseNegotiator(); |
| 74 |
|
$controller = $this; |
| 75 |
|
$negotiator->setCallback('CurrentForm', function() use(&$controller, &$form) { |
| 76 |
|
return $form ? $form->forTemplate() : $controller->renderWith($controller->getTemplatesWithSuffix('_Content')); |
| 77 |
|
}); |
| 78 |
|
$negotiator->setCallback('default', function() use(&$controller, &$form) { |
| 79 |
|
return $controller->customise(array('EditForm' => $form))->renderWith($controller->getViewer('show')); |
| 80 |
|
}); |
| 81 |
|
|
| 82 |
|
return $negotiator->respond($request); |
| 83 |
|
} |
| 84 |
|
|
| 85 |
|
public function getSilverStripeNavigator() { |
| 86 |
|
$record = $this->getRecord($this->currentPageID(), $this->getRequest()->param('VersionID')); |