You are here

function asset_views_options_formatters in Asset 6

Same name in this branch
  1. 6 asset_views.inc \asset_views_options_formatters()
  2. 6 inc/asset_views.inc \asset_views_options_formatters()
  3. 6 modules/asset_views.inc \asset_views_options_formatters()
Same name and namespace in other branches
  1. 5.2 modules/asset_views.inc \asset_views_options_formatters()
  2. 5 asset_views.inc \asset_views_options_formatters()
3 string references to 'asset_views_options_formatters'
asset_views_tables in ./asset_views.inc
asset_views_tables in inc/asset_views.inc
asset_views_tables in modules/asset_views.inc

File

inc/asset_views.inc, line 168

Code

function asset_views_options_formatters() {
  $all = t('Available for all Extensions');
  $specific = t('Only available for specific Extensions');
  $options[$all]['full'] = t('Default Full-Text');
  $options[$all]['teaser'] = t('Default Teaser');
  foreach (module_implements('asset_formatter') as $module) {
    $list = module_invoke($module, 'asset_formatter', 'info');
    foreach ($list as $key => $data) {
      foreach ($data['types'] as $type => $exts) {
        if ($exts == array(
          '*',
        )) {
          $options[$all][$module . ':' . $key] = $data['name'] . ' (' . join($exts, ',') . ')';
        }
        else {
          $options[$specific][$module . ':' . $key] = $data['name'] . ' (' . join($exts, ',') . ')';
        }
      }
    }
  }
  return $options;
}