@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
fork

Configure Feed

Select the types of activity you want to include in your feed.

Tie application event listeners to the applications they listen for

Summary:
Ref T3675. Some of these listeners shouldn't do their thing if the viewer doesn't have access to an application (for example, users without access to Differential should not be able to "Edit Tasks"). Set the stage for that:

- Introduce `PhabricatorEventListener`, which has an application.
- Populate this for event listeners installed by applications.
- Rename the "PeopleMenu" listeners to "ActionMenu" listeners, which better describes their modern behavior.

This doesn't actually change any behaviors.

Test Plan: Viewed Maniphest, Differntial, People.

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3675

Differential Revision: https://secure.phabricator.com/D7364

+88 -46
+25 -23
src/__phutil_library_map__.php
··· 90 90 'AphrontUsageException' => 'aphront/exception/AphrontUsageException.php', 91 91 'AphrontView' => 'view/AphrontView.php', 92 92 'AphrontWebpageResponse' => 'aphront/response/AphrontWebpageResponse.php', 93 - 'AuditPeopleMenuEventListener' => 'applications/audit/events/AuditPeopleMenuEventListener.php', 93 + 'AuditActionMenuEventListener' => 'applications/audit/events/AuditActionMenuEventListener.php', 94 94 'CelerityAPI' => 'infrastructure/celerity/CelerityAPI.php', 95 95 'CelerityPhabricatorResourceController' => 'infrastructure/celerity/CelerityPhabricatorResourceController.php', 96 96 'CelerityResourceController' => 'infrastructure/celerity/CelerityResourceController.php', ··· 244 244 'ConduitCallTestCase' => 'applications/conduit/call/__tests__/ConduitCallTestCase.php', 245 245 'ConduitException' => 'applications/conduit/protocol/ConduitException.php', 246 246 'ConduitSSHWorkflow' => 'applications/conduit/ssh/ConduitSSHWorkflow.php', 247 + 'ConpherenceActionMenuEventListener' => 'applications/conpherence/events/ConpherenceActionMenuEventListener.php', 247 248 'ConpherenceConfigOptions' => 'applications/conpherence/config/ConpherenceConfigOptions.php', 248 249 'ConpherenceConstants' => 'applications/conpherence/constants/ConpherenceConstants.php', 249 250 'ConpherenceController' => 'applications/conpherence/controller/ConpherenceController.php', ··· 261 262 'ConpherenceParticipantCountQuery' => 'applications/conpherence/query/ConpherenceParticipantCountQuery.php', 262 263 'ConpherenceParticipantQuery' => 'applications/conpherence/query/ConpherenceParticipantQuery.php', 263 264 'ConpherenceParticipationStatus' => 'applications/conpherence/constants/ConpherenceParticipationStatus.php', 264 - 'ConpherencePeopleMenuEventListener' => 'applications/conpherence/events/ConpherencePeopleMenuEventListener.php', 265 265 'ConpherencePeopleWidgetView' => 'applications/conpherence/view/ConpherencePeopleWidgetView.php', 266 266 'ConpherenceReplyHandler' => 'applications/conpherence/mail/ConpherenceReplyHandler.php', 267 267 'ConpherenceSettings' => 'applications/conpherence/constants/ConpherenceSettings.php', ··· 297 297 'DefaultDatabaseConfigurationProvider' => 'infrastructure/storage/configuration/DefaultDatabaseConfigurationProvider.php', 298 298 'DifferentialAction' => 'applications/differential/constants/DifferentialAction.php', 299 299 'DifferentialActionHasNoEffectException' => 'applications/differential/exception/DifferentialActionHasNoEffectException.php', 300 + 'DifferentialActionMenuEventListener' => 'applications/differential/events/DifferentialActionMenuEventListener.php', 300 301 'DifferentialAddCommentView' => 'applications/differential/view/DifferentialAddCommentView.php', 301 302 'DifferentialAffectedPath' => 'applications/differential/storage/DifferentialAffectedPath.php', 302 303 'DifferentialApplyPatchFieldSpecification' => 'applications/differential/field/specification/DifferentialApplyPatchFieldSpecification.php', ··· 390 391 'DifferentialPHIDTypeRevision' => 'applications/differential/phid/DifferentialPHIDTypeRevision.php', 391 392 'DifferentialParseRenderTestCase' => 'applications/differential/__tests__/DifferentialParseRenderTestCase.php', 392 393 'DifferentialPathFieldSpecification' => 'applications/differential/field/specification/DifferentialPathFieldSpecification.php', 393 - 'DifferentialPeopleMenuEventListener' => 'applications/differential/events/DifferentialPeopleMenuEventListener.php', 394 394 'DifferentialPrimaryPaneView' => 'applications/differential/view/DifferentialPrimaryPaneView.php', 395 395 'DifferentialProjectReviewersFieldSpecification' => 'applications/differential/field/specification/DifferentialProjectReviewersFieldSpecification.php', 396 396 'DifferentialRawDiffRenderer' => 'applications/differential/render/DifferentialRawDiffRenderer.php', ··· 704 704 'LiskIsolationTestDAOException' => 'infrastructure/storage/lisk/__tests__/LiskIsolationTestDAOException.php', 705 705 'LiskMigrationIterator' => 'infrastructure/storage/lisk/LiskMigrationIterator.php', 706 706 'LiskRawMigrationIterator' => 'infrastructure/storage/lisk/LiskRawMigrationIterator.php', 707 + 'ManiphestActionMenuEventListener' => 'applications/maniphest/event/ManiphestActionMenuEventListener.php', 707 708 'ManiphestBatchEditController' => 'applications/maniphest/controller/ManiphestBatchEditController.php', 708 709 'ManiphestCapabilityBulkEdit' => 'applications/maniphest/capability/ManiphestCapabilityBulkEdit.php', 709 710 'ManiphestCapabilityDefaultEdit' => 'applications/maniphest/capability/ManiphestCapabilityDefaultEdit.php', ··· 730 731 'ManiphestNameIndex' => 'applications/maniphest/storage/ManiphestNameIndex.php', 731 732 'ManiphestNameIndexEventListener' => 'applications/maniphest/event/ManiphestNameIndexEventListener.php', 732 733 'ManiphestPHIDTypeTask' => 'applications/maniphest/phid/ManiphestPHIDTypeTask.php', 733 - 'ManiphestPeopleMenuEventListener' => 'applications/maniphest/event/ManiphestPeopleMenuEventListener.php', 734 734 'ManiphestRemarkupRule' => 'applications/maniphest/remarkup/ManiphestRemarkupRule.php', 735 735 'ManiphestReplyHandler' => 'applications/maniphest/mail/ManiphestReplyHandler.php', 736 736 'ManiphestReportController' => 'applications/maniphest/controller/ManiphestReportController.php', ··· 1157 1157 'PhabricatorErrorExample' => 'applications/uiexample/examples/PhabricatorErrorExample.php', 1158 1158 'PhabricatorEvent' => 'infrastructure/events/PhabricatorEvent.php', 1159 1159 'PhabricatorEventEngine' => 'infrastructure/events/PhabricatorEventEngine.php', 1160 + 'PhabricatorEventListener' => 'infrastructure/events/PhabricatorEventListener.php', 1160 1161 'PhabricatorEventType' => 'infrastructure/events/constant/PhabricatorEventType.php', 1161 1162 'PhabricatorExampleEventListener' => 'infrastructure/events/PhabricatorExampleEventListener.php', 1162 1163 'PhabricatorExtendingPhabricatorConfigOptions' => 'applications/config/option/PhabricatorExtendingPhabricatorConfigOptions.php', ··· 2225 2226 1 => 'PhutilSafeHTMLProducerInterface', 2226 2227 ), 2227 2228 'AphrontWebpageResponse' => 'AphrontHTMLResponse', 2228 - 'AuditPeopleMenuEventListener' => 'PhutilEventListener', 2229 + 'AuditActionMenuEventListener' => 'PhabricatorEventListener', 2229 2230 'CelerityPhabricatorResourceController' => 'CelerityResourceController', 2230 2231 'CelerityResourceController' => 'PhabricatorController', 2231 2232 'CelerityResourceGraph' => 'AbstractDirectedGraph', ··· 2375 2376 'ConduitCallTestCase' => 'PhabricatorTestCase', 2376 2377 'ConduitException' => 'Exception', 2377 2378 'ConduitSSHWorkflow' => 'PhabricatorSSHWorkflow', 2379 + 'ConpherenceActionMenuEventListener' => 'PhabricatorEventListener', 2378 2380 'ConpherenceConfigOptions' => 'PhabricatorApplicationConfigOptions', 2379 2381 'ConpherenceController' => 'PhabricatorController', 2380 2382 'ConpherenceCreateThreadMailReceiver' => 'PhabricatorMailReceiver', 2381 2383 'ConpherenceDAO' => 'PhabricatorLiskDAO', 2382 2384 'ConpherenceEditor' => 'PhabricatorApplicationTransactionEditor', 2383 2385 'ConpherenceFileWidgetView' => 'ConpherenceWidgetView', 2384 - 'ConpherenceHovercardEventListener' => 'PhutilEventListener', 2386 + 'ConpherenceHovercardEventListener' => 'PhabricatorEventListener', 2385 2387 'ConpherenceLayoutView' => 'AphrontView', 2386 2388 'ConpherenceListController' => 'ConpherenceController', 2387 2389 'ConpherenceMenuItemView' => 'AphrontTagView', ··· 2391 2393 'ConpherenceParticipantCountQuery' => 'PhabricatorOffsetPagedQuery', 2392 2394 'ConpherenceParticipantQuery' => 'PhabricatorOffsetPagedQuery', 2393 2395 'ConpherenceParticipationStatus' => 'ConpherenceConstants', 2394 - 'ConpherencePeopleMenuEventListener' => 'PhutilEventListener', 2395 2396 'ConpherencePeopleWidgetView' => 'ConpherenceWidgetView', 2396 2397 'ConpherenceReplyHandler' => 'PhabricatorMailReplyHandler', 2397 2398 'ConpherenceSettings' => 'ConpherenceConstants', ··· 2418 2419 'DarkConsoleDataController' => 'PhabricatorController', 2419 2420 'DarkConsoleErrorLogPlugin' => 'DarkConsolePlugin', 2420 2421 'DarkConsoleEventPlugin' => 'DarkConsolePlugin', 2421 - 'DarkConsoleEventPluginAPI' => 'PhutilEventListener', 2422 + 'DarkConsoleEventPluginAPI' => 'PhabricatorEventListener', 2422 2423 'DarkConsoleRequestPlugin' => 'DarkConsolePlugin', 2423 2424 'DarkConsoleServicesPlugin' => 'DarkConsolePlugin', 2424 2425 'DarkConsoleXHProfPlugin' => 'DarkConsolePlugin', 2425 2426 'DefaultDatabaseConfigurationProvider' => 'DatabaseConfigurationProvider', 2426 2427 'DifferentialActionHasNoEffectException' => 'DifferentialException', 2428 + 'DifferentialActionMenuEventListener' => 'PhabricatorEventListener', 2427 2429 'DifferentialAddCommentView' => 'AphrontView', 2428 2430 'DifferentialAffectedPath' => 'DifferentialDAO', 2429 2431 'DifferentialApplyPatchFieldSpecification' => 'DifferentialFieldSpecification', ··· 2496 2498 'DifferentialFreeformFieldTestCase' => 'PhabricatorTestCase', 2497 2499 'DifferentialGitSVNIDFieldSpecification' => 'DifferentialFieldSpecification', 2498 2500 'DifferentialHostFieldSpecification' => 'DifferentialFieldSpecification', 2499 - 'DifferentialHovercardEventListener' => 'PhutilEventListener', 2501 + 'DifferentialHovercardEventListener' => 'PhabricatorEventListener', 2500 2502 'DifferentialHunk' => 'DifferentialDAO', 2501 2503 'DifferentialHunkParserTestCase' => 'PhabricatorTestCase', 2502 2504 'DifferentialHunkTestCase' => 'ArcanistPhutilTestCase', ··· 2516 2518 'DifferentialPHIDTypeRevision' => 'PhabricatorPHIDType', 2517 2519 'DifferentialParseRenderTestCase' => 'PhabricatorTestCase', 2518 2520 'DifferentialPathFieldSpecification' => 'DifferentialFieldSpecification', 2519 - 'DifferentialPeopleMenuEventListener' => 'PhutilEventListener', 2520 2521 'DifferentialPrimaryPaneView' => 'AphrontView', 2521 2522 'DifferentialProjectReviewersFieldSpecification' => 'DifferentialFieldSpecification', 2522 2523 'DifferentialReleephRequestFieldSpecification' => 'DifferentialFieldSpecification', ··· 2601 2602 'DiffusionGitStableCommitNameQuery' => 'DiffusionStableCommitNameQuery', 2602 2603 'DiffusionHistoryController' => 'DiffusionController', 2603 2604 'DiffusionHistoryTableView' => 'DiffusionView', 2604 - 'DiffusionHovercardEventListener' => 'PhutilEventListener', 2605 + 'DiffusionHovercardEventListener' => 'PhabricatorEventListener', 2605 2606 'DiffusionInlineCommentController' => 'PhabricatorInlineCommentController', 2606 2607 'DiffusionInlineCommentPreviewController' => 'PhabricatorInlineCommentPreviewController', 2607 2608 'DiffusionLastModifiedController' => 'DiffusionController', ··· 2842 2843 'LiskIsolationTestDAOException' => 'Exception', 2843 2844 'LiskMigrationIterator' => 'PhutilBufferedIterator', 2844 2845 'LiskRawMigrationIterator' => 'PhutilBufferedIterator', 2846 + 'ManiphestActionMenuEventListener' => 'PhabricatorEventListener', 2845 2847 'ManiphestBatchEditController' => 'ManiphestController', 2846 2848 'ManiphestCapabilityBulkEdit' => 'PhabricatorPolicyCapability', 2847 2849 'ManiphestCapabilityDefaultEdit' => 'PhabricatorPolicyCapability', ··· 2863 2865 'ManiphestCustomFieldStorage' => 'PhabricatorCustomFieldStorage', 2864 2866 'ManiphestCustomFieldStringIndex' => 'PhabricatorCustomFieldStringIndexStorage', 2865 2867 'ManiphestDAO' => 'PhabricatorLiskDAO', 2866 - 'ManiphestEdgeEventListener' => 'PhutilEventListener', 2868 + 'ManiphestEdgeEventListener' => 'PhabricatorEventListener', 2867 2869 'ManiphestExcelDefaultFormat' => 'ManiphestExcelFormat', 2868 2870 'ManiphestExportController' => 'ManiphestController', 2869 - 'ManiphestHovercardEventListener' => 'PhutilEventListener', 2871 + 'ManiphestHovercardEventListener' => 'PhabricatorEventListener', 2870 2872 'ManiphestNameIndex' => 'ManiphestDAO', 2871 - 'ManiphestNameIndexEventListener' => 'PhutilEventListener', 2873 + 'ManiphestNameIndexEventListener' => 'PhabricatorEventListener', 2872 2874 'ManiphestPHIDTypeTask' => 'PhabricatorPHIDType', 2873 - 'ManiphestPeopleMenuEventListener' => 'PhutilEventListener', 2874 2875 'ManiphestRemarkupRule' => 'PhabricatorRemarkupRuleObject', 2875 2876 'ManiphestReplyHandler' => 'PhabricatorMailReplyHandler', 2876 2877 'ManiphestReportController' => 'ManiphestController', ··· 3289 3290 'PhabricatorDaemonConsoleController' => 'PhabricatorDaemonController', 3290 3291 'PhabricatorDaemonController' => 'PhabricatorController', 3291 3292 'PhabricatorDaemonDAO' => 'PhabricatorLiskDAO', 3292 - 'PhabricatorDaemonEventListener' => 'PhutilEventListener', 3293 + 'PhabricatorDaemonEventListener' => 'PhabricatorEventListener', 3293 3294 'PhabricatorDaemonLog' => 3294 3295 array( 3295 3296 0 => 'PhabricatorDaemonDAO', ··· 3340 3341 'PhabricatorEnvTestCase' => 'PhabricatorTestCase', 3341 3342 'PhabricatorErrorExample' => 'PhabricatorUIExample', 3342 3343 'PhabricatorEvent' => 'PhutilEvent', 3344 + 'PhabricatorEventListener' => 'PhutilEventListener', 3343 3345 'PhabricatorEventType' => 'PhutilEventType', 3344 - 'PhabricatorExampleEventListener' => 'PhutilEventListener', 3346 + 'PhabricatorExampleEventListener' => 'PhabricatorEventListener', 3345 3347 'PhabricatorExtendingPhabricatorConfigOptions' => 'PhabricatorApplicationConfigOptions', 3346 3348 'PhabricatorExternalAccount' => 3347 3349 array( ··· 3464 3466 'PhabricatorFlagQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 3465 3467 'PhabricatorFlagSearchEngine' => 'PhabricatorApplicationSearchEngine', 3466 3468 'PhabricatorFlagSelectControl' => 'AphrontFormControl', 3467 - 'PhabricatorFlagsUIEventListener' => 'PhutilEventListener', 3469 + 'PhabricatorFlagsUIEventListener' => 'PhabricatorEventListener', 3468 3470 'PhabricatorFormExample' => 'PhabricatorUIExample', 3469 3471 'PhabricatorGarbageCollectorConfigOptions' => 'PhabricatorApplicationConfigOptions', 3470 3472 'PhabricatorGarbageCollectorDaemon' => 'PhabricatorDaemon', ··· 3670 3672 'PhabricatorPasteViewController' => 'PhabricatorPasteController', 3671 3673 'PhabricatorPeopleController' => 'PhabricatorController', 3672 3674 'PhabricatorPeopleEditController' => 'PhabricatorPeopleController', 3673 - 'PhabricatorPeopleHovercardEventListener' => 'PhutilEventListener', 3675 + 'PhabricatorPeopleHovercardEventListener' => 'PhabricatorEventListener', 3674 3676 'PhabricatorPeopleLdapController' => 'PhabricatorPeopleController', 3675 3677 'PhabricatorPeopleListController' => 3676 3678 array( ··· 3947 3949 'PhabricatorSubscribersQuery' => 'PhabricatorQuery', 3948 3950 'PhabricatorSubscriptionsEditController' => 'PhabricatorController', 3949 3951 'PhabricatorSubscriptionsEditor' => 'PhabricatorEditor', 3950 - 'PhabricatorSubscriptionsUIEventListener' => 'PhutilEventListener', 3952 + 'PhabricatorSubscriptionsUIEventListener' => 'PhabricatorEventListener', 3951 3953 'PhabricatorSymbolNameLinter' => 'ArcanistXHPASTLintNamingHook', 3952 3954 'PhabricatorSyntaxHighlightingConfigOptions' => 'PhabricatorApplicationConfigOptions', 3953 3955 'PhabricatorTagExample' => 'PhabricatorUIExample', ··· 3984 3986 'PhabricatorTokenPHIDTypeToken' => 'PhabricatorPHIDType', 3985 3987 'PhabricatorTokenQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 3986 3988 'PhabricatorTokenReceiverQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 3987 - 'PhabricatorTokenUIEventListener' => 'PhutilEventListener', 3989 + 'PhabricatorTokenUIEventListener' => 'PhabricatorEventListener', 3988 3990 'PhabricatorTransactionView' => 'AphrontView', 3989 3991 'PhabricatorTransformedFile' => 'PhabricatorFileDAO', 3990 3992 'PhabricatorTranslationsConfigOptions' => 'PhabricatorApplicationConfigOptions', ··· 4237 4239 'PhrequentTimeBlock' => 'Phobject', 4238 4240 'PhrequentTimeBlockTestCase' => 'PhabricatorTestCase', 4239 4241 'PhrequentTrackController' => 'PhrequentController', 4240 - 'PhrequentUIEventListener' => 'PhutilEventListener', 4242 + 'PhrequentUIEventListener' => 'PhabricatorEventListener', 4241 4243 'PhrequentUserTime' => 4242 4244 array( 4243 4245 0 => 'PhrequentDAO', ··· 4245 4247 ), 4246 4248 'PhrequentUserTimeQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 4247 4249 'PhrictionActionConstants' => 'PhrictionConstants', 4248 - 'PhrictionActionMenuEventListener' => 'PhutilEventListener', 4250 + 'PhrictionActionMenuEventListener' => 'PhabricatorEventListener', 4249 4251 'PhrictionChangeType' => 'PhrictionConstants', 4250 4252 'PhrictionContent' => 4251 4253 array(
+1 -1
src/aphront/console/plugin/event/DarkConsoleEventPluginAPI.php
··· 3 3 /** 4 4 * @group console 5 5 */ 6 - final class DarkConsoleEventPluginAPI extends PhutilEventListener { 6 + final class DarkConsoleEventPluginAPI extends PhabricatorEventListener { 7 7 8 8 private static $events = array(); 9 9 private static $discardMode = false;
+1 -1
src/applications/audit/application/PhabricatorApplicationAudit.php
··· 20 20 21 21 public function getEventListeners() { 22 22 return array( 23 - new AuditPeopleMenuEventListener() 23 + new AuditActionMenuEventListener() 24 24 ); 25 25 } 26 26
+1 -1
src/applications/audit/events/AuditPeopleMenuEventListener.php src/applications/audit/events/AuditActionMenuEventListener.php
··· 1 1 <?php 2 2 3 - final class AuditPeopleMenuEventListener extends PhutilEventListener { 3 + final class AuditActionMenuEventListener extends PhabricatorEventListener { 4 4 5 5 public function register() { 6 6 $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS);
+1 -1
src/applications/conpherence/application/PhabricatorApplicationConpherence.php
··· 31 31 32 32 public function getEventListeners() { 33 33 return array( 34 - new ConpherencePeopleMenuEventListener(), 34 + new ConpherenceActionMenuEventListener(), 35 35 new ConpherenceHovercardEventListener(), 36 36 ); 37 37 }
+1 -1
src/applications/conpherence/events/ConpherenceHovercardEventListener.php
··· 8 8 * 9 9 * @task event 10 10 */ 11 - final class ConpherenceHovercardEventListener extends PhutilEventListener { 11 + final class ConpherenceHovercardEventListener extends PhabricatorEventListener { 12 12 13 13 public function register() { 14 14 $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERHOVERCARD);
+2 -1
src/applications/conpherence/events/ConpherencePeopleMenuEventListener.php src/applications/conpherence/events/ConpherenceActionMenuEventListener.php
··· 1 1 <?php 2 2 3 - final class ConpherencePeopleMenuEventListener extends PhutilEventListener { 3 + final class ConpherenceActionMenuEventListener 4 + extends PhabricatorEventListener { 4 5 5 6 public function register() { 6 7 $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS);
+1 -1
src/applications/daemon/event/PhabricatorDaemonEventListener.php
··· 1 1 <?php 2 2 3 - final class PhabricatorDaemonEventListener extends PhutilEventListener { 3 + final class PhabricatorDaemonEventListener extends PhabricatorEventListener { 4 4 5 5 private $daemons = array(); 6 6
+1 -1
src/applications/differential/application/PhabricatorApplicationDifferential.php
··· 30 30 31 31 public function getEventListeners() { 32 32 return array( 33 - new DifferentialPeopleMenuEventListener(), 33 + new DifferentialActionMenuEventListener(), 34 34 new DifferentialHovercardEventListener(), 35 35 ); 36 36 }
+2 -1
src/applications/differential/events/DifferentialHovercardEventListener.php
··· 1 1 <?php 2 2 3 - final class DifferentialHovercardEventListener extends PhutilEventListener { 3 + final class DifferentialHovercardEventListener 4 + extends PhabricatorEventListener { 4 5 5 6 public function register() { 6 7 $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERHOVERCARD);
+2 -1
src/applications/differential/events/DifferentialPeopleMenuEventListener.php src/applications/differential/events/DifferentialActionMenuEventListener.php
··· 1 1 <?php 2 2 3 - final class DifferentialPeopleMenuEventListener extends PhutilEventListener { 3 + final class DifferentialActionMenuEventListener 4 + extends PhabricatorEventListener { 4 5 5 6 public function register() { 6 7 $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS);
+1 -1
src/applications/diffusion/events/DiffusionHovercardEventListener.php
··· 1 1 <?php 2 2 3 - final class DiffusionHovercardEventListener extends PhutilEventListener { 3 + final class DiffusionHovercardEventListener extends PhabricatorEventListener { 4 4 5 5 public function register() { 6 6 $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERHOVERCARD);
+1 -1
src/applications/flag/events/PhabricatorFlagsUIEventListener.php
··· 1 1 <?php 2 2 3 - final class PhabricatorFlagsUIEventListener extends PhutilEventListener { 3 + final class PhabricatorFlagsUIEventListener extends PhabricatorEventListener { 4 4 5 5 public function register() { 6 6 $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS);
+1 -1
src/applications/maniphest/application/PhabricatorApplicationManiphest.php
··· 35 35 public function getEventListeners() { 36 36 return array( 37 37 new ManiphestNameIndexEventListener(), 38 - new ManiphestPeopleMenuEventListener(), 38 + new ManiphestActionMenuEventListener(), 39 39 new ManiphestHovercardEventListener(), 40 40 ); 41 41 }
+1 -1
src/applications/maniphest/event/ManiphestEdgeEventListener.php
··· 7 7 * 8 8 * @group maniphest 9 9 */ 10 - final class ManiphestEdgeEventListener extends PhutilEventListener { 10 + final class ManiphestEdgeEventListener extends PhabricatorEventListener { 11 11 12 12 private $edges = array(); 13 13 private $tasks = array();
+1 -1
src/applications/maniphest/event/ManiphestHovercardEventListener.php
··· 1 1 <?php 2 2 3 - final class ManiphestHovercardEventListener extends PhutilEventListener { 3 + final class ManiphestHovercardEventListener extends PhabricatorEventListener { 4 4 5 5 public function register() { 6 6 $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERHOVERCARD);
+1 -1
src/applications/maniphest/event/ManiphestNameIndexEventListener.php
··· 1 1 <?php 2 2 3 - final class ManiphestNameIndexEventListener extends PhutilEventListener { 3 + final class ManiphestNameIndexEventListener extends PhabricatorEventListener { 4 4 5 5 public function register() { 6 6 $this->listen(PhabricatorEventType::TYPE_SEARCH_DIDUPDATEINDEX);
+1 -1
src/applications/maniphest/event/ManiphestPeopleMenuEventListener.php src/applications/maniphest/event/ManiphestActionMenuEventListener.php
··· 1 1 <?php 2 2 3 - final class ManiphestPeopleMenuEventListener extends PhutilEventListener { 3 + final class ManiphestActionMenuEventListener extends PhabricatorEventListener { 4 4 5 5 public function register() { 6 6 $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS);
+1 -1
src/applications/people/event/PhabricatorPeopleHovercardEventListener.php
··· 1 1 <?php 2 2 3 3 final class PhabricatorPeopleHovercardEventListener 4 - extends PhutilEventListener { 4 + extends PhabricatorEventListener { 5 5 6 6 public function register() { 7 7 $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERHOVERCARD);
+1 -1
src/applications/phrequent/event/PhrequentUIEventListener.php
··· 1 1 <?php 2 2 3 3 final class PhrequentUIEventListener 4 - extends PhutilEventListener { 4 + extends PhabricatorEventListener { 5 5 6 6 public function register() { 7 7 $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS);
+1 -1
src/applications/phriction/event/PhrictionActionMenuEventListener.php
··· 1 1 <?php 2 2 3 - final class PhrictionActionMenuEventListener extends PhutilEventListener { 3 + final class PhrictionActionMenuEventListener extends PhabricatorEventListener { 4 4 5 5 public function register() { 6 6 $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS);
+1 -1
src/applications/subscriptions/events/PhabricatorSubscriptionsUIEventListener.php
··· 1 1 <?php 2 2 3 3 final class PhabricatorSubscriptionsUIEventListener 4 - extends PhutilEventListener { 4 + extends PhabricatorEventListener { 5 5 6 6 public function register() { 7 7 $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS);
+1 -1
src/applications/tokens/event/PhabricatorTokenUIEventListener.php
··· 1 1 <?php 2 2 3 3 final class PhabricatorTokenUIEventListener 4 - extends PhutilEventListener { 4 + extends PhabricatorEventListener { 5 5 6 6 public function register() { 7 7 $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS);
+1
src/infrastructure/events/PhabricatorEventEngine.php
··· 26 26 foreach ($applications as $application) { 27 27 $listeners = $application->getEventListeners(); 28 28 foreach ($listeners as $listener) { 29 + $listener->setApplication($application); 29 30 $listener->register(); 30 31 } 31 32 }
+36
src/infrastructure/events/PhabricatorEventListener.php
··· 1 + <?php 2 + 3 + abstract class PhabricatorEventListener extends PhutilEventListener { 4 + 5 + private $application; 6 + 7 + public function setApplication(PhabricatorApplication $application) { 8 + $this->application = $application; 9 + return $this; 10 + } 11 + 12 + public function getApplication() { 13 + return $this->application; 14 + } 15 + 16 + public function hasApplicationCapability( 17 + PhabricatorUser $viewer, 18 + $capability) { 19 + return PhabricatorPolicyFilter::hasCapability( 20 + $viewer, 21 + $this->getApplication(), 22 + $capability); 23 + } 24 + 25 + public function canUseApplication(PhabricatorUser $viewer) { 26 + return $this->hasApplicationCapability( 27 + $viewer, 28 + PhabricatorPolicyCapability::CAN_VIEW); 29 + } 30 + 31 + } 32 + 33 + 34 + 35 + 36 +
+1 -1
src/infrastructure/events/PhabricatorExampleEventListener.php
··· 6 6 * 7 7 * @group events 8 8 */ 9 - final class PhabricatorExampleEventListener extends PhutilEventListener { 9 + final class PhabricatorExampleEventListener extends PhabricatorEventListener { 10 10 11 11 public function register() { 12 12 // When your listener is installed, its register() method will be called.