You are here

function _filefield_file_extension_info_original in FileField 6.2

2 calls to _filefield_file_extension_info_original()
_filefield_file_formatter_info in ./filefield.module
Retrieve information about the formatters that are going to display the single files for the node view or other views. This function also sorts the formatters in the way that the administrator has specified for this field.
_filefield_file_widget_info in ./filefield.module
Retrieve information about the widgets that are going to preview and edit the single files that are uploaded in CCK's edit form. This function also sorts the widgets in the way that the administrator has specified for this field.

File

./filefield.module, line 691

Code

function _filefield_file_extension_info_original($extension_type) {
  static $file_extension_info = array();

  // with 'widget' and 'formatter' keys
  if (!isset($file_extension_info[$extension_type])) {
    $file_extension_info[$extension_type] = array();
    $hook = 'file_' . $extension_type . '_info';
    foreach (module_implements($hook) as $module) {
      $function = $module . '_' . $hook;
      $module_extension_info = $function();

      // Prepare the array for mass consumption.
      foreach ($module_extension_info as $extension_name => $info) {
        if ($extension_type == 'formatter') {
          $info['theme'] = $module . '_file_formatter_' . $extension_name;
        }
        $info['module'] = $module;
        $info['name'] = $extension_name;
        $info['css'] = isset($info['css']) ? $info['css'] : array();
        $info['key'] = $module . '_' . $extension_name;
        $file_extension_info[$extension_type][$info['key']] = $info;
      }
    }
    drupal_alter($hook, $file_extension_info[$extension_type]);
  }
  return $file_extension_info[$extension_type];
}