You are here

function emapi_get_provider_class_by_class_name in Embedded Media Field 6.3

Return the registered EmAPI class specified by name.

3 calls to emapi_get_provider_class_by_class_name()
emapi_autoload in emapi/emapi.module
Autoload the media object classes when needed.
emfield_field in ./emfield.module
Implementation of hook_field().
emfield_widget in ./emfield.module
Implementation of hook_widget()

File

emapi/emapi.module, line 140
Provides an API for parsing, storage, and display of third party media.

Code

function emapi_get_provider_class_by_class_name($class_name = NULL, $reset = FALSE) {
  static $classes;
  if (!isset($classes) || $reset) {
    $classes = array();
    $provider_classes = emapi_get_provider_classes();
    foreach ($provider_classes as $scheme => $class) {
      $classes[$class['class_name']] = $class;
    }
  }
  if (isset($class_name)) {
    return $classes[$class_name];
  }
  return $classes;
}