Differential D20399 Diff 48690 src/applications/dashboard/paneltype/PhabricatorDashboardTabsPanelType.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/dashboard/paneltype/PhabricatorDashboardTabsPanelType.php
| Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | foreach ($config as $idx => $tab_spec) { | ||||
| } | } | ||||
| if (!strlen($name)) { | if (!strlen($name)) { | ||||
| $name = pht('Unnamed Tab'); | $name = pht('Unnamed Tab'); | ||||
| } | } | ||||
| $tab_view = id(new PHUIListItemView()) | $tab_view = id(new PHUIListItemView()) | ||||
| ->setHref('#') | ->setHref('#') | ||||
| ->setSelected($idx == $selected) | ->setSelected((string)$idx === (string)$selected) | ||||
| ->addSigil('dashboard-tab-panel-tab') | ->addSigil('dashboard-tab-panel-tab') | ||||
| ->setMetadata(array('panelKey' => $idx)) | ->setMetadata(array('panelKey' => $idx)) | ||||
| ->setName($name); | ->setName($name); | ||||
| if ($is_edit) { | if ($is_edit) { | ||||
| $dropdown_menu = id(new PhabricatorActionListView()) | $dropdown_menu = id(new PhabricatorActionListView()) | ||||
| ->setViewer($viewer); | ->setViewer($viewer); | ||||
| ▲ Show 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | return javelin_tag( | ||||
| ), | ), | ||||
| ), | ), | ||||
| array( | array( | ||||
| $list, | $list, | ||||
| $content, | $content, | ||||
| )); | )); | ||||
| } | } | ||||
| public function getSubpanelPHIDs(PhabricatorDashboardPanel $panel) { | |||||
| $config = $this->getPanelConfiguration($panel); | |||||
| $panel_ids = array(); | |||||
| foreach ($config as $tab_key => $tab_spec) { | |||||
| $panel_ids[] = $tab_spec['panelID']; | |||||
| } | |||||
| if ($panel_ids) { | |||||
| $panels = id(new PhabricatorDashboardPanelQuery()) | |||||
| ->setViewer(PhabricatorUser::getOmnipotentUser()) | |||||
| ->withIDs($panel_ids) | |||||
| ->execute(); | |||||
| } else { | |||||
| $panels = array(); | |||||
| } | |||||
| return mpull($panels, 'getPHID'); | |||||
| } | |||||
| } | } | ||||