Differential D19827 Diff 47387 src/applications/diffusion/controller/DiffusionRepositoryManagePanelsController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionRepositoryManagePanelsController.php
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | private function renderSideNav( | ||||
$selected) { | $selected) { | ||||
$base_uri = $repository->getPathURI('manage/'); | $base_uri = $repository->getPathURI('manage/'); | ||||
$base_uri = new PhutilURI($base_uri); | $base_uri = new PhutilURI($base_uri); | ||||
$nav = id(new AphrontSideNavFilterView()) | $nav = id(new AphrontSideNavFilterView()) | ||||
->setBaseURI($base_uri); | ->setBaseURI($base_uri); | ||||
foreach ($panels as $panel) { | $groups = DiffusionRepositoryManagementPanelGroup::getAllPanelGroups(); | ||||
$panel_groups = mgroup($panels, 'getManagementPanelGroupKey'); | |||||
$other_key = DiffusionRepositoryManagementOtherPanelGroup::PANELGROUPKEY; | |||||
foreach ($groups as $group_key => $group) { | |||||
// If this is the "Other" group, include everything else that isn't in | |||||
// some actual group. | |||||
if ($group_key === $other_key) { | |||||
$group_panels = array_mergev($panel_groups); | |||||
$panel_groups = array(); | |||||
} else { | |||||
$group_panels = idx($panel_groups, $group_key); | |||||
unset($panel_groups[$group_key]); | |||||
} | |||||
if (!$group_panels) { | |||||
continue; | |||||
} | |||||
$label = $group->getManagementPanelGroupLabel(); | |||||
if ($label) { | |||||
$nav->addLabel($label); | |||||
} | |||||
foreach ($group_panels as $panel) { | |||||
$key = $panel->getManagementPanelKey(); | $key = $panel->getManagementPanelKey(); | ||||
$label = $panel->getManagementPanelLabel(); | $label = $panel->getManagementPanelLabel(); | ||||
$icon = $panel->getManagementPanelIcon(); | $icon = $panel->getManagementPanelIcon(); | ||||
$href = $panel->getPanelNavigationURI(); | $href = $panel->getPanelNavigationURI(); | ||||
$item = id(new PHUIListItemView()) | $item = id(new PHUIListItemView()) | ||||
->setKey($key) | ->setKey($key) | ||||
->setName($label) | ->setName($label) | ||||
->setType(PHUIListItemView::TYPE_LINK) | ->setType(PHUIListItemView::TYPE_LINK) | ||||
->setHref($href) | ->setHref($href) | ||||
->setIcon($icon); | ->setIcon($icon); | ||||
$nav->addMenuItem($item); | $nav->addMenuItem($item); | ||||
} | } | ||||
} | |||||
$nav->selectFilter($selected); | $nav->selectFilter($selected); | ||||
return $nav; | return $nav; | ||||
} | } | ||||
public function buildHeaderView($title) { | public function buildHeaderView($title) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |