private function buildTagListTable(DiffusionRequest $drequest)
 {
     $viewer = $this->getRequest()->getUser();
     $repository = $drequest->getRepository();
     switch ($repository->getVersionControlSystem()) {
         case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
             // no tags in SVN
             return null;
     }
     $tag_limit = 15;
     $tags = array();
     $tags = DiffusionRepositoryTag::newFromConduit($this->callConduitWithDiffusionRequest('diffusion.tagsquery', array('commit' => null, 'limit' => $tag_limit + 1)));
     if (!$tags) {
         return null;
     }
     $more_tags = count($tags) > $tag_limit;
     $tags = array_slice($tags, 0, $tag_limit);
     $commits = id(new DiffusionCommitQuery())->setViewer($viewer)->withIdentifiers(mpull($tags, 'getCommitIdentifier'))->withRepository($repository)->needCommitData(true)->execute();
     $view = id(new DiffusionTagListView())->setUser($viewer)->setDiffusionRequest($drequest)->setTags($tags)->setCommits($commits);
     $phids = $view->getRequiredHandlePHIDs();
     $handles = $this->loadViewerHandles($phids);
     $view->setHandles($handles);
     $panel = new PHUIObjectBoxView();
     $header = new PHUIHeaderView();
     $header->setHeader(pht('Tags'));
     if ($more_tags) {
         $header->setSubHeader(pht('Showing the %d most recent tags.', $tag_limit));
     }
     $icon = id(new PHUIIconView())->setIconFont('fa-tag');
     $button = new PHUIButtonView();
     $button->setText(pht('Show All Tags'));
     $button->setTag('a');
     $button->setIcon($icon);
     $button->setHref($drequest->generateURI(array('action' => 'tags')));
     $header->addActionLink($button);
     $panel->setHeader($header);
     $panel->setTable($view);
     return $panel;
 }
 private function buildTagListTable(DiffusionRequest $drequest)
 {
     $viewer = $this->getRequest()->getUser();
     $tag_limit = 15;
     $tags = array();
     try {
         $tags = DiffusionRepositoryTag::newFromConduit($this->callConduitWithDiffusionRequest('diffusion.tagsquery', array('commit' => null, 'limit' => $tag_limit + 1)));
     } catch (ConduitException $e) {
         if ($e->getMessage() != 'ERR-UNSUPPORTED-VCS') {
             throw $e;
         }
     }
     if (!$tags) {
         return null;
     }
     $more_tags = count($tags) > $tag_limit;
     $tags = array_slice($tags, 0, $tag_limit);
     $commits = id(new DiffusionCommitQuery())->setViewer($viewer)->withIdentifiers(mpull($tags, 'getCommitIdentifier'))->withRepository($drequest->getRepository())->needCommitData(true)->execute();
     $view = id(new DiffusionTagListView())->setUser($viewer)->setDiffusionRequest($drequest)->setTags($tags)->setCommits($commits);
     $phids = $view->getRequiredHandlePHIDs();
     $handles = $this->loadViewerHandles($phids);
     $view->setHandles($handles);
     $panel = new PHUIObjectBoxView();
     $header = new PHUIHeaderView();
     $header->setHeader(pht('Tags'));
     if ($more_tags) {
         $header->setSubHeader(pht('Showing the %d most recent tags.', $tag_limit));
     }
     $icon = id(new PHUIIconView())->setIconFont('fa-tag');
     $button = new PHUIButtonView();
     $button->setText(pht('Show All Tags'));
     $button->setTag('a');
     $button->setIcon($icon);
     $button->setHref($drequest->generateURI(array('action' => 'tags')));
     $header->addActionLink($button);
     $panel->setHeader($header);
     $panel->appendChild($view);
     return $panel;
 }