--- loncom/interface/lonparmset.pm 2007/08/24 21:31:41 1.377 +++ loncom/interface/lonparmset.pm 2008/10/10 10:54:03 1.411 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.377 2007/08/24 21:31:41 www Exp $ +# $Id: lonparmset.pm,v 1.411 2008/10/10 10:54:03 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -577,6 +577,7 @@ sub valout { &date_sanity_info($value); } else { $result = $value; + $result = &HTML::Entities::encode($result,'"<>&'); } } return $result; @@ -613,10 +614,16 @@ sub plink { my ($parmname)=((split(/\&/,$marker))[1]=~/\_([^\_]+)$/); my ($hour,$min,$sec,$val)=&preset_defaults($parmname); unless (defined($winvalue)) { $winvalue=$val; } + my $valout = &valout($value,$type,1); + foreach my $item (\$type, \$dis, \$winvalue, \$marker, \$return, \$call, + \$hour, \$min, \$sec) { + $$item = &HTML::Entities::encode($$item,'"<>&'); + $$item =~ s/\'/\\\'/g; + } return '
'. ''. - &valout($value,$type,1).'
'; + $valout.''; } sub page_js { @@ -966,7 +973,7 @@ sub extractResourceInformation { if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) { my $display= &Apache::lonnet::metadata($srcf,$key.'.display'); my $parmdis = $display; - $parmdis =~ s/\[Part.*$//g; + $parmdis =~ s/ \[Part.*$//g; $$allparms{$name}=$parmdis; if (ref($defkeytype)) { $$defkeytype{$name}= @@ -978,7 +985,7 @@ sub extractResourceInformation { # allparts is a hash of all parts # my $part= &Apache::lonnet::metadata($srcf,$key.'.part'); - $$allparts{$part} = "Part: $part"; + $$allparts{$part} = &mt('Part: [_1]',$part); # # Remember all keys going with this resource # @@ -1003,7 +1010,7 @@ sub extractResourceInformation { $$mapp{$mapid}=$$mapp{$id}; $$allmaps{$mapid}=$$mapp{$id}; if ($mapid eq '1') { - $$maptitles{$mapid}='Main Course Documents'; + $$maptitles{$mapid}=&mt('Main Course Documents'); } else { $$maptitles{$mapid}= &Apache::lonnet::gettitle($$mapp{$id}); @@ -1100,8 +1107,8 @@ ENDSCRIPT if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) { $r->print(' checked'); } - $r->print('>'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} - : $tempkey) + $r->print('>'.($$allparms{$tempkey}=~/\S/ ? &mt($$allparms{$tempkey}) + : &mt($tempkey)) .''); $cnt++; if ($cnt==3) { @@ -1109,28 +1116,53 @@ ENDSCRIPT $cnt=0; } } - $r->print(' - -Select All
-Select Common Only - -Add Problem Dates -Add Content Dates
-Add Discussion Settings -Add Visibilities
-Add Part Parameters - -Unselect All - -'); - $r->print(''); + $r->print('' + .'' + .'' + .'
'.&mt('Parameter Selection').'' + .'' + .'• '.&mt('Select All').'' + .'' + .'
' + .'' + .'• '.&mt('Select Common Only').'' + .'' + .'
' + .'' + .'• '.&mt('Unselect All').'' + .'' + .'
' + .'' + .'' + .'
'.&mt('Add Selection for...').'' + .'' + .'• '.&mt('Problem Dates').'' + .'' + .'' + .' • '.&mt('Content Dates').'' + .'' +# .'
' + .'' + .' • '.&mt('Discussion Settings').'' + .'' + .'' + .' • '.&mt('Visibilities').'' + .'' +# .'
' + .'' + .' • '.&mt('Part Parameters').'' + .'' + .'
' + .'' + .'' + ); } sub partmenu { my ($r,$allparts,$psprt)=@_; $r->print('"); @@ -1275,9 +1307,9 @@ sub levelmenu { foreach (reverse sort keys %{$alllevs}) { $r->print(''); + $r->print('>'.&mt($_).''); } $r->print(""); } @@ -1293,7 +1325,7 @@ sub sectionmenu { $r->print('