Index: horde/config/conf.xml =================================================================== RCS file: /repository/horde/config/conf.xml,v retrieving revision 1.112 diff -u -r1.112 conf.xml --- conf.xml 21 Aug 2005 18:38:23 -0000 1.112 +++ conf.xml 11 Sep 2005 22:57:00 -0000 @@ -1142,6 +1142,12 @@ spaces in it. Use DOS-style abbreviations if necessary: Progra~1 instead of Program Files, for instance. If using GD, or using neither, leave this field blank."/> + + Index: framework/MIME/MIME/Viewer/msword.php =================================================================== RCS file: /repository/framework/MIME/MIME/Viewer/msword.php,v retrieving revision 1.30 diff -u -r1.30 msword.php --- framework/MIME/MIME/Viewer/msword.php 3 Jul 2005 04:34:52 -0000 1.30 +++ framework/MIME/MIME/Viewer/msword.php 11 Sep 2005 22:59:39 -0000 @@ -25,7 +25,7 @@ */ function render($params = array()) { - global $mime_drivers; + global $mime_drivers, $conf; /* Check to make sure the program actually exists. */ if (!file_exists($mime_drivers['horde']['msword']['location'])) { @@ -37,6 +37,13 @@ $tmp_output = Horde::getTempFile('msword'); $tmp_dir = Horde::getTempDir(); $tmp_file = str_replace($tmp_dir . '/', '', $tmp_output); + $img_dir = $conf['image']['images_dir']; + $img_path = $conf['image']['images_path']; + + if ($img_dir != '') { + $tmp_dir = $img_dir; + $tmp_output = $img_dir . '/' . $tmp_file; + } if (OS_WINDOWS) { $args = ' -x ' . dirname($mime_drivers['horde']['msword']['location']) . "\\wvHtml.xml -d $tmp_dir -1 $tmp_word > $tmp_output"; @@ -54,9 +61,9 @@ fclose($fh); exec($mime_drivers['horde']['msword']['location'] . $args); - + unlink($tmp_word); if (!file_exists($tmp_output)) { - return _("Unable to translate this Word document"); + return _("Unable to translate this Word document") . ' ' . $args; } $fh = fopen($tmp_output, 'r'); @@ -64,8 +71,9 @@ $data .= $rc; } fclose($fh); - - return $data; + unlink($tmp_output); + + return ($img_path == '') ? $data : str_replace('src="', 'src="' . $img_path . '/', $data); } /**