--- loncom/publisher/lonpublisher.pm 2008/08/19 10:43:59 1.246
+++ loncom/publisher/lonpublisher.pm 2009/03/26 11:27:26 1.254
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Publication Handler
#
-# $Id: lonpublisher.pm,v 1.246 2008/08/19 10:43:59 bisitz Exp $
+# $Id: lonpublisher.pm,v 1.254 2009/03/26 11:27:26 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -695,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}; }
@@ -873,7 +874,7 @@ sub store_metadata {
}
if (defined($status) && $status ne '') {
$error=''
- .&mt('Error occured saving new values in metadata table in LON-CAPA database!')
+ .&mt('Error occurred saving new values in metadata table in LON-CAPA database!')
.'';
&Apache::lonnet::logthis($error);
&Apache::lonnet::logthis($status);
@@ -947,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
@@ -1061,7 +1062,7 @@ sub publish {
my %oldparmstores=();
unless ($batch) {
- $scrout.='
'
- .&Apache::loncommon::start_data_table()
- .&Apache::loncommon::start_data_table_row();
-
+ .&Apache::loncommon::start_data_table();
+ my $cols_per_row = 10;
my $colcount=0;
+ my $wordcount=0;
+ my $numkeywords = scalar(keys(%keywords));
- foreach (sort keys %keywords) {
- $colcount++;
- $keywordout.='
';
- if ($colcount>=10) {
- $keywordout.=&Apache::loncommon::end_data_table_row()
- .&Apache::loncommon::start_data_table_row();
- $colcount=0;
- }
- }
- # Proper end of started table row:
- if ($colcount != 0) { # has still to be improved: if amount of keywords mod 10 == 0, then do not start another table row
- while ($colcount<10) {
- $keywordout.='
';
+ if ($colcount == $cols_per_row) {
+ $keywordout.=&Apache::loncommon::end_data_table_row();
+ $colcount=0;
+ }
+ }
+ if ($colcount > 0) {
+ $keywordout .= &Apache::loncommon::end_data_table_row();
}
$env{'form.keywords'}=~s/\,$//;
@@ -1497,7 +1504,7 @@ sub phasetwo {
return 0;
}
if ($target=~/\.(\d+)\.(\w+)$/) {
- $r->print(''.&mt('Cannot publish versioned resource, FAIL').'');
+ $r->print(''.&mt('Filename of resource contains internal version number. Cannot publish such resources, FAIL').'');
return 0;
}
}
@@ -1645,14 +1652,14 @@ sub phasetwo {
unlink($srcd.'/'.$filename);
unlink($srcd.'/'.$filename.'.meta');
} else {
- if ($filename=~/\Q$srcf\E\.(\d+)\.\Q$srct\E$/) {
+ if ($filename=~/^\Q$srcf\E\.(\d+)\.\Q$srct\E$/) {
$maxversion=($1>$maxversion)?$1:$maxversion;
}
}
}
closedir(DIR);
$maxversion++;
- $r->print('
Creating old version '.$maxversion.'
');
+ $r->print('
'.&mt('Creating old version [_1]',$maxversion).'
');
print $logfile "\nCreating old version ".$maxversion."\n";
my $copyfile=$srcd.'/'.$srcf.'.'.$maxversion.'.'.$srct;
@@ -1765,7 +1772,7 @@ sub phasetwo {
&mt('Back to Source Directory').'');
}
$logfile->close();
- $r->print('
'.&mt('Done').'
');
+ $r->print('
'.&mt('Done').'
');
return 1;
}
@@ -1832,7 +1839,11 @@ sub batchpublish {
my $thisembstyle=&Apache::loncommon::fileembstyle($thistype);
- $r->print('