public static function get_plugin_list_with_class($plugintype, $class, $file = null) {
        global $CFG; // Necessary in case it is referenced by included PHP scripts.

        if ($class) {
            $suffix = '_' . $class;
        } else {
            $suffix = '';
        }

        $pluginclasses = array();
        $plugins = self::get_plugin_list($plugintype);
        foreach ($plugins as $plugin => $fulldir) {
            // Try class in frankenstyle namespace.
            if ($class) {
                $classname = '\\' . $plugintype . '_' . $plugin . '\\' . $class;
                if (class_exists($classname, true)) {
                    $pluginclasses[$plugintype . '_' . $plugin] = $classname;
                    continue;
                }
            }

            // Try autoloading of class with frankenstyle prefix.
            $classname = $plugintype . '_' . $plugin . $suffix;
            if (class_exists($classname, true)) {
                $pluginclasses[$plugintype . '_' . $plugin] = $classname;
                continue;
            }

            // Fall back to old file location and class name.
            if ($file and file_exists("$fulldir/$file")) {
                include_once("$fulldir/$file");
                if (class_exists($classname, false)) {
                    $pluginclasses[$plugintype . '_' . $plugin] = $classname;
                    continue;
                }
            }
        }

        return $pluginclasses;
    }
public static function get_plugin_list_with_class($plugintype, $class, $file = null) {
        global $CFG; // Necessary in case it is referenced by included PHP scripts.

        if ($class) {
            $suffix = '_' . $class;
        } else {
            $suffix = '';
        }

        $pluginclasses = array();
        $plugins = self::get_plugin_list($plugintype);
        foreach ($plugins as $plugin => $fulldir) {
            // Try class in frankenstyle namespace.
            if ($class) {
                $classname = '\\' . $plugintype . '_' . $plugin . '\\' . $class;
                if (class_exists($classname, true)) {
                    $pluginclasses[$plugintype . '_' . $plugin] = $classname;
                    continue;
                }
            }

            // Try autoloading of class with frankenstyle prefix.
            $classname = $plugintype . '_' . $plugin . $suffix;
            if (class_exists($classname, true)) {
                $pluginclasses[$plugintype . '_' . $plugin] = $classname;
                continue;
            }

            // Fall back to old file location and class name.
            if ($file and file_exists("$fulldir/$file")) {
                include_once("$fulldir/$file");
                if (class_exists($classname, false)) {
                    $pluginclasses[$plugintype . '_' . $plugin] = $classname;
                    continue;
                }
            }
        }

        return $pluginclasses;
    }
public static function get_plugin_list_with_class ( $ plugintype , $ class , $ file = null ) { global $ CFG ; // Necessary in case it is referenced by included PHP scripts. if ( $ class ) { $ suffix = '_' . $ class ; } else { $ suffix = '' ; } $ pluginclasses = array ( ) ; $ plugins = self :: get_plugin_list ( $ plugintype ) ; foreach ( $ plugins as $ plugin => $ fulldir ) { // Try class in frankenstyle namespace. if ( $ class ) { $ classname = '\\' . $ plugintype . '_' . $ plugin . '\\' . $ class ; if ( class_exists ( $ classname , true ) ) { $ pluginclasses [ $ plugintype . '_' . $ plugin ] = $ classname ; continue ; } } // Try autoloading of class with frankenstyle prefix. $ classname = $ plugintype . '_' . $ plugin . $ suffix ; if ( class_exists ( $ classname , true ) ) { $ pluginclasses [ $ plugintype . '_' . $ plugin ] = $ classname ; continue ; } // Fall back to old file location and class name. if ( $ file and file_exists ( "$fulldir/$file" ) ) { include_once ( "$fulldir/$file" ) ; if ( class_exists ( $ classname , false ) ) { $ pluginclasses [ $ plugintype . '_' . $ plugin ] = $ classname ; continue ; } } } return $ pluginclasses ; }
Get a list of all the plugins of a given type that define a certain class
in a certain file. The plugin component names and class names are returned.

@param string $plugintype the type of plugin, e.g. 'mod' or 'report'.
@param string $class the part of the name of the class after the
frankenstyle prefix. e.g 'thing' if you are looking for classes with
names like report_courselist_thing. If you are looking for classes with
the same name as the plugin name (e.g. qtype_multichoice) then pass ''.
Frankenstyle namespaces are also supported.
@param string $file the name of file within the plugin that defines the class.
@return array with frankenstyle plugin names as keys (e.g. 'report_courselist', 'mod_forum')
and the class names as values (e.g. 'report_courselist_thing', 'qtype_multichoice').
Get a list of all the plugins of a given type that define a certain class in a certain file . The plugin component names and class names are returned .