Code Duplication    Length = 14-17 lines in 2 locations

code/controllers/CMSPageHistoryController.php 2 locations

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