Commit c31fad68 authored by guschilds's avatar guschilds

Issue #2051013 by 2pha, guschilds: Added default alt attribute values to thumbnails.

parent 024f96c5
......@@ -451,6 +451,7 @@ function youtube_field_formatter_view($entity_type, $entity, $field, $instance,
$element[$delta] = array(
'#theme' => 'youtube_thumbnail',
'#video_id' => $item['video_id'],
'#entity_title' => $entity->title,
'#image_style' => $display['settings']['image_style'],
'#image_link' => isset($uri) ? $uri : '',
);
......@@ -543,6 +544,7 @@ function youtube_theme($existing, $type, $theme, $path) {
'youtube_thumbnail' => array(
'variables' => array(
'video_id' => NULL,
'entity_title' => NULL,
'image_style' => NULL,
'image_link' => NULL
),
......
......@@ -118,13 +118,21 @@ function theme_youtube_thumbnail($variables) {
}
}
$alt = t('Embedded thumbnail for @entity_title', array(
'@entity_title' => $variables['entity_title'],
));
if ($style) {
$uri = 'public://' . $youtube . '/' . $id . '.png';
$image = theme('image_style', array('style_name' => $style, 'path' => $uri));
$image = theme('image_style', array(
'style_name' => $style,
'path' => $uri,
'alt' => $alt,
));
}
else {
$path = $files . '/' . $youtube . '/' . $id . '.png';
$image = theme('image', array('path' => $path));
$image = theme('image', array('path' => $path, 'alt' => $alt));
}
// Check if an url path is provided
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment