$from = $wgRequest->getVal( 'from' );
$until = $wgRequest->getVal( 'until' );
- global $wgCategoryMagicGallery;
- $cmg = $wgCategoryMagicGallery;
- $wgCategoryMagicGallery = !$wgOut->mNoGallery;
$wgOut->addHTML( $this->doCategoryMagic( $from, $until ) );
- $wgCategoryMagicGallery = $cmg;
}
/**
* @private
*/
function doCategoryMagic( $from = '', $until = '' ) {
+ global $wgOut;
global $wgContLang,$wgUser, $wgCategoryMagicGallery, $wgCategoryPagingLimit;
$fname = 'CategoryPage::doCategoryMagic';
wfProfileIn( $fname );
$articles_start_char = array();
$children = array();
$children_start_char = array();
- if( $wgCategoryMagicGallery ) {
+
+ $showGallery = $wgCategoryMagicGallery && !$wgOut->mNoGallery;
+ if( $showGallery ) {
$ig = new ImageGallery();
}
$sortkey=$wgContLang->firstChar( $x->cl_sortkey );
}
array_push( $children_start_char, $wgContLang->convert( $sortkey ) ) ;
- } elseif( $wgCategoryMagicGallery && $title->getNamespace() == NS_IMAGE ) {
+ } elseif( $showGallery && $title->getNamespace() == NS_IMAGE ) {
// Show thumbnails of categorized images, in a separate chunk
if( $flip ) {
$ig->insert( Image::newFromTitle( $title ) );
$r .= wfMsgExt( 'categoryarticlecount', array( 'parse' ), count( $articles) );
$r .= $this->formatList( $articles, $articles_start_char );
- if( $wgCategoryMagicGallery && ! $ig->isEmpty() ) {
+ if( $showGallery && ! $ig->isEmpty() ) {
$r.= $ig->toHTML();
}