r51787 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51786‎ | r51787 | r51788 >
Date:11:01, 12 June 2009
Author:thomasv
Status:ok
Tags:
Comment:
adding from...to parameters to pagelist
Modified paths:
  • /trunk/extensions/ProofreadPage/ProofreadPage.i18n.php (modified) (history)
  • /trunk/extensions/ProofreadPage/ProofreadPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/ProofreadPage.i18n.php
@@ -17,6 +17,7 @@
1818 'proofreadpage_nosuch_index' => 'Error: no such index',
1919 'proofreadpage_number_expected' => 'Error: numeric value expected',
2020 'proofreadpage_interval_too_large'=> 'Error: interval too large',
 21+ 'proofreadpage_invalid_interval' => 'Error: invalid interval',
2122 'proofreadpage_nextpage' => 'Next page',
2223 'proofreadpage_prevpage' => 'Previous page',
2324 'proofreadpage_header' => 'Header (noinclude):',
Index: trunk/extensions/ProofreadPage/ProofreadPage.php
@@ -591,7 +591,17 @@
592592 $page_ns_index = NS_MAIN;
593593 }
594594
595 - for ( $i = 0; $i < $count ; $i++ ) {
 595+ $from = $args['from'];
 596+ $to = $args['to'];
 597+ if( !$from ) $from = 1;
 598+ if( !$to ) $to = $count;
 599+
 600+ if( !is_numeric($from) || !is_numeric($to) )
 601+ return '<strong class="error">' . wfMsgForContent( 'proofreadpage_number_expected' ) . '</strong>';
 602+ if( ($from > $to) || ($from < 1) || ($to < 1 ) || ($to > $count) )
 603+ return '<strong class="error">' . wfMsgForContent( 'proofreadpage_invalid_interval' ) . '</strong>';
 604+
 605+ for ( $i = $from - 1; $i < $to; $i++ ) {
596606 if ( !isset( $query ) ) {
597607 $query = "SELECT page_id, page_title, page_namespace";
598608 $query .= " FROM $pagetable WHERE (page_namespace=" . intval( $page_ns_index ) . " AND page_title IN(";
@@ -616,7 +626,7 @@
617627
618628 $sk = $wgUser->getSkin();
619629
620 - for ( $i = 1; $i < $count + 1 ; $i++ ) {
 630+ for ( $i = $from; $i < $to + 1; $i++ ) {
621631 $pdbk = "$page_namespace:$name" . '/' . $i ;
622632 list( $view, $links, $mode ) = pr_pageNumber( $i, $args );
623633

Follow-up revisions

RevisionCommit summaryAuthorDate
r51788the index page may contain several pagelists (follow-up to r51787)thomasv11:18, 12 June 2009

Status & tagging log