1 common.inc backdrop_get_filetransfer_info()

Assembles the Backdrop FileTransfer registry.

Return value

The Backdrop FileTransfer class registry.

See also

FileTransfer

hook_filetransfer_info()

hook_filetransfer_info_alter()

File

core/includes/common.inc, line 8685
Common functions that many Backdrop modules will need to reference.

Code

function backdrop_get_filetransfer_info() {
  $info = &backdrop_static(__FUNCTION__);
  if (!isset($info)) {
    // Since we have to manually set the 'file path' default for each
    // module separately, we can't use module_invoke_all().
    $info = array();
    foreach (module_implements('filetransfer_info') as $module) {
      $function = $module . '_filetransfer_info';
      $result = $function();
      if (isset($result) && is_array($result)) {
        foreach ($result as &$values) {
          if (empty($values['file path'])) {
            $values['file path'] = backdrop_get_path('module', $module);
          }
        }
        $info = array_merge_recursive($info, $result);
      }
    }
    backdrop_alter('filetransfer_info', $info);
    backdrop_sort($info);
  }
  return $info;
}