- $wgOut->addHTML( '<h2>' . wfMsgHtml( $heading ) . "</h2>\n<ul>" );
- foreach ( $sortedPages as $desc => $title ) {
- $link = $sk->makeKnownLinkObj( $title, $desc );
- $wgOut->addHTML( "<li>{$link}</li>\n" );
+ foreach ( $groups as $group => $sortedPages ) {
+ $middle = ceil( count($sortedPages)/2 );
+ $total = count($sortedPages);
+ $count = 0;
+
+ $wgOut->addHTML( "<h4 class='mw-specialpagesgroup'>".wfMsgHtml("specialpages-group-$group")."</h4>\n" );
+ $wgOut->addHTML( "<table style='width: 100%;' class='mw-specialpages-table'><tr>" );
+ $wgOut->addHTML( "<td width='30%' valign='top'><ul>\n" );
+ foreach( $sortedPages as $desc => $specialpage ) {
+ list( $title, $restricted ) = $specialpage;
+ $link = $sk->makeKnownLinkObj( $title , htmlspecialchars( $desc ) );
+ if( $restricted ) {
+ $wgOut->addHTML( "<li class='mw-specialpages-page mw-specialpagerestricted'>{$link}</li>\n" );
+ } else {
+ $wgOut->addHTML( "<li>{$link}</li>\n" );
+ }
+
+ # Split up the larger groups
+ $count++;
+ if( $total > 3 && $count == $middle ) {
+ $wgOut->addHTML( "</ul></td><td width='10%'></td><td width='30%' valign='top'><ul>" );
+ }
+ }
+ $wgOut->addHTML( "</ul></td><td width='30%' valign='top'></td></tr></table>\n" );