Differential D20376 Diff 48641 src/applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php
Show All 35 Lines | $result = id(new AphrontMultiColumnView()) | ||||
->setGutter(AphrontMultiColumnView::GUTTER_LARGE); | ->setGutter(AphrontMultiColumnView::GUTTER_LARGE); | ||||
if ($this->arrangeMode) { | if ($this->arrangeMode) { | ||||
$h_mode = PhabricatorDashboardPanelRenderingEngine::HEADER_MODE_EDIT; | $h_mode = PhabricatorDashboardPanelRenderingEngine::HEADER_MODE_EDIT; | ||||
} else { | } else { | ||||
$h_mode = PhabricatorDashboardPanelRenderingEngine::HEADER_MODE_NORMAL; | $h_mode = PhabricatorDashboardPanelRenderingEngine::HEADER_MODE_NORMAL; | ||||
} | } | ||||
$panel_phids = array(); | |||||
foreach ($panel_grid_locations as $panel_column_locations) { | |||||
foreach ($panel_column_locations as $panel_phid) { | |||||
$panel_phids[] = $panel_phid; | |||||
} | |||||
} | |||||
$handles = $viewer->loadHandles($panel_phids); | |||||
foreach ($panel_grid_locations as $column => $panel_column_locations) { | foreach ($panel_grid_locations as $column => $panel_column_locations) { | ||||
$panel_phids = $panel_column_locations; | $panel_phids = $panel_column_locations; | ||||
// TODO: This list may contain duplicates when the dashboard itself | // TODO: This list may contain duplicates when the dashboard itself | ||||
// does not? Perhaps this is related to T10612. For now, just unique | // does not? Perhaps this is related to T10612. For now, just unique | ||||
// the list before moving on. | // the list before moving on. | ||||
$panel_phids = array_unique($panel_phids); | $panel_phids = array_unique($panel_phids); | ||||
$column_result = array(); | $column_result = array(); | ||||
foreach ($panel_phids as $panel_phid) { | foreach ($panel_phids as $panel_phid) { | ||||
$panel_engine = id(new PhabricatorDashboardPanelRenderingEngine()) | $panel_engine = id(new PhabricatorDashboardPanelRenderingEngine()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->setDashboardID($dashboard->getID()) | ->setDashboardID($dashboard->getID()) | ||||
->setEnableAsyncRendering(true) | ->setEnableAsyncRendering(true) | ||||
->setPanelPHID($panel_phid) | ->setPanelPHID($panel_phid) | ||||
->setParentPanelPHIDs(array()) | ->setParentPanelPHIDs(array()) | ||||
->setHeaderMode($h_mode); | ->setHeaderMode($h_mode) | ||||
->setPanelHandle($handles[$panel_phid]); | |||||
$panel = idx($panels, $panel_phid); | $panel = idx($panels, $panel_phid); | ||||
if ($panel) { | if ($panel) { | ||||
$panel_engine->setPanel($panel); | $panel_engine->setPanel($panel); | ||||
} | } | ||||
$column_result[] = $panel_engine->renderPanel(); | $column_result[] = $panel_engine->renderPanel(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |