Index: trunk/phase3/includes/ImageQueryPage.php |
— | — | @@ -9,8 +9,6 @@ |
10 | 10 | */ |
11 | 11 | class ImageQueryPage extends QueryPage { |
12 | 12 | |
13 | | - var $mIsGallery = true; |
14 | | - |
15 | 13 | /** |
16 | 14 | * Format and output report results using the given information plus |
17 | 15 | * OutputPage |
— | — | @@ -24,36 +22,19 @@ |
25 | 23 | */ |
26 | 24 | protected function outputResults( $out, $skin, $dbr, $res, $num, $offset ) { |
27 | 25 | 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 ) ); |
39 | 35 | } |
40 | | - $html = $gallery->toHtml(); |
41 | 36 | } |
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 | | - } |
56 | 37 | |
57 | | - $out->addHtml( $html ); |
| 38 | + $out->addHtml( $gallery->toHtml() ); |
58 | 39 | } |
59 | 40 | } |
60 | 41 | |
— | — | @@ -70,7 +51,7 @@ |
71 | 52 | ? wfFindFile( $title ) |
72 | 53 | : null; |
73 | 54 | } |
74 | | - |
| 55 | + |
75 | 56 | /** |
76 | 57 | * Get additional HTML to be shown in a results' cell |
77 | 58 | * |
— | — | @@ -80,11 +61,5 @@ |
81 | 62 | protected function getCellHtml( $row ) { |
82 | 63 | return ''; |
83 | 64 | } |
84 | | - |
85 | | - /** |
86 | | - * Is this to be output as a gallery? |
87 | | - */ |
88 | | - public function setGallery( $val ) { |
89 | | - $this->mIsGallery = $val; |
90 | | - } |
| 65 | + |
91 | 66 | } |