protected function renderResultList(array $all_applications, PhabricatorSavedQuery $query, array $handle) { assert_instances_of($all_applications, 'PhabricatorApplication'); $all_applications = msort($all_applications, 'getName'); if ($query->getQueryKey() == 'launcher') { $groups = mgroup($all_applications, 'getApplicationGroup'); } else { $groups = array($all_applications); } $group_names = PhabricatorApplication::getApplicationGroups(); $groups = array_select_keys($groups, array_keys($group_names)) + $groups; $results = array(); foreach ($groups as $group => $applications) { if (count($groups) > 1) { $results[] = phutil_tag('h1', array('class' => 'launcher-header'), idx($group_names, $group, $group)); } $list = new PHUIObjectItemListView(); $list->addClass('phui-object-item-launcher-list'); foreach ($applications as $application) { $icon = $application->getFontIcon(); if (!$icon) { $icon = 'application'; } // TODO: This sheet doesn't work the same way other sheets do so it // ends up with the wrong classes if we try to use PHUIIconView. This // is probably all changing in the redesign anyway. $icon_view = javelin_tag('span', array('class' => 'phui-icon-view phui-font-fa ' . $icon, 'aural' => false), ''); $description = phutil_tag('div', array('style' => 'white-space: nowrap; ' . 'overflow: hidden; ' . 'text-overflow: ellipsis;'), $application->getShortDescription()); $item = id(new PHUIObjectItemView())->setHeader($application->getName())->setImageIcon($icon_view)->addAttribute($description)->addAction(id(new PHUIListItemView())->setName(pht('Help/Options'))->setIcon('fa-cog')->setHref('/applications/view/' . get_class($application) . '/')); if ($application->getBaseURI() && $application->isInstalled()) { $item->setHref($application->getBaseURI()); } if (!$application->isInstalled()) { $item->addIcon('fa-times', pht('Uninstalled')); } if ($application->isPrototype()) { $item->addIcon('fa-bomb grey', pht('Prototype')); } if (!$application->isFirstParty()) { $item->addIcon('fa-puzzle-piece', pht('Extension')); } $list->addItem($item); } $results[] = $list; } return $results; }