Fixed spacing in specials folder
[lhc/web/wiklou.git] / includes / specials / SpecialSpecialpages.php
index 1e7c8bb..47c89d0 100644 (file)
@@ -53,17 +53,18 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
 
                $pages = SpecialPageFactory::getUsablePages( $this->getUser() );
 
-               if( !count( $pages ) ) {
+               if ( !count( $pages ) ) {
                        # Yeah, that was pointless. Thanks for coming.
                        return false;
                }
 
                /** Put them into a sortable array */
                $groups = array();
+               /** @var SpecialPage $page */
                foreach ( $pages as $page ) {
                        if ( $page->isListed() ) {
-                               $group = SpecialPageFactory::getGroup( $page );
-                               if( !isset( $groups[$group] ) ) {
+                               $group = $page->getFinalGroupName();
+                               if ( !isset( $groups[$group] ) ) {
                                        $groups[$group] = array();
                                }
                                $groups[$group][$page->getDescription()] = array(
@@ -76,13 +77,13 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
 
                /** Sort */
                if ( $wgSortSpecialPages ) {
-                       foreach( $groups as $group => $sortedPages ) {
+                       foreach ( $groups as $group => $sortedPages ) {
                                ksort( $groups[$group] );
                        }
                }
 
                /** Always move "other" to end */
-               if( array_key_exists( 'other', $groups ) ) {
+               if ( array_key_exists( 'other', $groups ) ) {
                        $other = $groups['other'];
                        unset( $groups['other'] );
                        $groups['other'] = $other;
@@ -104,12 +105,12 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
 
                        $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( '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"
                        );
-                       foreach( $sortedPages as $desc => $specialpage ) {
+                       foreach ( $sortedPages as $desc => $specialpage ) {
                                list( $title, $restricted, $cached ) = $specialpage;
 
                                $pageClasses = array();
@@ -117,17 +118,17 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
                                        $includesCachedPages = true;
                                        $pageClasses[] = 'mw-specialpagecached';
                                }
-                               if( $restricted ) {
+                               if ( $restricted ) {
                                        $includesRestrictedPages = true;
                                        $pageClasses[] = 'mw-specialpagerestricted';
                                }
 
-                               $link = Linker::linkKnown( $title , htmlspecialchars( $desc ) );
+                               $link = Linker::linkKnown( $title, htmlspecialchars( $desc ) );
                                $out->addHTML( Html::rawElement( 'li', array( 'class' => implode( ' ', $pageClasses ) ), $link ) . "\n" );
 
                                # Split up the larger groups
                                $count++;
-                               if( $total > 3 && $count == $middle ) {
+                               if ( $total > 3 && $count == $middle ) {
                                        $out->addHTML(
                                                Html::closeElement( 'ul' ) . Html::closeElement( 'td' ) .
                                                Html::element( 'td', array( 'style' => 'width:10%' ), '' ) .