Index: trunk/extensions/CheckUser/CheckUser_body.php |
— | — | @@ -12,8 +12,6 @@ |
13 | 13 | public function __construct() { |
14 | 14 | global $wgUser; |
15 | 15 | parent::__construct( 'CheckUser', 'checkuser' ); |
16 | | - |
17 | | - $this->sk = $wgUser->getSkin(); |
18 | 16 | } |
19 | 17 | |
20 | 18 | public function execute( $subpage ) { |
— | — | @@ -111,6 +109,15 @@ |
112 | 110 | ); |
113 | 111 | } |
114 | 112 | |
| 113 | + /** |
| 114 | + * @param $user |
| 115 | + * @param $reason |
| 116 | + * @param $checktype |
| 117 | + * @param $ip |
| 118 | + * @param $xff |
| 119 | + * @param $name |
| 120 | + * @param $period |
| 121 | + */ |
115 | 122 | protected function showForm( $user, $reason, $checktype, $ip, $xff, $name, $period ) { |
116 | 123 | global $wgOut, $wgUser; |
117 | 124 | $action = $this->getTitle()->escapeLocalUrl(); |
— | — | @@ -174,6 +181,7 @@ |
175 | 182 | /** |
176 | 183 | * Get a selector of time period options |
177 | 184 | * @param int $selected, selected level |
| 185 | + * @return string |
178 | 186 | */ |
179 | 187 | protected function getPeriodMenu( $selected = null ) { |
180 | 188 | $s = '<label for="period">' . wfMsgHtml( 'checkuser-period' ) . '</label> '; |
— | — | @@ -303,8 +311,14 @@ |
304 | 312 | return $safeUsers; |
305 | 313 | } |
306 | 314 | |
307 | | - // Give a "no matches found for X" message. |
308 | | - // If $checkLast, then mention the last edit by this user or IP. |
| 315 | + /** |
| 316 | + * Give a "no matches found for X" message. |
| 317 | + * If $checkLast, then mention the last edit by this user or IP. |
| 318 | + * |
| 319 | + * @param $userName |
| 320 | + * @param bool $checkLast |
| 321 | + * @return String |
| 322 | + */ |
309 | 323 | protected function noMatchesMessage( $userName, $checkLast = true ) { |
310 | 324 | global $wgLang; |
311 | 325 | if ( $checkLast ) { |
— | — | @@ -343,6 +357,10 @@ |
344 | 358 | return wfMsgExt( 'checkuser-nomatch', 'parse' ); |
345 | 359 | } |
346 | 360 | |
| 361 | + /** |
| 362 | + * @param $reason |
| 363 | + * @return bool |
| 364 | + */ |
347 | 365 | protected function checkReason( $reason ) { |
348 | 366 | global $wgCheckUserForceSummary; |
349 | 367 | return ( !$wgCheckUserForceSummary || strlen( $reason ) ); |
— | — | @@ -481,14 +499,14 @@ |
482 | 500 | if ( $block instanceof Block ) { |
483 | 501 | if ( $block->getType() == Block::TYPE_RANGE ) { |
484 | 502 | $userpage = Title::makeTitle( NS_USER, $block->getTarget() ); |
485 | | - $blocklog = $this->sk->makeKnownLinkObj( |
| 503 | + $blocklog = Linker::makeKnownLinkObj( |
486 | 504 | SpecialPage::getTitleFor( 'Log' ), |
487 | 505 | wfMsgHtml( 'checkuser-blocked' ), |
488 | 506 | 'type=block&page=' . urlencode( $userpage->getPrefixedText() ) |
489 | 507 | ); |
490 | 508 | return ' <strong>(' . $blocklog . ' - ' . $block->getTarget() . ')</strong>'; |
491 | 509 | } elseif ( $block->getType() == Block::TYPE_AUTO ) { |
492 | | - $blocklog = $this->sk->makeKnownLinkObj( |
| 510 | + $blocklog = Linker::makeKnownLinkObj( |
493 | 511 | SpecialPage::getTitleFor( 'BlockList' ), |
494 | 512 | wfMsgHtml( 'checkuser-blocked' ), |
495 | 513 | 'ip=' . urlencode( "#{$block->getId()}" ) |
— | — | @@ -496,7 +514,7 @@ |
497 | 515 | return ' <strong>(' . $blocklog . ')</strong>'; |
498 | 516 | } else { |
499 | 517 | $userpage = Title::makeTitle( NS_USER, $block->getTarget() ); |
500 | | - $blocklog = $this->sk->makeKnownLinkObj( |
| 518 | + $blocklog = Linker::makeKnownLinkObj( |
501 | 519 | SpecialPage::getTitleFor( 'Log' ), |
502 | 520 | wfMsgHtml( 'checkuser-blocked' ), |
503 | 521 | 'type=block&page=' . urlencode( $userpage->getPrefixedText() ) |
— | — | @@ -563,7 +581,7 @@ |
564 | 582 | $ret = $dbr->select( 'cu_changes', |
565 | 583 | array( 'cuc_ip_hex', 'COUNT(*) AS count', 'MIN(cuc_timestamp) AS first', 'MAX(cuc_timestamp) AS last' ), |
566 | 584 | array( $ip_conds, $time_conds ), |
567 | | - __METHOD___, |
| 585 | + __METHOD__, |
568 | 586 | array( |
569 | 587 | 'GROUP BY' => 'cuc_ip_hex', |
570 | 588 | 'ORDER BY' => 'cuc_ip_hex', |
— | — | @@ -956,7 +974,7 @@ |
957 | 975 | # Load user object |
958 | 976 | $user = User::newFromName( $name, false ); |
959 | 977 | # Add user tool links |
960 | | - $s .= $this->sk->userLink( - 1 , $name ) . $this->sk->userToolLinks( - 1 , $name ); |
| 978 | + $s .= Linker::userLink( - 1 , $name ) . Linker::userToolLinks( - 1 , $name ); |
961 | 979 | # Add CheckUser link |
962 | 980 | $s .= ' (<a href="' . $this->getTitle()->escapeLocalURL( 'user=' . urlencode( $name ) . |
963 | 981 | '&reason=' . urlencode( $reason ) ) . '">' . wfMsgHtml( 'checkuser-check' ) . '</a>)'; |
— | — | @@ -1013,7 +1031,7 @@ |
1014 | 1032 | list( $client, $trusted ) = CheckUserHooks::getClientIPfromXFF( $set[1], $set[0] ); |
1015 | 1033 | $c = $trusted ? '#F0FFF0' : '#FFFFCC'; |
1016 | 1034 | $s .= '   <span style="background-color: ' . $c . '"><strong>XFF</strong>: '; |
1017 | | - $s .= $this->sk->makeKnownLinkObj( $this->getTitle(), |
| 1035 | + $s .= Linker::makeKnownLinkObj( $this->getTitle(), |
1018 | 1036 | htmlspecialchars( $set[1] ), |
1019 | 1037 | 'user=' . urlencode( $client ) . '/xff' ) . '</span>'; |
1020 | 1038 | } |
— | — | @@ -1054,6 +1072,12 @@ |
1055 | 1073 | $wgOut->addHTML( $s ); |
1056 | 1074 | } |
1057 | 1075 | |
| 1076 | + /** |
| 1077 | + * @param $ip |
| 1078 | + * @param $userId |
| 1079 | + * @param $user User |
| 1080 | + * @return array |
| 1081 | + */ |
1058 | 1082 | protected function userBlockFlags( $ip, $userId, $user ) { |
1059 | 1083 | static $logs, $blocklist; |
1060 | 1084 | $logs = SpecialPage::getTitleFor( 'Log' ); |
— | — | @@ -1064,7 +1088,7 @@ |
1065 | 1089 | // Range blocked? |
1066 | 1090 | if ( $block->getType() == Block::TYPE_RANGE ) { |
1067 | 1091 | $userpage = Title::makeTitle( NS_USER, $block->getTarget() ); |
1068 | | - $blocklog = $this->sk->makeKnownLinkObj( |
| 1092 | + $blocklog = Linker::makeKnownLinkObj( |
1069 | 1093 | $logs, |
1070 | 1094 | wfMsgHtml( 'checkuser-blocked' ), |
1071 | 1095 | 'type=block&page=' . urlencode( $userpage->getPrefixedText() ) |
— | — | @@ -1072,7 +1096,7 @@ |
1073 | 1097 | $flags[] = '<strong>(' . $blocklog . ' - ' . $block->getTarget() . ')</strong>'; |
1074 | 1098 | // Auto blocked? |
1075 | 1099 | } elseif ( $block->getType() == Block::TYPE_AUTO ) { |
1076 | | - $blocklog = $this->sk->makeKnownLinkObj( |
| 1100 | + $blocklog = Linker::makeKnownLinkObj( |
1077 | 1101 | $blocklist, |
1078 | 1102 | wfMsgHtml( 'checkuser-blocked' ), |
1079 | 1103 | 'ip=' . urlencode( "#{$block->getId()}" ) |
— | — | @@ -1080,7 +1104,7 @@ |
1081 | 1105 | $flags[] = '<strong>(' . $blocklog . ')</strong>'; |
1082 | 1106 | } else { |
1083 | 1107 | $userpage = $user->getUserPage(); |
1084 | | - $blocklog = $this->sk->makeKnownLinkObj( |
| 1108 | + $blocklog =Linker::makeKnownLinkObj( |
1085 | 1109 | $logs, |
1086 | 1110 | wfMsgHtml( 'checkuser-blocked' ), |
1087 | 1111 | 'type=block&page=' . urlencode( $userpage->getPrefixedText() ) |
— | — | @@ -1092,7 +1116,7 @@ |
1093 | 1117 | $flags[] = '<strong>(' . wfMsgHtml( 'checkuser-gblocked' ) . ')</strong>'; |
1094 | 1118 | } elseif ( self::userWasBlocked( $user->getName() ) ) { |
1095 | 1119 | $userpage = $user->getUserPage(); |
1096 | | - $blocklog = $this->sk->makeKnownLinkObj( $logs, wfMsgHtml( 'checkuser-wasblocked' ), |
| 1120 | + $blocklog = Linker::makeKnownLinkObj( $logs, wfMsgHtml( 'checkuser-wasblocked' ), |
1097 | 1121 | 'type=block&page=' . urlencode( $userpage->getPrefixedText() ) ); |
1098 | 1122 | $flags[] = '<strong>(' . $blocklog . ')</strong>'; |
1099 | 1123 | } |
— | — | @@ -1125,8 +1149,8 @@ |
1126 | 1150 | # Show date |
1127 | 1151 | $line .= ' . . ' . $wgLang->time( wfTimestamp( TS_MW, $row->cuc_timestamp ), true, true ) . ' . . '; |
1128 | 1152 | # Userlinks |
1129 | | - $line .= $this->sk->userLink( $row->cuc_user, $row->cuc_user_text ); |
1130 | | - $line .= $this->sk->userToolLinks( $row->cuc_user, $row->cuc_user_text ); |
| 1153 | + $line .= Linker::userLink( $row->cuc_user, $row->cuc_user_text ); |
| 1154 | + $line .= Linker::userToolLinks( $row->cuc_user, $row->cuc_user_text ); |
1131 | 1155 | # Get block info |
1132 | 1156 | if ( isset( $flagCache[$row->cuc_user_text] ) ) { |
1133 | 1157 | $flags = $flagCache[$row->cuc_user_text]; |
— | — | @@ -1142,13 +1166,13 @@ |
1143 | 1167 | } |
1144 | 1168 | # Action text, hackish ... |
1145 | 1169 | if ( $row->cuc_actiontext ) { |
1146 | | - $line .= ' ' . $this->sk->formatComment( $row->cuc_actiontext ) . ' '; |
| 1170 | + $line .= ' ' . Linker::formatComment( $row->cuc_actiontext ) . ' '; |
1147 | 1171 | } |
1148 | 1172 | # Comment |
1149 | | - $line .= $this->sk->commentBlock( $row->cuc_comment ); |
| 1173 | + $line .= Linker::commentBlock( $row->cuc_comment ); |
1150 | 1174 | $line .= '<br />        <small>'; |
1151 | 1175 | # IP |
1152 | | - $line .= ' <strong>IP</strong>: ' . $this->sk->makeKnownLinkObj( $cuTitle, |
| 1176 | + $line .= ' <strong>IP</strong>: ' . Linker::makeKnownLinkObj( $cuTitle, |
1153 | 1177 | htmlspecialchars( $row->cuc_ip ), 'user=' . urlencode( $row->cuc_ip ) . '&reason=' . urlencode( $reason ) ); |
1154 | 1178 | # XFF |
1155 | 1179 | if ( $row->cuc_xff != null ) { |
— | — | @@ -1157,7 +1181,7 @@ |
1158 | 1182 | $c = $trusted ? '#F0FFF0' : '#FFFFCC'; |
1159 | 1183 | $line .= '   <span class="mw-checkuser-xff" style="background-color: ' . $c . '">' . |
1160 | 1184 | '<strong>XFF</strong>: '; |
1161 | | - $line .= $this->sk->makeKnownLinkObj( $cuTitle, |
| 1185 | + $line .= Linker::makeKnownLinkObj( $cuTitle, |
1162 | 1186 | htmlspecialchars( $row->cuc_xff ), |
1163 | 1187 | 'user=' . urlencode( $client ) . '/xff&reason=' . urlencode( $reason ) ) . '</span>'; |
1164 | 1188 | } |
— | — | @@ -1180,11 +1204,11 @@ |
1181 | 1205 | list( $specialName, $logtype ) = SpecialPage::resolveAliasWithSubpage( $row->cuc_title ); |
1182 | 1206 | $logname = LogPage::logName( $logtype ); |
1183 | 1207 | $title = Title::makeTitle( $row->cuc_namespace, $row->cuc_title ); |
1184 | | - $links = '(' . $this->sk->makeKnownLinkObj( $title, $logname ) . ')'; |
| 1208 | + $links = '(' . Linker::makeKnownLinkObj( $title, $logname ) . ')'; |
1185 | 1209 | // Log items (newer format) |
1186 | 1210 | } elseif ( $row->cuc_type == RC_LOG ) { |
1187 | 1211 | $title = Title::makeTitle( $row->cuc_namespace, $row->cuc_title ); |
1188 | | - $links = '(' . $this->sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), $this->message['log'], |
| 1212 | + $links = '(' . Linker::makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), $this->message['log'], |
1189 | 1213 | wfArrayToCGI( array( 'page' => $title->getPrefixedText() ) ) ) . ')'; |
1190 | 1214 | } else { |
1191 | 1215 | $title = Title::makeTitle( $row->cuc_namespace, $row->cuc_title ); |
— | — | @@ -1193,14 +1217,14 @@ |
1194 | 1218 | $links = '(' . $this->message['diff'] . ') '; |
1195 | 1219 | } else { |
1196 | 1220 | # Diff link |
1197 | | - $links = ' (' . $this->sk->makeKnownLinkObj( $title, $this->message['diff'], |
| 1221 | + $links = ' (' . Linker::makeKnownLinkObj( $title, $this->message['diff'], |
1198 | 1222 | wfArrayToCGI( array( |
1199 | 1223 | 'curid' => $row->cuc_page_id, |
1200 | 1224 | 'diff' => $row->cuc_this_oldid, |
1201 | 1225 | 'oldid' => $row->cuc_last_oldid ) ) ) . ') '; |
1202 | 1226 | } |
1203 | 1227 | # History link |
1204 | | - $links .= ' (' . $this->sk->makeKnownLinkObj( $title, $this->message['hist'], |
| 1228 | + $links .= ' (' . Linker::makeKnownLinkObj( $title, $this->message['hist'], |
1205 | 1229 | wfArrayToCGI( array( |
1206 | 1230 | 'curid' => $row->cuc_page_id, |
1207 | 1231 | 'action' => 'history' ) ) ) . ') . . '; |
— | — | @@ -1212,7 +1236,7 @@ |
1213 | 1237 | $links .= '<span class="minor">' . $this->message['minoreditletter'] . '</span>'; |
1214 | 1238 | } |
1215 | 1239 | # Page link |
1216 | | - $links .= ' ' . $this->sk->makeLinkObj( $title ); |
| 1240 | + $links .= ' ' . Linker::makeLinkObj( $title ); |
1217 | 1241 | } |
1218 | 1242 | return $links; |
1219 | 1243 | } |
Index: trunk/extensions/CheckUser/CheckUserLogPager.php |
— | — | @@ -5,10 +5,6 @@ |
6 | 6 | |
7 | 7 | function __construct( $specialPage, $searchConds, $y, $m ) { |
8 | 8 | parent::__construct(); |
9 | | - /* |
10 | | - $this->messages = array_map( 'wfMsg', |
11 | | - array( 'comma-separator', 'checkuser-log-userips', 'checkuser-log-ipedits', 'checkuser-log-ipusers', |
12 | | - 'checkuser-log-ipedits-xff', 'checkuser-log-ipusers-xff' ) );*/ |
13 | 9 | |
14 | 10 | $this->getDateCond( $y, $m ); |
15 | 11 | $this->searchConds = $searchConds ? $searchConds : array(); |
— | — | @@ -18,19 +14,17 @@ |
19 | 15 | function formatRow( $row ) { |
20 | 16 | global $wgLang; |
21 | 17 | |
22 | | - $skin = $this->getSkin(); |
23 | | - |
24 | 18 | if ( $row->cul_reason === '' ) { |
25 | 19 | $comment = ''; |
26 | 20 | } else { |
27 | | - $comment = $skin->commentBlock( $row->cul_reason ); |
| 21 | + $comment = Linker::commentBlock( $row->cul_reason ); |
28 | 22 | } |
29 | 23 | |
30 | | - $user = $skin->userLink( $row->cul_user, $row->user_name ); |
| 24 | + $user = Linker::userLink( $row->cul_user, $row->user_name ); |
31 | 25 | |
32 | 26 | if ( $row->cul_type == 'userips' || $row->cul_type == 'useredits' ) { |
33 | | - $target = $skin->userLink( $row->cul_target_id, $row->cul_target_text ) . |
34 | | - $skin->userToolLinks( $row->cul_target_id, $row->cul_target_text ); |
| 27 | + $target = Linker::userLink( $row->cul_target_id, $row->cul_target_text ) . |
| 28 | + Linker::userToolLinks( $row->cul_target_id, $row->cul_target_text ); |
35 | 29 | } else { |
36 | 30 | $target = $row->cul_target_text; |
37 | 31 | } |
— | — | @@ -47,6 +41,9 @@ |
48 | 42 | '</li>'; |
49 | 43 | } |
50 | 44 | |
| 45 | + /** |
| 46 | + * @return string |
| 47 | + */ |
51 | 48 | function getStartBody() { |
52 | 49 | if ( $this->getNumRows() ) { |
53 | 50 | return '<ul>'; |
— | — | @@ -55,6 +52,9 @@ |
56 | 53 | } |
57 | 54 | } |
58 | 55 | |
| 56 | + /** |
| 57 | + * @return string |
| 58 | + */ |
59 | 59 | function getEndBody() { |
60 | 60 | if ( $this->getNumRows() ) { |
61 | 61 | return '</ul>'; |
— | — | @@ -63,6 +63,9 @@ |
64 | 64 | } |
65 | 65 | } |
66 | 66 | |
| 67 | + /** |
| 68 | + * @return string |
| 69 | + */ |
67 | 70 | function getEmptyBody() { |
68 | 71 | return '<p>' . wfMsgHtml( 'checkuser-empty' ) . '</p>'; |
69 | 72 | } |
Index: trunk/extensions/CheckUser/SpecialCheckUserLog.php |
— | — | @@ -5,6 +5,14 @@ |
6 | 6 | parent::__construct( 'CheckUserLog', 'checkuser-log' ); |
7 | 7 | } |
8 | 8 | |
| 9 | + /** |
| 10 | + * @var Title |
| 11 | + */ |
| 12 | + var $checkUserFormTitle; |
| 13 | + |
| 14 | + /** |
| 15 | + * @return Title |
| 16 | + */ |
9 | 17 | function getCheckUserFormTitle() { |
10 | 18 | if ( !isset( $this->checkUserFormTitle ) ) { |
11 | 19 | $this->checkUserFormTitle = SpecialPage::getTitleFor('CheckUser'); |