Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -84,7 +84,7 @@ |
85 | 85 | if ( $this->getTitle()->getNamespace() != NS_FILE || ( isset( $diff ) && $diffOnly ) ) { |
86 | 86 | return parent::view(); |
87 | 87 | } |
88 | | - |
| 88 | + |
89 | 89 | $this->loadFile(); |
90 | 90 | |
91 | 91 | if ( $this->getTitle()->getNamespace() == NS_FILE && $this->mPage->getFile()->getRedirected() ) { |
— | — | @@ -94,7 +94,7 @@ |
95 | 95 | $wgRequest->setVal( 'diffonly', 'true' ); |
96 | 96 | return parent::view(); |
97 | 97 | } else { |
98 | | - // mTitle is not the same as the redirect target so it is |
| 98 | + // mTitle is not the same as the redirect target so it is |
99 | 99 | // probably the redirect page itself. Fake the redirect symbol |
100 | 100 | $wgOut->setPageTitle( $this->getTitle()->getPrefixedText() ); |
101 | 101 | $wgOut->addHTML( $this->viewRedirect( Title::makeTitle( NS_FILE, $this->mPage->getFile()->getName() ), |
— | — | @@ -159,7 +159,7 @@ |
160 | 160 | # @todo FIXME: For some freaky reason, we can't redirect to foreign images. |
161 | 161 | # Yet we return metadata about the target. Definitely an issue in the FileRepo |
162 | 162 | $this->imageLinks(); |
163 | | - |
| 163 | + |
164 | 164 | # Allow extensions to add something after the image links |
165 | 165 | $html = ''; |
166 | 166 | wfRunHooks( 'ImagePageAfterImageLinks', array( $this, &$html ) ); |
— | — | @@ -204,9 +204,9 @@ |
205 | 205 | if ( $metadata ) { |
206 | 206 | $r[] = '<li><a href="#metadata">' . wfMsgHtml( 'metadata' ) . '</a></li>'; |
207 | 207 | } |
208 | | - |
| 208 | + |
209 | 209 | wfRunHooks( 'ImagePageShowTOC', array( $this, &$r ) ); |
210 | | - |
| 210 | + |
211 | 211 | return '<ul id="filetoc">' . implode( "\n", $r ) . '</ul>'; |
212 | 212 | } |
213 | 213 | |
— | — | @@ -318,12 +318,12 @@ |
319 | 319 | foreach ( $wgImageLimits as $size ) { |
320 | 320 | if ( $size[0] < $width_orig && $size[1] < $height_orig && |
321 | 321 | $size[0] != $width && $size[1] != $height ) { |
322 | | - $otherSizes[] = $this->makeSizeLink( $params, $size[0], $size[1] ); |
| 322 | + $otherSizes[] = $this->makeSizeLink( $params, $size[0], $size[1] ); |
323 | 323 | } |
324 | 324 | } |
325 | 325 | $msgsmall = wfMessage( 'show-big-image-preview' )-> |
326 | 326 | rawParams( $this->makeSizeLink( $params, $width, $height ) )-> |
327 | | - parse() . ' ' . |
| 327 | + parse() . ' ' . |
328 | 328 | wfMessage( 'show-big-image-other' )-> |
329 | 329 | rawParams( $wgLang->pipeList( $otherSizes ) )->parse(); |
330 | 330 | } else { |
— | — | @@ -475,9 +475,9 @@ |
476 | 476 | } |
477 | 477 | } |
478 | 478 | } |
479 | | - |
| 479 | + |
480 | 480 | /** |
481 | | - * Creates an thumbnail of specified size and returns an HTML link to it |
| 481 | + * Creates an thumbnail of specified size and returns an HTML link to it |
482 | 482 | * @param array $params Scaler parameters |
483 | 483 | * @param int $width |
484 | 484 | * @param int $height |
— | — | @@ -491,7 +491,7 @@ |
492 | 492 | 'href' => $thumbnail->getUrl(), |
493 | 493 | 'class' => 'mw-thumbnail-link' |
494 | 494 | ), wfMessage( 'show-big-image-size' )->numParams( |
495 | | - $thumbnail->getWidth(), $thumbnail->getHeight() |
| 495 | + $thumbnail->getWidth(), $thumbnail->getHeight() |
496 | 496 | )->parse() ); |
497 | 497 | } else { |
498 | 498 | return ''; |
— | — | @@ -619,15 +619,15 @@ |
620 | 620 | array( 'page_namespace', 'page_title', 'page_is_redirect', 'il_to' ), |
621 | 621 | array( 'il_to' => $target, 'il_from = page_id' ), |
622 | 622 | __METHOD__, |
623 | | - array( 'LIMIT' => $limit + 1 ) |
624 | | - ); |
| 623 | + array( 'LIMIT' => $limit + 1, 'ORDER BY' => 'il_from', ) |
| 624 | + ); |
625 | 625 | } |
626 | | - |
| 626 | + |
627 | 627 | protected function imageLinks() { |
628 | 628 | global $wgUser, $wgOut, $wgLang; |
629 | 629 | |
630 | 630 | $limit = 100; |
631 | | - |
| 631 | + |
632 | 632 | $res = $this->queryImageLinks( $this->getTitle()->getDbKey(), $limit + 1); |
633 | 633 | $rows = array(); |
634 | 634 | $redirects = array(); |
— | — | @@ -638,10 +638,10 @@ |
639 | 639 | $rows[] = $row; |
640 | 640 | } |
641 | 641 | $count = count( $rows ); |
642 | | - |
| 642 | + |
643 | 643 | $hasMore = $count > $limit; |
644 | 644 | if ( !$hasMore && count( $redirects ) ) { |
645 | | - $res = $this->queryImageLinks( array_keys( $redirects ), |
| 645 | + $res = $this->queryImageLinks( array_keys( $redirects ), |
646 | 646 | $limit - count( $rows ) + 1 ); |
647 | 647 | foreach ( $res as $row ) { |
648 | 648 | $redirects[$row->il_to][] = $row; |
— | — | @@ -658,7 +658,7 @@ |
659 | 659 | ); |
660 | 660 | return; |
661 | 661 | } |
662 | | - |
| 662 | + |
663 | 663 | $wgOut->addHTML( "<div id='mw-imagepage-section-linkstoimage'>\n" ); |
664 | 664 | if ( !$hasMore ) { |
665 | 665 | $wgOut->addWikiMsg( 'linkstoimage', $count ); |
— | — | @@ -687,7 +687,7 @@ |
688 | 688 | if ( $currentCount > $limit ) { |
689 | 689 | break; |
690 | 690 | } |
691 | | - |
| 691 | + |
692 | 692 | $link = $sk->linkKnown( Title::makeTitle( $element->page_namespace, $element->page_title ) ); |
693 | 693 | if ( !isset( $redirects[$element->page_title] ) ) { |
694 | 694 | $liContents = $link; |
— | — | @@ -698,7 +698,7 @@ |
699 | 699 | if ( $currentCount > $limit ) { |
700 | 700 | break; |
701 | 701 | } |
702 | | - |
| 702 | + |
703 | 703 | $link2 = $sk->linkKnown( Title::makeTitle( $row->page_namespace, $row->page_title ) ); |
704 | 704 | $ul .= Html::rawElement( |
705 | 705 | 'li', |
— | — | @@ -707,7 +707,7 @@ |
708 | 708 | ) . "\n"; |
709 | 709 | } |
710 | 710 | $ul .= '</ul>'; |
711 | | - $liContents = wfMessage( 'linkstoimage-redirect' )->rawParams( |
| 711 | + $liContents = wfMessage( 'linkstoimage-redirect' )->rawParams( |
712 | 712 | $link, $ul )->parse(); |
713 | 713 | } |
714 | 714 | $wgOut->addHTML( Html::rawElement( |
— | — | @@ -830,7 +830,7 @@ |
831 | 831 | /** |
832 | 832 | * Callback for usort() to do link sorts by (namespace, title) |
833 | 833 | * Function copied from Title::compare() |
834 | | - * |
| 834 | + * |
835 | 835 | * @param $a object page to compare with |
836 | 836 | * @param $b object page to compare with |
837 | 837 | * @return Integer: result of string comparison, or namespace comparison |
— | — | @@ -1096,7 +1096,7 @@ |
1097 | 1097 | $wgLang->time( $timestamp, true ) ), |
1098 | 1098 | 'file-link' => true, |
1099 | 1099 | ); |
1100 | | - |
| 1100 | + |
1101 | 1101 | if ( !$thumbnail ) { |
1102 | 1102 | return wfMsgHtml( 'filehist-nothumb' ); |
1103 | 1103 | } |
— | — | @@ -1141,7 +1141,7 @@ |
1142 | 1142 | $this->mHist = array(); |
1143 | 1143 | $this->mRange = array( 0, 0 ); // display range |
1144 | 1144 | } |
1145 | | - |
| 1145 | + |
1146 | 1146 | function getTitle() { |
1147 | 1147 | return $this->mTitle; |
1148 | 1148 | } |
— | — | @@ -1157,7 +1157,7 @@ |
1158 | 1158 | function formatRow( $row ) { |
1159 | 1159 | return ''; |
1160 | 1160 | } |
1161 | | - |
| 1161 | + |
1162 | 1162 | function getBody() { |
1163 | 1163 | $s = ''; |
1164 | 1164 | $this->doQuery(); |
— | — | @@ -1260,7 +1260,7 @@ |
1261 | 1261 | } |
1262 | 1262 | $this->mQueryDone = true; |
1263 | 1263 | } |
1264 | | - |
| 1264 | + |
1265 | 1265 | protected function preventClickjacking( $enable = true ) { |
1266 | 1266 | $this->preventClickjacking = $enable; |
1267 | 1267 | } |