* Implement view diffs in MR module.

This commit is contained in:
dingguodong
2021-11-03 17:53:14 +08:00
parent 074d13aa20
commit bdcf454239
3 changed files with 69 additions and 29 deletions
+9 -5
View File
@@ -258,10 +258,13 @@ class mr extends control
* @access public
* @return void
*/
public function diff($MRID)
public function diff($MRID, $encoding= '')
{
$encoding = empty($encoding) ? 'utf-8' : $encoding;
$encoding = strtolower(str_replace('_', '-', $encoding)); /* Revert $config->requestFix in $encoding. */
$MR = $this->mr->getByID($MRID);
$diffs = $this->mr->getDiffs($MR);
$diffs = $this->mr->getDiffs($MR, $encoding = '');
$arrange = $this->cookie->arrange ? $this->cookie->arrange : 'inline';
if($this->server->request_method == 'POST')
@@ -294,9 +297,10 @@ class mr extends control
}
}
$this->view->title = $this->lang->mr->viewDiff;
$this->view->diffs = $diffs;
$this->view->arrange = $arrange;
$this->view->title = $this->lang->mr->viewDiff;
$this->view->diffs = $diffs;
$this->view->encoding = $encoding;
$this->view->arrange = $arrange;
$this->display();
}
}