Index: trunk/phase3/includes/Linker.php |
— | — | @@ -754,10 +754,10 @@ |
755 | 755 | /** |
756 | 756 | * @param $userId Integer: user id in database. |
757 | 757 | * @param $userText String: user name in database. |
| 758 | + * @param $redContribsWhenNoEdits Bool: return a red contribs link when the user had no edits and this is true. |
758 | 759 | * @return string HTML fragment with talk and/or block links |
759 | | - * @private |
760 | 760 | */ |
761 | | - function userToolLinks( $userId, $userText ) { |
| 761 | + public function userToolLinks( $userId, $userText, $redContribsWhenNoEdits = false ) { |
762 | 762 | global $wgUser, $wgDisableAnonTalk, $wgSysopUserBans; |
763 | 763 | $talkable = !( $wgDisableAnonTalk && 0 == $userId ); |
764 | 764 | $blockable = ( $wgSysopUserBans || 0 == $userId ); |
— | — | @@ -767,9 +767,15 @@ |
768 | 768 | $items[] = $this->userTalkLink( $userId, $userText ); |
769 | 769 | } |
770 | 770 | if( $userId ) { |
| 771 | + // check if the user has an edit |
| 772 | + if( $redContribsWhenNoEdits && User::edits( $userId ) == 0 ) { |
| 773 | + $style = "class='new'"; |
| 774 | + } else { |
| 775 | + $style = ''; |
| 776 | + } |
771 | 777 | $contribsPage = SpecialPage::getTitleFor( 'Contributions', $userText ); |
772 | | - $items[] = $this->makeKnownLinkObj( $contribsPage , |
773 | | - wfMsgHtml( 'contribslink' ) ); |
| 778 | + |
| 779 | + $items[] = $this->makeKnownLinkObj( $contribsPage, wfMsgHtml( 'contribslink' ), '', '', '', '', $style ); |
774 | 780 | } |
775 | 781 | if( $blockable && $wgUser->isAllowed( 'block' ) ) { |
776 | 782 | $items[] = $this->blockLink( $userId, $userText ); |
— | — | @@ -783,6 +789,14 @@ |
784 | 790 | } |
785 | 791 | |
786 | 792 | /** |
| 793 | + * Alias for userToolLinks( $userId, $userText, true ); |
| 794 | + */ |
| 795 | + public function userToolLinksRedContribs( $userId, $userText ) { |
| 796 | + return $this->userToolLinks( $userId, $userText, true ); |
| 797 | + } |
| 798 | + |
| 799 | + |
| 800 | + /** |
787 | 801 | * @param $userId Integer: user id in database. |
788 | 802 | * @param $userText String: user name in database. |
789 | 803 | * @return string HTML fragment with user talk link |
Index: trunk/phase3/includes/SpecialLog.php |
— | — | @@ -311,7 +311,7 @@ |
312 | 312 | $linkCache->addBadLinkObj( $title ); |
313 | 313 | } |
314 | 314 | |
315 | | - $userLink = $this->skin->userLink( $s->log_user, $s->user_name ) . $this->skin->userToolLinks( $s->log_user, $s->user_name ); |
| 315 | + $userLink = $this->skin->userLink( $s->log_user, $s->user_name ) . $this->skin->userToolLinksRedContribs( $s->log_user, $s->user_name ); |
316 | 316 | $comment = $this->skin->commentBlock( $s->log_comment ); |
317 | 317 | $paramArray = LogPage::extractParams( $s->log_params ); |
318 | 318 | $revert = ''; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -141,6 +141,9 @@ |
142 | 142 | * (bug 3717) Update user count for AuthPlugin account autocreation |
143 | 143 | * (bug 8719) Firefox release notes lie! Fix tooltips for Firefox 2 on x11; |
144 | 144 | accesskeys default settings appear to be same as Windows. |
| 145 | +* Added an option to make Linker::userToolLinks() show the contribs link |
| 146 | + red when the user has no edits. Linker::userToolLinksRedContribs() is an |
| 147 | + alias to that which should be used to make it more self documentating. |
145 | 148 | |
146 | 149 | |
147 | 150 | == Languages updated == |