Index: trunk/extensions/ContributionScores/ContributionScores_body.php |
— | — | @@ -17,10 +17,6 @@ |
18 | 18 | parent::__construct( 'ContributionScores' ); |
19 | 19 | } |
20 | 20 | |
21 | | - function getDescription() { |
22 | | - return wfMsg( 'contributionscores' ); |
23 | | - } |
24 | | - |
25 | 21 | ///Generates a "Contribution Scores" table for a given LIMIT and date range |
26 | 22 | /** |
27 | 23 | * Function generates Contribution Scores tables in HTML format (not wikiText) |
— | — | @@ -31,7 +27,7 @@ |
32 | 28 | * @return HTML Table representing the requested Contribution Scores. |
33 | 29 | */ |
34 | 30 | function genContributionScoreTable( $days, $limit, $title = null, $options = 'none' ) { |
35 | | - global $wgContribScoreIgnoreBots, $wgContribScoreIgnoreBlockedUsers, $wgUser, $wgLang; |
| 31 | + global $wgContribScoreIgnoreBots, $wgContribScoreIgnoreBlockedUsers, $wgLang; |
36 | 32 | |
37 | 33 | $opts = explode( ',', strtolower( $options ) ); |
38 | 34 | |
— | — | @@ -95,32 +91,36 @@ |
96 | 92 | |
97 | 93 | $output = "<table class=\"wikitable contributionscores plainlinks{$sortable}\" >\n". |
98 | 94 | "<tr class='header'>\n". |
99 | | - "<th>" . wfMsgHtml( 'contributionscores-score' ) . "</th>\n" . |
100 | | - "<th>" . wfMsgHtml( 'contributionscores-pages' ) . "</th>\n" . |
101 | | - "<th>" . wfMsgHtml( 'contributionscores-changes' ) . "</th>\n" . |
102 | | - "<th>" . wfMsgHtml( 'contributionscores-username' ) . "</th>\n"; |
| 95 | + Html::element( 'th', array(), wfMsg( 'contributionscores-score' ) ) . |
| 96 | + Html::element( 'th', array(), wfMsg( 'contributionscores-pages' ) ) . |
| 97 | + Html::element( 'th', array(), wfMsg( 'contributionscores-changes' ) ) . |
| 98 | + Html::element( 'th', array(), wfMsg( 'contributionscores-username' ) ); |
103 | 99 | |
104 | | - $skin = $wgUser->getSkin(); |
105 | 100 | $altrow = ''; |
106 | 101 | foreach ( $res as $row ) { |
107 | | - $output .= "</tr><tr class='{$altrow}'>\n<td class='content'>" . |
| 102 | + $output .= Html::closeElement( 'tr' ); |
| 103 | + $output .= "<tr class='{$altrow}'>\n<td class='content'>" . |
108 | 104 | $wgLang->formatNum( round( $row->wiki_rank, 0 ) ) . "\n</td><td class='content'>" . |
109 | 105 | $wgLang->formatNum( $row->page_count ) . "\n</td><td class='content'>" . |
110 | 106 | $wgLang->formatNum( $row->rev_count ) . "\n</td><td class='content'>" . |
111 | | - $skin->userLink( $row->user_id, $row->user_name ); |
| 107 | + Linker::userLink( $row->user_id, $row->user_name ); |
112 | 108 | |
113 | 109 | # Option to not display user tools |
114 | | - if ( !in_array( 'notools', $opts ) ) |
115 | | - $output .= $skin->userToolLinks( $row->user_id, $row->user_name ); |
| 110 | + if ( !in_array( 'notools', $opts ) ) { |
| 111 | + $output .= Linker::userToolLinks( $row->user_id, $row->user_name ); |
| 112 | + } |
116 | 113 | |
117 | | - $output .= "</td>\n"; |
| 114 | + $output .= Html::closeElement( 'td' ) . "\n"; |
118 | 115 | |
119 | | - if ( $altrow == '' && empty( $sortable ) ) |
| 116 | + if ( $altrow == '' && empty( $sortable ) ) { |
120 | 117 | $altrow = 'odd '; |
121 | | - else |
| 118 | + } else { |
122 | 119 | $altrow = ''; |
| 120 | + } |
123 | 121 | } |
124 | | - $output .= "</tr></table>"; |
| 122 | + $output .= Html::closeElement( 'tr' ); |
| 123 | + $output .= Html::closeElement( 'table' ); |
| 124 | + |
125 | 125 | $dbr->freeResult( $res ); |
126 | 126 | |
127 | 127 | if ( !empty( $title ) ) |
— | — | @@ -145,6 +145,7 @@ |
146 | 146 | } else { |
147 | 147 | $this->showPage(); |
148 | 148 | } |
| 149 | + |
149 | 150 | return true; |
150 | 151 | } |
151 | 152 | |
Index: trunk/extensions/ContributionScores/ContributionScores.php |
— | — | @@ -15,23 +15,23 @@ |
16 | 16 | 'url' => 'https://www.mediawiki.org/wiki/Extension:Contribution_Scores', |
17 | 17 | 'author' => 'Tim Laqua', |
18 | 18 | 'descriptionmsg' => 'contributionscores-desc', |
19 | | - 'version' => '1.12' |
| 19 | + 'version' => '1.13' |
20 | 20 | ); |
21 | 21 | |
22 | | -define( 'CONTRIBUTIONSCORES_PATH', dirname( __FILE__ ) ); |
23 | | -define( 'CONTRIBUTIONSCORES_EXTPATH', str_replace( $_SERVER['DOCUMENT_ROOT'], '/', CONTRIBUTIONSCORES_PATH ) ); |
| 22 | +$dir = dirname( __FILE__ ) . '/'; |
| 23 | + |
24 | 24 | define( 'CONTRIBUTIONSCORES_MAXINCLUDELIMIT', 50 ); |
25 | 25 | $wgContribScoreReports = null; |
26 | 26 | $wgContribScoreIgnoreBlockedUsers = false; |
27 | 27 | $wgContribScoreIgnoreBots = false; |
28 | 28 | $wgContribScoreDisableCache = false; |
29 | 29 | |
30 | | -$wgAutoloadClasses['ContributionScores'] = CONTRIBUTIONSCORES_PATH . '/ContributionScores_body.php'; |
| 30 | +$wgAutoloadClasses['ContributionScores'] = $dir . 'ContributionScores_body.php'; |
31 | 31 | $wgSpecialPages['ContributionScores'] = 'ContributionScores'; |
32 | 32 | $wgSpecialPageGroups['ContributionScores'] = 'wiki'; |
33 | 33 | |
34 | | -$wgExtensionMessagesFiles['ContributionScores'] = CONTRIBUTIONSCORES_PATH . '/ContributionScores.i18n.php'; |
35 | | -$wgExtensionMessagesFiles['ContributionScoresAlias'] = CONTRIBUTIONSCORES_PATH . '/ContributionScores.alias.php'; |
| 34 | +$wgExtensionMessagesFiles['ContributionScores'] = $dir . 'ContributionScores.i18n.php'; |
| 35 | +$wgExtensionMessagesFiles['ContributionScoresAlias'] = $dir . 'ContributionScores.alias.php'; |
36 | 36 | |
37 | 37 | $wgHooks['LanguageGetMagic'][] = 'efContributionScores_LanguageGetMagic'; |
38 | 38 | |