Presentation model for email-user

Bug: T116843
Change-Id: I99e790d72c7c534665d1d86c38459c5d0e60b91b
This commit is contained in:
Stephane Bisson 2015-11-17 12:44:45 -05:00
parent 8145cd1425
commit 44149b6cbd
5 changed files with 16 additions and 4 deletions

View file

@ -411,6 +411,7 @@ $wgEchoNotifications = array(
'icon' => 'site',
),
'emailuser' => array(
'presentation-model' => 'EchoEmailUserPresentationModel',
'user-locators' => array(
array( 'EchoUserLocator::locateFromEventExtra', array( 'to-user-id' ) ),
),
@ -419,8 +420,6 @@ $wgEchoNotifications = array(
'section' => 'alert',
'title-message' => 'notification-emailuser',
'title-params' => array( 'agent' ),
'flyout-message' => 'notification-emailuser-flyout',
'flyout-params' => array( 'agent' ),
'icon' => 'site',
),
);

View file

@ -44,6 +44,7 @@ $wgAutoloadClasses += array(
'EchoEmailFormatterTest' => __DIR__ . '/tests/phpunit/EmailFormatterTest.php',
'EchoEmailMode' => __DIR__ . '/includes/EmailFormatter.php',
'EchoEmailSingle' => __DIR__ . '/includes/EmailFormatter.php',
'EchoEmailUserPresentationModel' => __DIR__ . '/includes/formatters/EmailUserPresentationModel.php',
'EchoEvent' => __DIR__ . '/includes/model/Event.php',
'EchoEventFormatter' => __DIR__ . '/includes/formatters/EchoEventFormatter.php',
'EchoEventMapper' => __DIR__ . '/includes/mapper/EventMapper.php',

View file

@ -82,7 +82,7 @@
"notification-reverted2": "Your {{PLURAL:$4|edit on [[:$2]] has|edits on [[:$2]] have}} been {{GENDER:$1|reverted}} by [[$5|$1]]. $3",
"notification-reverted-flyout2": "Your {{PLURAL:$4|edit on $2 has|edits on $2 have}} been {{GENDER:$1|reverted}} by $1. $3",
"notification-emailuser": "[[User:$1|$1]] {{GENDER:$1|sent}} you an email.",
"notification-emailuser-flyout": "$1 {{GENDER:$1|sent}} you an email",
"notification-header-emailuser": "$1 {{GENDER:$2|sent}} you an email",
"notification-edit-talk-page-email-subject2": "$1 {{GENDER:$1|left}} you a message on {{SITENAME}}",
"notification-edit-talk-page-email-batch-body2": "$1 {{GENDER:$1|left}} a message on your talk page.",
"notification-edit-talk-page-email-batch-body-with-section": "$1 {{GENDER:$1|left}} a message on your talk page in \"$2\".",

View file

@ -103,7 +103,7 @@
"notification-reverted2": "Format for displaying notifications of a user's edit being reverted. Parameters:\n* $1 - the username of the person who reverted, plain text. Can be used for GENDER.\n* $2 - the page that was reverted, formatted\n* $3 - a diff link which is labeled {{msg-mw|Showdiff}}\n* $4 - the number of edits that were reverted. NOTE: This will only be set to 1 or 2, with 2 actually meaning 'an unknown number greater than 0'.\n* $5 - Page for reverting user.\nUser page if logged in, or user's contributions page if logged out.\n{{Related|Notification-reverted}}",
"notification-reverted-flyout2": "Flyout-specific format for displaying notifications of a user's edit being reverted.\n\nParameters:\n* $1 - the username of the person who reverted, plain text. Can be used for GENDER.\n* $2 - the page that was reverted, formatted\n* $3 - a diff link which is labeled {{msg-mw|Showdiff}}\n* $4 - the number of edits that were reverted. NOTE: This will only be set to 1 or 2, with 2 actually meaning \"an unknown number greater than 0\".\n{{Related|Notification-reverted}}",
"notification-emailuser": "Format for displaying notifications of a user has sent an email to another user. Parameters:\n* $1 - the username of the person the email, plain text. Can be used for GENDER.",
"notification-emailuser-flyout": "Flyout-specific format for displaying notifications of user has sent an email to another user.\n\nParameters:\n* $1 - the username of the person who sent the email, plain text. Can be used for GENDER.",
"notification-header-emailuser": "Flyout-specific format for displaying notifications of user has sent an email to another user.\n\nParameters:\n* $1 - the formatted username of the person who sent the email.\n* $2 - the username for GENDER.",
"notification-edit-talk-page-email-subject2": "Email subject. Parameters:\n* $1 - a username which can be used for gender support",
"notification-edit-talk-page-email-batch-body2": "First line of the email notification for a talk page edit. The following line completes it with the description of the message in question, that is its edit summary.\n\nParameters:\n* $1 - a username (which also links to the userpage of the user in question, in the HTML version)\nSee also:\n* {{msg-mw|Notification-edit-talk-page2}}\n* {{msg-mw|Notification-edit-talk-page-email-subject2}}\n* {{msg-mw|Notification-edit-talk-page-flyout2}}",
"notification-edit-talk-page-email-batch-body-with-section": "Email notification for talk page edit with new section or new comment. Parameters:\n* $1 - a username\n* $2 - the raw section title text",

View file

@ -0,0 +1,12 @@
<?php
class EchoEmailUserPresentationModel extends EchoEventPresentationModel {
public function getIconType() {
return 'site';
}
public function getPrimaryLink() {
return false;
}
}