From 14c097ff41e0410784aa1fdae7b4312ec70ff5e0 Mon Sep 17 00:00:00 2001 From: Heshan Date: Mon, 14 Mar 2011 20:58:44 +0530 Subject: Move common codes from the insert and update, and formate the helper thumbnails --- includes/preset.inc | 3 ++- includes/video_helper.inc | 16 +++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'includes') diff --git a/includes/preset.inc b/includes/preset.inc index d3a3fdd..c2870a5 100644 --- a/includes/preset.inc +++ b/includes/preset.inc @@ -62,7 +62,8 @@ class video_preset { * @return array $properties */ public function properties() { - module_load_include('inc', 'video_ui', 'video.preset'); + // adding modules/video_ui to load this file even if UI module is disabled + module_load_include('inc', 'video', 'modules/video_ui/video.preset'); $presets = array(); $preset = $this->preset; foreach ($preset as $preset_name) { diff --git a/includes/video_helper.inc b/includes/video_helper.inc index e47830c..cd743c7 100644 --- a/includes/video_helper.inc +++ b/includes/video_helper.inc @@ -89,21 +89,19 @@ class video_helper { $thumbnail->filepath = ''; $thumbnail->url = ''; //@todo future enhancements for our thumbnails - $thumbnail->alt = ''; - $thumbnail->title = ''; - $thumbnail->description = ''; - + $thumbnail->alt = $variables['entity']->title; + $thumbnail->title = $variables['entity']->title; +// $thumbnail->description = ''; // Setup our thumbnail path. - $default_thumbnail = file_load($field_settings['default_video_thumbnail']); - $use_default_img = isset($variables['item']['use_default_video_thumb']) ? - $variables['item']['use_default_video_thumb'] : FALSE; + $use_default_img = isset($variables['item']['use_default_video_thumb']) ? TRUE : FALSE; if ($use_default_img && !empty($field_settings['default_video_thumbnail'])) { + $default_thumbnail = file_load($field_settings['default_video_thumbnail']['fid']); // Check the checkbox to use default thumbnail on node $thumbnail->filepath = $default_thumbnail->uri; - } elseif (isset($variables['item']['video_thumb']) ? $variables['item']['video_thumb'] : FALSE) { + } elseif (isset($variables['item']['thumbanail']) ? TRUE : FALSE) { // actual video thumbnails is present - $thumbnail_load = file_load($variables['item']['video_thumb']); + $thumbnail_load = file_load($variables['item']['thumbanail']); $thumbnail->filepath = $thumbnail_load->uri; } else { //need some type of default if nothing is present -- cgit v1.2.3