Cripple the wiki text stuff for now. It doesn't SEEM dangerous but I haven't tested...
[lhc/web/wiklou.git] / includes / CategoryPage.php
index 400b2d1..0c4b85c 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 if( !defined( 'MEDIAWIKI' ) )
-       die( -1 );
+       die( 1 );
 
 /**
  * @package MediaWiki
@@ -40,6 +40,7 @@ class CategoryPage extends Article {
                global $wgOut, $wgRequest;
                $from = $wgRequest->getVal( 'from' );
                $until = $wgRequest->getVal( 'until' );
+               
                $wgOut->addHTML( $this->doCategoryMagic( $from, $until ) );
        }
 
@@ -52,6 +53,7 @@ class CategoryPage extends Article {
         * @private
         */
        function doCategoryMagic( $from = '', $until = '' ) {
+               global $wgOut;
                global $wgContLang,$wgUser, $wgCategoryMagicGallery, $wgCategoryPagingLimit;
                $fname = 'CategoryPage::doCategoryMagic';
                wfProfileIn( $fname );
@@ -60,7 +62,9 @@ class CategoryPage extends Article {
                $articles_start_char = array();
                $children = array();
                $children_start_char = array();
-               if( $wgCategoryMagicGallery ) {
+               
+               $showGallery = $wgCategoryMagicGallery && !$wgOut->mNoGallery;
+               if( $showGallery ) {
                        $ig = new ImageGallery();
                }
 
@@ -117,7 +121,7 @@ class CategoryPage extends Article {
                                        $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 ) );
@@ -159,7 +163,7 @@ class CategoryPage extends Article {
                $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();
                }