show the version information of GeSHi currently using, only show the version when Special:Version is loaded using the SpecialVersionExtensionTypes hook.

Link to r52546, r52550 and r52555 as there have some comments on CodeReview.
This commit is contained in:
Shinjiman 2009-07-01 19:34:01 +00:00
parent bb149b0887
commit e63f55da7d
2 changed files with 11 additions and 0 deletions

View file

@ -311,4 +311,14 @@ class SyntaxHighlight_GeSHi {
}
return true;
}
/**
* Get the GeSHI's version information while Special:Version is read
*/
public static function hSpecialVersion_GeSHi( &$sp, &$extensionTypes ) {
global $wgExtensionCredits;
require_once( 'geshi/geshi.php' );
$wgExtensionCredits['parserhook']['SyntaxHighlight_GeSHi']['version'] = GESHI_VERSION;
return true;
}
}

View file

@ -55,6 +55,7 @@ $dir = dirname(__FILE__) . '/';
$wgExtensionMessagesFiles['SyntaxHighlight_GeSHi'] = $dir . 'SyntaxHighlight_GeSHi.i18n.php';
$wgAutoloadClasses['SyntaxHighlight_GeSHi'] = $dir . 'SyntaxHighlight_GeSHi.class.php';
$wgHooks['ShowRawCssJs'][] = 'SyntaxHighlight_GeSHi::viewHook';
$wgHooks['SpecialVersionExtensionTypes'][] = 'SyntaxHighlight_GeSHi::hSpecialVersion_GeSHi';
if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
$wgHooks['ParserFirstCallInit'][] = 'efSyntaxHighlight_GeSHiSetup';
} else {