+ $sk = $wgUser->getSkin();
+ $includesRestrictedPages = false;
+
+ foreach ( $groups as $group => $sortedPages ) {
+ $middle = ceil( count( $sortedPages )/2 );
+ $total = count( $sortedPages );
+ $count = 0;
+
+ $wgOut->wrapWikiMsg( "<h4 class=\"mw-specialpagesgroup\" id=\"mw-specialpagesgroup-$group\">$1</h4>\n", "specialpages-group-$group" );
+ $wgOut->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"
+ );
+ foreach( $sortedPages as $desc => $specialpage ) {
+ list( $title, $restricted ) = $specialpage;
+ $link = $sk->linkKnown( $title , htmlspecialchars( $desc ) );
+ if( $restricted ) {
+ $includesRestrictedPages = true;
+ $wgOut->addHTML( Html::rawElement( 'li', array( 'class' => 'mw-specialpages-page mw-specialpagerestricted' ), Html::rawElement( 'strong', array(), $link ) ) . "\n" );
+ } else {
+ $wgOut->addHTML( Html::rawElement( 'li', array(), $link ) . "\n" );
+ }
+
+ # Split up the larger groups
+ $count++;
+ if( $total > 3 && $count == $middle ) {
+ $wgOut->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"
+ );
+ }