Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/module/PhabricatorConfigPHIDModule.php
Show All 12 Lines | final class PhabricatorConfigPHIDModule extends PhabricatorConfigModule { | ||||
public function renderModuleStatus(AphrontRequest $request) { | public function renderModuleStatus(AphrontRequest $request) { | ||||
$viewer = $request->getViewer(); | $viewer = $request->getViewer(); | ||||
$types = PhabricatorPHIDType::getAllTypes(); | $types = PhabricatorPHIDType::getAllTypes(); | ||||
$types = msort($types, 'getTypeConstant'); | $types = msort($types, 'getTypeConstant'); | ||||
$rows = array(); | $rows = array(); | ||||
foreach ($types as $key => $type) { | foreach ($types as $key => $type) { | ||||
$class_name = $type->getPHIDTypeApplicationClass(); | |||||
if ($class_name !== null) { | |||||
$app = PhabricatorApplication::getByClass($class_name); | |||||
$app_name = $app->getName(); | |||||
$icon = $app->getFontIcon(); | |||||
if ($icon) { | |||||
$app_icon = id(new PHUIIconView())->setIconFont($icon); | |||||
} else { | |||||
$app_icon = null; | |||||
} | |||||
} else { | |||||
$app_name = null; | |||||
$app_icon = null; | |||||
} | |||||
$icon = $type->getTypeIcon(); | |||||
if ($icon) { | |||||
$type_icon = id(new PHUIIconView())->setIconFont($icon); | |||||
} else { | |||||
$type_icon = null; | |||||
} | |||||
$rows[] = array( | $rows[] = array( | ||||
$type->getTypeConstant(), | $type->getTypeConstant(), | ||||
get_class($type), | get_class($type), | ||||
$app_icon, | |||||
$app_name, | |||||
$type_icon, | |||||
$type->getTypeName(), | $type->getTypeName(), | ||||
); | ); | ||||
} | } | ||||
$table = id(new AphrontTableView($rows)) | $table = id(new AphrontTableView($rows)) | ||||
->setHeaders( | ->setHeaders( | ||||
array( | array( | ||||
pht('Constant'), | pht('Constant'), | ||||
pht('Class'), | pht('Class'), | ||||
null, | |||||
pht('Application'), | |||||
null, | |||||
pht('Name'), | pht('Name'), | ||||
)) | )) | ||||
->setColumnClasses( | ->setColumnClasses( | ||||
array( | array( | ||||
null, | null, | ||||
'pri', | 'pri', | ||||
'icon', | |||||
null, | |||||
'icon', | |||||
'wide', | 'wide', | ||||
)); | )); | ||||
return id(new PHUIObjectBoxView()) | return id(new PHUIObjectBoxView()) | ||||
->setHeaderText(pht('PHID Types')) | ->setHeaderText(pht('PHID Types')) | ||||
->setTable($table); | ->setTable($table); | ||||
} | } | ||||
} | } |