3 final class PhabricatorDashboardPanelRenderController
4 extends PhabricatorDashboardController
{
6 public function shouldAllowPublic() {
10 public function handleRequest(AphrontRequest
$request) {
11 $viewer = $request->getViewer();
12 $id = $request->getURIData('id');
14 $panel = id(new PhabricatorDashboardPanelQuery())
19 return new Aphront404Response();
22 if ($request->isAjax()) {
23 $parent_phids = $request->getStrList('parentPanelPHIDs', null);
24 if ($parent_phids === null) {
27 'Required parameter `parentPanelPHIDs` is not present in '.
31 $parent_phids = array();
34 $engine = id(new PhabricatorDashboardPanelRenderingEngine())
37 ->setPanelPHID($panel->getPHID())
38 ->setParentPanelPHIDs($parent_phids)
39 ->setMovable($request->getBool('movable'))
40 ->setHeaderMode($request->getStr('headerMode'))
41 ->setPanelKey($request->getStr('panelKey'));
43 $context_phid = $request->getStr('contextPHID');
45 $context = id(new PhabricatorObjectQuery())
47 ->withPHIDs(array($context_phid))
50 return new Aphront404Response();
52 $engine->setContextObject($context);
55 $rendered_panel = $engine->renderPanel();
57 if ($request->isAjax()) {
58 return id(new AphrontAjaxResponse())
61 'panelMarkup' => hsprintf('%s', $rendered_panel),
65 $crumbs = $this->buildApplicationCrumbs()
66 ->addTextCrumb(pht('Panels'), $this->getApplicationURI('panel/'))
67 ->addTextCrumb($panel->getMonogram(), '/'.$panel->getMonogram())
68 ->addTextCrumb(pht('Standalone View'))
71 $view = id(new PHUIBoxView())
72 ->addClass('dashboard-view')
73 ->appendChild($rendered_panel);
75 return $this->newPage()
76 ->setTitle(array(pht('Panel'), $panel->getName()))