Made base extension types accessible for other code
authorJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Mon, 9 Aug 2010 00:21:09 +0000 (00:21 +0000)
committerJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Mon, 9 Aug 2010 00:21:09 +0000 (00:21 +0000)
includes/specials/SpecialVersion.php

index f718e10..0c2b469 100644 (file)
@@ -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 ) );