diff --git a/Echo.php b/Echo.php index 00eef019e..879691e62 100644 --- a/Echo.php +++ b/Echo.php @@ -296,6 +296,7 @@ $wgEchoNotifications = array( 'category' => 'system', 'group' => 'positive', 'section' => 'alert', + 'presentation-model' => 'EchoWelcomePresentationModel', 'title-message' => 'notification-new-user', 'title-params' => array( 'agent' ), 'icon' => 'site', diff --git a/autoload.php b/autoload.php index 9b6775c41..681690a8b 100644 --- a/autoload.php +++ b/autoload.php @@ -92,6 +92,7 @@ $wgAutoloadClasses += array( 'EchoUserNotificationGatewayTest' => __DIR__ . '/tests/phpunit/gateway/UserNotificationGatewayTest.php', 'EchoUserRightsFormatter' => __DIR__ . '/includes/formatters/UserRightsFormatter.php', 'EchoUserRightsPresentationModel' => __DIR__ . '/includes/formatters/UserRightsPresentationModel.php', + 'EchoWelcomePresentationModel' => __DIR__ . '/includes/formatters/WelcomePresentationModel.php', 'FilteredSequentialIteratorTest' => __DIR__ . '/tests/phpunit/iterator/FilteredSequentialIteratorTest.php', 'MWEchoDbFactory' => __DIR__ . '/includes/EchoDbFactory.php', 'MWEchoDbFactoryTest' => __DIR__ . '/tests/phpunit/EchoDbFactoryTest.php', diff --git a/i18n/en.json b/i18n/en.json index ff0230fed..119a43875 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -78,6 +78,7 @@ "notification-user-rights-add": "You are now a member of {{PLURAL:$2|this group|these groups}}: $1", "notification-user-rights-remove": "You are no longer a member of {{PLURAL:$2|this group|these groups}}: $1", "notification-new-user": "Welcome to {{SITENAME}}, $1! We're glad you're here.", + "notification-header-welcome": "{{GENDER:$2|Welcome}} to {{SITENAME}}, $1! We're glad {{GENDER:$2|you're}} here.", "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.", diff --git a/i18n/qqq.json b/i18n/qqq.json index a2c023fb8..504360396 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -99,6 +99,7 @@ "notification-user-rights-add": "Message indicating that a user was added to a user group. Parameters:\n* $1 - a comma separated list of user group names\n* $2 - the number of user groups, this is used for PLURAL support\nSee also:\n* {{msg-mw|Notification-user-rights-remove}}", "notification-user-rights-remove": "Message indicating that a user was removed from a user group. Parameters:\n* $1 - a comma separated list of user group names\n* $2 - the number of user groups, this is used for PLURAL support\nSee also:\n* {{msg-mw|Notification-user-rights-add}}", "notification-new-user": "Text of the welcome notification. Parameters:\n* $1 - the name of the new user\nSee also:\n* {{msg-mw|Guidedtour-tour-gettingstarted-start-title}}", + "notification-header-welcome": "Text of the welcome notification. Parameters:\n* $1 - the name of the new user.Parameters:\n* $1 - the formatted username of the new user\n* $2 - the username for gender purposes\nSee also:\n* {{msg-mw|Guidedtour-tour-gettingstarted-start-title}}", "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.", diff --git a/includes/formatters/WelcomePresentationModel.php b/includes/formatters/WelcomePresentationModel.php new file mode 100644 index 000000000..7819eb05d --- /dev/null +++ b/includes/formatters/WelcomePresentationModel.php @@ -0,0 +1,12 @@ +