r37621 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37620‎ | r37621 | r37622 >
Date:16:56, 13 July 2008
Author:thomasv
Status:old
Tags:
Comment:
always use canonical page order if document is multipage
Modified paths:
  • /trunk/extensions/ProofreadPage/ProofreadPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/ProofreadPage.php
@@ -64,10 +64,9 @@
6565 }
6666 $dbr->freeResult( $result ) ;
6767
68 - if( !$index_title ) { // there is no index, or no page list in the index
 68+ //if multipage, we use the page order, but we should read pagenum from the index
 69+ if( $image->exists() && $image->isMultiPage() ) {
6970
70 - if( ! ($image->exists() && $image->isMultiPage() ) ) return $err;
71 -
7271 $pagenr = 1;
7372 $parts = explode( '/', $wgTitle->getText() );
7473 if( count( $parts ) > 1 ) {
@@ -80,10 +79,14 @@
8180 $index_name = "$index_namespace:$name";
8281 $prev_name = "$page_namespace:$name/" . ( $pagenr - 1 );
8382 $next_name = "$page_namespace:$name/" . ( $pagenr + 1 );
84 - $index_title = Title::newFromText( $index_name );
8583 $prev_url = ( $pagenr == 1 ) ? '' : Title::newFromText( $prev_name )->getFullURL();
8684 $next_url = ( $pagenr == $count ) ? '' : Title::newFromText( $next_name )->getFullURL();
8785 $page_num = $pagenr;
 86+
 87+ if( !$index_title ) {
 88+ //there is no index, or the page is not listed in the index : use canonical index
 89+ $index_title = Title::newFromText( $index_name );
 90+ }
8891 }
8992 else {
9093 $page_num = '';
@@ -91,6 +94,8 @@
9295 $next_url = '';
9396 }
9497
 98+
 99+ if( !$index_title ) return $err;
95100 $index_url = $index_title->getFullURL();
96101
97102 //if the index page exists, read metadata

Status & tagging log