--- loncom/publisher/lonpublisher.pm 2008/08/14 13:39:02 1.245
+++ loncom/publisher/lonpublisher.pm 2009/02/11 11:49:22 1.251
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Publication Handler
#
-# $Id: lonpublisher.pm,v 1.245 2008/08/14 13:39:02 onken Exp $
+# $Id: lonpublisher.pm,v 1.251 2009/02/11 11:49:22 schafran Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -266,8 +266,9 @@ sub metaread {
my ($logfile,$fn,$prefix)=@_;
unless (-e $fn) {
print($logfile 'No file '.$fn."\n");
- return '
'.&mt('No file').': '.
- &Apache::loncfile::display($fn).'';
+ return '
'
+ .&mt('No file: [_1]'
+ ,' '.&Apache::loncfile::display($fn).'
');
}
print($logfile 'Processing '.$fn."\n");
my $metastring;
@@ -276,8 +277,9 @@ sub metaread {
$metastring=join('',<$metafh>);
}
&metaeval($metastring,$prefix);
- return '
'.&mt('Processed file').': '.
- &Apache::loncfile::display($fn).'
';
+ return ''
+ .&mt('Processed file: [_1]'
+ ,' '.&Apache::loncfile::display($fn).'
');
}
#########################################
@@ -693,6 +695,7 @@ sub fix_ids_and_indices {
$responsecounter=0;
}
if ($lctag=~/response$/) { $responsecounter++; }
+ if ($lctag eq 'import') { $responsecounter++; }
my %parms=%{$token->[2]};
$counter=$addid{$tag};
if (!$counter) { $counter=$addid{$lctag}; }
@@ -845,15 +848,17 @@ sub store_metadata {
# Determine if the table exists
my $status = &Apache::lonmysql::check_table('metadata');
if (! defined($status)) {
- $error='WARNING: Cannot connect to '.
- 'database!';
+ $error=''
+ .&mt('WARNING: Cannot connect to database!')
+ .'';
&Apache::lonnet::logthis($error);
return ($error,undef);
}
if ($status == 0) {
# It would be nice to actually create the table....
- $error ='WARNING: The metadata table does not '.
- 'exist in the LON-CAPA database.';
+ $error =''
+ .&mt('WARNING: The metadata table does not exist in the LON-CAPA database!')
+ .'';
&Apache::lonnet::logthis($error);
return ($error,undef);
}
@@ -868,8 +873,9 @@ sub store_metadata {
\%metadata);
}
if (defined($status) && $status ne '') {
- $error='Error occured saving new values in '.
- 'metadata table in LON-CAPA database';
+ $error=''
+ .&mt('Error occurred saving new values in metadata table in LON-CAPA database!')
+ .'';
&Apache::lonnet::logthis($error);
&Apache::lonnet::logthis($status);
return ($error,undef);
@@ -942,7 +948,7 @@ backup copies, performs any automatic pr
especially for rat and ssi files),
Returns a 2 element array, the first is the string to be shown to the
-user, the second is an error code, either 1 (an error occured) or 0
+user, the second is an error code, either 1 (an error occurred) or 0
(no error occurred)
I
@@ -985,30 +991,30 @@ sub publish {
if ($error) { return ($outstring,$error); }
# ------------------------------------------------------------ Construct Allows
- $scrout.=''.&mt('Dependencies').'
';
+ my $outdep=''; # Collect dependencies output data
my $allowstr='';
foreach my $thisdep (sort(keys(%allow))) {
if ($thisdep !~ /[^\s]/) { next; }
if ($thisdep =~/\$/) {
- $scrout.='
'
+ $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;
@@ -1210,7 +1222,7 @@ sub publish {
my $intr_scrout.='
'
.'');
$lock=0;
} else {
@@ -1931,7 +1949,7 @@ sub defaultmetapublish {
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
- $r->print(&Apache::loncommon::start_page('Catalog Information Publication'));
+ $r->print(&Apache::loncommon::start_page('Metadata Publication'));
# ---------------------------------------------------------------- Write Source
my $copyfile=$target;
@@ -1966,7 +1984,7 @@ sub defaultmetapublish {
# ------------------------------------------------------------------- Link back
my $link=$fn;
$link=~s/^\/home\/$cuname\/public_html\//\/priv\/$cuname\//;
- $r->print("".&mt('Back to Catalog Information').'');
+ $r->print("".&mt('Back to Metadata').'');
$r->print(&Apache::loncommon::end_page());
return OK;
}
@@ -2176,9 +2194,7 @@ 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'))
.''
@@ -2211,7 +2227,7 @@ ENDDIFF
unless ($errorcount) {
my ($outstring,$error)=
&publish($thisfn,$thistarget,$thisembstyle);
- $r->print('
'.$outstring);
+ $r->print($outstring);
} else {
$r->print(''.
&mt('The document contains errors and cannot be published.').