mw.widgets.TitleOptionWidget: Prevent page navigation by clicking labels
[lhc/web/wiklou.git] / includes / api / ApiModuleManager.php
index f7d0ccf..ba6c144 100644 (file)
@@ -196,7 +196,9 @@ class ApiModuleManager extends ContextSource {
                        $instance = call_user_func( $factory, $this->mParent, $name );
 
                        if ( !$instance instanceof $class ) {
-                               throw new MWException( "The factory function for module $name did not return an instance of $class!" );
+                               throw new MWException(
+                                       "The factory function for module $name did not return an instance of $class!"
+                               );
                        }
                } else {
                        // create instance from class name
@@ -241,6 +243,21 @@ class ApiModuleManager extends ContextSource {
                return $result;
        }
 
+       /**
+        * Returns the class name of the given module
+        *
+        * @param string $module Module name
+        * @return string|bool class name or false if the module does not exist
+        * @since 1.24
+        */
+       public function getClassName( $module ) {
+               if ( isset( $this->mModules[$module] ) ) {
+                       return $this->mModules[$module][1];
+               }
+
+               return false;
+       }
+
        /**
         * Returns true if the specific module is defined at all or in a specific group.
         * @param string $moduleName Module name