Remove SpecialSearchNoResults and call SpecialSearchResults always
[lhc/web/wiklou.git] / includes / CategoryViewer.php
index 22eb3d1..60694c9 100644 (file)
@@ -87,12 +87,11 @@ class CategoryViewer extends ContextSource {
        function __construct( $title, IContextSource $context, $from = array(),
                $until = array(), $query = array()
        ) {
-               global $wgCategoryPagingLimit;
                $this->title = $title;
                $this->setContext( $context );
                $this->from = $from;
                $this->until = $until;
-               $this->limit = $wgCategoryPagingLimit;
+               $this->limit = $context->getConfig()->get( 'CategoryPagingLimit' );
                $this->cat = Category::newFromTitle( $title );
                $this->query = $query;
                $this->collation = Collation::singleton();
@@ -105,10 +104,10 @@ class CategoryViewer extends ContextSource {
         * @return string HTML output
         */
        public function getHTML() {
-               global $wgCategoryMagicGallery;
                wfProfileIn( __METHOD__ );
 
-               $this->showGallery = $wgCategoryMagicGallery && !$this->getOutput()->mNoGallery;
+               $this->showGallery = $this->getConfig()->get( 'CategoryMagicGallery' )
+                       && !$this->getOutput()->mNoGallery;
 
                $this->clearCategoryState();
                $this->doCategoryQuery();
@@ -154,14 +153,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();