Follow-up on r55909: showLogExtract can now tell Pager to ignore wgRequest offset...
authorTobias <churchofemacs@users.mediawiki.org>
Sun, 20 Sep 2009 22:07:44 +0000 (22:07 +0000)
committerTobias <churchofemacs@users.mediawiki.org>
Sun, 20 Sep 2009 22:07:44 +0000 (22:07 +0000)
includes/LogEventsList.php
includes/specials/SpecialBlockip.php
includes/specials/SpecialContributions.php

index 29a54c6..77f0f8a 100644 (file)
@@ -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 = '';
index 03a4bd3..a85285c 100644 (file)
@@ -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 ) );
                }
        }
 
index e7cdb5b..e5a5d72 100644 (file)
@@ -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
                                        )
                                );
                        }