From: Tobias Date: Sun, 20 Sep 2009 22:07:44 +0000 (+0000) Subject: Follow-up on r55909: showLogExtract can now tell Pager to ignore wgRequest offset... X-Git-Tag: 1.31.0-rc.0~39608 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=98303b05be80723f7a63ad8307ca64d0aec87672;p=lhc%2Fweb%2Fwiklou.git Follow-up on r55909: showLogExtract can now tell Pager to ignore wgRequest offset. Needed for block notice on SpecialContributions. Also small fix for SpecialBlockip (after r56420) --- diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index 29a54c6f31..77f0f8a5ec 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -580,6 +580,8 @@ class LogEventsList { * to the key of the message. First element is the message * key, additional optional elements are parameters for the * key that are processed with wgMsgExt and option 'parse' + * offset Set to overwrite offset parameter in $wgRequest + * set to '' to unset offset * @return Integer Number of total log items (not limited by $lim) */ public static function showLogExtract( &$out, $types=array(), $page='', $user='', @@ -607,6 +609,8 @@ class LogEventsList { # Insert list of top 50 (or top $lim) items $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut, 0 ); $pager = new LogPager( $loglist, $types, $user, $page, '', $conds ); + if ( isset( $param['offset'] ) ) # Tell pager to ignore $wgRequest offset + $pager->setOffset( $param['offset'] ); if( $lim > 0 ) $pager->mLimit = $lim; $logBody = $pager->getBody(); $s = ''; diff --git a/includes/specials/SpecialBlockip.php b/includes/specials/SpecialBlockip.php index 03a4bd3486..a85285c064 100644 --- a/includes/specials/SpecialBlockip.php +++ b/includes/specials/SpecialBlockip.php @@ -586,12 +586,12 @@ class IPBlockForm { private function showLogFragment( $out, $title ) { global $wgUser; LogEventsList::showLogExtract( $out, 'block', $title->getPrefixedText(), '', - array( 'lim' => 10, 'msgKey' => array( 'blocklog-showlog' ) ) ); + array( 'lim' => 10, 'msgKey' => array( 'blocklog-showlog' ), 'showIfEmpty' => false ) ); // Add suppression block entries if allowed if( $wgUser->isAllowed( 'hideuser' ) ) { LogEventsList::showLogExtract( $out, 'suppress', $title->getPrefixedText(), '', array('lim' => 10, 'conds' => array('log_action' => array('block','reblock','unblock')), - 'msgKey' => array( 'blocklog-showsuppresslog' ) ) ); + 'msgKey' => array( 'blocklog-showsuppresslog' ), 'showIfEmpty' => false ) ); } } diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index e7cdb5b413..e5a5d720c1 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -235,7 +235,8 @@ class SpecialContributions extends SpecialPage { array( 'lim' => 1, 'showIfEmpty' => false, - 'msgKey' => array( 'sp-contributions-blocked-notice' ) + 'msgKey' => array( 'sp-contributions-blocked-notice' ), + 'offset' => '' # don't use $wgRequest parameter offset ) ); }