r46690 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46689‎ | r46690 | r46691 >
Date:22:26, 1 February 2009
Author:siebrand
Status:deferred (Comments)
Tags:
Comment:
* re-revert r46688 to r46264. The fixes are proper, as tested. See screenshot in http://www.mediawiki.org/wiki/File:R46264_tested.png where "x of y" displays properly. Maybe the reverter has a local override (?)
* add several FIXMEs where I observed notices with trunk code.
Modified paths:
  • /trunk/extensions/SocialProfile/UserGifts/GiftsClass.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserGifts/SpecialGiftManager.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserProfile/UserProfile.i18n.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserStats/UserStatsClass.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php
@@ -607,9 +607,9 @@
608608 $output .= '</div>
609609 <div class="action-left">';
610610 if( intval( str_replace( ",", "", $relationship_count ) ) > 4 ) {
611 - $output .= "{$per_row} ".wfMsg('user-count-separator')." {$relationship_count}";
 611+ $output .= wfMsg( 'user-count-separator', $per_row, $relationship_count );
612612 } else {
613 - $output .= "{$relationship_count} ".wfMsg('user-count-separator')." {$relationship_count}";
 613+ $output .= wfMsg( 'user-count-separator', $relationship_count, $relationship_count );
614614 }
615615 $output .= '</div>
616616 </div>
@@ -687,9 +687,9 @@
688688 $output .= '</div>
689689 <div class="action-left">';
690690 if( $gift_count > 4 ) {
691 - $output .= "4 ".wfMsg('user-count-separator')." {$gift_count}";
 691+ $output .= wfMsg( 'user-count-separator', "4", $gift_count );
692692 } else {
693 - $output .= "{$gift_count} ".wfMsg('user-count-separator')." {$gift_count}";
 693+ $output .= wfMsg( 'user-count-separator', $gift_count, $gift_count );
694694 }
695695 $output .= '</div>
696696 <div class="cleared"></div>
@@ -770,9 +770,9 @@
771771 $output .= '</div>
772772 <div class="action-left">';
773773 if( $system_gift_count > 4 ) {
774 - $output .= "4 ".wfMsg('user-count-separator')." {$system_gift_count}";
 774+ $output .= wfMsg( 'user-count-separator', "4", $system_gift_count );
775775 } else {
776 - $output .= "{$system_gift_count}&nbsp;".wfMsg('user-count-separator')."&nbsp;{$system_gift_count}";
 776+ $output .= wfMsg( 'user-count-separator', $system_gift_count, $system_gift_count );
777777 }
778778 $output .= "</div>
779779 <div class=\"cleared\"></div>
@@ -846,9 +846,9 @@
847847 $output .= '</div>
848848 <div class="action-left">';
849849 if( $total > 10 ) {
850 - $output .= "10 ".wfMsg('user-count-separator')." {$total}";
 850+ $output .= wfMsg( 'user-count-separator', "10", $total );
851851 } else if( $total > 0 ) {
852 - $output .= "{$total} ".wfMsg('user-count-separator')." {$total}";
 852+ $output .= wfMsg( 'user-count-separator', $total, $total );
853853 }
854854 $output .= '</div>
855855 <div class="cleared"></div>
@@ -939,9 +939,9 @@
940940 $output .= '</div>
941941 <div class="action-left">';
942942 if( $fanbox_count > 10 ) {
943 - $output .= "10 ".wfMsg('user-count-separator')." {$fanbox_count}";
 943+ $output .= wfMsg('user-count-separator', "10", $fanbox_count );
944944 } else {
945 - $output .= "{$fanbox_count} ".wfMsg('user-count-separator')." {$fanbox_count}";
 945+ $output .= wfMsg( 'user-count-separator',$fanbox_count, $fanbox_count);
946946 }
947947 $output .= '</div>
948948 <div class="cleared"></div>
Index: trunk/extensions/SocialProfile/UserProfile/UserProfile.i18n.php
@@ -16,7 +16,7 @@
1717 'populateuserprofiles' => 'Populate user profiles',
1818 'user-awards-title' => 'Awards',
1919 'user-gifts-title' => 'Gifts',
20 - 'user-count-separator' => 'of',
 20+ 'user-count-separator' => '$1 of $2',
