From 7ee45931f5852247d7e4fd292204c65f5f20fea5 Mon Sep 17 00:00:00 2001 From: Heshan Wanigasooriya Date: Sat, 8 Jan 2011 05:18:58 +0000 Subject: Adding filed info and update the video field. --- video.theme.inc | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'video.theme.inc') 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 ''; -} \ 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 .= '
'; + + if (isset($element['preview'])) { + $output .= '
'; + $output .= drupal_render($element['preview']); + $output .= '
'; + } + + $output .= '
'; + if ($element['fid']['#value'] != 0) { + $element['filename']['#markup'] .= ' (' . format_size($element['#file']->filesize) . ') '; + } + $output .= drupal_render_children($element); + $output .= '
'; + $output .= '
'; + + return $output; +} -- cgit v1.2.3