--- loncom/publisher/lonpublisher.pm 2004/02/10 19:23:11 1.145.2.2 +++ loncom/publisher/lonpublisher.pm 2003/12/08 18:26:01 1.146 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.145.2.2 2004/02/10 19:23:11 albertel Exp $ +# $Id: lonpublisher.pm,v 1.146 2003/12/08 18:26:01 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"); @@ -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=$_; @@ -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').":". "


". '

'; @@ -1731,14 +1731,12 @@ sub handler { return HTTP_NOT_ACCEPTABLE; } - my $home=&Apache::lonnet::homeserver($cuname,$cudom); - my $allowed=0; - my @ids=&Apache::lonnet::current_machine_ids(); - foreach my $id (@ids) { if ($id eq $home) { $allowed = 1; } } - unless ($allowed) { + unless (&Apache::lonnet::homeserver($cuname,$cudom) + eq $r->dir_config('lonHostID')) { $r->log_reason($cuname.' at '.$cudom. ' trying to publish file '.$ENV{'form.filename'}. - ' ('.$fn.') - not homeserver ('.$home.')', + ' ('.$fn.') - not homeserver ('. + &Apache::lonnet::homeserver($cuname,$cudom).')', $r->filename); return HTTP_NOT_ACCEPTABLE; }