X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FImageQueryPage.php;h=75f7ba640b5002d74397d34c03723e1d9ad31a18;hb=8f04fa304ae68431a9fc1eb16f06995ad6affa00;hp=b9ec6e027aa4db65c7ff4c92b7b3b13a6438e2ef;hpb=cbec306bba11d8d62e873586d78b9e384f95ec82;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ImageQueryPage.php b/includes/ImageQueryPage.php index b9ec6e027a..75f7ba640b 100644 --- a/includes/ImageQueryPage.php +++ b/includes/ImageQueryPage.php @@ -41,12 +41,13 @@ abstract class ImageQueryPage extends QueryPage { * @param int $offset Paging offset */ protected function outputResults( $out, $skin, $dbr, $res, $num, $offset ) { - if( $num > 0 ) { - $gallery = new ImageGallery(); + if ( $num > 0 ) { + $gallery = ImageGalleryBase::factory(); + $gallery->setContext( $this->getContext() ); # $res might contain the whole 1,000 rows, so we read up to # $num [should update this to use a Pager] - for( $i = 0; $i < $num && $row = $dbr->fetchObject( $res ); $i++ ) { + for ( $i = 0; $i < $num && $row = $dbr->fetchObject( $res ); $i++ ) { $namespace = isset( $row->namespace ) ? $row->namespace : NS_FILE; $title = Title::makeTitleSafe( $namespace, $row->title ); if ( $title instanceof Title && $title->getNamespace() == NS_FILE ) {