Merge "mediawiki.ui: checkbox: Fix gap between bevel and border"
[lhc/web/wiklou.git] / includes / CategoryViewer.php
index ec8efae..f68da95 100644 (file)
@@ -25,10 +25,10 @@ class CategoryViewer extends ContextSource {
        public $limit;
 
        /** @var array */
-       protected $from;
+       public $from;
 
        /** @var array */
-       protected $until;
+       public $until;
 
        /** @var string[] */
        public $articles;
@@ -37,37 +37,37 @@ class CategoryViewer extends ContextSource {
        public $articles_start_char;
 
        /** @var array */
-       protected $children;
+       public $children;
 
        /** @var array */
-       protected $children_start_char;
+       public $children_start_char;
 
        /** @var bool */
-       protected $showGallery;
+       public $showGallery;
 
        /** @var array */
-       protected $imgsNoGallery_start_char;
+       public $imgsNoGallery_start_char;
 
        /** @var array */
-       protected $imgsNoGallery;
+       public $imgsNoGallery;
 
        /** @var array */
-       protected $nextPage;
+       public $nextPage;
 
        /** @var array */
        protected $prevPage;
 
        /** @var array */
-       protected $flip;
+       public $flip;
 
        /** @var Title */
-       protected $title;
+       public $title;
 
        /** @var Collation */
-       protected $collation;
+       public $collation;
 
        /** @var ImageGallery */
-       protected $gallery;
+       public $gallery;
 
        /** @var Category Category object for this page. */
        private $cat;
@@ -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();
@@ -137,7 +136,7 @@ class CategoryViewer extends ContextSource {
                }
 
                $lang = $this->getLanguage();
-               $langAttribs = array( 'lang' => $lang->getCode(), 'dir' => $lang->getDir() );
+               $langAttribs = array( 'lang' => $lang->getHtmlCode(), 'dir' => $lang->getDir() );
                # put a div around the headings which are in the user language
                $r = Html::openElement( 'div', $langAttribs ) . $r . '</div>';
 
@@ -516,7 +515,7 @@ class CategoryViewer extends ContextSource {
                }
 
                $pageLang = $this->title->getPageLanguage();
-               $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
+               $attribs = array( 'lang' => $pageLang->getHtmlCode(), 'dir' => $pageLang->getDir(),
                        'class' => 'mw-content-' . $pageLang->getDir() );
                $list = Html::rawElement( 'div', $attribs, $list );