Full ELMS Learning Network documentation
function theme_file_widget
×
Error message
User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).cis7 file.field.inc | theme_file_widget($variables) |
cle7 file.field.inc | theme_file_widget($variables) |
elmsmedia7 file.field.inc | theme_file_widget($variables) |
icor7 file.field.inc | theme_file_widget($variables) |
meedjum_blog7 file.field.inc | theme_file_widget($variables) |
mooc7 file.field.inc | theme_file_widget($variables) |
Returns HTML for an individual file upload widget.
Parameters
$variables: An associative array containing:
- element: A render element representing the widget.
Related topics
2 string references to the theme hook from theme_file_widget()
Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.
- file_field_widget_process in modules/
file/ file.field.inc - An element #process callback for the file_generic field type.
- file_theme in modules/
file/ file.module - Implements hook_theme().
File
- modules/
file/ file.field.inc, line 799 - Field module functionality for the File module.
Code
function theme_file_widget($variables) {
$element = $variables['element'];
$output = '';
// The "form-managed-file" class is required for proper Ajax functionality.
$output .= '<div class="file-widget form-managed-file clearfix">';
if ($element['fid']['#value'] != 0) {
// Add the file size after the file name.
$element['filename']['#markup'] .= ' <span class="file-size">(' . format_size($element['#file']->filesize) . ')</span> ';
}
$output .= drupal_render_children($element);
$output .= '</div>';
return $output;
}