Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / search / controller / PhabricatorSearchHandleController.php
blob751b4e367da419fa74fb3dfca209b54ad6d87c04
1 <?php
3 final class PhabricatorSearchHandleController
4 extends PhabricatorSearchBaseController {
6 public function shouldAllowPublic() {
7 return true;
10 public function handleRequest(AphrontRequest $request) {
11 $viewer = $this->getViewer();
12 $phid = $request->getURIData('phid');
14 $handles = $viewer->loadHandles(array($phid));
15 $handle = $handles[$phid];
17 $cancel_uri = $handle->getURI();
18 if (!$cancel_uri) {
19 $cancel_uri = '/';
22 $rows = array();
24 $rows[] = array(
25 pht('PHID'),
26 $phid,
29 $rows[] = array(
30 pht('PHID Type'),
31 phid_get_type($phid),
34 $rows[] = array(
35 pht('URI'),
36 $handle->getURI(),
39 $icon = $handle->getIcon();
40 if ($icon !== null) {
41 $icon = id(new PHUIIconView())
42 ->setIcon($handle->getIcon());
45 $rows[] = array(
46 pht('Icon'),
47 $icon,
50 $rows[] = array(
51 pht('Object Name'),
52 $handle->getObjectName(),
55 $rows[] = array(
56 pht('Name'),
57 $handle->getName(),
60 $rows[] = array(
61 pht('Full Name'),
62 $handle->getFullName(),
65 $rows[] = array(
66 pht('Tag'),
67 $handle->renderTag(),
70 $rows[] = array(
71 pht('Link'),
72 $handle->renderLink(),
75 $table = id(new AphrontTableView($rows))
76 ->setColumnClasses(
77 array(
78 'header',
79 'wide',
80 ));
82 return $this->newDialog()
83 ->setTitle(pht('Handle: %s', $phid))
84 ->setWidth(AphrontDialogView::WIDTH_FORM)
85 ->appendChild($table)
86 ->addCancelButton($cancel_uri, pht('Done'));