Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -2128,6 +2128,7 @@ |
2129 | 2129 | 'unblocklink', |
2130 | 2130 | 'change-blocklink', |
2131 | 2131 | 'contribslink', |
| 2132 | + 'emaillink', |
2132 | 2133 | 'autoblocker', |
2133 | 2134 | 'blocklogpage', |
2134 | 2135 | 'blocklog-showlog', |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -12,6 +12,7 @@ |
13 | 13 | * Flags for userToolLinks() |
14 | 14 | */ |
15 | 15 | const TOOL_LINKS_NOBLOCK = 1; |
| 16 | + const TOOL_LINKS_EMAIL = 2; |
16 | 17 | |
17 | 18 | /** |
18 | 19 | * Get the appropriate HTML attributes to add to the "a" element of an ex- |
— | — | @@ -932,7 +933,7 @@ |
933 | 934 | * @param $userText String: user name or IP address |
934 | 935 | * @param $redContribsWhenNoEdits Boolean: should the contributions link be |
935 | 936 | * red if the user has no edits? |
936 | | - * @param $flags Integer: customisation flags (e.g. Linker::TOOL_LINKS_NOBLOCK) |
| 937 | + * @param $flags Integer: customisation flags (e.g. Linker::TOOL_LINKS_NOBLOCK and Linker::TOOL_LINKS_EMAIL) |
937 | 938 | * @param $edits Integer: user edit count (optional, for performance) |
938 | 939 | * @return String: HTML fragment |
939 | 940 | */ |
— | — | @@ -942,6 +943,7 @@ |
943 | 944 | global $wgUser, $wgDisableAnonTalk, $wgLang; |
944 | 945 | $talkable = !( $wgDisableAnonTalk && 0 == $userId ); |
945 | 946 | $blockable = !$flags & self::TOOL_LINKS_NOBLOCK; |
| 947 | + $addEmailLink = $flags & self::TOOL_LINKS_EMAIL; |
946 | 948 | |
947 | 949 | $items = array(); |
948 | 950 | if ( $talkable ) { |
— | — | @@ -964,6 +966,10 @@ |
965 | 967 | $items[] = self::blockLink( $userId, $userText ); |
966 | 968 | } |
967 | 969 | |
| 970 | + if ( $addEmailLink && $wgUser->canSendEmail() ) { |
| 971 | + $items[] = self::emailLink( $userId, $userText ); |
| 972 | + } |
| 973 | + |
968 | 974 | if ( $items ) { |
969 | 975 | return ' <span class="mw-usertoollinks">(' . $wgLang->pipeList( $items ) . ')</span>'; |
970 | 976 | } else { |
— | — | @@ -1007,6 +1013,18 @@ |
1008 | 1014 | } |
1009 | 1015 | |
1010 | 1016 | /** |
| 1017 | + * @param $userId Integer: userid |
| 1018 | + * @param $userText String: user name in database. |
| 1019 | + * @return String: HTML fragment with e-mail user link |
| 1020 | + * @private |
| 1021 | + */ |
| 1022 | + static function emailLink( $userId, $userText ) { |
| 1023 | + $emailPage = SpecialPage::getTitleFor( 'EmailUser', $userText ); |
| 1024 | + $emailLink = self::link( $emailPage, wfMsgHtml( 'emaillink' ) ); |
| 1025 | + return $emailLink; |
| 1026 | + } |
| 1027 | + |
| 1028 | + /** |
1011 | 1029 | * Generate a user link if the current user is allowed to view it |
1012 | 1030 | * @param $rev Revision object. |
1013 | 1031 | * @param $isPublic Boolean: show only if all users can see it |
Index: trunk/phase3/languages/messages/MessagesQqq.php |
— | — | @@ -2794,6 +2794,7 @@ |
2795 | 2795 | 'blocklink' => "Display name for a link that, when selected, leads to a form where a user can be blocked. Used in page history and recent changes pages. Example: \"''UserName (Talk | contribs | '''block''')''\".", |
2796 | 2796 | 'change-blocklink' => 'Used to name the link on Special:Log', |
2797 | 2797 | 'contribslink' => 'Short for "contributions". Used as display name for a link to user contributions on history pages, [[Special:RecentChanges]], [[Special:Watchlist]], etc.', |
| 2798 | +'emaillink' => 'Used as display name for a link to send an e-mail to a user in the user tool links. Example: "(Talk | contribs | block | send e-mail)".', |
2798 | 2799 | 'blocklogpage' => "The page name of [[Special:Log/block]]. Also appears in the drop down menu of [[Special:Log]] pages and in the action links of Special:Contributions/''Username'' pages (e.g. \"For Somebody (talk | block log | logs)\"). |
2799 | 2800 | |
2800 | 2801 | {{Identical|Block log}}", |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -3111,6 +3111,7 @@ |
3112 | 3112 | 'unblocklink' => 'unblock', |
3113 | 3113 | 'change-blocklink' => 'change block', |
3114 | 3114 | 'contribslink' => 'contribs', |
| 3115 | +'emaillink' => 'send e-mail', |
3115 | 3116 | 'autoblocker' => 'Autoblocked because your IP address has been recently used by "[[User:$1|$1]]". |
3116 | 3117 | The reason given for $1\'s block is: "$2"', |
3117 | 3118 | 'blocklogpage' => 'Block log', |
Index: trunk/extensions/CodeReview/ui/CodeRevisionAuthorView.php |
— | — | @@ -19,7 +19,12 @@ |
20 | 20 | |
21 | 21 | return wfMsgHtml( 'code-author-haslink', |
22 | 22 | $this->skin->userLink( $this->mUser->getId(), $this->mUser->getName() ) . |
23 | | - $this->skin->userToolLinks( $this->mUser->getId(), $this->mUser->getName() ) ); |
| 23 | + $this->skin->userToolLinks( |
| 24 | + $this->mUser->getId(), |
| 25 | + $this->mUser->getName(), |
| 26 | + false, /* default for redContribsWhenNoEdits */ |
| 27 | + Linker::TOOL_LINKS_EMAIL /* Add "send e-mail" link */ |
| 28 | + ) ); |
24 | 29 | } |
25 | 30 | |
26 | 31 | function execute() { |