aboutsummaryrefslogtreecommitdiff
path: root/video.theme.inc
diff options
context:
space:
mode:
authorHeshan Wanigasooriya <heshanmw@gmail.com>2011-01-08 05:18:58 +0000
committerHeshan Wanigasooriya <heshanmw@gmail.com>2011-01-08 05:18:58 +0000
commit7ee45931f5852247d7e4fd292204c65f5f20fea5 (patch)
tree6502b72d2f5adf95f67efb2e3933eb2b7eede47f /video.theme.inc
parent427d9f26ae67d2c533029b26ac6578528aaddb68 (diff)
downloadvideo-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.inc33
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;
+}