r64199 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64198‎ | r64199 | r64200 >
Date:22:41, 25 March 2010
Author:ashley
Status:deferred
Tags:
Comment:
SocialProfile: cleanup to UserWelcome and a fix for help page link (help pages are usually available only in the wiki's content language)
Modified paths:
  • /trunk/extensions/SocialProfile/UserWelcome/UserWelcome.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserWelcome/UserWelcome.php
@@ -5,9 +5,9 @@
66 *
77 * @file
88 * @ingroup Extensions
 9+ * @version 1.3
910 * @author David Pean <david.pean@gmail.com>
1011 * @author Jack Phoenix <jack@countervandalism.net>
11 - * @version 1.2
1212 * @link http://www.mediawiki.org/wiki/Extension:UserWelcome Documentation
1313 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1414 */
@@ -20,7 +20,7 @@
2121 $wgExtensionCredits['parserhook'][] = array(
2222 'path' => __FILE__,
2323 'name' => 'UserWelcome',
24 - 'version' => '1.2',
 24+ 'version' => '1.3',
2525 'author' => array( 'David Pean', 'Jack Phoenix' ),
2626 'descriptionmsg' => 'userwelcome-desc',
2727 'url' => 'http://www.mediawiki.org/wiki/Extension:UserWelcome',
@@ -60,9 +60,8 @@
6161 $user_level = new UserLevel( $stats_data['points'] );
6262
6363 // Safe links
64 - $level_link = Title::makeTitle( NS_HELP, wfMsgHtml( 'mp-userlevels-link' ) );
 64+ $level_link = Title::makeTitle( NS_HELP, wfMsgForContent( 'mp-userlevels-link' ) );
6565 $avatar_link = SpecialPage::getTitleFor( 'UploadAvatar' );
66 - $invite_link = Title::makeTitle( NS_SPECIAL, 'InviteContacts' );
6766
6867 // Make an avatar
6968 $avatar = new wAvatar( $wgUser->getID(), 'l' );
@@ -88,10 +87,15 @@
8988 </div>
9089 <div class="cleared"></div>
9190 <div class="needed-points">
92 - <br />
93 - ' . wfMsgExt( 'mp-welcome-needed-points', 'parsemag', $level_link->escapeFullURL(),
94 - $user_level->getNextLevelName(), $user_level->getPointsNeededToAdvance() ) . '
95 - </div>
 91+ <br />'
 92+ . wfMsgExt(
 93+ 'mp-welcome-needed-points',
 94+ 'parsemag',
 95+ $level_link->escapeFullURL(),
 96+ $user_level->getNextLevelName(),
 97+ $user_level->getPointsNeededToAdvance()
 98+ ) .
 99+ '</div>
96100 </div>';
97101 }
98102
@@ -106,7 +110,8 @@
107111 wfLoadExtensionMessages( 'UserWelcome' );
108112
109113 // Get requests
110 - $requests = getNewMessagesLink() . getRelationshipRequestLink() . getNewGiftLink() . getNewSystemGiftLink();
 114+ $requests = getNewMessagesLink() . getRelationshipRequestLink() .
 115+ getNewGiftLink() . getNewSystemGiftLink();
111116
112117 $output = '';
113118 if ( $requests ) {
@@ -129,7 +134,6 @@
130135 $foe_request_count = UserRelationship::getOpenRequestCount( $wgUser->getID(), 2 );
131136 $relationship_request_link = SpecialPage::getTitleFor( 'ViewRelationshipRequests' );
132137
133 - $rel_title = SpecialPage::getTitleFor( 'ViewRelationshipRequests' );
134138 $output = '';
135139
136140 if ( $friend_request_count ) {
@@ -160,7 +164,9 @@
161165 if ( $gift_count ) {
162166 $output .= '<p>
163167 <img src="' . $wgScriptPath . '/extensions/SocialProfile/images/icon_package_get.gif" alt="" border="0" />
164 - <a href="' . $gifts_title->escapeFullURL() . '" rel="nofollow">' . wfMsgExt( 'mp-request-new-gift', 'parsemag', $gift_count ) . '</a>
 168+ <a href="' . $gifts_title->escapeFullURL() . '" rel="nofollow">'
 169+ . wfMsgExt( 'mp-request-new-gift', 'parsemag', $gift_count ) .
 170+ '</a>
165171 </p>';
166172 }
167173 return $output;
@@ -176,7 +182,9 @@
177183 if ( $gift_count ) {
178184 $output .= '<p>
179185 <img src="' . $wgScriptPath . '/extensions/SocialProfile/images/awardIcon.png" alt="" border="0" />
180 - <a href="' . $gifts_title->escapeFullURL() . '" rel="nofollow">' . wfMsgExt( 'mp-request-new-award', 'parsemag', $gift_count ) . '</a>
 186+ <a href="' . $gifts_title->escapeFullURL() . '" rel="nofollow">'
 187+ . wfMsgExt( 'mp-request-new-award', 'parsemag', $gift_count ) .
 188+ '</a>
181189 </p>';
182190 }
183191
@@ -191,8 +199,10 @@
192200 if ( $new_messages ) {
193201 $board_link = SpecialPage::getTitleFor( 'UserBoard' );
194202 $output .= '<p>
195 - <img src="' . $wgScriptPath . '/extensions/SocialProfile/images/emailIcon.gif" alt="email icon" border="" />
196 - <a href="' . $board_link->escapeFullURL() . '" rel="nofollow">' . wfMsg( 'mp-request-new-message' ) . '</a>
 203+ <img src="' . $wgScriptPath . '/extensions/SocialProfile/images/emailIcon.gif" alt="" border="" />
 204+ <a href="' . $board_link->escapeFullURL() . '" rel="nofollow">'
 205+ . wfMsg( 'mp-request-new-message' ) .
 206+ '</a>
197207 </p>';
198208 }
199209 return $output;

Status & tagging log