You are here

function _filefield_sources_enabled in FileField Sources 8

Same name and namespace in other branches
  1. 7 filefield_sources.module \_filefield_sources_enabled()

Helper to return enabled sources for a field.

This provides backward compatibility for 'upload' type.

See also

http://drupal.org/node/932994

3 calls to _filefield_sources_enabled()
filefield_sources_field_process in ./filefield_sources.module
A #process callback to extend the filefield_widget element type.
filefield_sources_field_widget_settings_summary_alter in ./filefield_sources.module
Implements hook_field_widget_settings_summary_alter().
filefield_sources_form in ./filefield_sources.module
Configuration form for editing FileField Sources settings for a widget.

File

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

Code

function _filefield_sources_enabled($settings) {
  if (!isset($settings['sources']['upload'])) {
    $settings['sources']['upload'] = 'upload';
  }
  $enabled = array_keys(array_filter($settings['sources']));
  asort($enabled);
  return array_combine($enabled, $enabled);
}