Differential D14599 Diff 35336 src/applications/transactions/editengineextension/PhabricatorEditEngineExtensionModule.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editengineextension/PhabricatorEditEngineExtensionModule.php
- This file was added.
| <?php | |||||
| final class PhabricatorEditEngineExtensionModule | |||||
| extends PhabricatorConfigModule { | |||||
| public function getModuleKey() { | |||||
| return 'editengine'; | |||||
| } | |||||
| public function getModuleName() { | |||||
| return pht('EditEngine Extensions'); | |||||
| } | |||||
| public function renderModuleStatus(AphrontRequest $request) { | |||||
| $viewer = $request->getViewer(); | |||||
| $extensions = PhabricatorEditEngineExtension::getAllExtensions(); | |||||
| $rows = array(); | |||||
| foreach ($extensions as $extension) { | |||||
| $rows[] = array( | |||||
| $extension->getExtensionPriority(), | |||||
| get_class($extension), | |||||
| $extension->getExtensionName(), | |||||
| $extension->isExtensionEnabled() | |||||
| ? pht('Yes') | |||||
| : pht('No'), | |||||
| ); | |||||
| } | |||||
| $table = id(new AphrontTableView($rows)) | |||||
| ->setHeaders( | |||||
| array( | |||||
| pht('Priority'), | |||||
| pht('Class'), | |||||
| pht('Name'), | |||||
| pht('Enabled'), | |||||
| )) | |||||
| ->setColumnClasses( | |||||
| array( | |||||
| null, | |||||
| null, | |||||
| 'wide pri', | |||||
| null, | |||||
| )); | |||||
| return id(new PHUIObjectBoxView()) | |||||
| ->setHeaderText(pht('EditEngine Extensions')) | |||||
| ->setTable($table); | |||||
| } | |||||
| } | |||||