function theme_image_attach_body in Image 5
Same name and namespace in other branches
- 5.2 contrib/image_attach/image_attach.module \theme_image_attach_body()
Theme the body
File
- contrib/
image_attach/ image_attach.module, line 464 - image_attach.module
Code
function theme_image_attach_body($node) {
$img_size = variable_get('image_attach_size_body_' . $node->type, IMAGE_THUMBNAIL);
if ($img_size != IMAGE_ATTACH_HIDDEN) {
drupal_add_css(drupal_get_path('module', 'image_attach') . '/image_attach.css');
$image = node_load($node->iid);
if (!node_access('view', $image)) {
// If the image is restricted, don't show it as an attachment.
return NULL;
}
$info = image_get_info(file_create_path($image->images[$img_size]));
$output = '<div style="width: ' . $info['width'] . 'px" class="image-attach-body">';
$output .= l(image_display($image, $img_size), "node/{$node->iid}", array(), NULL, NULL, FALSE, TRUE);
$output .= '</div>' . "\n";
return $output;
}
}