--- loncom/xml/londefdef.pm 2006/11/07 02:39:39 1.344 +++ loncom/xml/londefdef.pm 2006/12/05 02:55:54 1.345 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.344 2006/11/07 02:39:39 albertel Exp $ +# $Id: londefdef.pm,v 1.345 2006/12/05 02:55:54 albertel Exp $ # # # Copyright Michigan State University Board of Trustees @@ -48,6 +48,7 @@ use Apache::lonmenu(); use Apache::lonmeta(); use Apache::Constants qw(:common); use File::Basename; +use LONCAPA(); # use Data::Dumper; BEGIN { @@ -4298,15 +4299,15 @@ sub eps_generation { print $temp_file "$src\n"; my $newsrc = $src; $newsrc =~ s/(\.gif|\.jpg|\.jpeg)$/\.eps/i; - $newsrc=~s/\/home\/httpd\/html\/res//; - $newsrc=~s/\/home\/([^\/]*)\/public_html\//\/$1\//; - $newsrc=~s/\/\.\//\//; - $newsrc=~s/\/([^\/]+)\.(ps|eps)/\//; - if ($newsrc=~/\/home\/httpd\/lonUsers\//) { - $newsrc=~s/\/home\/httpd\/lonUsers//; - $newsrc=~s/\/([^\/]+)\/(\w)\/(\w)\/(\w)\//\/$1\//; + $newsrc=~s{/home/httpd/html/res}{}; + $newsrc=~s{/home/($LONCAPA::username_re)/public_html/}{/$1/}; + $newsrc=~s{/\./}{/}; + $newsrc=~s{/([^/]+)\.(ps|eps)}{/}; + if ($newsrc=~m{/home/httpd/lonUsers/}) { + $newsrc=~s{/home/httpd/lonUsers}{}; + $newsrc=~s{/($LONCAPA::domain_re)/./././}{/$1/}; } - if ($newsrc=~/\/userfiles\//) { + if ($newsrc=~m{/userfiles/}) { return ' \graphicspath{{'.$newsrc.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; } else { return ' \graphicspath{{/home/httpd/prtspool'.$newsrc.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} ';