2121 'user-view-all' => 'View all',
2222 'user-upload-image' => 'Upload image',
2323 'user-edit-this' => 'Edit this',
Index: trunk/extensions/SocialProfile/UserProfile/SpecialUpdateProfile.php
@@ -571,6 +571,7 @@
572572
573573 wfLoadExtensionMessages( 'SocialProfileUserProfile' );
574574
 575+ // FIXME: if the checkboxes are in front of the option, this will look more like Special:Preferences
575576 $wgOut->setPageTitle( wfMsg('user-profile-section-preferences') );
576577 $form = UserProfile::getEditProfileNav( wfMsg( 'user-profile-section-preferences' ) );
577578 $form .= '<form action="" method="post" enctype="multipart/form-data" name=profile>';
Index: trunk/extensions/SocialProfile/UserGifts/GiftsClass.php
@@ -26,6 +26,7 @@
2727 static function addGift( $gift_name, $gift_description, $gift_access = 0 ){
2828 global $wgUser;
2929
 30+ // FIXME: undefined variable user_to
3031 $user_id_to = User::idFromName($user_to);
3132 $dbw = wfGetDB( DB_MASTER );
3233
Index: trunk/extensions/SocialProfile/UserGifts/SpecialGiftManager.php
@@ -122,7 +122,8 @@
123123 global $wgScriptPath;
124124 wfLoadExtensionMessages('UserGifts');
125125 $output = ''; // Prevent E_NOTICE
126 - $gifts = Gifts::getManagedGiftList($per_page, $page);
 126+ // FIXME: undefined variables per_page and page
 127+ $gifts = Gifts::getManagedGiftList( $per_page, $page );
127128 if( $gifts ){
128129 foreach( $gifts as $gift ) {
129130 $output .= "<div class=\"Item\">
@@ -151,6 +152,7 @@
152153
153154 $form .= '<form action="" method="POST" enctype="multipart/form-data" name="gift">';
154155 $form .= '<table border="0" cellpadding="5" cellspacing="0" width="500">';
 156+ // FIXME: undefined variable gift (twice)
155157 $form .= '<tr>
156158 <td width="200" class="view-form">'.wfMsg('g-gift-name').'</td>
157159 <td width="695"><input type="text" size="45" class="createbox" name="gift_name" value="'. $gift['gift_name'] . '"/></td>
@@ -169,6 +171,7 @@
170172 if( !in_array('giftadmin', $wgUser->getGroups() ) ){
171173 $form .= '<input type="hidden" name="access" value="1">';
172174 } else {
 175+ // FIXME: undefined variable gift (twice)
173176 $form .= '<tr>
174177 <td class="view-form">'.wfMsg('giftmanager-access').'</td>
175178 <td>
@@ -192,6 +195,7 @@
193196 </tr>';
194197 }
195198
 199+ // FIXME: undefined variable gift (twice)
196200 $form .= '
197201 <tr>
198202 <td colspan="2">
Index: trunk/extensions/SocialProfile/UserStats/UserStatsClass.php
@@ -426,6 +426,7 @@
427427 if( $row ){
428428 // recaculate point total
429429 $new_total_points = 1000;
 430+ // FIXME: Invalid argument supplied for foreach()
430431 foreach( $this->point_values as $point_field => $point_value ){
431432 if( $this->stats_fields[$point_field] ){
432433 $field = $this->stats_fields[$point_field];
@@ -459,6 +460,7 @@
460461 }
461462 $this->clearCache();
462463 }
 464+ // FIXME: Undefined variable: stats_data
463465 return $stats_data;
464466 }
465467 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r95399SocialProfile: check for permission, not for group membership in Special:Gift...ashley14:16, 24 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r46264* add plural support for 'user-profile-points'...siebrand16:07, 26 January 2009
r46688partial revert of r46264: "improve i18n for 'user-count-separator'". this did...ashley21:22, 1 February 2009

Comments

#Comment by Siebrand (talk | contribs)   22:29, 1 February 2009
Screenshot

Partially reverted in r46688. Re-reverted in r46690. Also see screenshot.

Status & tagging log