* @param $sk skin object ???
*/
function wfSpecialSpecialpages_gen($pages,$heading,$sk) {
- global $wgLang, $wgOut;
+ global $wgLang, $wgOut, $wgSortSpecialPages;
+ if( count( $pages ) == 0 ) {
+ # Yeah, that was pointless. Thanks for coming.
+ return;
+ }
+
/** Put them into a sortable array */
$sortedPages = array();
foreach ( $pages as $name => $page ) {
}
/** Sort */
- ksort( $sortedPages );
+ if ( $wgSortSpecialPages ) {
+ ksort( $sortedPages );
+ }
/** Now output the HTML */
$wgOut->addHTML( '<h2>' . wfMsg( $heading ) . "</h2>\n<ul>" );