Differential D19123 Diff 45823 src/applications/dashboard/typeahead/PhabricatorDashboardPanelDatasource.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/dashboard/typeahead/PhabricatorDashboardPanelDatasource.php
Show All 28 Lines | public function buildResults() { | ||||
$query = id(new PhabricatorDashboardPanelQuery()); | $query = id(new PhabricatorDashboardPanelQuery()); | ||||
$panels = $this->executeQuery($query); | $panels = $this->executeQuery($query); | ||||
$results = array(); | $results = array(); | ||||
foreach ($panels as $panel) { | foreach ($panels as $panel) { | ||||
$impl = $panel->getImplementation(); | $impl = $panel->getImplementation(); | ||||
if ($impl) { | if ($impl) { | ||||
$type_text = $impl->getPanelTypeName(); | $type_text = $impl->getPanelTypeName(); | ||||
$icon = $impl->getIcon(); | |||||
} else { | } else { | ||||
$type_text = nonempty($panel->getPanelType(), pht('Unknown Type')); | $type_text = nonempty($panel->getPanelType(), pht('Unknown Type')); | ||||
$icon = 'fa-question'; | |||||
} | } | ||||
$id = $panel->getID(); | $id = $panel->getID(); | ||||
$monogram = $panel->getMonogram(); | $monogram = $panel->getMonogram(); | ||||
$properties = $panel->getProperties(); | $properties = $panel->getProperties(); | ||||
$result = id(new PhabricatorTypeaheadResult()) | $result = id(new PhabricatorTypeaheadResult()) | ||||
->setName($monogram.' '.$panel->getName()) | ->setName($monogram.' '.$panel->getName()) | ||||
->setPHID($id) | ->setPHID($id) | ||||
->setIcon($impl->getIcon()) | ->setIcon($icon) | ||||
->addAttribute($type_text); | ->addAttribute($type_text); | ||||
if (!empty($properties['class'])) { | if (!empty($properties['class'])) { | ||||
$result->addAttribute($properties['class']); | $result->addAttribute($properties['class']); | ||||
} | } | ||||
if ($panel->getIsArchived()) { | if ($panel->getIsArchived()) { | ||||
$result->setClosed(pht('Archived')); | $result->setClosed(pht('Archived')); | ||||
Show All 9 Lines |