@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhabricatorSearchHandleController
4 extends PhabricatorSearchBaseController {
5
6 public function shouldAllowPublic() {
7 return true;
8 }
9
10 public function handleRequest(AphrontRequest $request) {
11 $viewer = $this->getViewer();
12 $phid = $request->getURIData('phid');
13
14 $handles = $viewer->loadHandles(array($phid));
15 $handle = $handles[$phid];
16
17 $cancel_uri = $handle->getURI();
18 if (!$cancel_uri) {
19 $cancel_uri = '/';
20 }
21
22 $rows = array();
23
24 $rows[] = array(
25 pht('PHID'),
26 $phid,
27 );
28
29 $rows[] = array(
30 pht('PHID Type'),
31 phid_get_type($phid),
32 );
33
34 $rows[] = array(
35 pht('URI'),
36 $handle->getURI(),
37 );
38
39 $icon = $handle->getIcon();
40 if ($icon !== null) {
41 $icon = id(new PHUIIconView())
42 ->setIcon($handle->getIcon());
43 }
44
45 $rows[] = array(
46 pht('Icon'),
47 $icon,
48 );
49
50 $rows[] = array(
51 pht('Object Name'),
52 $handle->getObjectName(),
53 );
54
55 $rows[] = array(
56 pht('Name'),
57 $handle->getName(),
58 );
59
60 $rows[] = array(
61 pht('Full Name'),
62 $handle->getFullName(),
63 );
64
65 $rows[] = array(
66 pht('Tag'),
67 $handle->renderTag(),
68 );
69
70 $rows[] = array(
71 pht('Link'),
72 $handle->renderLink(),
73 );
74
75 $table = id(new AphrontTableView($rows))
76 ->setColumnClasses(
77 array(
78 'header',
79 'wide',
80 ));
81
82 return $this->newDialog()
83 ->setTitle(pht('Handle: %s', $phid))
84 ->setWidth(AphrontDialogView::WIDTH_FORM)
85 ->appendChild($table)
86 ->addCancelButton($cancel_uri, pht('Done'));
87 }
88
89}