You are here

function theme_feeds_upload in Feeds 6

Same name and namespace in other branches
  1. 8.2 feeds.pages.inc \theme_feeds_upload()
  2. 7.2 feeds.pages.inc \theme_feeds_upload()
  3. 7 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 166
Menu callbacks, form callbacks and helpers.

Code

function theme_feeds_upload($element) {
  drupal_add_css(drupal_get_path('module', 'feeds') . '/feeds.css');
  _form_set_class($element, array(
    'form-file',
  ));
  $output = '';
  if (!empty($element['#file_info'])) {
    $info = $element['#file_info'];
    $output .= '<div class="file-info">';
    $output .= '<div class="file-name">';
    $output .= l(basename($info['path']), $info['path']);
    $output .= '</div>';
    $output .= '<div class="file-size">';
    $output .= format_size($info['size']);
    $output .= '</div>';
    if (isset($info['mime'])) {
      $output .= '<div class="file-mime">';
      $output .= check_plain($info['mime']);
      $output .= '</div>';
    }
    $output .= '</div>';
  }
  $output .= '<div class="file-upload">';
  $output .= '<input type="file" name="' . $element['#name'] . '"' . ($element['#attributes'] ? ' ' . drupal_attributes($element['#attributes']) : '') . ' id="' . $element['#id'] . '" size="' . $element['#size'] . "\" />\n";
  $output .= '</div>';
  return theme('form_element', $element, $output);
}