From fe61c9aa678fe2adbdce4dd42cac35d7f31da406 Thu, 26 Apr 2012 14:02:05 -0300
From: Javier Castro <javier.alejandro.castro@gmail.com>
Date: Thu, 26 Apr 2012 13:59:27 -0300
Subject: [PATCH] Fix: missing class 'inline' attribute (integration with lightbox2 not working) Fix: $file->filepath should be $file->uri Fix: Wrong href= generated for inline link images (added file_create_url call)

diff --git a/inline.theme.inc b/inline.theme.inc
old mode 100644
new mode 100755
index 304bcf4..7c9e18a
--- a/inline.theme.inc
+++ b/inline.theme.inc
@@ -14,7 +14,7 @@
   // Prepare link text with title or filename.
   $linktext = ($file->title ? $file->title : $file->filename);
 
-  return l($linktext, file_create_url($file->filepath), array('attributes' => array('title' => t('Download: @name (@size)', array('@name' => $file->filename, '@size' => format_size($file->filesize))))));
+  return l($linktext, file_create_url($file->uri), array('attributes' => array('title' => t('Download: @name (@size)', array('@name' => $file->filename, '@size' => format_size($file->filesize))))));
 }
 
 /**
@@ -28,10 +28,10 @@
   $inline_preset = $viewmode == 'summary' ? 'inline_teaser_preset' : 'inline_full_preset';
 
   if (variable_get($inline_preset, '') != '') {
-    $image = theme('image_style', array('style_name' => variable_get($inline_preset), 'path' => $file->uri, 'alt' => $file->alt, 'title' => $file->title));
+    $image = theme('image_style', array('style_name' => variable_get($inline_preset), 'path' => $file->uri, 'alt' => $file->alt, 'title' => $file->title, 'attributes' => array('class' => 'inline')));
   }
   else {
-    $image = theme('image', array('path' => $file->uri, 'alt' => $title, 'title' => $title));
+    $image = theme('image', array('path' => $file->uri, 'alt' => $title, 'title' => $title, 'attributes' => array('class' => 'inline')));
   }
 
   if (variable_get('inline_link_img', '1')) {
@@ -39,7 +39,7 @@
       'class' => 'inline-image-link',
       'title' => t("View") . ': ' . $title,
     );
-    $html = l($image, $file->uri, array('attributes' => $attributes, 'html' => TRUE));
+    $html = l($image, file_create_url($file->uri), array('attributes' => $attributes, 'html' => TRUE));
   }
   else {
     $html = $image;