--- loncom/publisher/lonpublisher.pm 2003/08/21 17:01:07 1.130 +++ loncom/publisher/lonpublisher.pm 2003/09/22 00:48:32 1.134 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.130 2003/08/21 17:01:07 albertel Exp $ +# $Id: lonpublisher.pm,v 1.134 2003/09/22 00:48:32 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -142,6 +142,7 @@ use DBI; use Apache::lonnet(); use Apache::loncommon(); use Apache::lonmysql; +use Apache::lonlocal; use vars qw(%metadatafields %metadatakeys); my %addid; @@ -324,6 +325,7 @@ string which presents the form field (fo ######################################### sub textfield { my ($title,$name,$value)=@_; + $title=&mt($title); my $uctitle=uc($title); return "\n

$uctitle:". "


". @@ -337,6 +339,7 @@ sub hiddenfield { sub selectbox { my ($title,$name,$value,$functionref,@idlist)=@_; + $title=&mt($title); my $uctitle=uc($title); $value=(split(/\s*,\s*/,$value))[-1]; my $selout="\n

$uctitle:". @@ -719,7 +722,7 @@ sub fix_ids_and_indices { if (!$endtag) { if ($token->[4]=~m:/>$:) { $endtag=' /'; }; } $outstring.='<'.$tag.$newparmstring.$endtag.'>'; if ($lctag eq 'm' || $lctag eq 'script' - || $lctag eq 'display') { + || $lctag eq 'display' || $lctag eq 'tex') { $outstring.=&get_all_text_unbalanced('/'.$lctag,\@parser); } } elsif ($token->[0] eq 'E') { @@ -974,11 +977,12 @@ sub publish { # -------------------------------------------------- Parse content for metadata if (($style eq 'ssi') || ($style eq 'prv')) { - my $oldenv=$ENV{'request.uri'}; - - $ENV{'request.uri'}=$target; - $allmeta=Apache::lonxml::xmlparse(undef,'meta',$content); - $ENV{'request.uri'}=$oldenv; + my $dir=$source; + $dir=~s-/[^/]*$--; + my $file=$source; + $file=(split('/',$file))[-1]; + $source=&Apache::lonnet::hreflocation($dir,$file); + $allmeta=&Apache::lonnet::ssi_body($source,('grade_target' => 'meta')); &metaeval($allmeta); } @@ -1492,6 +1496,8 @@ sub phasetwo { sub batchpublish { my ($r,$srcfile,$targetfile)=@_; + #publication pollutes %ENV with form.* values + my %oldENV=%ENV; $srcfile=~s/\/+/\//g; $targetfile=~s/\/+/\//g; my $thisdisfn=$srcfile; @@ -1527,6 +1533,7 @@ sub batchpublish { &phasetwo($r,$srcfile,$targetfile,$thisembstyle,$thisdistarget,1); $r->print('

'); } + %ENV=%oldENV; return ''; }