Add failing test for bug 14404.
[lhc/web/wiklou.git] / includes / CategoryPage.php
index 42e6ff4..05bc6f3 100644 (file)
@@ -23,11 +23,13 @@ class CategoryPage extends Article {
                $diff = $wgRequest->getVal( 'diff' );
                $diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) );
 
-               if ( isset( $diff ) && $diffOnly )
+               if ( isset( $diff ) && $diffOnly ) {
                        return parent::view();
+               }
 
-               if ( !wfRunHooks( 'CategoryPageView', array( &$this ) ) )
+               if ( !wfRunHooks( 'CategoryPageView', array( &$this ) ) ) {
                        return;
+               }
 
                if ( NS_CATEGORY == $this->mTitle->getNamespace() ) {
                        $this->openShowCategory();
@@ -99,9 +101,8 @@ class CategoryViewer {
         * Format the category data list.
         *
         * @return string HTML output
-        * @private
         */
-       function getHTML() {
+       public function getHTML() {
                global $wgOut, $wgCategoryMagicGallery, $wgContLang;
                wfProfileIn( __METHOD__ );
 
@@ -161,9 +162,10 @@ class CategoryViewer {
         */
        function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) {
                // Subcategory; strip the 'Category' namespace from the link text.
+               $title = $cat->getTitle();
                $this->children[] = $this->getSkin()->link(
-                       $cat->getTitle(),
-                       null,
+                       $title,
+                       $title->getText(),
                        array(),
                        array(),
                        array( 'known', 'noclasses' )
@@ -420,10 +422,10 @@ class CategoryViewer {
         */
        function formatList( $articles, $articles_start_char, $cutoff = 6 ) {
                if ( count ( $articles ) > $cutoff ) {
-                       return $this->columnList( $articles, $articles_start_char );
+                       return self::columnList( $articles, $articles_start_char );
                } elseif ( count( $articles ) > 0 ) {
                        // for short lists of articles in categories.
-                       return $this->shortList( $articles, $articles_start_char );
+                       return self::shortList( $articles, $articles_start_char );
                }
                return '';
        }