--- loncom/publisher/lonpublisher.pm 2004/01/20 23:02:20 1.145.2.1 +++ loncom/publisher/lonpublisher.pm 2003/12/16 14:42:34 1.147 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.145.2.1 2004/01/20 23:02:20 albertel Exp $ +# $Id: lonpublisher.pm,v 1.147 2003/12/16 14:42:34 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -219,10 +219,7 @@ sub metaeval { $newentry=~s/^\s*//; if ($newentry !~m|^/res|) { $newentry=$prefix.$newentry; } } -# actually store - if ( $entry eq 'rule' && exists($metadatafields{$unikey})) { - $metadatafields{$unikey}.=','.$newentry; - } else { + unless ($metadatafields{$unikey}=~/\w/) { $metadatafields{$unikey}=$newentry; } } @@ -270,7 +267,7 @@ sub metaread { my ($logfile,$fn,$prefix)=@_; unless (-e $fn) { print($logfile 'No file '.$fn."\n"); - return '
No file: '. + return '
'.&mt('No file').': '. &Apache::loncfile::display($fn).''; } print($logfile 'Processing '.$fn."\n"); @@ -280,7 +277,7 @@ sub metaread { $metastring=join('',<$metafh>); } &metaeval($metastring,$prefix); - return '
Processed file: '. + return '
'.&mt('Processed file').': '. &Apache::loncfile::display($fn).''; } @@ -631,7 +628,7 @@ sub fix_ids_and_indices { join(', ',@duplicatedids)); if ($duplicateids) { print $logfile "Duplicate ID(s) exist, ".join(', ',@duplicatedids)."\n"; - my $outstring='Unable to publish file, it contains duplicated ID(s), ID(s) need to be unique. The duplicated ID(s) are: '.join(', ',@duplicatedids).''; + my $outstring=''.&mt('Unable to publish file, it contains duplicated ID(s), ID(s) need to be unique. The duplicated ID(s) are').': '.join(', ',@duplicatedids).''; return ($outstring,1); } if ($needsfixup) { @@ -871,7 +868,7 @@ sub publish { my %allow=(); unless ($logfile=Apache::File->new('>>'.$source.'.log')) { - return ('No write permission to user directory, FAIL',1); + return (''.&mt('No write permission to user directory, FAIL').'',1); } print $logfile "\n\n================= Publish ".localtime()." Phase One ================\n".$ENV{'user.name'}.'@'.$ENV{'user.domain'}."\n"; @@ -895,7 +892,7 @@ sub publish { if ($error) { return ($outstring,$error); } # ------------------------------------------------------------ Construct Allows - $scrout.='

Dependencies

'; + $scrout.='

'.&mt('Dependencies').'

'; my $allowstr=''; foreach (sort(keys(%allow))) { my $thisdep=$_; @@ -913,7 +910,7 @@ sub publish { if ( &Apache::lonnet::getfile($Apache::lonnet::perlvar{'lonDocRoot'}.'/'. $thisdep.'.meta') eq '-1') { - $scrout.= ' - Currently not available'. + $scrout.= ' - '.&mt('Currently not available'). ''; } else { my %temphash=(&Apache::lonnet::declutter($target).'___'. @@ -1090,7 +1087,7 @@ sub publish { unless ($batch) { $scrout.= '
'. - '

'. + '

'. &hiddenfield('phase','two'). &hiddenfield('filename',$ENV{'form.filename'}). &hiddenfield('allmeta',&Apache::lonnet::escape($allmeta)). @@ -1102,6 +1099,9 @@ sub publish { # --------------------------------------------------- Scan content for keywords my $keywords_help = Apache::loncommon::help_open_topic("Publishing_Keywords"); + my $KEYWORDS=&mt('KEYWORDS'); + my $CheckAll=&mt('check all'); + my $UncheckAll=&mt('uncheck all'); my $keywordout=<<"END"; -

KEYWORDS: +

$KEYWORDS: $keywords_help - - + +


END @@ -1150,7 +1150,7 @@ END $scrout.=&textfield('Notes','notes',$metadatafields{'notes'}); $scrout.= - "\n

ABSTRACT:". + "\n

".&mt('ABSTRACT').":". "


". '

';