You are here

function media_get_registration_kinds in D7 Media 6

Parsing function for the registrations to hand back the kinds of modules registering. Used to select all formatters, resources, etc.

Parameters

string $kinds: Return all the matching registrations of this kind.

Return value

array An array of matching registrations.

File

./media.module, line 303
Media API

Code

function media_get_registration_kinds($kind = NULL) {
  $kinds = array();

  // Get the registered modules.
  $registrations = media_get_registered_modules();

  // Parse the registrations.
  foreach ($registrations as $id => $registration) {
    if ($kind) {

      // Get the kind that is being looked for.
      if ($registration['kind'][$kind]) {
        $kinds[$id] = $registration;
      }
    }
    else {
      $kinds[$id] = $registration;
    }
  }
  return $kinds;
}