r96099 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96098‎ | r96099 | r96100 >
Date:15:01, 2 September 2011
Author:ialex
Status:ok
Tags:
Comment:
svn:eol-style native
Modified paths:
  • /trunk/extensions/CentralNotice/CentralNoticePageLogPager.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/html/globalcollect_test_2.html (modified) (history)
  • /trunk/extensions/LuaFoo/includes/ConverterRuntime.lua (modified) (history)
  • /trunk/extensions/SecurePoll/cli/dumpComments.php (modified) (history)
  • /trunk/extensions/SecurePoll/includes/talliers/CommentDumper.php (modified) (history)
  • /trunk/extensions/SignupAPI/includes/SignupAPI.hooks.php (modified) (history)
  • /trunk/extensions/WikiScripts/interpreter/nparser/COPYING (modified) (history)
  • /trunk/extensions/WikimediaIncubator/ListUsersTestWiki.php (modified) (history)

Diff [purge]

Property changes on: trunk/extensions/LuaFoo/includes/ConverterRuntime.lua
___________________________________________________________________
Added: svn:eol-style
11 + native
Property changes on: trunk/extensions/DonationInterface/payflowpro_gateway/forms/html/globalcollect_test_2.html
___________________________________________________________________
Added: svn:eol-style
22 + native
Property changes on: trunk/extensions/WikiScripts/interpreter/nparser/COPYING
___________________________________________________________________
Added: svn:eol-style
33 + native
Property changes on: trunk/extensions/SecurePoll/includes/talliers/CommentDumper.php
___________________________________________________________________
Added: svn:eol-style
44 + native
Property changes on: trunk/extensions/SecurePoll/cli/dumpComments.php
___________________________________________________________________
Added: svn:eol-style
55 + native
Index: trunk/extensions/WikimediaIncubator/ListUsersTestWiki.php
@@ -1,58 +1,58 @@
2 -<?php
3 -
4 -/**
5 - * Ability to filter list of users based on their test wiki preference
6 - */
7 -class ListUsersTestWiki {
8 - /**
9 - * Get the &testwiki=wx/xyz parameter and validate it
10 - * @return Array
11 - */
12 - static function getTestWiki() {
13 - global $wgRequest;
14 - return IncubatorTest::analyzePrefix( $wgRequest->getVal( 'testwiki' ), true );
15 - }
16 -
17 - /**
18 - * Input form
19 - */
20 - static function onSpecialListusersHeaderForm( $pager, &$out ) {
21 - $testwiki = self::getTestWiki();
22 - $out .= Xml::label( wfMsg( 'wminc-testwiki' ), 'testwiki' ) . ' ' .
23 - Xml::input( 'testwiki', 20, ( $testwiki['error'] ? null : $testwiki['prefix'] ), array( 'id' => 'testwiki' ) ) . '<br />';
24 - return true;
25 - }
26 -
27 - /**
28 - * Show a message that you are viewing a list of users of a certain test wiki
29 - */
30 - static function onSpecialListusersHeader( $pager, &$out ) {
31 - $testwiki = self::getTestWiki();
32 - if( !$testwiki['error'] ) {
33 - $out .= wfMsgWikiHtml( 'wminc-listusers-testwiki', $testwiki['prefix'] );
34 - }
35 - return true;
36 - }
37 -
38 - /**
39 - * Query
40 - */
41 - static function onSpecialListusersQueryInfo( $pager, &$query ) {
42 - $testwiki = self::getTestWiki();
43 - if( !$testwiki['error'] ) {
44 - global $wmincPref;
45 - $dbr = wfGetDB( DB_SLAVE );
46 - $projectPrefName = $dbr->addQuotes( "$wmincPref-project" );
47 - $projectPrefVal = $dbr->addQuotes( $testwiki['project'] );
48 - $langPrefName = $dbr->addQuotes( "$wmincPref-code" );
49 - $langPrefVal = $dbr->addQuotes( $testwiki['lang'] );
50 - $query['tables']['p1'] = 'user_properties';
51 - $query['tables']['p2'] = 'user_properties';
52 - $query['join_conds']['p1'] = array( 'JOIN',
53 - "user_id=p1.up_user AND (p1.up_property=$projectPrefName AND p1.up_value=$projectPrefVal)" );
54 - $query['join_conds']['p2'] = array( 'JOIN',
55 - "user_id=p2.up_user AND (p2.up_property=$langPrefName AND p2.up_value=$langPrefVal)" );
56 - }
57 - return true;
58 - }
59 -}
 2+<?php
 3+
 4+/**
 5+ * Ability to filter list of users based on their test wiki preference
 6+ */
 7+class ListUsersTestWiki {
 8+ /**
 9+ * Get the &testwiki=wx/xyz parameter and validate it
 10+ * @return Array
 11+ */
 12+ static function getTestWiki() {
 13+ global $wgRequest;
 14+ return IncubatorTest::analyzePrefix( $wgRequest->getVal( 'testwiki' ), true );
 15+ }
 16+
 17+ /**
 18+ * Input form
 19+ */
 20+ static function onSpecialListusersHeaderForm( $pager, &$out ) {
 21+ $testwiki = self::getTestWiki();
 22+ $out .= Xml::label( wfMsg( 'wminc-testwiki' ), 'testwiki' ) . ' ' .
 23+ Xml::input( 'testwiki', 20, ( $testwiki['error'] ? null : $testwiki['prefix'] ), array( 'id' => 'testwiki' ) ) . '<br />';
 24+ return true;
 25+ }
 26+
 27+ /**
 28+ * Show a message that you are viewing a list of users of a certain test wiki
 29+ */
 30+ static function onSpecialListusersHeader( $pager, &$out ) {
 31+ $testwiki = self::getTestWiki();
 32+ if( !$testwiki['error'] ) {
 33+ $out .= wfMsgWikiHtml( 'wminc-listusers-testwiki', $testwiki['prefix'] );
 34+ }
 35+ return true;
 36+ }
 37+
 38+ /**
 39+ * Query
 40+ */
 41+ static function onSpecialListusersQueryInfo( $pager, &$query ) {
 42+ $testwiki = self::getTestWiki();
 43+ if( !$testwiki['error'] ) {
 44+ global $wmincPref;
 45+ $dbr = wfGetDB( DB_SLAVE );
 46+ $projectPrefName = $dbr->addQuotes( "$wmincPref-project" );
 47+ $projectPrefVal = $dbr->addQuotes( $testwiki['project'] );
 48+ $langPrefName = $dbr->addQuotes( "$wmincPref-code" );
 49+ $langPrefVal = $dbr->addQuotes( $testwiki['lang'] );
 50+ $query['tables']['p1'] = 'user_properties';
 51+ $query['tables']['p2'] = 'user_properties';
 52+ $query['join_conds']['p1'] = array( 'JOIN',
 53+ "user_id=p1.up_user AND (p1.up_property=$projectPrefName AND p1.up_value=$projectPrefVal)" );
 54+ $query['join_conds']['p2'] = array( 'JOIN',
 55+ "user_id=p2.up_user AND (p2.up_property=$langPrefName AND p2.up_value=$langPrefVal)" );
 56+ }
 57+ return true;
 58+ }
 59+}
Property changes on: trunk/extensions/WikimediaIncubator/ListUsersTestWiki.php
___________________________________________________________________
Added: svn:eol-style
6060 + native
Property changes on: trunk/extensions/CentralNotice/CentralNoticePageLogPager.php
___________________________________________________________________
Added: svn:eol-style
6161 + native
Property changes on: trunk/extensions/SignupAPI/includes/SignupAPI.hooks.php
___________________________________________________________________
Added: svn:eol-style
6262 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r98920Copy from trunk r96099awjrichards21:04, 4 October 2011

Status & tagging log