You are here

function _scald_get_info in Scald: Media Management made easy 7

Get the info from all modules on a specific scald item type.

4 calls to _scald_get_info()
scald_actions in ./scald.module
Get the available Scald Actions.
scald_contexts in ./scald.module
Get available Scald Contexts.
scald_players in ./scald.module
Get the available Scald Players.
scald_transcoders in ./scald.module
Get the available Scald Transcoders.
1 string reference to '_scald_get_info'
ScaldBaseTestCase::testScaldContext in tests/scald.test
Test Scald context.

File

./scald.module, line 353
The Scald Core, which handles all Scald Registries and dispatch.

Code

function _scald_get_info($type, $reset = FALSE) {
  $data =& drupal_static(__FUNCTION__);
  if (!isset($data)) {
    $data = array();
  }
  if (!$reset && isset($data[$type])) {
    return $data[$type];
  }
  global $language;
  $key = 'info:' . $language->language . ':' . $type;
  $info = cache_get($key, 'cache_scald');
  if ($reset || empty($info)) {
    $info = array();
    $hook = 'scald_' . $type;
    foreach (module_implements($hook) as $module) {
      $list = module_invoke($module, $hook);
      foreach ($list as &$item) {
        $item['provider'] = $module;
      }
      $info = array_merge($info, $list);
    }
    drupal_alter($hook, $info);
    cache_set($key, $info, 'cache_scald');
  }
  else {
    $info = $info->data;
  }
  $data[$type] = $info;
  return $info;
}