From 8be2cf67a83c09e3e234423e1494db3a4e54a159 Mon Sep 17 00:00:00 2001 From: Jeroen De Dauw Date: Mon, 9 Aug 2010 00:21:09 +0000 Subject: [PATCH] Made base extension types accessible for other code --- includes/specials/SpecialVersion.php | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index f718e103f5..0c2b469c99 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -197,6 +197,24 @@ class SpecialVersion extends SpecialPage { return $version; } + /** + * Returns an array with the base extension types. + * Type is stored as array key, the message as array value. + * + * @since 1.17 + * + * @return array + */ + public static function getBaseExtensionTypes() { + return array( + 'specialpage' => wfMsg( 'version-specialpages' ), + 'parserhook' => wfMsg( 'version-parserhooks' ), + 'variable' => wfMsg( 'version-variables' ), + 'media' => wfMsg( 'version-mediahandlers' ), + 'other' => wfMsg( 'version-other' ), + ); + } + /** * Generate wikitext showing extensions name, URL, author and description. * @@ -209,13 +227,7 @@ class SpecialVersion extends SpecialPage { return ''; } - $extensionTypes = array( - 'specialpage' => wfMsg( 'version-specialpages' ), - 'parserhook' => wfMsg( 'version-parserhooks' ), - 'variable' => wfMsg( 'version-variables' ), - 'media' => wfMsg( 'version-mediahandlers' ), - 'other' => wfMsg( 'version-other' ), - ); + $extensionTypes = self::getBaseExtensionTypes(); wfRunHooks( 'SpecialVersionExtensionTypes', array( &$this, &$extensionTypes ) ); -- 2.20.1