Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionController.php
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | protected function loadDiffusionContext() { | ||||
$request = $this->getRequest(); | $request = $this->getRequest(); | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$identifier = $request->getURIData('repositoryCallsign'); | $identifier = $request->getURIData('repositoryCallsign'); | ||||
if (!strlen($identifier)) { | if (!strlen($identifier)) { | ||||
$identifier = (int)$request->getURIData('repositoryID'); | $identifier = (int)$request->getURIData('repositoryID'); | ||||
} | } | ||||
$blob = $request->getURIData('dblob'); | $params = array( | ||||
if (strlen($blob)) { | 'repository' => $identifier, | ||||
$parsed = DiffusionRequest::parseRequestBlob($blob); | 'user' => $viewer, | ||||
} else { | 'blob' => $request->getURIData('dblob'), | ||||
$parsed = array( | |||||
'commit' => $request->getURIData('commit'), | 'commit' => $request->getURIData('commit'), | ||||
'path' => $request->getURIData('path'), | 'path' => $request->getURIData('path'), | ||||
'line' => $request->getURIData('line'), | 'line' => $request->getURIData('line'), | ||||
'branch' => $request->getURIData('branch'), | 'branch' => $request->getURIData('branch'), | ||||
'lint' => $request->getStr('lint'), | 'lint' => $request->getStr('lint'), | ||||
); | ); | ||||
} | |||||
$params = array( | |||||
'repository' => $identifier, | |||||
'user' => $viewer, | |||||
) + $parsed; | |||||
$drequest = DiffusionRequest::newFromDictionary($params); | $drequest = DiffusionRequest::newFromDictionary($params); | ||||
if (!$drequest) { | if (!$drequest) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
$this->diffusionRequest = $drequest; | $this->diffusionRequest = $drequest; | ||||
▲ Show 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | abstract class DiffusionController extends PhabricatorController { | ||||
protected function renderStatusMessage($title, $body) { | protected function renderStatusMessage($title, $body) { | ||||
return id(new PHUIInfoView()) | return id(new PHUIInfoView()) | ||||
->setSeverity(PHUIInfoView::SEVERITY_WARNING) | ->setSeverity(PHUIInfoView::SEVERITY_WARNING) | ||||
->setTitle($title) | ->setTitle($title) | ||||
->appendChild($body); | ->appendChild($body); | ||||
} | } | ||||
protected function renderTablePagerBox(PHUIPagerView $pager) { | |||||
return id(new PHUIBoxView()) | |||||
->addMargin(PHUI::MARGIN_LARGE) | |||||
->appendChild($pager); | |||||
} | |||||
} | } |