'
+ $outdep.=''
.&mt('The resource depends on another resource with variable filename, i.e., [_1].',''.$thisdep.'').'
'
.&mt('You likely need to explicitly allow access to all possible dependencies using the [_1]-tag.','<allow>')
- .'
';
+ ."
\n";
}
unless ($style eq 'rat') {
$allowstr.="\n".'';
}
- $scrout.='
';
+ $outdep.='
';
+ }
+
+ if ($outdep) {
+ $scrout.=''.&mt('Dependencies').'
'
+ .$outdep
}
$outstring=~s/\n*(\<\/[^\>]+\>[^<]*)$/$allowstr\n$1\n/s;
@@ -1048,7 +1062,7 @@ sub publish {
my %oldparmstores=();
unless ($batch) {
- $scrout.=''.&mt('Metadata Information').' ' .
+ $scrout.=''.&mt('Metadata').' ' .
&Apache::loncommon::help_open_topic("Metadata_Description")
. '
';
}
@@ -1107,7 +1121,7 @@ sub publish {
# ------------------------------------------------------------- Save some stuff
my %savemeta=();
foreach ('title') {
- $savemeta{$_}=$metadatafields{$_};
+ if ($metadatafields{$_}) { $savemeta{$_}=$metadatafields{$_}; }
}
# ------------------------------------------ See if anything new in file itself
@@ -1152,15 +1166,16 @@ sub publish {
}
}
if ($chparms) {
- $scrout.='
'.&mt('Obsolete parameters or saved values').': '.
- $chparms.'
'.&mt('Warning!').
- '
'.
- &mt('If this resource is in active use, student performance data from the previous version may become inaccessible.').'
';
+ $scrout.=''.&mt('Obsolete parameters or saved values').': '
+ .$chparms.'
'
+ .''.&mt('Warning!').'
'
+ .&mt('If this resource is in active use, student performance data from the previous version may become inaccessible.')
+ .'
';
}
if ($metadatafields{'copyright'} eq 'priv') {
- $scrout.=''.&mt('Warning!').
- '
'.
- &mt('Copyright/distribution option "Private" is no longer supported. Select another option from below. Consider "Custom Rights" for maximum control over the usage of your resource.').'
';
+ $scrout.=''.&mt('Warning!').'
'
+ .&mt('Copyright/distribution option "Private" is no longer supported. Select another option from below. Consider "Custom Rights" for maximum control over the usage of your resource.')
+ .'
';
}
# ------------------------------------------------------- Now have all metadata
@@ -1172,17 +1187,22 @@ sub publish {
$textonly=~s/\';
- $r->print(&Apache::loncommon::start_page('Resource Publication',$js));
-
-
- my $thisfn=$fn;
-
- my $thistarget=$thisfn;
-
- $thistarget=~s/^\/home/$targetdir/;
- $thistarget=~s/\/public\_html//;
-
- my $thisdistarget=$thistarget;
- $thisdistarget=~s/^\Q$docroot\E//;
-
- my $thisdisfn=$thisfn;
- $thisdisfn=~s/^\/home\/\Q$cuname\E\/public_html\///;
+ $r->print(&Apache::loncommon::start_page('Resource Publication',$js)
+ .&Apache::lonhtmlcommon::breadcrumbs()
+ .&Apache::loncommon::head_subbox(
+ &Apache::loncommon::CSTR_pageheader()) # FIXME crumbs broken?
+ );
+
+ my $thisdisfn=&HTML::Entities::encode($fn,'<>&"');
+ my $thistarget=$fn;
+ $thistarget=~s/^\/priv\//\/res\//;
+ my $thisdistarget=&HTML::Entities::encode($thistarget,'<>&"');
if ($fn=~/\/$/) {
# -------------------------------------------------------- This is a directory
&publishdirectory($r,$fn,$thisdisfn);
- $r->print('
'.&mt('Return to Directory').'');
-
-
+ $r->print('
'.&mt('Return to Directory').'');
} else {
# ---------------------- Evaluate individual file, and then output information.
- $thisfn=~/\.(\w+)$/;
+ $fn=~/\.(\w+)$/;
my $thistype=$1;
my $thisembstyle=&Apache::loncommon::fileembstyle($thistype);
if ($thistype eq 'page') { $thisembstyle = 'rat'; }
- $r->print(''.&mt('Publishing [_1]',''.$thisdisfn.'').'
');
+ $r->print(''
+ .&mt('Publishing [_1]'
+ ,''.$thisdisfn.'')
+ .'
'
+ );
$r->print(''.&mt('Resource Details').'
');
@@ -2159,7 +2204,7 @@ sub handler {
.''
);
$r->print(<
+
$thisdisfn
ENDCAPTION
$r->print(''
@@ -2169,13 +2214,11 @@ ENDCAPTION
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Target'))
.''.$thisdistarget.''
);
-# SB - ToDo:
if (($cuname ne $env{'user.name'})||($cudom ne $env{'user.domain'})) {
-# $r->print(&Apache::lonhtmlcommon::row_title(''.&mt('Co-Author').'')
$r->print(&Apache::lonhtmlcommon::row_closure()
.&Apache::lonhtmlcommon::row_title(&mt('Co-Author'))
.''
- .&mt('[_1] at [_2]',$cuname,$cudom)
+ .&Apache::loncommon::plainname($cuname,$cudom) .' ('.$cuname.':'.$cudom.')'
.''
);
}
@@ -2184,7 +2227,7 @@ ENDCAPTION
$r->print(&Apache::lonhtmlcommon::row_closure()
.&Apache::lonhtmlcommon::row_title(&mt('Diffs')));
$r->print(<
+
ENDDIFF
$r->print(&mt('Diffs with Current Version').'');
}
@@ -2193,26 +2236,25 @@ ENDDIFF
.&Apache::lonhtmlcommon::end_pick_box()
);
-# ------------------ Publishing from $thisfn to $thistarget with $thisembstyle.
+# ---------------------- Publishing from $fn to $thistarget with $thisembstyle.
unless ($env{'form.phase'} eq 'two') {
# ---------------------------------------------------------- Parse for problems
my ($warningcount,$errorcount);
if ($thisembstyle eq 'ssi') {
- ($warningcount,$errorcount)=&checkonthis($r,$thisfn);
+ ($warningcount,$errorcount)=&checkonthis($r,$fn);
}
unless ($errorcount) {
my ($outstring,$error)=
- &publish($thisfn,$thistarget,$thisembstyle);
- $r->print('
'.$outstring);
+ &publish($fn,$thistarget,$thisembstyle);
+ $r->print($outstring);
} else {
$r->print(''.
&mt('The document contains errors and cannot be published.').
'
');
}
} else {
- &phasetwo($r,$thisfn,$thistarget,$thisembstyle,$thisdistarget);
- $r->print('
');
+ &phasetwo($r,$fn,$thistarget,$thisembstyle,$thisdistarget);
}
}
$r->print(&Apache::loncommon::end_page());