version 1.129, 2003/08/14 13:48:34
|
version 1.135, 2003/09/24 19:38:18
|
Line 142 use DBI;
|
Line 142 use DBI;
|
use Apache::lonnet(); |
use Apache::lonnet(); |
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonmysql; |
use Apache::lonmysql; |
|
use Apache::lonlocal; |
use vars qw(%metadatafields %metadatakeys); |
use vars qw(%metadatafields %metadatakeys); |
|
|
my %addid; |
my %addid; |
Line 324 string which presents the form field (fo
|
Line 325 string which presents the form field (fo
|
######################################### |
######################################### |
sub textfield { |
sub textfield { |
my ($title,$name,$value)=@_; |
my ($title,$name,$value)=@_; |
|
$title=&mt($title); |
my $uctitle=uc($title); |
my $uctitle=uc($title); |
return "\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:". |
return "\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:". |
"</b></font></p><br />". |
"</b></font></p><br />". |
Line 337 sub hiddenfield {
|
Line 339 sub hiddenfield {
|
|
|
sub selectbox { |
sub selectbox { |
my ($title,$name,$value,$functionref,@idlist)=@_; |
my ($title,$name,$value,$functionref,@idlist)=@_; |
|
$title=&mt($title); |
my $uctitle=uc($title); |
my $uctitle=uc($title); |
$value=(split(/\s*,\s*/,$value))[-1]; |
$value=(split(/\s*,\s*/,$value))[-1]; |
my $selout="\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:". |
my $selout="\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:". |
Line 667 sub fix_ids_and_indices {
|
Line 670 sub fix_ids_and_indices {
|
} |
} |
} |
} |
# probably a <randomlabel> image type <label> |
# probably a <randomlabel> image type <label> |
if ($lctag eq 'label' && defined($parms{'description'})) { |
# or a <image> tag inside <imageresponse> |
|
if (($lctag eq 'label' && defined($parms{'description'})) |
|
|| |
|
($lctag eq 'image')) { |
my $next_token=$parser[-1]->get_token(); |
my $next_token=$parser[-1]->get_token(); |
if ($next_token->[0] eq 'T') { |
if ($next_token->[0] eq 'T') { |
$next_token->[1]=&set_allow(\%allow,$logfile, |
$next_token->[1]=&set_allow(\%allow,$logfile, |
Line 718 sub fix_ids_and_indices {
|
Line 724 sub fix_ids_and_indices {
|
} |
} |
if (!$endtag) { if ($token->[4]=~m:/>$:) { $endtag=' /'; }; } |
if (!$endtag) { if ($token->[4]=~m:/>$:) { $endtag=' /'; }; } |
$outstring.='<'.$tag.$newparmstring.$endtag.'>'; |
$outstring.='<'.$tag.$newparmstring.$endtag.'>'; |
if ($lctag eq 'm') { |
if ($lctag eq 'm' || $lctag eq 'script' |
$outstring.=&get_all_text_unbalanced('/m',\@parser); |
|| $lctag eq 'display' || $lctag eq 'tex') { |
|
$outstring.=&get_all_text_unbalanced('/'.$lctag,\@parser); |
} |
} |
} elsif ($token->[0] eq 'E') { |
} elsif ($token->[0] eq 'E') { |
if ($token->[2]) { |
if ($token->[2]) { |
Line 973 sub publish {
|
Line 980 sub publish {
|
|
|
# -------------------------------------------------- Parse content for metadata |
# -------------------------------------------------- Parse content for metadata |
if (($style eq 'ssi') || ($style eq 'prv')) { |
if (($style eq 'ssi') || ($style eq 'prv')) { |
my $oldenv=$ENV{'request.uri'}; |
my $dir=$source; |
|
$dir=~s-/[^/]*$--; |
$ENV{'request.uri'}=$target; |
my $file=$source; |
$allmeta=Apache::lonxml::xmlparse(undef,'meta',$content); |
$file=(split('/',$file))[-1]; |
$ENV{'request.uri'}=$oldenv; |
$source=&Apache::lonnet::hreflocation($dir,$file); |
|
$allmeta=&Apache::lonnet::ssi_body($source,('grade_target' => 'meta')); |
|
|
&metaeval($allmeta); |
&metaeval($allmeta); |
} |
} |
Line 1491 sub phasetwo {
|
Line 1499 sub phasetwo {
|
|
|
sub batchpublish { |
sub batchpublish { |
my ($r,$srcfile,$targetfile)=@_; |
my ($r,$srcfile,$targetfile)=@_; |
|
#publication pollutes %ENV with form.* values |
|
my %oldENV=%ENV; |
$srcfile=~s/\/+/\//g; |
$srcfile=~s/\/+/\//g; |
$targetfile=~s/\/+/\//g; |
$targetfile=~s/\/+/\//g; |
my $thisdisfn=$srcfile; |
my $thisdisfn=$srcfile; |
Line 1526 sub batchpublish {
|
Line 1536 sub batchpublish {
|
&phasetwo($r,$srcfile,$targetfile,$thisembstyle,$thisdistarget,1); |
&phasetwo($r,$srcfile,$targetfile,$thisembstyle,$thisdistarget,1); |
$r->print('</p>'); |
$r->print('</p>'); |
} |
} |
|
%ENV=%oldENV; |
return ''; |
return ''; |
} |
} |
|
|