From: Jeroen De Dauw Date: Mon, 2 Aug 2010 04:41:44 +0000 (+0000) Subject: Follow up to r70313 X-Git-Tag: 1.31.0-rc.0~35789 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=1d84f311866d463b9ec94ccdeb2f5a2e6c100fe8;p=lhc%2Fweb%2Fwiklou.git Follow up to r70313 --- diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 266ced56e0..3959f68189 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -56,7 +56,7 @@ class SpecialVersion extends SpecialPage { $text = $this->getMediaWikiCredits() . $this->softwareInformation() . - $this->extensionCredits(); + $this->getExtensionCredits(); if ( $wgSpecialVersionShowHooks ) { $text .= $this->getWgHooks(); } @@ -204,11 +204,12 @@ class SpecialVersion extends SpecialPage { * * @return String: Wikitext */ - function extensionCredits() { + function getExtensionCredits() { global $wgExtensionCredits, $wgExtensionFunctions, $wgParser, $wgSkinExtensionFunctions; - if ( ! count( $wgExtensionCredits ) && ! count( $wgExtensionFunctions ) && ! count( $wgSkinExtensionFunctions ) ) + if ( !count( $wgExtensionCredits ) && !count( $wgExtensionFunctions ) && !count( $wgSkinExtensionFunctions ) ) { return ''; + } $extensionTypes = array( 'specialpage' => wfMsg( 'version-specialpages' ), @@ -217,6 +218,7 @@ class SpecialVersion extends SpecialPage { 'media' => wfMsg( 'version-mediahandlers' ), 'other' => wfMsg( 'version-other' ), ); + wfRunHooks( 'SpecialVersionExtensionTypes', array( &$this, &$extensionTypes ) ); $out = Xml::element( 'h2', array( 'id' => 'mw-version-ext' ), wfMsg( 'version-extensions' ) ) . @@ -229,7 +231,7 @@ class SpecialVersion extends SpecialPage { usort( $wgExtensionCredits[$type], array( $this, 'compare' ) ); foreach ( $wgExtensionCredits[$type] as $extension ) { - $out .= $this->formatCredits( $extension ); + $out .= $this->getCreditsForExtension( $extension ); } } } @@ -275,7 +277,14 @@ class SpecialVersion extends SpecialPage { } } - function formatCredits( $extension ) { + /** + * Creates and formats the creidts for a single extension and returns this. + * + * @param $extension String + * + * @return string + */ + function getCreditsForExtension( $extension ) { $name = isset( $extension['name'] ) ? $extension['name'] : '[no name]'; if ( isset( $extension['path'] ) ) {