diff options
author | Bartosz DziewoĆski <matma.rex@gmail.com> | 2021-07-28 12:31:27 +0200 |
---|---|---|
committer | David Lynch <dlynch@wikimedia.org> | 2021-08-02 09:44:27 -0500 |
commit | 6d361d61bd82f26a06c08fca234d2240bd281874 (patch) | |
tree | 4a88e077eb468f8458a3a8f0a11a69b98dbc704e /includes/HookContainer | |
parent | deb52d68474bee3689e499eebc9d131f72c6558f (diff) | |
download | mediawikicore-6d361d61bd82f26a06c08fca234d2240bd281874.tar.gz mediawikicore-6d361d61bd82f26a06c08fca234d2240bd281874.zip |
Add a hook 'GetActionName' to allow overriding the action name
The use case is to change action=edit into action=view in some
scenarios where we want to offer a more limited interface or a
gentler introduction to editing than MediaWiki provides, for example
I2e7b2682da7beb3c1c469bb784a9a8ec3998aeb9 in DiscussionTools.
Bug: T282204
Change-Id: Ib9302e2fda7dadf1edc43c0107db7234eb4bdf7a
Diffstat (limited to 'includes/HookContainer')
-rw-r--r-- | includes/HookContainer/HookRunner.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/includes/HookContainer/HookRunner.php b/includes/HookContainer/HookRunner.php index 645f051f9a53..cebc7d23e8e1 100644 --- a/includes/HookContainer/HookRunner.php +++ b/includes/HookContainer/HookRunner.php @@ -29,6 +29,7 @@ use Title; * @internal */ class HookRunner implements + \MediaWiki\Actions\Hook\GetActionNameHook, \MediaWiki\Auth\Hook\AuthManagerLoginAuthenticateAuditHook, \MediaWiki\Auth\Hook\ExemptFromAccountCreationThrottleHook, \MediaWiki\Auth\Hook\LocalUserCreatedHook, @@ -1762,6 +1763,14 @@ class HookRunner implements ); } + public function onGetActionName( IContextSource $context, string &$action ): void { + $this->container->run( + 'GetActionName', + [ $context, &$action ], + [ 'abortable' => false ] + ); + } + public function onGetCacheVaryCookies( $out, &$cookies ) { return $this->container->run( 'GetCacheVaryCookies', |