mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-30 18:45:07 +00:00
e058b980b5
Adjusted the edit-user-talk event creation to detect and record which section of the talk page was edited. Flyout, special page, and email messages have been adjusted to use this section title as a URL fragment when available. Bug: 46937 Change-Id: I161e2ffda2f2540f64de90cc621fb3b69479d0db
44 lines
1 KiB
PHP
44 lines
1 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Formatter for 'user-rights' notifications
|
|
*/
|
|
class EchoUserRightsFormatter extends EchoBasicFormatter {
|
|
|
|
/**
|
|
* @param $event EchoEvent
|
|
* @param $param string
|
|
* @param $message Message
|
|
* @param $user User
|
|
*/
|
|
protected function processParam( $event, $param, $message, $user ) {
|
|
$extra = $event->getExtra();
|
|
|
|
switch ( $param ) {
|
|
// List of user rights that are granted or revoked
|
|
case 'user-rights-list':
|
|
global $wgLang;
|
|
|
|
$list = array();
|
|
|
|
foreach ( array( 'add', 'remove' ) as $action ) {
|
|
if ( isset( $extra[$action] ) && $extra[$action] ) {
|
|
// Messages that can be used here:
|
|
// * notification-user-rights-add
|
|
// * notification-user-rights-remove
|
|
$list[] = wfMessage( 'notification-user-rights-' . $action )
|
|
->params( $wgLang->commaList( $extra[$action] ), count( $extra[$action] ) )
|
|
->escaped();
|
|
}
|
|
}
|
|
$message->params( $wgLang->semicolonList( $list ) );
|
|
break;
|
|
|
|
default:
|
|
parent::processParam( $event, $param, $message, $user );
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|