You are here

function _webform_defaults_file in Webform 7.4

Same name and namespace in other branches
  1. 5.2 components/file.inc \_webform_defaults_file()
  2. 6.3 components/file.inc \_webform_defaults_file()
  3. 6.2 components/file.inc \_webform_defaults_file()
  4. 7.3 components/file.inc \_webform_defaults_file()

Implements _webform_defaults_component().

File

components/file.inc, line 11
Webform module file component.

Code

function _webform_defaults_file() {

  // If private file storage is enabled, make it the default for security
  // reasons. See: https://www.drupal.org/psa-2016-003
  $available_schemes = file_get_stream_wrappers(STREAM_WRAPPERS_WRITE_VISIBLE);
  $scheme = isset($available_schemes['private']) ? 'private' : 'public';
  return array(
    'name' => '',
    'form_key' => NULL,
    'required' => 0,
    'pid' => 0,
    'weight' => 0,
    'extra' => array(
      'filtering' => array(
        'types' => array(
          'gif',
          'jpg',
          'png',
        ),
        'addextensions' => '',
        'size' => '2 MB',
      ),
      'rename' => '',
      'scheme' => $scheme,
      'directory' => '',
      'progress_indicator' => 'throbber',
      'title_display' => 0,
      'description' => '',
      'description_above' => FALSE,
      'attributes' => array(),
      'private' => FALSE,
      'analysis' => FALSE,
    ),
  );
}