1.20.x file.module | file_element_info() |
Implements hook_element_info().
The managed file element may be used anywhere in Backdrop.
File
- modules/
file/ file.module, line 519 - Defines a "managed_file" Form API field and a "file" field for Field module.
Code
function file_element_info() {
$file_path = backdrop_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,
'#browser_view' => FALSE,
'#size' => 22,
'#extended' => FALSE,
'#attached' => array(
'css' => array($file_path . '/css/file.admin.css'),
'js' => array($file_path . '/js/file.js'),
),
);
return $types;
}