example of this.
* (bug 740) Messages from extensions now appear in Special:Allmessages
* (bug 2857) fixed parsing of lists in <pre> sections
-
+* Now sorting interwiki links by iw_prefix and avoiding duplicates
=== Caveats ===
}
$a = $wgOut->getLanguageLinks();
+ $a = $this->sortInterwikiLinks( $a );
if ( 0 == count( $a ) ) {
return '';
}
wfProfileOut( $fname );
return $bar;
}
+
+ function sortInterwikiLinks( $links ) {
+ $nlinks = $nnlinks = array();
+
+ foreach($links as $link) {
+ list($iso, $url) = explode( ':', $link, 2 );
+ $nlinks[$iso] = $url;
+ }
+
+ ksort( $nlinks );
+
+ foreach($nlinks as $k => $v) {
+ $nnlinks[] = implode( ':', array($k, $v) );
+ }
+
+ return $nnlinks;
+ }
}
}
$language_urls = array();
if ( !$wgHideInterlanguageLinks ) {
- foreach( $wgOut->getLanguageLinks() as $l ) {
+ $iwlinks = $wgOut->getLanguageLinks();
+ $iwlinks = $this->sortInterwikiLinks( $iwlinks );
+ foreach( $iwlinks as $l ) {
$nt = Title::newFromText( $l );
$language_urls[] = array('href' => $nt->getFullURL(),
'text' => ($wgContLang->getLanguageName( $nt->getInterwiki()) != ''?$wgContLang->getLanguageName( $nt->getInterwiki()) : $l),