You are here

function filefield_sources_invoke_all in FileField Sources 6

Same name and namespace in other branches
  1. 8 filefield_sources.module \filefield_sources_invoke_all()
  2. 7 filefield_sources.module \filefield_sources_invoke_all()

Call all FileField Source hooks stored in the available include files.

5 calls to filefield_sources_invoke_all()
filefield_sources_filefield_sources_info in ./filefield_sources.module
Implements hook_filefield_sources_info().
filefield_sources_form in ./filefield_sources.module
Configuration form for editing FileField Sources settings for a widget.
filefield_sources_menu in ./filefield_sources.module
Implements hook_menu().
filefield_sources_theme in ./filefield_sources.module
Implements hook_theme().
filefield_sources_widget_settings in ./filefield_sources.module
A list of settings needed by FileField Sources module on widgets.

File

./filefield_sources.module, line 222
Extend FileField to allow files from multiple sources.

Code

function filefield_sources_invoke_all($method, &$params) {
  $return = array();
  foreach (filefield_sources_includes() as $source) {
    $function = 'filefield_source_' . $source . '_' . $method;
    if (function_exists($function)) {
      $result = call_user_func_array($function, $params);
      if (isset($result) && is_array($result)) {
        $return = array_merge_recursive($return, $result);
      }
      elseif (isset($result)) {
        $return[] = $result;
      }
    }
  }
  return $return;
}