Révision 6135231a
Ajouté par Assos Assos il y a presque 6 ans
drupal7/sites/all/modules/lightbox2/lightbox2.formatter.inc | ||
---|---|---|
27 | 27 |
$image_style = $variables['image_style']; |
28 | 28 |
$node_id = $variables['node_id']; |
29 | 29 |
$field_name = $variables['field_name']; |
30 |
$caption = $variables['caption']; |
|
30 | 31 |
|
31 | 32 |
if (!$variables["lightbox_style"]) { |
32 | 33 |
$path['path'] = file_create_url($item['uri']); |
... | ... | |
66 | 67 |
$rel .= ']'; |
67 | 68 |
|
68 | 69 |
// Title Start |
69 |
$rel .= '[' . $item['title']; |
|
70 |
$rel .= '['; |
|
71 |
|
|
72 |
switch($caption) { |
|
73 |
case 'hidden': |
|
74 |
break; |
|
75 |
case 'filename': |
|
76 |
$rel .= $item['filename']; |
|
77 |
break; |
|
78 |
case 'title': |
|
79 |
$rel .= $item['title']; |
|
80 |
break; |
|
81 |
default: |
|
82 |
$caption_display = array( |
|
83 |
'label' => 'hidden', |
|
84 |
); |
|
85 |
$entity = entity_load('file', array($item['fid'])); |
|
86 |
$entity = $entity[$item['fid']]; |
|
87 |
$renderable_field = field_view_field('file', $entity, $caption, $caption_display); |
|
88 |
$rel .= drupal_render($renderable_field); |
|
89 |
break; |
|
90 |
} |
|
70 | 91 |
|
71 | 92 |
// Download Link |
72 | 93 |
if (user_access('download original image')) { |
73 |
$rel .= '<p><a href="' . file_create_url($item['uri']) . '">' . variable_get('lightbox2_download_link_text', 'Download Original') . '</a></p>'; |
|
94 |
$url_download = file_create_url($item['uri']); |
|
95 |
$download_original_text = t(variable_get('lightbox2_download_link_text', 'Download Original')); |
|
96 |
$options_download = array(); |
|
97 |
$options_download['attributes']['title'] = $download_original_text; |
|
98 |
$options_download['attributes']['download'] = ''; |
|
99 |
$rel .= '<p>' . l($download_original_text, $url_download, $options_download) . '</p>'; |
|
74 | 100 |
} |
75 | 101 |
|
76 | 102 |
// Title End |
... | ... | |
260 | 286 |
if (!empty($target)) { |
261 | 287 |
$attributes['target'] = $target; |
262 | 288 |
} |
263 |
$node_link_text = variable_get('lightbox2_node_link_text', 'View Image Details');
|
|
289 |
$node_link_text = t(variable_get('lightbox2_node_link_text', 'View Image Details'));
|
|
264 | 290 |
if (!$on_image_node && !empty($node_link_text)) { |
265 | 291 |
$node_links[] = l($node_link_text, 'node/'. $item['nid'], array('attributes' => $attributes)); |
266 | 292 |
} |
267 |
$download_link_text = check_plain(variable_get('lightbox2_download_link_text', 'Download Original'));
|
|
293 |
$download_link_text = check_plain(t(variable_get('lightbox2_download_link_text', 'Download Original')));
|
|
268 | 294 |
if (!empty($download_link_text) && user_access('download original image')) { |
269 | 295 |
$node_links[] = l($download_link_text, file_create_url($item['filepath']), array('attributes' => array('target' => '_blank', 'id' => 'lightbox2-download-link-text'))); |
270 | 296 |
} |
... | ... | |
324 | 350 |
} |
325 | 351 |
elseif ($view_preset == 'link') { |
326 | 352 |
// Not actually an image, just a text link. |
327 |
$image = variable_get('lightbox2_view_image_text', 'View image');
|
|
353 |
$image = t(variable_get('lightbox2_view_image_text', 'View image'));
|
|
328 | 354 |
} |
329 | 355 |
else { |
330 | 356 |
$image = theme('imagecache', array( 'style_name' => $view_preset, 'path' => $item['filepath'], 'alt' => $image_tag_alt, 'title' => $image_tag_title, 'attributes' => $attributes ) ); |
Formats disponibles : Unified diff
Weekly update of contrib modules