--- loncom/publisher/lonpublisher.pm 2008/08/01 18:11:19 1.244
+++ loncom/publisher/lonpublisher.pm 2011/10/25 14:28:17 1.272
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Publication Handler
#
-# $Id: lonpublisher.pm,v 1.244 2008/08/01 18:11:19 bisitz Exp $
+# $Id: lonpublisher.pm,v 1.272 2011/10/25 14:28:17 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -118,6 +118,8 @@ use Apache::File;
use File::Copy;
use Apache::Constants qw(:common :http :methods);
use HTML::LCParser;
+use HTML::Entities;
+use Encode::Encoder;
use Apache::lonxml;
use Apache::loncacc;
use DBI;
@@ -264,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; @@ -274,8 +277,9 @@ sub metaread { $metastring=join('',<$metafh>); } &metaeval($metastring,$prefix); - return '' + .&mt('Processed file: [_1]',&Apache::loncfile::display($fn)) + .'
'; } ######################################### @@ -380,11 +384,11 @@ sub selectbox { my $selout="\n".&Apache::lonhtmlcommon::row_title($title) .''.&Apache::lonhtmlcommon::row_closure(); return $selout; @@ -691,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}; } @@ -843,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); } @@ -866,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); @@ -940,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'.&mt('Obsolete parameters or saved values').': '. - $chparms.'
'. - &mt('If this resource is in active use, student performance data from the previous version may become inaccessible.').'
'.&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.')
+ .'
'. - &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.').'
'.&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.')
+ .'