Index: branches/wmf/1.17wmf1/extensions/CodeReview/ui/CodeRevisionAuthorView.php |
— | — | @@ -19,12 +19,7 @@ |
20 | 20 | |
21 | 21 | return wfMsgHtml( 'code-author-haslink', |
22 | 22 | $this->skin->userLink( $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 | | - ) ); |
| 23 | + $this->skin->userToolLinks( $this->mUser->getId(), $this->mUser->getName() ) ); |
29 | 24 | } |
30 | 25 | |
31 | 26 | function execute() { |
Index: branches/wmf/1.17wmf1/includes/Linker.php |
— | — | @@ -14,7 +14,6 @@ |
15 | 15 | * Flags for userToolLinks() |
16 | 16 | */ |
17 | 17 | const TOOL_LINKS_NOBLOCK = 1; |
18 | | - const TOOL_LINKS_EMAIL = 2; |
19 | 18 | |
20 | 19 | function __construct() {} |
21 | 20 | |
— | — | @@ -835,14 +834,15 @@ |
836 | 835 | * @param $userId Integer: user id in database. |
837 | 836 | * @param $userText String: user name in database |
838 | 837 | * @return String: HTML fragment |
| 838 | + * @private |
839 | 839 | */ |
840 | | - public static function userLink( $userId, $userText ) { |
| 840 | + function userLink( $userId, $userText ) { |
841 | 841 | if ( $userId == 0 ) { |
842 | 842 | $page = SpecialPage::getTitleFor( 'Contributions', $userText ); |
843 | 843 | } else { |
844 | 844 | $page = Title::makeTitle( NS_USER, $userText ); |
845 | 845 | } |
846 | | - return self::link( $page, htmlspecialchars( $userText ), array( 'class' => 'mw-userlink' ) ); |
| 846 | + return $this->link( $page, htmlspecialchars( $userText ), array( 'class' => 'mw-userlink' ) ); |
847 | 847 | } |
848 | 848 | |
849 | 849 | /** |
— | — | @@ -852,15 +852,14 @@ |
853 | 853 | * @param $userText String: user name or IP address |
854 | 854 | * @param $redContribsWhenNoEdits Boolean: should the contributions link be |
855 | 855 | * red if the user has no edits? |
856 | | - * @param $flags Integer: customisation flags (e.g. Linker::TOOL_LINKS_NOBLOCK and Linker::TOOL_LINKS_EMAIL) |
| 856 | + * @param $flags Integer: customisation flags (e.g. self::TOOL_LINKS_NOBLOCK) |
857 | 857 | * @param $edits Integer: user edit count (optional, for performance) |
858 | 858 | * @return String: HTML fragment |
859 | 859 | */ |
860 | 860 | public function userToolLinks( $userId, $userText, $redContribsWhenNoEdits = false, $flags = 0, $edits = null ) { |
861 | 861 | global $wgUser, $wgDisableAnonTalk, $wgSysopUserBans, $wgLang; |
862 | 862 | $talkable = !( $wgDisableAnonTalk && 0 == $userId ); |
863 | | - $blockable = !( $flags & self::TOOL_LINKS_NOBLOCK ); |
864 | | - $addEmailLink = $flags & self::TOOL_LINKS_EMAIL && $userId; |
| 863 | + $blockable = ( $wgSysopUserBans || 0 == $userId ) && !$flags & self::TOOL_LINKS_NOBLOCK; |
865 | 864 | |
866 | 865 | $items = array(); |
867 | 866 | if ( $talkable ) { |
— | — | @@ -883,10 +882,6 @@ |
884 | 883 | $items[] = $this->blockLink( $userId, $userText ); |
885 | 884 | } |
886 | 885 | |
887 | | - if ( $addEmailLink && $wgUser->canSendEmail() ) { |
888 | | - $items[] = self::emailLink( $userId, $userText ); |
889 | | - } |
890 | | - |
891 | 886 | if ( $items ) { |
892 | 887 | return ' <span class="mw-usertoollinks">(' . $wgLang->pipeList( $items ) . ')</span>'; |
893 | 888 | } else { |
— | — | @@ -909,8 +904,9 @@ |
910 | 905 | * @param $userId Integer: user id in database. |
911 | 906 | * @param $userText String: user name in database. |
912 | 907 | * @return String: HTML fragment with user talk link |
| 908 | + * @private |
913 | 909 | */ |
914 | | - public static function userTalkLink( $userId, $userText ) { |
| 910 | + function userTalkLink( $userId, $userText ) { |
915 | 911 | $userTalkPage = Title::makeTitle( NS_USER_TALK, $userText ); |
916 | 912 | $userTalkLink = $this->link( $userTalkPage, wfMsgHtml( 'talkpagelinktext' ) ); |
917 | 913 | return $userTalkLink; |
— | — | @@ -920,26 +916,15 @@ |
921 | 917 | * @param $userId Integer: userid |
922 | 918 | * @param $userText String: user name in database. |
923 | 919 | * @return String: HTML fragment with block link |
| 920 | + * @private |
924 | 921 | */ |
925 | | - |
926 | | - public static function blockLink( $userId, $userText ) { |
927 | | - $blockPage = SpecialPage::getTitleFor( 'Block', $userText ); |
928 | | - $blockLink = self::link( $blockPage, wfMsgHtml( 'blocklink' ) ); |
| 922 | + function blockLink( $userId, $userText ) { |
| 923 | + $blockPage = SpecialPage::getTitleFor( 'Blockip', $userText ); |
| 924 | + $blockLink = $this->link( $blockPage, wfMsgHtml( 'blocklink' ) ); |
929 | 925 | return $blockLink; |
930 | 926 | } |
931 | 927 | |
932 | 928 | /** |
933 | | - * @param $userId Integer: userid |
934 | | - * @param $userText String: user name in database. |
935 | | - * @return String: HTML fragment with e-mail user link |
936 | | - */ |
937 | | - public static function emailLink( $userId, $userText ) { |
938 | | - $emailPage = SpecialPage::getTitleFor( 'Emailuser', $userText ); |
939 | | - $emailLink = self::link( $emailPage, wfMsgHtml( 'emaillink' ) ); |
940 | | - return $emailLink; |
941 | | - } |
942 | | - |
943 | | - /** |
944 | 929 | * Generate a user link if the current user is allowed to view it |
945 | 930 | * @param $rev Revision object. |
946 | 931 | * @param $isPublic Boolean: show only if all users can see it |