Index: trunk/phase3/includes/ChangesList.php |
— | — | @@ -16,6 +16,11 @@ |
17 | 17 | var $curlink , $difflink, $lastlink, $usertalklink, $versionlink; |
18 | 18 | var $userlink, $timestamp, $watched; |
19 | 19 | |
| 20 | + /** |
| 21 | + * @static |
| 22 | + * @param $rc RecentChange |
| 23 | + * @return RCCacheEntry |
| 24 | + */ |
20 | 25 | static function newFromParent( $rc ) { |
21 | 26 | $rc2 = new RCCacheEntry; |
22 | 27 | $rc2->mAttribs = $rc->mAttribs; |
— | — | @@ -28,6 +33,10 @@ |
29 | 34 | * Base class for all changes lists |
30 | 35 | */ |
31 | 36 | class ChangesList { |
| 37 | + |
| 38 | + /** |
| 39 | + * @var Skin |
| 40 | + */ |
32 | 41 | public $skin; |
33 | 42 | protected $watchlist = false; |
34 | 43 | |
— | — | @@ -83,7 +92,7 @@ |
84 | 93 | |
85 | 94 | /** |
86 | 95 | * Returns the appropriate flags for new page, minor change and patrolling |
87 | | - * @param $flags Associative array of 'flag' => Bool |
| 96 | + * @param $flags Array Associative array of 'flag' => Bool |
88 | 97 | * @param $nothing String to use for empty space |
89 | 98 | * @return String |
90 | 99 | */ |
— | — | @@ -196,6 +205,11 @@ |
197 | 206 | } |
198 | 207 | } |
199 | 208 | |
| 209 | + /** |
| 210 | + * @param $s |
| 211 | + * @param $rc RecentChange |
| 212 | + * @return void |
| 213 | + */ |
200 | 214 | public function insertMove( &$s, $rc ) { |
201 | 215 | # Diff |
202 | 216 | $s .= '(' . $this->message['diff'] . ') ('; |
— | — | @@ -253,6 +267,12 @@ |
254 | 268 | ) . ')'; |
255 | 269 | } |
256 | 270 | |
| 271 | + /** |
| 272 | + * @param $s |
| 273 | + * @param $rc RecentChange |
| 274 | + * @param $unpatrolled |
| 275 | + * @return void |
| 276 | + */ |
257 | 277 | public function insertDiffHist( &$s, &$rc, $unpatrolled ) { |
258 | 278 | # Diff link |
259 | 279 | if( $rc->mAttribs['rc_type'] == RC_NEW || $rc->mAttribs['rc_type'] == RC_LOG ) { |
— | — | @@ -293,6 +313,13 @@ |
294 | 314 | $s .= ') . . '; |
295 | 315 | } |
296 | 316 | |
| 317 | + /** |
| 318 | + * @param $s |
| 319 | + * @param $rc RecentChange |
| 320 | + * @param $unpatrolled |
| 321 | + * @param $watched |
| 322 | + * @return void |
| 323 | + */ |
297 | 324 | public function insertArticleLink( &$s, &$rc, $unpatrolled, $watched ) { |
298 | 325 | global $wgContLang; |
299 | 326 | # If it's a new article, there is no diff link, but if it hasn't been |
— | — | @@ -334,23 +361,34 @@ |
335 | 362 | $s .= " $articlelink"; |
336 | 363 | } |
337 | 364 | |
| 365 | + /** |
| 366 | + * @param $s |
| 367 | + * @param $rc RecentChange |
| 368 | + * @return void |
| 369 | + */ |
338 | 370 | public function insertTimestamp( &$s, $rc ) { |
339 | 371 | global $wgLang; |
340 | 372 | $s .= $this->message['semicolon-separator'] . |
341 | 373 | $wgLang->time( $rc->mAttribs['rc_timestamp'], true, true ) . ' . . '; |
342 | 374 | } |
343 | 375 | |
344 | | - /** Insert links to user page, user talk page and eventually a blocking link */ |
| 376 | + /** Insert links to user page, user talk page and eventually a blocking link |
| 377 | + * |
| 378 | + * @param $rc RecentChange |
| 379 | + */ |
345 | 380 | public function insertUserRelatedLinks( &$s, &$rc ) { |
346 | 381 | if( $this->isDeleted( $rc, Revision::DELETED_USER ) ) { |
347 | | - $s .= ' <span class="history-deleted">' . wfMsgHtml( 'rev-deleted-user' ) . '</span>'; |
| 382 | + $s .= ' <span class="history-deleted">' . wfMsgHtml( 'rev-deleted-user' ) . '</span>'; |
348 | 383 | } else { |
349 | | - $s .= $this->skin->userLink( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); |
350 | | - $s .= $this->skin->userToolLinks( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); |
| 384 | + $s .= $this->skin->userLink( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); |
| 385 | + $s .= $this->skin->userToolLinks( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); |
351 | 386 | } |
352 | 387 | } |
353 | 388 | |
354 | | - /** insert a formatted action */ |
| 389 | + /** insert a formatted action |
| 390 | + * |
| 391 | + * @param $rc RecentChange |
| 392 | + */ |
355 | 393 | public function insertAction( &$s, &$rc ) { |
356 | 394 | if( $rc->mAttribs['rc_type'] == RC_LOG ) { |
357 | 395 | if( $this->isDeleted( $rc, LogPage::DELETED_ACTION ) ) { |
— | — | @@ -362,7 +400,10 @@ |
363 | 401 | } |
364 | 402 | } |
365 | 403 | |
366 | | - /** insert a formatted comment */ |
| 404 | + /** insert a formatted comment |
| 405 | + * |
| 406 | + * @param $rc RecentChange |
| 407 | + */ |
367 | 408 | public function insertComment( &$s, &$rc ) { |
368 | 409 | if( $rc->mAttribs['rc_type'] != RC_MOVE && $rc->mAttribs['rc_type'] != RC_MOVE_OVER_REDIRECT ) { |
369 | 410 | if( $this->isDeleted( $rc, Revision::DELETED_COMMENT ) ) { |
— | — | @@ -432,7 +473,11 @@ |
433 | 474 | } |
434 | 475 | } |
435 | 476 | |
436 | | - /** Inserts a rollback link */ |
| 477 | + /** Inserts a rollback link |
| 478 | + * |
| 479 | + * @param $s |
| 480 | + * @param $rc RecentChange |
| 481 | + */ |
437 | 482 | public function insertRollback( &$s, &$rc ) { |
438 | 483 | global $wgUser; |
439 | 484 | if( !$rc->mAttribs['rc_new'] && $rc->mAttribs['rc_this_oldid'] && $rc->mAttribs['rc_cur_id'] ) { |
— | — | @@ -453,6 +498,12 @@ |
454 | 499 | } |
455 | 500 | } |
456 | 501 | |
| 502 | + /** |
| 503 | + * @param $s |
| 504 | + * @param $rc RecentChange |
| 505 | + * @param $classes |
| 506 | + * @return |
| 507 | + */ |
457 | 508 | public function insertTags( &$s, &$rc, &$classes ) { |
458 | 509 | if ( empty($rc->mAttribs['ts_tags']) ) |
459 | 510 | return; |
— | — | @@ -474,6 +525,8 @@ |
475 | 526 | class OldChangesList extends ChangesList { |
476 | 527 | /** |
477 | 528 | * Format a line using the old system (aka without any javascript). |
| 529 | + * |
| 530 | + * @param $rc RecentChange |
478 | 531 | */ |
479 | 532 | public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) { |
480 | 533 | global $wgLang, $wgRCShowChangedSize, $wgUser; |
— | — | @@ -584,6 +637,8 @@ |
585 | 638 | } |
586 | 639 | /** |
587 | 640 | * Format a line for enhanced recentchange (aka with javascript and block of lines). |
| 641 | + * |
| 642 | + * @param $baseRC RecentChange |
588 | 643 | */ |
589 | 644 | public function recentChangesLine( &$baseRC, $watched = false ) { |
590 | 645 | global $wgLang, $wgUser; |
— | — | @@ -1053,6 +1108,8 @@ |
1054 | 1109 | |
1055 | 1110 | /** |
1056 | 1111 | * Enhanced RC ungrouped line. |
| 1112 | + * |
| 1113 | + * @param $rcObj RecentChange |
1057 | 1114 | * @return String: a HTML formated line (generated using $r) |
1058 | 1115 | */ |
1059 | 1116 | protected function recentChangesBlockLine( $rcObj ) { |