--- loncom/publisher/lonpublisher.pm 2011/10/22 21:25:37 1.269 +++ loncom/publisher/lonpublisher.pm 2011/10/22 22:05:23 1.270 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.269 2011/10/22 21:25:37 www Exp $ +# $Id: lonpublisher.pm,v 1.270 2011/10/22 22:05:23 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1223,14 +1223,12 @@ sub publish { my $intr_scrout.='
' .'
'; unless ($env{'form.makeobsolete'}) { - my $thissrc=$source; - $thissrc=~s{^/home/($match_username)/public_html}{/priv/$1}; $intr_scrout.='

' .&mt('Searching for your resource will be based on the following metadata. Please provide as much data as possible.') .'

' .'

'.&mt('Cancel').'

'; + .'" /> '.&mt('Cancel').'

'; } $intr_scrout.=&Apache::lonhtmlcommon::start_pick_box(); $intr_scrout.= @@ -1767,9 +1765,8 @@ sub phasetwo { # ------------------------------------------------ Provide link to new resource unless ($batch) { - my $thissrc=$source; - $thissrc=~s{^/home/($match_username)/public_html}{/priv/$1}; + my $thissrc=&Apache::loncfile::display($source); my $thissrcdir=$thissrc; $thissrcdir=~s/\/[^\/]+$/\//; @@ -1839,8 +1836,6 @@ sub batchpublish { my %oldenv=%env; $srcfile=~s/\/+/\//g; $targetfile=~s/\/+/\//g; - my $thisdisfn=$srcfile; - $thisdisfn=~s/\/home\/korte\/public_html\///; $srcfile=~s/\/+/\//g; my $docroot=$r->dir_config('lonDocRoot'); @@ -1858,7 +1853,7 @@ sub batchpublish { $r->print('

' .&mt('Publishing [_1]' - ,''.$thisdisfn.'') + ,''.&Apache::loncfile::display($srcfile).'') .'

' ); @@ -1973,12 +1968,11 @@ sub publishdirectory { sub defaultmetapublish { my ($r,$fn,$cuname,$cudom)=@_; - $fn=~s/^\/\~$cuname\//\/home\/$cuname\/public_html\//; unless (-e $fn) { return HTTP_NOT_FOUND; } my $target=$fn; - $target=~s/^\/home\/$cuname\/public_html\//$Apache::lonnet::perlvar{'lonDocRoot'}\/res\/$cudom\/$cuname\//; + $target=~s/^\Q$Apache::lonnet::perlvar{'lonDocRoot'}\E\/priv\//\Q$Apache::lonnet::perlvar{'lonDocRoot'}\E\/res\//; &Apache::loncommon::content_type($r,'text/html'); @@ -2021,9 +2015,7 @@ sub defaultmetapublish { $r->print($reply.'


');$r->rflush; } # ------------------------------------------------------------------- Link back - my $link=$fn; - $link=~s/^\/home\/$cuname\/public_html\//\/priv\/$cuname\//; - $r->print("".&mt('Back to Metadata').''); + $r->print("".&mt('Back to Metadata').''); $r->print(&Apache::loncommon::end_page()); return OK; }