You are here

function file_element_info in Drupal 7

Implements hook_element_info().

The managed file element may be used anywhere in Drupal.

File

modules/file/file.module, line 61
Defines a "managed_file" Form API field and a "file" field for Field module.

Code

function file_element_info() {
  $file_path = drupal_get_path('module', 'file');
  $types['managed_file'] = array(
    '#input' => TRUE,
    '#process' => array(
      'file_managed_file_process',
    ),
    '#value_callback' => 'file_managed_file_value',
    '#element_validate' => array(
      'file_managed_file_validate',
    ),
    '#pre_render' => array(
      'file_managed_file_pre_render',
    ),
    '#theme' => 'file_managed_file',
    '#theme_wrappers' => array(
      'form_element',
    ),
    '#progress_indicator' => 'throbber',
    '#progress_message' => NULL,
    '#upload_validators' => array(),
    '#upload_location' => NULL,
    '#size' => 22,
    '#extended' => FALSE,
    '#attached' => array(
      'css' => array(
        $file_path . '/file.css',
      ),
      'js' => array(
        $file_path . '/file.js',
      ),
    ),
  );
  return $types;
}