Differential D14941 Diff 36117 src/applications/diffusion/controller/DiffusionBranchTableController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionBranchTableController.php
<?php | <?php | ||||
final class DiffusionBranchTableController extends DiffusionController { | final class DiffusionBranchTableController extends DiffusionController { | ||||
public function shouldAllowPublic() { | public function shouldAllowPublic() { | ||||
return true; | return true; | ||||
} | } | ||||
protected function processDiffusionRequest(AphrontRequest $request) { | public function handleRequest(AphrontRequest $request) { | ||||
$drequest = $this->getDiffusionRequest(); | $response = $this->loadDiffusionContext(); | ||||
$viewer = $request->getUser(); | if ($response) { | ||||
return $response; | |||||
} | |||||
$viewer = $this->getViewer(); | |||||
$drequest = $this->getDiffusionRequest(); | |||||
$repository = $drequest->getRepository(); | $repository = $drequest->getRepository(); | ||||
$pager = new PHUIPagerView(); | $pager = id(new PHUIPagerView()) | ||||
$pager->setURI($request->getRequestURI(), 'offset'); | ->readFromRequest($request); | ||||
$pager->setOffset($request->getInt('offset')); | |||||
// TODO: Add support for branches that contain commit | // TODO: Add support for branches that contain commit | ||||
$branches = $this->callConduitWithDiffusionRequest( | $branches = $this->callConduitWithDiffusionRequest( | ||||
'diffusion.branchquery', | 'diffusion.branchquery', | ||||
array( | array( | ||||
'offset' => $pager->getOffset(), | 'offset' => $pager->getOffset(), | ||||
'limit' => $pager->getPageSize() + 1, | 'limit' => $pager->getPageSize() + 1, | ||||
)); | )); | ||||
Show All 26 Lines | if (!$branches) { | ||||
$content = $panel; | $content = $panel; | ||||
} | } | ||||
$crumbs = $this->buildCrumbs( | $crumbs = $this->buildCrumbs( | ||||
array( | array( | ||||
'branches' => true, | 'branches' => true, | ||||
)); | )); | ||||
return $this->buildApplicationPage( | $pager_box = $this->renderTablePagerBox($pager); | ||||
array( | |||||
$crumbs, | return $this->newPage() | ||||
$content, | ->setTitle( | ||||
$pager, | |||||
), | |||||
array( | array( | ||||
'title' => array( | |||||
pht('Branches'), | pht('Branches'), | ||||
$repository->getDisplayName(), | $repository->getDisplayName(), | ||||
), | )) | ||||
->setCrumbs($crumbs) | |||||
->appendChild( | |||||
array( | |||||
$content, | |||||
$pager_box, | |||||
)); | )); | ||||
} | } | ||||
} | } |