Code Duplication    Length = 14-17 lines in 2 locations

code/Controllers/CMSPageHistoryController.php 2 locations

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