Use CSS columns instead of tables in Special:SpecialPages
[lhc/web/wiklou.git] / includes / specials / SpecialSpecialpages.php
index 3ba50bb..c3234e1 100644 (file)
@@ -45,12 +45,11 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
                        return;
                }
 
+               $out->addHelpLink( 'Help:Special pages' );
                $this->outputPageList( $groups );
        }
 
        private function getPageGroups() {
-               global $wgSortSpecialPages;
-
                $pages = SpecialPageFactory::getUsablePages( $this->getUser() );
 
                if ( !count( $pages ) ) {
@@ -76,10 +75,8 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
                }
 
                /** Sort */
-               if ( $wgSortSpecialPages ) {
-                       foreach ( $groups as $group => $sortedPages ) {
-                               ksort( $groups[$group] );
-                       }
+               foreach ( $groups as $group => $sortedPages ) {
+                       ksort( $groups[$group] );
                }
 
                /** Always move "other" to end */
@@ -99,22 +96,14 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
                $includesCachedPages = false;
 
                foreach ( $groups as $group => $sortedPages ) {
-                       $total = count( $sortedPages );
-                       $middle = ceil( $total / 2 );
-                       $count = 0;
 
                        $out->wrapWikiMsg(
                                "<h2 class=\"mw-specialpagesgroup\" id=\"mw-specialpagesgroup-$group\">$1</h2>\n",
                                "specialpages-group-$group"
                        );
                        $out->addHTML(
-                               Html::openElement(
-                                       'table',
-                                       array( 'style' => 'width:100%;', 'class' => 'mw-specialpages-table' )
-                               ) . "\n" .
-                               Html::openElement( 'tr' ) . "\n" .
-                               Html::openElement( 'td', array( 'style' => 'width:30%;vertical-align:top' ) ) . "\n" .
-                               Html::openElement( 'ul' ) . "\n"
+                               Html::openElement( 'div', array( 'class' => 'mw-specialpages-list' ) )
+                               . '<ul>'
                        );
                        foreach ( $sortedPages as $desc => $specialpage ) {
                                list( $title, $restricted, $cached ) = $specialpage;
@@ -135,21 +124,10 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
                                                array( 'class' => implode( ' ', $pageClasses ) ),
                                                $link
                                        ) . "\n" );
-
-                               # Split up the larger groups
-                               $count++;
-                               if ( $total > 3 && $count == $middle ) {
-                                       $out->addHTML(
-                                               Html::closeElement( 'ul' ) . Html::closeElement( 'td' ) .
-                                               Html::element( 'td', array( 'style' => 'width:10%' ), '' ) .
-                                               Html::openElement( 'td', array( 'style' => 'width:30%' ) ) . Html::openElement( 'ul' ) . "\n"
-                                       );
-                               }
                        }
                        $out->addHTML(
-                               Html::closeElement( 'ul' ) . Html::closeElement( 'td' ) .
-                               Html::element( 'td', array( 'style' => 'width:30%' ), '' ) .
-                               Html::closeElement( 'tr' ) . Html::closeElement( 'table' ) . "\n"
+                               Html::closeElement( 'ul' ) .
+                               Html::closeElement( 'div' )
                        );
                }