@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
at upstream/main 75 lines 1.7 kB view raw
1<?php 2 3final class PhabricatorConfigPHIDModule extends PhabricatorConfigModule { 4 5 public function getModuleKey() { 6 return 'phid'; 7 } 8 9 public function getModuleName() { 10 return pht('PHID Types'); 11 } 12 13 public function renderModuleStatus(AphrontRequest $request) { 14 $viewer = $request->getViewer(); 15 16 $types = PhabricatorPHIDType::getAllTypes(); 17 $types = msort($types, 'getTypeConstant'); 18 19 $rows = array(); 20 foreach ($types as $key => $type) { 21 $class_name = $type->getPHIDTypeApplicationClass(); 22 if ($class_name !== null) { 23 $app = PhabricatorApplication::getByClass($class_name); 24 $app_name = $app->getName(); 25 26 $icon = $app->getIcon(); 27 if ($icon) { 28 $app_icon = id(new PHUIIconView())->setIcon($icon); 29 } else { 30 $app_icon = null; 31 } 32 } else { 33 $app_name = null; 34 $app_icon = null; 35 } 36 37 $icon = $type->getTypeIcon(); 38 if ($icon) { 39 $type_icon = id(new PHUIIconView())->setIcon($icon); 40 } else { 41 $type_icon = null; 42 } 43 44 $rows[] = array( 45 $type->getTypeConstant(), 46 get_class($type), 47 $app_icon, 48 $app_name, 49 $type_icon, 50 $type->getTypeName(), 51 ); 52 } 53 54 return id(new AphrontTableView($rows)) 55 ->setHeaders( 56 array( 57 pht('Constant'), 58 pht('Class'), 59 null, 60 pht('Application'), 61 null, 62 pht('Name'), 63 )) 64 ->setColumnClasses( 65 array( 66 null, 67 'pri', 68 'icon', 69 null, 70 'icon', 71 'wide', 72 )); 73 } 74 75}