diff options
author | Heshan Wanigasooriya <heshanmw@gmail.com> | 2011-01-08 05:18:58 +0000 |
---|---|---|
committer | Heshan Wanigasooriya <heshanmw@gmail.com> | 2011-01-08 05:18:58 +0000 |
commit | 7ee45931f5852247d7e4fd292204c65f5f20fea5 (patch) | |
tree | 6502b72d2f5adf95f67efb2e3933eb2b7eede47f /video.theme.inc | |
parent | 427d9f26ae67d2c533029b26ac6578528aaddb68 (diff) | |
download | video-7ee45931f5852247d7e4fd292204c65f5f20fea5.tar.gz video-7ee45931f5852247d7e4fd292204c65f5f20fea5.tar.bz2 |
Adding filed info and update the video field.
Diffstat (limited to 'video.theme.inc')
-rw-r--r-- | video.theme.inc | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/video.theme.inc b/video.theme.inc index dfa36e5..4910460 100644 --- a/video.theme.inc +++ b/video.theme.inc @@ -102,4 +102,35 @@ function theme_video_image($file, $alt = '', $title = '', $attributes = NULL, $g $attributes['src'] = $url; $attributes = drupal_attributes($attributes); return '<img '. $attributes .' />'; -}
\ No newline at end of file +} + +/** + * Returns HTML for an video field widget. + * + * @param $variables + * An associative array containing: + * - element: A render element representing the image field widget. + * + * @ingroup themeable + */ +function theme_video_widget($variables) { + $element = $variables['element']; + $output = ''; + $output .= '<div class="image-widget form-managed-file clearfix">'; + + if (isset($element['preview'])) { + $output .= '<div class="image-preview">'; + $output .= drupal_render($element['preview']); + $output .= '</div>'; + } + + $output .= '<div class="image-widget-data">'; + if ($element['fid']['#value'] != 0) { + $element['filename']['#markup'] .= ' <span class="file-size">(' . format_size($element['#file']->filesize) . ')</span> '; + } + $output .= drupal_render_children($element); + $output .= '</div>'; + $output .= '</div>'; + + return $output; +} |