3 final class PhabricatorApplicationPanelController
4 extends PhabricatorApplicationsController
{
8 public function handleRequest(AphrontRequest
$request) {
9 $viewer = $this->getViewer();
11 $application = $request->getURIData('application');
12 $panel_key = $request->getURIData('panel');
14 $selected = id(new PhabricatorApplicationQuery())
16 ->withClasses(array($application))
17 ->requireCapabilities(
19 PhabricatorPolicyCapability
::CAN_VIEW
,
20 PhabricatorPolicyCapability
::CAN_EDIT
,
24 return new Aphront404Response();
28 PhabricatorApplicationConfigurationPanel
::loadAllPanelsForApplication(
30 if (empty($panels[$panel_key])) {
31 return new Aphront404Response();
34 $panel = $panels[$panel_key];
36 if (!$panel->shouldShowForApplication($selected)) {
37 return new Aphront404Response();
40 $panel->setViewer($viewer);
41 $panel->setApplication($selected);
43 $this->application
= $selected;
45 return $panel->handlePanelRequest($request, $this);
48 public function buildPanelCrumbs(
49 PhabricatorApplicationConfigurationPanel
$panel) {
50 $application = $this->application
;
52 $crumbs = $this->buildApplicationCrumbs();
54 $view_uri = '/applications/view/'.get_class($application).'/';
55 $crumbs->addTextCrumb($application->getName(), $view_uri);
60 public function buildPanelPage(
61 PhabricatorApplicationConfigurationPanel
$panel,
66 return $this->newPage()
69 ->appendChild($content);