* (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.

This commit is contained in:
Brion Vibber 2011-02-05 00:58:07 +00:00
parent 56a62b9c7b
commit fbbdd9edd9

View file

@ -445,7 +445,7 @@ class SpecialVersion extends SpecialPage {
$author = isset ( $extension['author'] ) ? $extension['author'] : array();
$extDescAuthor = "<td>$description</td>
<td>" . $this->listToText( (array)$author, false ) . "</td>
<td>" . $this->listAuthors( $author, false ) . "</td>
</tr>\n";
return $extNameVer . $extDescAuthor;
@ -512,6 +512,24 @@ class SpecialVersion extends SpecialPage {
"<span style='display:none'>visited from $ip</span>";
}
/**
* 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.
*