You are here

function asset_embed_list_providers in Asset 6

Same name and namespace in other branches
  1. 5 asset_embed/asset_embed.module \asset_embed_list_providers()

return a list of available providers

Parameters

$all: Should all providers be returned or just the enabled ones.

Return value

The array of availabe providers

3 calls to asset_embed_list_providers()
asset_embed_asset_formatter in asset_embed/asset_embed.module
asset_embed_asset_settings in asset_embed/asset_embed.module
asset_embed_asset_type in asset_embed/asset_embed.module

File

asset_embed/asset_embed.module, line 49
Asset Embed Module

Code

function asset_embed_list_providers($all = FALSE) {
  static $providers = array();
  if (!count($providers)) {
    $path = drupal_get_path('module', 'asset_embed') . '/providers';
    $files = drupal_system_listing('.*\\.inc$', $path, 'name', 0);
    foreach ($files as $file) {
      if ($all || variable_get('asset_embed_' . $file->name . '_enabled', 1)) {
        require_once "./{$file->filename}";
        $info = asset_embed_invoke($file->name, 'info');
        $providers[$file->name] = $info['name'] ? $info['name'] : $file->name;
      }
    }
  }
  return $providers;
}