Page MenuHomePhabricator

D16446.id39561.diff
No OneTemporary

D16446.id39561.diff

diff --git a/src/applications/search/typeahead/PhabricatorSearchDocumentTypeDatasource.php b/src/applications/search/typeahead/PhabricatorSearchDocumentTypeDatasource.php
--- a/src/applications/search/typeahead/PhabricatorSearchDocumentTypeDatasource.php
+++ b/src/applications/search/typeahead/PhabricatorSearchDocumentTypeDatasource.php
@@ -25,20 +25,30 @@
}
private function buildResults() {
+ $viewer = $this->getViewer();
$types =
- PhabricatorSearchApplicationSearchEngine::getIndexableDocumentTypes();
+ PhabricatorSearchApplicationSearchEngine::getIndexableDocumentTypes(
+ $viewer);
- $icons = mpull(
- PhabricatorPHIDType::getAllTypes(),
- 'getTypeIcon',
+ $phid_types = mpull(PhabricatorPHIDType::getAllTypes(),
+ null,
'getTypeConstant');
$results = array();
foreach ($types as $type => $name) {
+ $type_object = idx($phid_types, $type);
+ if (!$type_object) {
+ continue;
+ }
+ $application_class = $type_object->getPHIDTypeApplicationClass();
+ $application = PhabricatorApplication::getByClass($application_class);
+ $application_name = $application->getName();
+
$results[$type] = id(new PhabricatorTypeaheadResult())
->setPHID($type)
->setName($name)
- ->setIcon(idx($icons, $type));
+ ->addAttribute($application_name)
+ ->setIcon($type_object->getTypeIcon());
}
return $results;

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 2, 12:39 PM (5 d, 13 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
12283500
Default Alt Text
D16446.id39561.diff (1 KB)

Event Timeline