function theme_feeds_upload in Feeds 7
Same name and namespace in other branches
- 8.2 feeds.pages.inc \theme_feeds_upload()
- 6 feeds.pages.inc \theme_feeds_upload()
- 7.2 feeds.pages.inc \theme_feeds_upload()
Theme upload widget.
1 theme call to theme_feeds_upload()
- FeedsFileFetcher::sourceForm in plugins/
FeedsFileFetcher.inc - Source form.
File
- ./
feeds.pages.inc, line 155 - Menu callbacks, form callbacks and helpers.
Code
function theme_feeds_upload($variables) {
$element = $variables['element'];
drupal_add_css(drupal_get_path('module', 'feeds') . '/feeds.css');
_form_set_class($element, array(
'form-file',
));
$description = '';
if (!empty($element['#file_info'])) {
$file = $element['#file_info'];
$wrapper = file_stream_wrapper_get_instance_by_uri($file->uri);
$description .= '<div class="file-info">';
$description .= '<div class="file-name">';
$description .= l($file->filename, $wrapper
->getExternalUrl());
$description .= '</div>';
$description .= '<div class="file-size">';
$description .= format_size($file->filesize);
$description .= '</div>';
$description .= '<div class="file-mime">';
$description .= check_plain($file->filemime);
$description .= '</div>';
$description .= '</div>';
}
$description .= '<div class="file-upload">';
$description .= '<input type="file" name="' . $element['#name'] . '"' . ($element['#attributes'] ? ' ' . drupal_attributes($element['#attributes']) : '') . ' id="' . $element['#id'] . '" size="' . $element['#size'] . "\" />\n";
$description .= '</div>';
$element['#description'] = $description;
// For some reason not unsetting #title leads to printing the title twice.
unset($element['#title']);
return theme('form_element', $element);
}