r56687 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56686‎ | r56687 | r56688 >
Date:22:07, 20 September 2009
Author:churchofemacs
Status:ok
Tags:
Comment:
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)
Modified paths:
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialBlockip.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LogEventsList.php
@@ -580,6 +580,8 @@
581581 * to the key of the message. First element is the message
582582 * key, additional optional elements are parameters for the
583583 * key that are processed with wgMsgExt and option 'parse'
 584+ * offset Set to overwrite offset parameter in $wgRequest
 585+ * set to '' to unset offset
584586 * @return Integer Number of total log items (not limited by $lim)
585587 */
586588 public static function showLogExtract( &$out, $types=array(), $page='', $user='',
@@ -607,6 +609,8 @@
608610 # Insert list of top 50 (or top $lim) items
609611 $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut, 0 );
610612 $pager = new LogPager( $loglist, $types, $user, $page, '', $conds );
 613+ if ( isset( $param['offset'] ) ) # Tell pager to ignore $wgRequest offset
 614+ $pager->setOffset( $param['offset'] );
611615 if( $lim > 0 ) $pager->mLimit = $lim;
612616 $logBody = $pager->getBody();
613617 $s = '';
Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -235,7 +235,8 @@
236236 array(
237237 'lim' => 1,
238238 'showIfEmpty' => false,
239 - 'msgKey' => array( 'sp-contributions-blocked-notice' )
 239+ 'msgKey' => array( 'sp-contributions-blocked-notice' ),
 240+ 'offset' => '' # don't use $wgRequest parameter offset
240241 )
241242 );
242243 }
Index: trunk/phase3/includes/specials/SpecialBlockip.php
@@ -586,12 +586,12 @@
587587 private function showLogFragment( $out, $title ) {
588588 global $wgUser;
589589 LogEventsList::showLogExtract( $out, 'block', $title->getPrefixedText(), '',
590 - array( 'lim' => 10, 'msgKey' => array( 'blocklog-showlog' ) ) );
 590+ array( 'lim' => 10, 'msgKey' => array( 'blocklog-showlog' ), 'showIfEmpty' => false ) );
591591 // Add suppression block entries if allowed
592592 if( $wgUser->isAllowed( 'hideuser' ) ) {
593593 LogEventsList::showLogExtract( $out, 'suppress', $title->getPrefixedText(), '',
594594 array('lim' => 10, 'conds' => array('log_action' => array('block','reblock','unblock')),
595 - 'msgKey' => array( 'blocklog-showsuppresslog' ) ) );
 595+ 'msgKey' => array( 'blocklog-showsuppresslog' ), 'showIfEmpty' => false ) );
596596 }
597597 }
598598

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r55909Display note on Special:Contributions if user is blocked, and provide an exce...churchofemacs01:29, 7 September 2009
r56420Follow-up on r56284: LogEventsList::showLogExtract gets associative array for...churchofemacs17:17, 16 September 2009

Status & tagging log