r113390 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113389‎ | r113390 | r113391 >
Date:19:44, 8 March 2012
Author:emsmith
Status:ok (Comments)
Tags:
Comment:
bug 34090 - adding translation for "automatic hider" user
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/api/ApiFlagFeedbackArticleFeedbackv5.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php
@@ -364,6 +364,9 @@
365365 'articlefeedbackv5-activity-item-comment' => '$1 $2 $3 : $4',
366366 'articlefeedbackv5-activity-item' => '$1 $2 $3',
367367
 368+ /* Our fake/default user */
 369+ 'articlefeedbackv5-default-user' => 'Article Feedback V5',
 370+
368371 /* EmailCapture */
369372 'articlefeedbackv5-emailcapture-response-body' => 'Hello!
370373
@@ -683,6 +686,7 @@
684687 * <code>$2</code> – Page name of item with feedback requiring oversight.
685688 * <code>$3</code> – URL directly to feedback location
686689 * <code>$4</code> – The help link.',
 690+ 'articlefeedbackv5-default-user' => 'The name of the default or internal user who is listed as being the one who autohides feedback for logging and display purposes'
687691 );
688692
689693 /** Afrikaans (Afrikaans)
Index: trunk/extensions/ArticleFeedbackv5/api/ApiFlagFeedbackArticleFeedbackv5.php
@@ -48,6 +48,9 @@
4949 // woah, we were not checking for permissions (that could have been script kiddy bad)
5050 global $wgUser;
5151
 52+ // we may not actually use this, but don't want to repeat this a million times
 53+ $default_user = wfMessage( 'articlefeedbackv5-default-user' )->text();
 54+
5255 // we use ONE db connection that talks to master
5356 $dbw = wfGetDB( DB_MASTER );
5457 $dbw->begin();
@@ -98,7 +101,7 @@
99102 // tell front-end autohiding was done
100103 $results['autohidden'] = 1;
101104 // This is data for the "hidden by, oversighted by" red line
102 - $results['hide-user'] = ApiArticleFeedbackv5Utils::getUserLink(null, 'Article Feedback V5');
 105+ $results['hide-user'] = ApiArticleFeedbackv5Utils::getUserLink(null, $default_user);
103106 $results['hide-timestamp'] = wfTimestamp( TS_RFC2822, $timestamp );
104107 }
105108
@@ -202,7 +205,7 @@
203206 // tell front-end autohiding was done
204207 $results['autohidden'] = 1;
205208 // This is data for the "hidden by, oversighted by" red line
206 - $results['hide-user'] = ApiArticleFeedbackv5Utils::getUserLink(null, 'Article Feedback V5');
 209+ $results['hide-user'] = ApiArticleFeedbackv5Utils::getUserLink(null, $default_user);
207210 $results['hide-timestamp'] = wfTimestamp( TS_RFC2822, $timestamp );
208211 }
209212 }
@@ -250,7 +253,7 @@
251254 // tell front-end autohiding was done
252255 $results['autohidden'] = 1;
253256 // This is data for the "hidden by, oversighted by" red line
254 - $results['hide-user'] = ApiArticleFeedbackv5Utils::getUserLink(null, 'Article Feedback V5');
 257+ $results['hide-user'] = ApiArticleFeedbackv5Utils::getUserLink(null, $default_user);
255258 $results['hide-timestamp'] = wfTimestamp( TS_RFC2822, $timestamp );
256259 }
257260
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php
@@ -347,6 +347,7 @@
348348 $can_vote = !$wgUser->isBlocked();
349349 $can_hide = $wgUser->isAllowed( 'aftv5-hide-feedback' );
350350 $can_delete = $wgUser->isAllowed( 'aftv5-delete-feedback' );
 351+ $default_user = wfMessage( 'articlefeedbackv5-default-user' )->text();
351352
352353 $footer_links = Html::openElement( 'div', array(
353354 'class' => 'articleFeedbackv5-vote-wrapper'
@@ -498,12 +499,12 @@
499500 );
500501 if ( $record[0]->af_is_hidden ) {
501502
502 - $attributes['hide-user'] = ApiArticleFeedbackv5Utils::getUserLink($record[0]->af_hide_user_id, 'Article Feedback V5');
 503+ $attributes['hide-user'] = ApiArticleFeedbackv5Utils::getUserLink($record[0]->af_hide_user_id, $default_user);
503504 $attributes['hide-timestamp'] = wfTimestamp( TS_RFC2822, $record[0]->af_hide_timestamp );
504505 }
505506 if ( $record[0]->af_is_deleted ) {
506507
507 - $attributes['oversight-user'] = ApiArticleFeedbackv5Utils::getUserLink($record[0]->af_oversight_user_id, 'Article Feedback V5');
 508+ $attributes['oversight-user'] = ApiArticleFeedbackv5Utils::getUserLink($record[0]->af_oversight_user_id, $default_user);
508509 $attributes['oversight-timestamp'] = wfTimestamp( TS_RFC2822, $record[0]->af_oversight_timestamp );
509510 }
510511
Index: trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php
@@ -241,7 +241,8 @@
242242
243243 // if this is an automatic action, we create our special extension doer and send
244244 if ($auto) {
245 - $doer = User::newFromName( 'Article Feedback V5' );
 245+ $default_user = wfMessage( 'articlefeedbackv5-default-user' )->text();
 246+ $doer = User::newFromName( $default_user );
246247 // I cannot see how this could fail, but if it does do not log
247248 if (!$doer) {
248249 return;

Follow-up revisions

RevisionCommit summaryAuthorDate
r113391r113390: Update keys. 1 to ignoreraymond19:56, 8 March 2012
r113392bug 34090 - followup to r113287 - adjusted localization documentationemsmith20:03, 8 March 2012
r113393bug 34090 - followup to r113370 - adjusted localization documentationemsmith20:05, 8 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111211bug 34090 - Added a log namespace and log types for the Article Feedback v5 e...emsmith22:53, 10 February 2012
r111472bug 34090 - Added an additional column in the main feedback table to keep a c...emsmith19:14, 14 February 2012
r111474bug 34090 - remove a todo - take the note from the flag submission and save i...emsmith19:57, 14 February 2012
r111552bug 34090 - split activity notes into their own config for maximum length (th...emsmith16:07, 15 February 2012
r111557bug 34090 - changed structure of the link classes and ids per the following f...emsmith16:47, 15 February 2012
r111570bug 34090 - request oversight is now a counter - so you can request/unrequest...emsmith19:53, 15 February 2012
r111573bug 34090 - removed the "header" portion of the html generation from the acti...emsmith20:18, 15 February 2012
r111645bug 34090 - updated the filter count update script to get requested oversight...emsmith15:45, 16 February 2012
r112038bug 34090 - added additional counts for filters including unhidden, undeleted...emsmith20:28, 21 February 2012
r112039bug 34090 - fixed issue noted : if $feedback is false return nothing - not th...emsmith20:50, 21 February 2012
r112041bug 34090 - kill the -1 issue by never letting it get below 0emsmith21:08, 21 February 2012
r112115bug 34090 - no code changes, just fixing/adding keyword svn propertiesemsmith16:31, 22 February 2012
r112119bug 34090 - cast the naughty column so it can be signed, the greatest still k...emsmith16:57, 22 February 2012
r112142bug 34090 - toggle for atomic un/helpful changing (and elimination of an extr...emsmith20:37, 22 February 2012
r112147bug 34090 - note to self, watch the copy and paste errors...emsmith21:01, 22 February 2012
r112149bug 34090 - no upper limit, only lower limit - we can't get any worse then 0emsmith21:21, 22 February 2012
r112154bug 34090 - quick and dirty helper script to get missing documentation keysemsmith21:57, 22 February 2012
r112156bug 34090 - only send the activity header if continue < 1, make the more div ...emsmith22:14, 22 February 2012
r112161bug 34090 - fix limit and use old continue to determine if we do the headeremsmith23:15, 22 February 2012
r112218bug 34090 - make sure the name are right for hidden/unhidden logging (argh)emsmith16:44, 23 February 2012
r112225bug 34090 - unhidden and unoversight logic adjustmentsemsmith18:06, 23 February 2012
r112228bug 34090 - fix filter - needsoversight are always autohiddenemsmith19:16, 23 February 2012
r112230bug 34090 - let's try this again - needsoversight and declined will have hidd...emsmith19:38, 23 February 2012
r112232bug 34090 - hide and show shouldn't fiddle with oversight counts or declined ...emsmith19:48, 23 February 2012
r112599bug 34090 - follow up to r111211 - rename things to make them "less confusin...emsmith14:43, 28 February 2012
r112603bug 34090 - Add the logging of automated hide/show errors by the "Article Fee...emsmith15:21, 28 February 2012
r112604bug 34090 - can't believe there were no permissions checks in this - only del...emsmith15:38, 28 February 2012
r112610bug 34090 - change all sql updates to use escaping except for explicitly comm...emsmith16:22, 28 February 2012
r112611bug 34090 - take out implicit show and add returning user that hid/oversighte...emsmith17:02, 28 February 2012
r112627bug 34090 - follow up to r112599 - change to use getText since it's going int...emsmith18:53, 28 February 2012
r112825bug 34090 - insert custom attributes (sigh) for the user and formatted timest...emsmith18:14, 1 March 2012
r112830bug 34090 - follow up to r111474 - use truncate for choppingemsmith19:42, 1 March 2012
r113052bug 34090 - remaining backend feature in requirements, oversight email genera...emsmith18:04, 5 March 2012
r113062bug 34090 - follow up to r110520 1. change index 2. default of null for conti...emsmith18:54, 5 March 2012
r113073bug 34090 - follow up to r111472 part 1 - change to use getDbKey, check for b...emsmith19:48, 5 March 2012
r113082bug 34090 - follow up to r111471 - changed to use text()emsmith20:42, 5 March 2012
r113083bug 34090 - follow up to rr111472 part 2 - only use log_id for orderingemsmith20:48, 5 March 2012
r113104bug 34090 - follow up to rr111472 part 3 - totally redo the continue function...emsmith23:10, 5 March 2012
r113159bug 34090 - follow up to rr111472 part 4 and follow up to r111596 (same issue...emsmith17:37, 6 March 2012
r113160bug 34090 - follow up to rr111472 part 5 plural and number format action countemsmith17:48, 6 March 2012
r113161bug 34090 - follow up to rr111472 part 6 last of lego messagesemsmith17:53, 6 March 2012
r113163bug 34090 - two additional configuration settings (help url and admin user ur...emsmith18:02, 6 March 2012
r113193bug 34090 - followup to r113104 - only sort by timestamp (sorting by log id w...emsmith22:56, 6 March 2012
r113228bug 34090 - followup to r113160emsmith14:05, 7 March 2012
r113247bug 34090 - db issue, remove one of the sorts from the query, use the ids arr...emsmith16:52, 7 March 2012
r113269bug 34090 - followup to r113247emsmith19:01, 7 March 2012
r113273bug 34090 - add javascript level hiding on request oversight IF autohidden is...emsmith19:22, 7 March 2012
r113287bug 34090 - usernames and formatted timestamps into red lines for hidden/over...emsmith20:22, 7 March 2012
r113311bug 34090 - fixing the username bugs - apparently using the data- stuff with ...emsmith22:34, 7 March 2012
r113317bug 34090 - js and css voodoo to make the element with the red lines appear a...emsmith23:01, 7 March 2012
r113370bug 34090 - make different titles for masking appear if it's been hidden or o...emsmith16:43, 8 March 2012
r113371bug 34090 - fixes for oversighter view for hide/oversight panelsemsmith17:51, 8 March 2012
r113383bug 34090 - not entirely necessary, but keeps $2 from showing up in hiders pa...emsmith19:25, 8 March 2012
r113384bug 34090 - fix for double red line issues when hiding an oversighted post ha...emsmith19:28, 8 March 2012

Comments

#Comment by Raymond (talk | contribs)   19:59, 8 March 2012
'articlefeedbackv5-default-user' => 'Article Feedback V5',

I do not know this extension very well so maybe I misread something. If 'Article Feedback V5' is a username please consider addind to $wgReservedUsernames, see Manual:$wgReservedUsernames.

#Comment by Santhosh.thottingal (talk | contribs)   06:22, 9 March 2012

Please use stylize.php to stylize your PHP code before committing. I just did it in r113456.

Status & tagging log