r38213 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38212‎ | r38213 | r38214 >
Date:03:07, 30 July 2008
Author:demon
Status:old
Tags:
Comment:
Bah! Partial revert of r38212. Unrelated file snuck into my commit window.
Modified paths:
  • /trunk/phase3/includes/ImageQueryPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ImageQueryPage.php
@@ -9,8 +9,6 @@
1010 */
1111 class ImageQueryPage extends QueryPage {
1212
13 - var $mIsGallery = true;
14 -
1513 /**
1614 * Format and output report results using the given information plus
1715 * OutputPage
@@ -24,36 +22,19 @@
2523 */
2624 protected function outputResults( $out, $skin, $dbr, $res, $num, $offset ) {
2725 if( $num > 0 ) {
28 - if ( $this->mIsGallery ) {
29 - $gallery = new ImageGallery();
30 - $gallery->useSkin( $skin );
31 -
32 - # $res might contain the whole 1,000 rows, so we read up to
33 - # $num [should update this to use a Pager]
34 - for( $i = 0; $i < $num && $row = $dbr->fetchObject( $res ); $i++ ) {
35 - $image = $this->prepareImage( $row );
36 - if( $image ) {
37 - $gallery->add( $image->getTitle(), $this->getCellHtml( $row ) );
38 - }
 26+ $gallery = new ImageGallery();
 27+ $gallery->useSkin( $skin );
 28+
 29+ # $res might contain the whole 1,000 rows, so we read up to
 30+ # $num [should update this to use a Pager]
 31+ for( $i = 0; $i < $num && $row = $dbr->fetchObject( $res ); $i++ ) {
 32+ $image = $this->prepareImage( $row );
 33+ if( $image ) {
 34+ $gallery->add( $image->getTitle(), $this->getCellHtml( $row ) );
3935 }
40 - $html = $gallery->toHtml();
4136 }
42 - else {
43 - global $wgUser, $wgLang;
44 - $sk = $wgUser->getSkin();
45 - $html = "<ol>\n";
46 - for( $i = 0; $i < $num && $row = $dbr->fetchObject( $res ); $i++ ) {
47 - $image = $this->prepareImage( $row );
48 - if( $image ) {
49 - $bytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'), $wgLang->formatNum( $image->getSize() ) );
50 - $html .= "<li>" . $sk->makeKnownLinkObj( $image->getTitle(), $image->getTitle()->getText() ) .
51 - " (" . $bytes . ")</li>\n";
52 - }
53 - }
54 - $html .= "</ol>\n";
55 - }
5637
57 - $out->addHtml( $html );
 38+ $out->addHtml( $gallery->toHtml() );
5839 }
5940 }
6041
@@ -70,7 +51,7 @@
7152 ? wfFindFile( $title )
7253 : null;
7354 }
74 -
 55+
7556 /**
7657 * Get additional HTML to be shown in a results' cell
7758 *
@@ -80,11 +61,5 @@
8162 protected function getCellHtml( $row ) {
8263 return '';
8364 }
84 -
85 - /**
86 - * Is this to be output as a gallery?
87 - */
88 - public function setGallery( $val ) {
89 - $this->mIsGallery = $val;
90 - }
 65+
9166 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r38212Remove unused $wgServer global.demon03:05, 30 July 2008

Status & tagging log