From: Brion Vibber Date: Sat, 5 Feb 2011 00:58:07 +0000 (+0000) Subject: * (bug 27083) Extension info for Special:Version can include '...' as a special value... X-Git-Tag: 1.31.0-rc.0~32193 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=fbbdd9edd920477fc710cc0fd4ccdb1acb1fd30e;p=lhc%2Fweb%2Fwiklou.git * (bug 27083) Extension info for Special:Version can include '...' as a special value which is turned into the localized 'others' used for Special:Version author lists. --- diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 3118f65cb6..cf7816198a 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -445,7 +445,7 @@ class SpecialVersion extends SpecialPage { $author = isset ( $extension['author'] ) ? $extension['author'] : array(); $extDescAuthor = "$description - " . $this->listToText( (array)$author, false ) . " + " . $this->listAuthors( $author, false ) . " \n"; return $extNameVer . $extDescAuthor; @@ -512,6 +512,24 @@ class SpecialVersion extends SpecialPage { "visited from $ip"; } + /** + * Return a formatted unsorted list of authors + * + * @param $authors mixed: string or array of strings + * @return String: HTML fragment + */ + function listAuthors( $authors ) { + $list = array(); + foreach( (array)$authors as $item ) { + if( $item == '...' ) { + $list[] = wfMsg( 'version-poweredby-others' ); + } else { + $list[] = $item; + } + } + return $this->listToText( $list, false ); + } + /** * Convert an array of items into a list for display. *