$wgSkinExtensionFunctions = array();
$wgExtensionFunctions = array();
/**
- * An array of extension names, their authors, and optionally, urls
- * add to it from an extension like:
+ * An array of extension types and inside that their names, versions, authors
+ * and urls, note that the version and url key can be omitted.
*
* <code>
* $wgExtensionCredits[$type][] = array(
* 'name' => 'Example extension',
+ * 'version' => 1.9,
* 'author' => 'Foo Barstein',
* 'url' => 'http://wwww.example.com/Example%20Extension/',
* );
* </code>
+ *
* Where $type is 'specialpage', 'parserhook', or 'other'.
*/
$wgExtensionCredits = array();
if ( count( @$wgExtensionCredits[$type] ) > 0 ) {
$out .= "=== $text ===\n";
foreach ( $wgExtensionCredits[$type] as $extension ) {
- if ( isset( $extension['url'] ) ) {
- $out .= '* [' . $extension['url'] . ' ' . $extension['name'] . ']';
- } else {
- $out .= '* ' . $extension['name'];
- }
- $out .= ' by ' . $extension['author'] . "\n";
-
+ $out .= formatExtensionCredits( $extension['name'], $extension['author'], @$extension['url'], @$extension['version'] );
}
}
}
$wgOut->addWikiText( $out );
}
+
+function formatExtensionCredits( $name, $author, $url = null, $version = null ) {
+ $ret = '* ';
+ if ( isset( $url ) )
+ $ret .= "[$url ";
+ $ret .= $name;
+ if ( isset( $url ) )
+ $ret .= ']';
+ if ( isset( $version ) )
+ $ret .= " $version";
+ $ret .= " by $author";
+ return $ret;
+}
?>