--- loncom/publisher/lonpublisher.pm 2011/10/22 22:05:23 1.270
+++ loncom/publisher/lonpublisher.pm 2011/10/26 15:05:25 1.273
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Publication Handler
#
-# $Id: lonpublisher.pm,v 1.270 2011/10/22 22:05:23 www Exp $
+# $Id: lonpublisher.pm,v 1.273 2011/10/26 15:05:25 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -266,9 +266,9 @@ sub metaread {
my ($logfile,$fn,$prefix)=@_;
unless (-e $fn) {
print($logfile 'No file '.$fn."\n");
- return '
'
- .&mt('No file: [_1]'
- ,' '.&Apache::loncfile::display($fn).'
');
+ return ''
+ .&mt('No file: [_1]',&Apache::loncfile::display($fn))
+ .'
';
}
print($logfile 'Processing '.$fn."\n");
my $metastring;
@@ -277,9 +277,9 @@ sub metaread {
$metastring=join('',<$metafh>);
}
&metaeval($metastring,$prefix);
- return ''
- .&mt('Processed file: [_1]'
- ,' '.&Apache::loncfile::display($fn).'
');
+ return ''
+ .&mt('Processed file: [_1]',&Apache::loncfile::display($fn))
+ .'
';
}
#########################################
@@ -1228,7 +1228,7 @@ sub publish {
.''
.' '.&mt('Cancel').'
';
+ .'" /> '.&mt('Cancel').' ';
}
$intr_scrout.=&Apache::lonhtmlcommon::start_pick_box();
$intr_scrout.=
@@ -1766,7 +1766,7 @@ sub phasetwo {
# ------------------------------------------------ Provide link to new resource
unless ($batch) {
- my $thissrc=&Apache::loncfile::display($source);
+ my $thissrc=&Apache::loncfile::url($source);
my $thissrcdir=$thissrc;
$thissrcdir=~s/\/[^\/]+$/\//;
@@ -1852,8 +1852,7 @@ sub batchpublish {
my $thisembstyle=&Apache::loncommon::fileembstyle($thistype);
$r->print(''
- .&mt('Publishing [_1]'
- ,''.&Apache::loncfile::display($srcfile).' ')
+ .&mt('Publishing [_1]',&Apache::loncfile::display($srcfile))
.' '
);
@@ -1879,15 +1878,15 @@ sub publishdirectory {
my ($r,$fn,$thisdisfn)=@_;
$fn=~s/\/+/\//g;
$thisdisfn=~s/\/+/\//g;
- my $resdir=
- $Apache::lonnet::perlvar{'lonDocRoot'}.'/res/'.$cudom.'/'.$cuname.'/'.
- $thisdisfn;
+ my $thisdisresdir=$thisdisfn;
+ $thisdisresdir=~s/^\/priv\//\/res\//;
+ my $resdir='/home/httpd/html'.$thisdisresdir;
$r->print(&Apache::lonhtmlcommon::start_pick_box()
.&Apache::lonhtmlcommon::row_title(&mt('Directory'))
.''.$thisdisfn.' '
.&Apache::lonhtmlcommon::row_closure()
.&Apache::lonhtmlcommon::row_title(&mt('Target'))
- .''.$resdir.' '
+ .''.$thisdisresdir.' '
);
my $dirptr=16384; # Mask indicating a directory in stat.cmode.
@@ -1926,7 +1925,7 @@ sub publishdirectory {
if ($filename=~/\.(\w+)$/) { $extension=$1; }
if ($cmode&$dirptr) {
if (($filename!~/^\./) && ($env{'form.pubrec'})) {
- &publishdirectory($r,$fn.'/'.$filename,$thisdisfn.'/'.$filename);
+ &publishdirectory($r,$docroot.$fn.'/'.$filename,$thisdisfn.'/'.$filename);
}
} elsif ((&Apache::loncommon::fileembstyle($extension) ne 'hdn') &&
($filename!~/^[\#\.]/) && ($filename!~/\~$/)) {
@@ -2168,7 +2167,7 @@ sub handler {
if ($fn=~/\/$/) {
# -------------------------------------------------------- This is a directory
- &publishdirectory($r,$fn,$thisdisfn);
+ &publishdirectory($r,$docroot.$fn,$thisdisfn);
$r->print(''.&mt('Return to Directory').' ');
} else {
# ---------------------- Evaluate individual file, and then output information.
@@ -2238,7 +2237,7 @@ ENDDIFF
}
unless ($errorcount) {
my ($outstring,$error)=
- &publish($docroot.$fn,$thistarget,$thisembstyle);
+ &publish($docroot.$fn,$docroot.$thistarget,$thisembstyle);
$r->print($outstring);
} else {
$r->print(''.
@@ -2246,7 +2245,7 @@ ENDDIFF
' ');
}
} else {
- &phasetwo($r,$fn,$thistarget,$thisembstyle,$thisdistarget);
+ &phasetwo($r,$docroot.$fn,$docroot.$thistarget,$thisembstyle,$thisdistarget);
}
}
$r->print(&Apache::loncommon::end_page());