Code Duplication    Length = 14-17 lines in 2 locations

code/controllers/CMSPageHistoryController.php 2 locations

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