includes/htmlform/: Use Config instead of globals
[lhc/web/wiklou.git] / includes / CategoryViewer.php
index 1c7e604..ec8efae 100644 (file)
@@ -154,14 +154,13 @@ class CategoryViewer extends ContextSource {
                        // Note that null for mode is taken to mean use default.
                        $mode = $this->getRequest()->getVal( 'gallerymode', null );
                        try {
-                               $this->gallery = ImageGalleryBase::factory( $mode );
+                               $this->gallery = ImageGalleryBase::factory( $mode, $this->getContext() );
                        } catch ( MWException $e ) {
                                // User specified something invalid, fallback to default.
-                               $this->gallery = ImageGalleryBase::factory();
+                               $this->gallery = ImageGalleryBase::factory( false, $this->getContext() );
                        }
 
                        $this->gallery->setHideBadImages();
-                       $this->gallery->setContext( $this->getContext() );
                } else {
                        $this->imgsNoGallery = array();
                        $this->imgsNoGallery_start_char = array();
@@ -730,7 +729,7 @@ class CategoryViewer extends ContextSource {
                        // quick due to the small number of entries.
                        $totalcnt = $rescnt;
                        $category = $this->cat;
-                       wfGetDB( DB_MASTER )->onTransactionIdle( function() use ( $category ) {
+                       wfGetDB( DB_MASTER )->onTransactionIdle( function () use ( $category ) {
                                $category->refreshCounts();
                        } );
                } else {