Index: trunk/phase3/includes/LogEventsList.php |
— | — | @@ -557,29 +557,32 @@ |
558 | 558 | |
559 | 559 | /** |
560 | 560 | * Quick function to show a short log extract |
561 | | - * @param $out OutputPage |
| 561 | + * @param $out OutputPage or String-by-reference |
562 | 562 | * @param $types String or Array |
563 | 563 | * @param $page String |
564 | 564 | * @param $user String |
565 | 565 | * @param $lim Integer |
566 | 566 | * @param $conds Array |
567 | 567 | */ |
568 | | - public static function showLogExtract( $out, $types=array(), $page='', $user='', $lim=0, $conds=array() ) { |
569 | | - global $wgUser; |
| 568 | + public static function showLogExtract( &$out, $types=array(), $page='', $user='', $lim=0, $conds=array() ) { |
| 569 | + global $wgUser, $wgOut; |
570 | 570 | # Insert list of top 50 or so items |
571 | | - $loglist = new LogEventsList( $wgUser->getSkin(), $out, 0 ); |
| 571 | + $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut, 0 ); |
572 | 572 | $pager = new LogPager( $loglist, $types, $user, $page, '', $conds ); |
573 | 573 | if( $lim > 0 ) $pager->mLimit = $lim; |
574 | 574 | $logBody = $pager->getBody(); |
575 | 575 | if( $logBody ) { |
576 | | - $out->addHTML( |
577 | | - $loglist->beginLogEventsList() . |
578 | | - $logBody . |
579 | | - $loglist->endLogEventsList() |
580 | | - ); |
| 576 | + $s = $loglist->beginLogEventsList() . |
| 577 | + $logBody . |
| 578 | + $loglist->endLogEventsList(); |
581 | 579 | } else { |
582 | | - $out->addWikiMsg( 'logempty' ); |
| 580 | + $s = wfMsgExt( 'logempty', array('parse') ); |
583 | 581 | } |
| 582 | + if( $out instanceof OutputPage ){ |
| 583 | + $out->addHTML( $s ); |
| 584 | + } else { |
| 585 | + $out = $s; |
| 586 | + } |
584 | 587 | return $pager->getNumRows(); |
585 | 588 | } |
586 | 589 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -199,6 +199,8 @@ |
200 | 200 | * MakeSysop and MakeBot are now aliases for Special:UserRights |
201 | 201 | * IndexPager->mLimitsShown can now be an associative array of limit => text-to- |
202 | 202 | display-in-limit-form. |
| 203 | +* (bug 18880) LogEventsList::showLogExtract() can now take a string-by-reference |
| 204 | + and add its HTML to it, rather than having to go straight to $wgOut. |
203 | 205 | |
204 | 206 | === Bug fixes in 1.16 === |
205 | 207 | |