Bug 33514 - Make category "columns" (table cells) equal width
[lhc/web/wiklou.git] / includes / CategoryViewer.php
index c64bb73..4d3532c 100644 (file)
@@ -108,7 +108,7 @@ class CategoryViewer extends ContextSource {
                        $r = wfMsgExt( 'category-empty', array( 'parse' ) );
                }
 
-               $lang = $this->getLang();
+               $lang = $this->getLanguage();
                $langAttribs = array( 'lang' => $lang->getCode(), 'dir' => $lang->getDir() );
                # put a div around the headings which are in the user language
                $r = Html::openElement( 'div', $langAttribs ) . $r . '</div>';
@@ -159,6 +159,7 @@ class CategoryViewer extends ContextSource {
         * @deprecated since 1.17 kept for compatibility, please use addSubcategoryObject instead
         */
        function addSubcategory( Title $title, $sortkey, $pageLength ) {
+               wfDeprecated( __METHOD__, '1.17' );
                $this->addSubcategoryObject( Category::newFromTitle( $title ), $sortkey, $pageLength );
        }
 
@@ -485,10 +486,11 @@ class CategoryViewer extends ContextSource {
                # Split into three columns
                $columns = array_chunk( $columns, ceil( count( $columns ) / 3 ), true /* preserve keys */ );
 
-               $ret = '<table width="100%"><tr valign="top"><td>';
+               $ret = '<table width="100%"><tr valign="top">';
                $prevchar = null;
 
                foreach ( $columns as $column ) {
+                       $ret .= '<td width="33.3%">';
                        $colContents = array();
 
                        # Kind of like array_flip() here, but we keep duplicates in an
@@ -518,10 +520,10 @@ class CategoryViewer extends ContextSource {
                                $prevchar = $char;
                        }
 
-                       $ret .= "</td>\n<td>";
+                       $ret .= "</td>\n";
                }
 
-               $ret .= '</td></tr></table>';
+               $ret .= '</tr></table>';
                return $ret;
        }