protected function renderResultList(array $posts, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($posts, 'PhamePost');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($posts as $post) {
         $id = $post->getID();
         $blog = $post->getBlog();
         $blog_name = $viewer->renderHandle($post->getBlogPHID())->render();
         $blog_name = pht('Blog: %s', $blog_name);
         $item = id(new PHUIObjectItemView())->setUser($viewer)->setObject($post)->setHeader($post->getTitle())->setStatusIcon('fa-star')->setHref($post->getViewURI())->addAttribute($blog_name);
         if ($post->isDraft()) {
             $item->setStatusIcon('fa-star-o grey');
             $item->setDisabled(true);
             $item->addIcon('none', pht('Draft Post'));
         } else {
             $date = $post->getDatePublished();
             $item->setEpoch($date);
         }
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No blogs posts found.'));
     return $result;
 }
 protected function renderResultList(array $dashboards, PhabricatorSavedQuery $query, array $handles)
 {
     $dashboards = mpull($dashboards, null, 'getPHID');
     $viewer = $this->requireViewer();
     if ($dashboards) {
         $installs = id(new PhabricatorDashboardInstall())->loadAllWhere('objectPHID IN (%Ls) AND dashboardPHID IN (%Ls)', array(PhabricatorHomeApplication::DASHBOARD_DEFAULT, $viewer->getPHID()), array_keys($dashboards));
         $installs = mpull($installs, null, 'getDashboardPHID');
     } else {
         $installs = array();
     }
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     $list->initBehavior('phabricator-tooltips', array());
     $list->requireResource('aphront-tooltip-css');
     foreach ($dashboards as $dashboard_phid => $dashboard) {
         $id = $dashboard->getID();
         $item = id(new PHUIObjectItemView())->setObjectName(pht('Dashboard %d', $id))->setHeader($dashboard->getName())->setHref($this->getApplicationURI("view/{$id}/"))->setObject($dashboard);
         if (isset($installs[$dashboard_phid])) {
             $install = $installs[$dashboard_phid];
             if ($install->getObjectPHID() == $viewer->getPHID()) {
                 $attrs = array('tip' => pht('This dashboard is installed to your personal homepage.'));
                 $item->addIcon('fa-user', pht('Installed'), $attrs);
             } else {
                 $attrs = array('tip' => pht('This dashboard is the default homepage for all users.'));
                 $item->addIcon('fa-globe', pht('Installed'), $attrs);
             }
         }
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No dashboards found.'));
     return $result;
 }
 protected function renderResultList(array $blogs, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($blogs, 'PhameBlog');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($blogs as $blog) {
         $id = $blog->getID();
         if ($blog->getDomain()) {
             $domain = $blog->getDomain();
         } else {
             $domain = pht('Local Blog');
         }
         $item = id(new PHUIObjectItemView())->setUser($viewer)->setObject($blog)->setHeader($blog->getName())->setImageURI($blog->getProfileImageURI())->setDisabled($blog->isArchived())->setHref($this->getApplicationURI("/blog/view/{$id}/"))->addAttribute($domain);
         if (!$blog->isArchived()) {
             $button = id(new PHUIButtonView())->setTag('a')->setText('New Post')->setHref($this->getApplicationURI('/post/edit/?blog=' . $id));
             $item->setLaunchButton($button);
         }
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No blogs found.'));
     return $result;
 }
 protected function renderResultList(array $authorizations, PhabricatorSavedQuery $query, array $handles)
 {
     $list = id(new DrydockAuthorizationListView())->setUser($this->requireViewer())->setAuthorizations($authorizations);
     $result = new PhabricatorApplicationSearchResultView();
     $result->setTable($list);
     return $result;
 }
 protected function renderResultList(array $notifications, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($notifications, 'PhabricatorFeedStory');
     $viewer = $this->requireViewer();
     $image = id(new PHUIIconView())->setIconFont('fa-eye-slash');
     $button = id(new PHUIButtonView())->setTag('a')->addSigil('workflow')->setColor(PHUIButtonView::SIMPLE)->setIcon($image)->setText(pht('Mark All Read'));
     switch ($query->getQueryKey()) {
         case 'unread':
             $header = pht('Unread Notifications');
             $no_data = pht('You have no unread notifications.');
             break;
         default:
             $header = pht('Notifications');
             $no_data = pht('You have no notifications.');
             break;
     }
     $clear_uri = id(new PhutilURI('/notification/clear/'));
     if ($notifications) {
         $builder = id(new PhabricatorNotificationBuilder($notifications))->setUser($viewer);
         $view = $builder->buildView();
         $clear_uri->setQueryParam('chronoKey', head($notifications)->getChronologicalKey());
     } else {
         $view = phutil_tag_div('phabricator-notification no-notifications', $no_data);
         $button->setDisabled(true);
     }
     $button->setHref((string) $clear_uri);
     $view = id(new PHUIBoxView())->addPadding(PHUI::PADDING_MEDIUM)->addClass('phabricator-notification-list')->appendChild($view);
     $result = new PhabricatorApplicationSearchResultView();
     $result->addAction($button);
     $result->setContent($view);
     return $result;
 }
 protected function renderResultList(array $panels, PhabricatorSavedQuery $query, array $handles)
 {
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($panels as $panel) {
         $item = id(new PHUIObjectItemView())->setObjectName($panel->getMonogram())->setHeader($panel->getName())->setHref('/' . $panel->getMonogram())->setObject($panel);
         $impl = $panel->getImplementation();
         if ($impl) {
             $type_text = $impl->getPanelTypeName();
         } else {
             $type_text = nonempty($panel->getPanelType(), pht('Unknown Type'));
         }
         $item->addAttribute($type_text);
         $properties = $panel->getProperties();
         $class = idx($properties, 'class');
         $item->addAttribute($class);
         if ($panel->getIsArchived()) {
             $item->setDisabled(true);
         }
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No panels found.'));
     return $result;
 }
 protected function renderResultList(array $plans, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($plans, 'HarbormasterBuildPlan');
     $viewer = $this->requireViewer();
     if ($plans) {
         $edge_query = id(new PhabricatorEdgeQuery())->withSourcePHIDs(mpull($plans, 'getPHID'))->withEdgeTypes(array(PhabricatorProjectObjectHasProjectEdgeType::EDGECONST));
         $edge_query->execute();
     }
     $list = new PHUIObjectItemListView();
     foreach ($plans as $plan) {
         $id = $plan->getID();
         $item = id(new PHUIObjectItemView())->setObjectName(pht('Plan %d', $id))->setHeader($plan->getName());
         if ($plan->isDisabled()) {
             $item->setDisabled(true);
         }
         if ($plan->isAutoplan()) {
             $item->addIcon('fa-lock grey', pht('Autoplan'));
         }
         $item->setHref($this->getApplicationURI("plan/{$id}/"));
         $phid = $plan->getPHID();
         $project_phids = $edge_query->getDestinationPHIDs(array($phid));
         $project_handles = $viewer->loadHandles($project_phids);
         $item->addAttribute(id(new PHUIHandleTagListView())->setLimit(4)->setNoDataString(pht('No Projects'))->setSlim(true)->setHandles($project_handles));
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No build plans found.'));
     return $result;
 }
 protected function renderResultList(array $invites, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($invites, 'PhabricatorAuthInvite');
     $viewer = $this->requireViewer();
     $rows = array();
     foreach ($invites as $invite) {
         $rows[] = array($invite->getEmailAddress(), $handles[$invite->getAuthorPHID()]->renderLink(), $invite->getAcceptedByPHID() ? $handles[$invite->getAcceptedByPHID()]->renderLink() : null, phabricator_datetime($invite->getDateCreated(), $viewer));
     }
     $table = id(new AphrontTableView($rows))->setHeaders(array(pht('Email Address'), pht('Sent By'), pht('Accepted By'), pht('Invited')))->setColumnClasses(array('', '', 'wide', 'right'));
     $result = new PhabricatorApplicationSearchResultView();
     $result->setTable($table);
     return $result;
 }
 protected function renderResultList(array $clients, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($clients, 'PhabricatorOauthServerClient');
     $viewer = $this->requireViewer();
     $list = id(new PHUIObjectItemListView())->setUser($viewer);
     foreach ($clients as $client) {
         $creator = $handles[$client->getCreatorPHID()];
         $item = id(new PHUIObjectItemView())->setObjectName(pht('Application %d', $client->getID()))->setHeader($client->getName())->setHref($client->getViewURI())->setObject($client)->addByline(pht('Creator: %s', $creator->renderLink()));
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No clients found.'));
     return $result;
 }
 protected function renderResultList(array $urls, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($urls, 'PhabricatorPhurlURL');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $handles = $viewer->loadHandles(mpull($urls, 'getAuthorPHID'));
     foreach ($urls as $url) {
         $item = id(new PHUIObjectItemView())->setUser($viewer)->setObject($url)->setHeader($viewer->renderHandle($url->getPHID()));
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No URLs found.'));
     return $result;
 }
 protected function renderResultList(array $packages, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($packages, 'PhabricatorOwnersPackage');
     $viewer = $this->requireViewer();
     $list = id(new PHUIObjectItemListView())->setUser($viewer);
     foreach ($packages as $package) {
         $id = $package->getID();
         $item = id(new PHUIObjectItemView())->setObject($package)->setObjectName(pht('Package %d', $id))->setHeader($package->getName())->setHref('/owners/package/' . $id . '/');
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No packages found.'));
     return $result;
 }
 protected function renderResultList(array $merchants, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($merchants, 'PhortuneMerchant');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($merchants as $merchant) {
         $item = id(new PHUIObjectItemView())->setSubhead(pht('Merchant %d', $merchant->getID()))->setHeader($merchant->getName())->setHref('/phortune/merchant/' . $merchant->getID() . '/')->setObject($merchant)->setImageIcon('fa-bank');
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No merchants found.'));
     return $result;
 }
 protected function renderResultList(array $queues, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($queues, 'NuanceQueue');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($queues as $queue) {
         $item = id(new PHUIObjectItemView())->setObjectName(pht('Queue %d', $queue->getID()))->setHeader($queue->getName())->setHref($queue->getURI());
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No queues found.'));
     return $result;
 }
 protected function renderResultList(array $services, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($services, 'AlmanacService');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($services as $service) {
         $item = id(new PHUIObjectItemView())->setObjectName(pht('Service %d', $service->getID()))->setHeader($service->getName())->setHref($service->getURI())->setObject($service)->addIcon($service->getServiceImplementation()->getServiceTypeIcon(), $service->getServiceImplementation()->getServiceTypeShortName());
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No Almanac Services found.'));
     return $result;
 }
 protected function renderResultList(array $blogs, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($blogs, 'PhameBlog');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($blogs as $blog) {
         $id = $blog->getID();
         $item = id(new PHUIObjectItemView())->setUser($viewer)->setObject($blog)->setHeader($blog->getName())->setStatusIcon('fa-star')->setHref($this->getApplicationURI("/blog/view/{$id}/"))->addAttribute($blog->getSkin())->addAttribute($blog->getDomain());
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No blogs found.'));
     return $result;
 }
 protected function renderResultList(array $networks, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($networks, 'AlmanacNetwork');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($networks as $network) {
         $id = $network->getID();
         $item = id(new PHUIObjectItemView())->setObjectName(pht('Network %d', $id))->setHeader($network->getName())->setHref($this->getApplicationURI("network/{$id}/"))->setObject($network);
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No Almanac Networks found.'));
     return $result;
 }
 protected function renderResultList(array $imports, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($imports, 'PhabricatorCalendarImport');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     foreach ($imports as $import) {
         $item = id(new PHUIObjectItemView())->setViewer($viewer)->setObjectName(pht('Import %d', $import->getID()))->setHeader($import->getDisplayName())->setHref($import->getURI());
         if ($import->getIsDisabled()) {
             $item->setDisabled(true);
         }
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No imports found.'));
     return $result;
 }
 protected function renderResultList(array $items, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($items, 'NuanceItem');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($items as $item) {
         $impl = $item->getImplementation();
         $view = id(new PHUIObjectItemView())->setObjectName(pht('Item %d', $item->getID()))->setHeader($item->getDisplayName())->setHref($item->getURI());
         $view->addIcon($impl->getItemTypeDisplayIcon(), $impl->getItemTypeDisplayName());
         $list->addItem($view);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No items found.'));
     return $result;
 }
 protected function renderResultList(array $keys, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($keys, 'PhabricatorAuthSSHKey');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($keys as $key) {
         $item = id(new PHUIObjectItemView())->setObjectName(pht('SSH Key %d', $key->getID()))->setHeader($key->getName())->setHref($key->getURI());
         if (!$key->getIsActive()) {
             $item->setDisabled(true);
         }
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No matching SSH keys.'));
     return $result;
 }
 protected function renderResultList(array $blueprints, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($blueprints, 'DrydockBlueprint');
     $viewer = $this->requireViewer();
     $view = new PHUIObjectItemListView();
     foreach ($blueprints as $blueprint) {
         $item = id(new PHUIObjectItemView())->setHeader($blueprint->getBlueprintName())->setHref($this->getApplicationURI('/blueprint/' . $blueprint->getID()))->setObjectName(pht('Blueprint %d', $blueprint->getID()));
         if (!$blueprint->getImplementation()->isEnabled()) {
             $item->setDisabled(true);
         }
         $item->addAttribute($blueprint->getImplementation()->getBlueprintName());
         $view->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($view);
     $result->setNoDataString(pht('No blueprints found.'));
     return $result;
 }
 protected function renderResultList(array $devices, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($devices, 'AlmanacDevice');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($devices as $device) {
         $item = id(new PHUIObjectItemView())->setObjectName(pht('Device %d', $device->getID()))->setHeader($device->getName())->setHref($device->getURI())->setObject($device);
         if ($device->isClusterDevice()) {
             $item->addIcon('fa-sitemap', pht('Cluster Device'));
         }
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No Almanac Devices found.'));
     return $result;
 }
 protected function renderResultList(array $products, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($products, 'ReleephProject');
     $viewer = $this->requireViewer();
     $list = id(new PHUIObjectItemListView())->setUser($viewer);
     foreach ($products as $product) {
         $id = $product->getID();
         $item = id(new PHUIObjectItemView())->setHeader($product->getName())->setHref($this->getApplicationURI("product/{$id}/"));
         if (!$product->getIsActive()) {
             $item->setDisabled(true);
             $item->addIcon('none', pht('Inactive'));
         }
         $repo = $product->getRepository();
         $item->addAttribute(phutil_tag('a', array('href' => $repo->getURI()), $repo->getMonogram()));
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     return $result;
 }
 protected function renderResultList(array $badges, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($badges, 'PhabricatorBadgesBadge');
     $viewer = $this->requireViewer();
     $list = id(new PHUIObjectItemListView());
     foreach ($badges as $badge) {
         $quality = idx($badge->getQualityNameMap(), $badge->getQuality());
         $mini_badge = id(new PHUIBadgeMiniView())->setHeader($badge->getName())->setIcon($badge->getIcon())->setQuality($badge->getQuality());
         $item = id(new PHUIObjectItemView())->setHeader($badge->getName())->setBadge($mini_badge)->setHref('/badges/view/' . $badge->getID() . '/')->addAttribute($quality)->addAttribute($badge->getFlavor());
         if ($badge->isClosed()) {
             $item->setDisabled(true);
             $item->addIcon('fa-ban', pht('Archived'));
         }
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No badges found.'));
     return $result;
 }
 protected function renderResultList(array $spaces, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($spaces, 'PhabricatorSpacesNamespace');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($spaces as $space) {
         $item = id(new PHUIObjectItemView())->setObjectName($space->getMonogram())->setHeader($space->getNamespaceName())->setHref('/' . $space->getMonogram());
         if ($space->getIsDefaultNamespace()) {
             $item->addIcon('fa-certificate', pht('Default Space'));
         }
         if ($space->getIsArchived()) {
             $item->setDisabled(true);
         }
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No spaces found.'));
     return $result;
 }
 protected function renderResultList(array $plans, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($plans, 'HarbormasterBuildPlan');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     foreach ($plans as $plan) {
         $id = $plan->getID();
         $item = id(new PHUIObjectItemView())->setObjectName(pht('Plan %d', $plan->getID()))->setHeader($plan->getName());
         if ($plan->isDisabled()) {
             $item->setDisabled(true);
         }
         if ($plan->isAutoplan()) {
             $item->addIcon('fa-lock grey', pht('Autoplan'));
         }
         $item->setHref($this->getApplicationURI("plan/{$id}/"));
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No build plans found.'));
     return $result;
 }
 protected function renderResultList(array $exports, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($exports, 'PhabricatorCalendarExport');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     foreach ($exports as $export) {
         $item = id(new PHUIObjectItemView())->setViewer($viewer)->setObjectName(pht('Export %d', $export->getID()))->setHeader($export->getName())->setHref($export->getURI());
         if ($export->getIsDisabled()) {
             $item->setDisabled(true);
         }
         $mode = $export->getPolicyMode();
         $policy_icon = PhabricatorCalendarExport::getPolicyModeIcon($mode);
         $policy_name = PhabricatorCalendarExport::getPolicyModeName($mode);
         $policy_color = PhabricatorCalendarExport::getPolicyModeColor($mode);
         $item->addIcon("{$policy_icon} {$policy_color}", $policy_name);
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No exports found.'));
     return $result;
 }
 protected function renderResultList(array $blueprints, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($blueprints, 'DrydockBlueprint');
     $viewer = $this->requireViewer();
     if ($blueprints) {
         $edge_query = id(new PhabricatorEdgeQuery())->withSourcePHIDs(mpull($blueprints, 'getPHID'))->withEdgeTypes(array(PhabricatorProjectObjectHasProjectEdgeType::EDGECONST));
         $edge_query->execute();
     }
     $view = new PHUIObjectItemListView();
     foreach ($blueprints as $blueprint) {
         $impl = $blueprint->getImplementation();
         $item = id(new PHUIObjectItemView())->setHeader($blueprint->getBlueprintName())->setHref($blueprint->getURI())->setObjectName(pht('Blueprint %d', $blueprint->getID()));
         if (!$impl->isEnabled()) {
             $item->setDisabled(true);
             $item->addIcon('fa-chain-broken grey', pht('Implementation'));
         }
         if ($blueprint->getIsDisabled()) {
             $item->setDisabled(true);
             $item->addIcon('fa-ban grey', pht('Disabled'));
         }
         $impl_icon = $impl->getBlueprintIcon();
         $impl_name = $impl->getBlueprintName();
         $impl_icon = id(new PHUIIconView())->setIcon($impl_icon, 'lightgreytext');
         $item->addAttribute(array($impl_icon, ' ', $impl_name));
         $phid = $blueprint->getPHID();
         $project_phids = $edge_query->getDestinationPHIDs(array($phid));
         if ($project_phids) {
             $project_handles = $viewer->loadHandles($project_phids);
             $item->addAttribute(id(new PHUIHandleTagListView())->setLimit(4)->setSlim(true)->setHandles($project_handles));
         }
         $view->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($view);
     $result->setNoDataString(pht('No blueprints found.'));
     return $result;
 }
 protected function renderResultList(array $mocks, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($mocks, 'PholioMock');
     $viewer = $this->requireViewer();
     $handles = $viewer->loadHandles(mpull($mocks, 'getAuthorPHID'));
     $xform = PhabricatorFileTransform::getTransformByKey(PhabricatorFileThumbnailTransform::TRANSFORM_PINBOARD);
     $board = new PHUIPinboardView();
     foreach ($mocks as $mock) {
         $image = $mock->getCoverFile();
         $image_uri = $image->getURIForTransform($xform);
         list($x, $y) = $xform->getTransformedDimensions($image);
         $header = 'M' . $mock->getID() . ' ' . $mock->getName();
         $item = id(new PHUIPinboardItemView())->setUser($viewer)->setHeader($header)->setObject($mock)->setURI('/M' . $mock->getID())->setImageURI($image_uri)->setImageSize($x, $y)->setDisabled($mock->isClosed())->addIconCount('fa-picture-o', count($mock->getImages()))->addIconCount('fa-trophy', $mock->getTokenCount());
         if ($mock->getAuthorPHID()) {
             $author_handle = $handles[$mock->getAuthorPHID()];
             $datetime = phabricator_date($mock->getDateCreated(), $viewer);
             $item->appendChild(pht('By %s on %s', $author_handle->renderLink(), $datetime));
         }
         $board->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setContent($board);
     return $result;
 }
 protected function renderResultList(array $credentials, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($credentials, 'PassphraseCredential');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($credentials as $credential) {
         $item = id(new PHUIObjectItemView())->setObjectName('K' . $credential->getID())->setHeader($credential->getName())->setHref('/K' . $credential->getID())->setObject($credential);
         $item->addAttribute(pht('Login: %s', $credential->getUsername()));
         if ($credential->getIsDestroyed()) {
             $item->addIcon('fa-ban', pht('Destroyed'));
             $item->setDisabled(true);
         }
         $type = PassphraseCredentialType::getTypeByConstant($credential->getCredentialType());
         if ($type) {
             $item->addIcon('fa-wrench', $type->getCredentialTypeName());
         }
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No credentials found.'));
     return $result;
 }
 protected function renderResultList(array $countdowns, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($countdowns, 'PhabricatorCountdown');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($countdowns as $countdown) {
         $id = $countdown->getID();
         $item = id(new PHUIObjectItemView())->setObjectName("C{$id}")->setHeader($countdown->getTitle())->setHref($this->getApplicationURI("{$id}/"))->addByline(pht('Created by %s', $handles[$countdown->getAuthorPHID()]->renderLink()));
         $epoch = $countdown->getEpoch();
         if ($epoch >= time()) {
             $item->addIcon('none', pht('Ends %s', phabricator_datetime($epoch, $viewer)));
         } else {
             $item->addIcon('delete', pht('Ended %s', phabricator_datetime($epoch, $viewer)));
             $item->setDisabled(true);
         }
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No countdowns found.'));
     return $result;
 }