r70728 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70727‎ | r70728 | r70729 >
Date:00:21, 9 August 2010
Author:jeroendedauw
Status:ok
Tags:
Comment:
Made base extension types accessible for other code
Modified paths:
  • /trunk/phase3/includes/specials/SpecialVersion.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialVersion.php
@@ -198,6 +198,24 @@
199199 }
200200
201201 /**
 202+ * Returns an array with the base extension types.
 203+ * Type is stored as array key, the message as array value.
 204+ *
 205+ * @since 1.17
 206+ *
 207+ * @return array
 208+ */
 209+ public static function getBaseExtensionTypes() {
 210+ return array(
 211+ 'specialpage' => wfMsg( 'version-specialpages' ),
 212+ 'parserhook' => wfMsg( 'version-parserhooks' ),
 213+ 'variable' => wfMsg( 'version-variables' ),
 214+ 'media' => wfMsg( 'version-mediahandlers' ),
 215+ 'other' => wfMsg( 'version-other' ),
 216+ );
 217+ }
 218+
 219+ /**
202220 * Generate wikitext showing extensions name, URL, author and description.
203221 *
204222 * @return String: Wikitext
@@ -209,13 +227,7 @@
210228 return '';
211229 }
212230
213 - $extensionTypes = array(
214 - 'specialpage' => wfMsg( 'version-specialpages' ),
215 - 'parserhook' => wfMsg( 'version-parserhooks' ),
216 - 'variable' => wfMsg( 'version-variables' ),
217 - 'media' => wfMsg( 'version-mediahandlers' ),
218 - 'other' => wfMsg( 'version-other' ),
219 - );
 231+ $extensionTypes = self::getBaseExtensionTypes();
220232
221233 wfRunHooks( 'SpecialVersionExtensionTypes', array( &$this, &$extensionTypes ) );
222234

Status & tagging log