From: Chad Horohoe Date: Wed, 30 Jul 2008 03:07:54 +0000 (+0000) Subject: Bah! Partial revert of r38212. Unrelated file snuck into my commit window. X-Git-Tag: 1.31.0-rc.0~46290 X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=commitdiff_plain;h=8cb8523fd232a8b506c62129779b28be88ae29cb;p=lhc%2Fweb%2Fwiklou.git Bah! Partial revert of r38212. Unrelated file snuck into my commit window. --- diff --git a/includes/ImageQueryPage.php b/includes/ImageQueryPage.php index 1685795979..da9b6fd6f5 100644 --- a/includes/ImageQueryPage.php +++ b/includes/ImageQueryPage.php @@ -9,8 +9,6 @@ */ class ImageQueryPage extends QueryPage { - var $mIsGallery = true; - /** * Format and output report results using the given information plus * OutputPage @@ -24,36 +22,19 @@ class ImageQueryPage extends QueryPage { */ protected function outputResults( $out, $skin, $dbr, $res, $num, $offset ) { if( $num > 0 ) { - if ( $this->mIsGallery ) { - $gallery = new ImageGallery(); - $gallery->useSkin( $skin ); - - # $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++ ) { - $image = $this->prepareImage( $row ); - if( $image ) { - $gallery->add( $image->getTitle(), $this->getCellHtml( $row ) ); - } - } - $html = $gallery->toHtml(); - } - else { - global $wgUser, $wgLang; - $sk = $wgUser->getSkin(); - $html = "
    \n"; - for( $i = 0; $i < $num && $row = $dbr->fetchObject( $res ); $i++ ) { - $image = $this->prepareImage( $row ); - if( $image ) { - $bytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'), $wgLang->formatNum( $image->getSize() ) ); - $html .= "
  1. " . $sk->makeKnownLinkObj( $image->getTitle(), $image->getTitle()->getText() ) . - " (" . $bytes . ")
  2. \n"; - } + $gallery = new ImageGallery(); + $gallery->useSkin( $skin ); + + # $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++ ) { + $image = $this->prepareImage( $row ); + if( $image ) { + $gallery->add( $image->getTitle(), $this->getCellHtml( $row ) ); } - $html .= "
\n"; } - $out->addHtml( $html ); + $out->addHtml( $gallery->toHtml() ); } } @@ -70,7 +51,7 @@ class ImageQueryPage extends QueryPage { ? wfFindFile( $title ) : null; } - + /** * Get additional HTML to be shown in a results' cell * @@ -80,11 +61,5 @@ class ImageQueryPage extends QueryPage { protected function getCellHtml( $row ) { return ''; } - - /** - * Is this to be output as a gallery? - */ - public function setGallery( $val ) { - $this->mIsGallery = $val; - } + }