r96864 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96863‎ | r96864 | r96865 >
Date:16:49, 12 September 2011
Author:reedy
Status:ok
Tags:
Comment:
Revert Linker.php in r96858, r96856

Revert CodeReview from r96860
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/CodeReview/ui/CodeRevisionAuthorView.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/Linker.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/CodeReview/ui/CodeRevisionAuthorView.php
@@ -19,12 +19,7 @@
2020
2121 return wfMsgHtml( 'code-author-haslink',
2222 $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() ) );
2924 }
3025
3126 function execute() {
Index: branches/wmf/1.17wmf1/includes/Linker.php
@@ -14,7 +14,6 @@
1515 * Flags for userToolLinks()
1616 */
1717 const TOOL_LINKS_NOBLOCK = 1;
18 - const TOOL_LINKS_EMAIL = 2;
1918
2019 function __construct() {}
2120
@@ -835,14 +834,15 @@
836835 * @param $userId Integer: user id in database.
837836 * @param $userText String: user name in database
838837 * @return String: HTML fragment
 838+ * @private
839839 */
840 - public static function userLink( $userId, $userText ) {
 840+ function userLink( $userId, $userText ) {
841841 if ( $userId == 0 ) {
842842 $page = SpecialPage::getTitleFor( 'Contributions', $userText );
843843 } else {
844844 $page = Title::makeTitle( NS_USER, $userText );
845845 }
846 - return self::link( $page, htmlspecialchars( $userText ), array( 'class' => 'mw-userlink' ) );
 846+ return $this->link( $page, htmlspecialchars( $userText ), array( 'class' => 'mw-userlink' ) );
847847 }
848848
849849 /**
@@ -852,15 +852,14 @@
853853 * @param $userText String: user name or IP address
854854 * @param $redContribsWhenNoEdits Boolean: should the contributions link be
855855 * 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)
857857 * @param $edits Integer: user edit count (optional, for performance)
858858 * @return String: HTML fragment
859859 */
860860 public function userToolLinks( $userId, $userText, $redContribsWhenNoEdits = false, $flags = 0, $edits = null ) {
861861 global $wgUser, $wgDisableAnonTalk, $wgSysopUserBans, $wgLang;
862862 $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;
865864
866865 $items = array();
867866 if ( $talkable ) {
@@ -883,10 +882,6 @@
884883 $items[] = $this->blockLink( $userId, $userText );
885884 }
886885
887 - if ( $addEmailLink && $wgUser->canSendEmail() ) {
888 - $items[] = self::emailLink( $userId, $userText );
889 - }
890 -
891886 if ( $items ) {
892887 return ' <span class="mw-usertoollinks">(' . $wgLang->pipeList( $items ) . ')</span>';
893888 } else {
@@ -909,8 +904,9 @@
910905 * @param $userId Integer: user id in database.
911906 * @param $userText String: user name in database.
912907 * @return String: HTML fragment with user talk link
 908+ * @private
913909 */
914 - public static function userTalkLink( $userId, $userText ) {
 910+ function userTalkLink( $userId, $userText ) {
915911 $userTalkPage = Title::makeTitle( NS_USER_TALK, $userText );
916912 $userTalkLink = $this->link( $userTalkPage, wfMsgHtml( 'talkpagelinktext' ) );
917913 return $userTalkLink;
@@ -920,26 +916,15 @@
921917 * @param $userId Integer: userid
922918 * @param $userText String: user name in database.
923919 * @return String: HTML fragment with block link
 920+ * @private
924921 */
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' ) );
929925 return $blockLink;
930926 }
931927
932928 /**
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 - /**
944929 * Generate a user link if the current user is allowed to view it
945930 * @param $rev Revision object.
946931 * @param $isPublic Boolean: show only if all users can see it

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r968561.17wmf1: MFT r94212, r96373, r96386, r96389, r96420, r96645...reedy15:35, 12 September 2011
r968581.17wmf1: MFT r96430, r96449, r96773reedy16:25, 12 September 2011
r968601.17wmf1: MFT r96420, r96627reedy16:30, 12 September 2011

Status & tagging log