You are here

function filefield_sources_list in FileField Sources 6

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

Create a list of FileField Sources by name, suitable for a select list.

1 call to filefield_sources_list()
filefield_sources_form in ./filefield_sources.module
Configuration form for editing FileField Sources settings for a widget.

File

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

Code

function filefield_sources_list($include_default = TRUE) {
  $info = filefield_sources_info();
  $list = array();
  if ($include_default) {
    $list['upload'] = t('Upload');
  }
  foreach ($info as $key => $source) {
    $list[$key] = $source['name'];
  }
  return $list;
}