aboutsummaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorHeshan <heshan@heidisoft.com>2011-03-14 20:58:44 +0530
committerHeshan <heshan@heidisoft.com>2011-03-14 20:58:44 +0530
commit14c097ff41e0410784aa1fdae7b4312ec70ff5e0 (patch)
tree6a7f7ab3c6abe600ad320dbbfc7cf3c49ec95570 /includes
parent0d300315ee1144b50bdf666f364cd02dceb2e5cf (diff)
downloadvideo-14c097ff41e0410784aa1fdae7b4312ec70ff5e0.tar.gz
video-14c097ff41e0410784aa1fdae7b4312ec70ff5e0.tar.bz2
Move common codes from the insert and update, and formate the helper thumbnails
Diffstat (limited to 'includes')
-rw-r--r--includes/preset.inc3
-rw-r--r--includes/video_helper.inc16
2 files changed, 9 insertions, 10 deletions
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