r87832 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87831‎ | r87832 | r87833 >
Date:17:56, 10 May 2011
Author:ashley
Status:deferred
Tags:
Comment:
SocialProfile: fix fixme from April -- I think this is more correct than the previous code (but let's see what breaks)
Modified paths:
  • /trunk/extensions/SocialProfile/UserGifts/SpecialGiveGift.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserGifts/SpecialGiveGift.php
@@ -219,19 +219,13 @@
220220 * @return String: HTML
221221 */
222222 function displayFormNoUser() {
223 - global $wgUser, $wgOut, $wgRequest, $wgFriendingEnabled;
 223+ global $wgUser, $wgOut, $wgFriendingEnabled;
224224
225 - $output = $wgOut->setPageTitle( wfMsg( 'g-give-no-user-title' ) );
 225+ $wgOut->setPageTitle( wfMsg( 'g-give-no-user-title' ) );
226226
227 - // @todo FIXME: $wgRequest->getVal()...seriously?
228 - // Seems that this should use the proper MW function (maybe
229 - // $this->getTitle()->getFullURL() or something) instead.
230 - // Maybe that's the reason why I (and other people) frequently have
231 - // problems with this special page.
232 - // --Jack Phoenix <jack@countervandalism.net>, 6 April 2011
233 - $output .= '<form action="" method="get" enctype="multipart/form-data" name="gift">
234 - <input type="hidden" name="title" value="' . $wgRequest->getVal( 'title' ) . '" />
235 - <div class="g-message">' .
 227+ $output = '<form action="" method="get" enctype="multipart/form-data" name="gift">' .
 228+ Xml::hidden( 'title', $this->getTitle() ) .
 229+ '<div class="g-message">' .
236230 wfMsg( 'g-give-no-user-message' ) .
237231 '</div>
238232 <div class="g-give-container">';
@@ -248,13 +242,13 @@
249243 '</div>
250244 <div class="g-gift-select">
251245 <select onchange="javascript:chooseFriend(this.value)">
252 - <option value="#" selected="selected">' .
253 - wfMsg( 'g-select-a-friend' ) .
254 - '</option>';
 246+ <option value="#" selected="selected">' .
 247+ wfMsg( 'g-select-a-friend' ) .
 248+ '</option>';
255249 foreach ( $friends as $friend ) {
256250 $output .= '<option value="' . urlencode( $friend['user_name'] ) . '">' .
257251 $friend['user_name'] .
258 - '</option>';
 252+ '</option>' . "\n";
259253 }
260254 $output .= '</select>
261255 </div>
@@ -340,7 +334,8 @@
341335 if ( $numofpages > 1 ) {
342336 $output .= '<div class="page-nav">';
343337 if ( $page > 1 ) {
344 - $output .= '<a href="' . $giveGiftLink->escapeFullURL( 'user=' . $user_safe . '&page=' . ( $page - 1 ) ) . '">' . wfMsg( 'g-previous' ) . '</a> ';
 338+ $output .= '<a href="' . $giveGiftLink->escapeFullURL( 'user=' . $user_safe . '&page=' . ( $page - 1 ) ) . '">' .
 339+ wfMsg( 'g-previous' ) . '</a> ';
345340 }
346341
347342 if ( ( $total % $per_page ) != 0 ) {
@@ -358,7 +353,8 @@
359354 }
360355
361356 if ( ( $total - ( $per_page * $page ) ) > 0 ) {
362 - $output .= ' <a href="' . $giveGiftLink->escapeFullURL( 'user=' . $user_safe . '&page=' . ( $page + 1 ) ) . '">' . wfMsg( 'g-next' ) . '</a>';
 357+ $output .= ' <a href="' . $giveGiftLink->escapeFullURL( 'user=' . $user_safe . '&page=' . ( $page + 1 ) ) . '">' .
 358+ wfMsg( 'g-next' ) . '</a>';
363359 }
364360 $output .= '</div>';
365361 }

Status & tagging log