--- loncom/interface/lonparmset.pm 2006/07/14 17:44:11 1.321 +++ loncom/interface/lonparmset.pm 2008/12/12 17:06:05 1.419 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.321 2006/07/14 17:44:11 www Exp $ +# $Id: lonparmset.pm,v 1.419 2008/12/12 17:06:05 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -44,46 +44,11 @@ This module sets coursewide and assessme =head1 INTERNAL SUBROUTINES -=over 4 - -=cut - -################################################################### -################################################################### - -package Apache::lonparmset; - -use strict; -use Apache::lonnet; -use Apache::Constants qw(:common :http REDIRECT); -use Apache::lonhtmlcommon(); -use Apache::loncommon; -use GDBM_File; -use Apache::lonhomework; -use Apache::lonxml; -use Apache::lonlocal; -use Apache::lonnavmaps; -use Apache::longroup; -use Apache::lonrss; -use LONCAPA; - -# --- Caches local to lonparmset - -my $parmhashid; -my %parmhash; -my $symbsid; -my %symbs; -my $rulesid; -my %rules; - -# --- end local caches - -################################################## -################################################## +=over =pod -=item parmval +=item parmval() Figure out a cascading parameter. @@ -108,9 +73,282 @@ Returns: A list, the first item is the 2 - Map or Folder level for specific student 1 - resource level for specific student +=item parmval_by_symb() + +=item reset_caches() + +=item cacheparmhash() + +=item parmhash() + +=item symbcache() + +=item preset_defaults() + +=item date_sanity_info() + +=item storeparm() + +Store a parameter by symb + + Takes + - symb + - name of parameter + - level + - new value + - new type + - username + - userdomain + +=item log_parmset() + +=item storeparm_by_symb_inner() + +=item valout() + +Format a value for output. + +Inputs: $value, $type, $editable + +Returns: $value, formatted for output. If $type indicates it is a date, +localtime($value) is returned. +$editable will return an icon to click on + +=item plink() + +Produces a link anchor. + +Inputs: $type,$dis,$value,$marker,$return,$call + +Returns: scalar with html code for a link which will envoke the +javascript function 'pjump'. + +=item page_js() + +=item startpage() + +=item print_row() + +=item print_td() + +=item print_usergroups() + +=item parm_control_group() + +=item extractResourceInformation() : + +Given the course data hash, extractResourceInformation extracts lots of information about the course's resources into a variety of hashes. + +Input: See list below: + +=item * B : An array that will contain all of the ids in the course. + +=item * B : hash, id->type, where "type" contains the extension of the file, thus, I. + +=item * B : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id + +=item * B : hash, name of parameter->display value (what is the display value?) + +=item * B : hash, part identification->text representation of part, where the text representation is "[Part $part]" + +=item * B : hash, full key to part->display value (what's display value?) + +=item * B : hash, ??? + +=item * B : ??? + +=item * B : hash, ??? + +=item * B : ?? + +=item * B : hash, id->full sym? + + + +=item isdateparm() + +=item parmmenu() + +=item partmenu() + +=item usermenu() + +=item displaymenu() + +=item mapmenu() + +=item levelmenu() + +=item sectionmenu() + +=item keysplit() + +=item keysinorder() + +=item keysinorder_bytype() + +=item keysindisplayorder() + +=item standardkeyorder() + +=item assessparms() : + +Show assessment data and parameters. This is a large routine that should +be simplified and shortened... someday. + +Inputs: $r + +Returns: nothing + +Variables used (guessed by Jeremy): + +=item * B: ParameterS CATegories? ends up a list of the types of parameters that exist, e.g., tol, weight, acc, opendate, duedate, answerdate, sig, maxtries, type. + +=item * B: ParameterS PaRTs? a list of the parts of a problem that we are displaying? Used to display only selected parts? + +=item * B<@catmarker> contains list of all possible parameters including part #s + +=item * B<$fullkeyp> contains the full part/id # for the extraction of proper parameters + +=item * B<$tempkeyp> contains part 0 only (no ids - ie, subparts) + When storing information, store as part 0 + When requesting information, request from full part + +=item crsenv() + +Show and set course data and parameters. This is a large routine that should +be simplified and shortened... someday. + +Inputs: $r + +Returns: nothing + +=item can_modify_catsettings() + +=item assign_course_categories() + +=item tablestart() + +=item tableend() + +=item extractuser() + +=item parse_listdata_key() + +=item listdata() + +=item date_interval_selector() + +=item get_date_interval_from_form() + +=item default_selector() + +=item string_selector() + +=item dateshift() + +=item newoverview() + +=item secgroup_lister() + +=item overview() + +=item clean_parameters() + +=item date_shift_one() + +=item date_shift_two() + +=item parse_key() + +=item check_cloners() : + +Checks if new users included in list of allowed cloners +are valid users. Replaces supplied list with +cleaned list containing only users with valid usernames +and domains. + +Inputs: $clonelist, $oldcloner +where $clonelist is ref to array of requested cloners, +and $oldcloner is ref to array of currently allowed +cloners. + +Returns: string - comma separated list of requested +cloners (username:domain) who do not exist in system. + +=item change_clone() : + +Modifies the list of courses a user can clone (stored +in the user's environment.db file), called when a +change is made to the list of users allowed to clone +a course. + +Inputs: $action,$cloner +where $action is add or drop, and $cloner is identity of +user for whom cloning ability is to be changed in course. + + +=item check_cloners() + +=item change_clone() + +=item header() + +Output html header for page + +=item print_main_menu() + +=item output_row() + +Set portfolio metadata + +=item order_meta_fields() + +=item addmetafield() + +=item setrestrictmeta() + +=item get_added_meta_fieldnames() + +=item get_deleted_meta_fieldnames() + +=item defaultsetter() + +=item components() + +=item load_parameter_names() + +=item parm_change_log() + +=item handler() : + +Main handler. Calls &assessparms and &crsenv subroutines. + + +=back + =cut -################################################## +################################################################### +################################################################### + +package Apache::lonparmset; + +use strict; +use Apache::lonnet; +use Apache::Constants qw(:common :http REDIRECT); +use Apache::lonhtmlcommon(); +use Apache::loncommon; +use GDBM_File; +use Apache::lonhomework; +use Apache::lonxml; +use Apache::lonlocal; +use Apache::lonnavmaps; +use Apache::longroup; +use Apache::lonrss; +use LONCAPA qw(:DEFAULT :match); + + sub parmval { my ($what,$id,$def,$uname,$udom,$csec,$cgroup,$courseopt)=@_; return &parmval_by_symb($what,&symbcache($id),$def,$uname,$udom,$csec, @@ -119,10 +357,11 @@ sub parmval { sub parmval_by_symb { my ($what,$symb,$def,$uname,$udom,$csec,$cgroup,$courseopt)=@_; -# load caches - &cacheparmhash(); - my $useropt=&Apache::lonnet::get_userresdata($uname,$udom); + my $useropt; + if ($uname ne '' && $udom ne '') { + $useropt = &Apache::lonnet::get_userresdata($uname,$udom); + } my $result=''; my @outpar=(); @@ -164,7 +403,7 @@ sub parmval_by_symb { # ------------------------------------------------------ third, check map parms - my $thisparm=$parmhash{$symbparm}; + my $thisparm=&parmhash($symbparm); if (defined($thisparm)) { $outpar[11]=$thisparm; $result=11; } if (defined($$courseopt{$courselevelr})) { @@ -173,7 +412,7 @@ sub parmval_by_symb { } # ------------------------------------------------------ fourth, back to course - if (defined($csec)) { + if ($csec ne '') { if (defined($$courseopt{$seclevel})) { $outpar[9]=$$courseopt{$seclevel}; $result=9; @@ -189,7 +428,7 @@ sub parmval_by_symb { } } # ------------------------------------------------------ fifth, check course group - if (defined($cgroup)) { + if ($cgroup ne '') { if (defined($$courseopt{$grplevel})) { $outpar[6]=$$courseopt{$grplevel}; $result=6; @@ -206,7 +445,7 @@ sub parmval_by_symb { # ---------------------------------------------------------- fifth, check user - if (defined($uname)) { + if ($uname ne '') { if (defined($$useropt{$courselevel})) { $outpar[3]=$$useropt{$courselevel}; $result=3; @@ -225,62 +464,94 @@ sub parmval_by_symb { return ($result,@outpar); } -sub resetparmhash { - $parmhashid=''; -} -sub cacheparmhash { - if ($parmhashid eq $env{'request.course.fn'}) { return; } - my %parmhashfile; - if (tie(%parmhashfile,'GDBM_File', - $env{'request.course.fn'}.'_parms.db',&GDBM_READER(),0640)) { - %parmhash=%parmhashfile; - untie %parmhashfile; - $parmhashid=$env{'request.course.fn'}; - } -} -sub resetsymbcache { - $symbsid=''; +# --- Caches local to lonparmset + + +sub reset_caches { + &resetparmhash(); + &resetsymbcache(); + &resetrulescache(); } -sub symbcache { - my $id=shift; - if ($symbsid ne $env{'request.course.id'}) { - %symbs=(); +{ + my $parmhashid; + my %parmhash; + sub resetparmhash { + undef($parmhashid); + undef(%parmhash); } - unless ($symbs{$id}) { - my $navmap = Apache::lonnavmaps::navmap->new(); - if ($id=~/\./) { - my $resource=$navmap->getById($id); - $symbs{$id}=$resource->symb(); - } else { - my $resource=$navmap->getByMapPc($id); - $symbs{$id}=&Apache::lonnet::declutter($resource->src()); + + sub cacheparmhash { + if ($parmhashid eq $env{'request.course.fn'}) { return; } + my %parmhashfile; + if (tie(%parmhashfile,'GDBM_File', + $env{'request.course.fn'}.'_parms.db',&GDBM_READER(),0640)) { + %parmhash=%parmhashfile; + untie(%parmhashfile); + $parmhashid=$env{'request.course.fn'}; } - $symbsid=$env{'request.course.id'}; } - return $symbs{$id}; -} - -sub resetrulescache { - $rulesid=''; -} + + sub parmhash { + my ($id) = @_; + &cacheparmhash(); + return $parmhash{$id}; + } + } + +{ + my $symbsid; + my %symbs; + sub resetsymbcache { + undef($symbsid); + undef(%symbs); + } + + sub symbcache { + my $id=shift; + if ($symbsid ne $env{'request.course.id'}) { + undef(%symbs); + } + if (!$symbs{$id}) { + my $navmap = Apache::lonnavmaps::navmap->new(); + if ($id=~/\./) { + my $resource=$navmap->getById($id); + $symbs{$id}=$resource->symb(); + } else { + my $resource=$navmap->getByMapPc($id); + $symbs{$id}=&Apache::lonnet::declutter($resource->src()); + } + $symbsid=$env{'request.course.id'}; + } + return $symbs{$id}; + } + } -sub rulescache { - my $id=shift; - if ($rulesid ne $env{'request.course.id'}) { - %rules=(); +{ + my $rulesid; + my %rules; + sub resetrulescache { + undef($rulesid); + undef(%rules); } - unless (defined($rules{$id})) { - my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; - my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; - %rules=&Apache::lonnet::dump('parmdefactions',$dom,$crs); - $rulesid=$env{'request.course.id'}; + + sub rulescache { + my $id=shift; + if ($rulesid ne $env{'request.course.id'} + && !defined($rules{$id})) { + my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; + my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; + %rules=&Apache::lonnet::dump('parmdefactions',$dom,$crs); + $rulesid=$env{'request.course.id'}; + } + return $rules{$id}; } - return $rules{$id}; } + + sub preset_defaults { my $type=shift; if (&rulescache($type.'_action') eq 'default') { @@ -295,7 +566,8 @@ sub preset_defaults { } } -################################################## + + sub date_sanity_info { my $checkdate=shift; @@ -304,14 +576,31 @@ sub date_sanity_info { my $crsprefix='course.'.$env{'request.course.id'}.'.'; if ($env{$crsprefix.'default_enrollment_end_date'}) { if ($checkdate>$env{$crsprefix.'default_enrollment_end_date'}) { - $result.='
'.&mt('After course enrollment end!'); + $result.='
' + .&mt('After course enrollment end!') + .'
'; } } if ($env{$crsprefix.'default_enrollment_start_date'}) { if ($checkdate<$env{$crsprefix.'default_enrollment_start_date'}) { - $result.='
'.&mt('Before course enrollment start!'); + $result.='
' + .&mt('Before course enrollment start!') + .'
'; } } +# Preparation for additional warnings about dates in the past/future. +# An improved, more context sensitive version is recommended, +# e.g. warn for due and answer dates which are defined before the corresponding open date, etc. +# if ($checkdate'; +# } +# if ($checkdate>time) { +# $result.='
' +# .'('.&mt('in the future').')' +# .'
'; +# } return $result; } ################################################## @@ -333,18 +622,6 @@ sub storeparm { &storeparm_by_symb(&symbcache($sresid),$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,'',$cgroup); } -# -# Store a parameter by symb -# -# Takes -# - symb -# - name of parameter -# - level -# - new value -# - new type -# - username -# - userdomain - my %recstack; sub storeparm_by_symb { my ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$recflag,$cgroup)=@_; @@ -499,86 +776,64 @@ sub storeparm_by_symb_inner { return ''; } -################################################## -################################################## - -=pod - -=item valout - -Format a value for output. - -Inputs: $value, $type, $editable - -Returns: $value, formatted for output. If $type indicates it is a date, -localtime($value) is returned. -$editable will return an icon to click on -=cut - -################################################## -################################################## sub valout { my ($value,$type,$editable)=@_; my $result = ''; # Values of zero are valid. if (! $value && $value ne '0') { if ($editable) { - $result = ''; + $result = '*'; } else { $result=' '; } } else { if ($type eq 'date_interval') { my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value); + my @timer; $year=$year-70; $mday--; if ($year) { - $result.=$year.' yrs '; +# $result.=&mt('[quant,_1,yr]',$year).' '; + push(@timer,&mt('[quant,_1,yr]',$year)); } if ($mon) { - $result.=$mon.' mths '; +# $result.=&mt('[quant,_1,mth]',$mon).' '; + push(@timer,&mt('[quant,_1,mth]',$mon)); } if ($mday) { - $result.=$mday.' days '; +# $result.=&mt('[quant,_1,day]',$mday).' '; + push(@timer,&mt('[quant,_1,day]',$mday)); } if ($hour) { - $result.=$hour.' hrs '; +# $result.=&mt('[quant,_1,hr]',$hour).' '; + push(@timer,&mt('[quant,_1,hr]',$hour)); } if ($min) { - $result.=$min.' mins '; +# $result.=&mt('[quant,_1,min]',$min).' '; + push(@timer,&mt('[quant,_1,min]',$min)); } if ($sec) { - $result.=$sec.' secs '; +# $result.=&mt('[quant,_1,sec]',$sec).' '; + push(@timer,&mt('[quant,_1,sec]',$sec)); + } +# $result=~s/\s+$//; + if (!@timer) { # Special case: all entries 0 -> display "0 secs" intead of empty field to keep this field editable + push(@timer,&mt('[quant,_1,sec]',0)); } - $result=~s/\s+$//; + $result.=join(", ",@timer); } elsif (&isdateparm($type)) { - $result = localtime($value).&date_sanity_info($value); + $result = &Apache::lonlocal::locallocaltime($value). + &date_sanity_info($value); } else { $result = $value; + $result = &HTML::Entities::encode($result,'"<>&'); } } return $result; } -################################################## -################################################## - -=pod - -=item plink - -Produces a link anchor. - -Inputs: $type,$dis,$value,$marker,$return,$call - -Returns: scalar with html code for a link which will envoke the -javascript function 'pjump'. -=cut - -################################################## -################################################## sub plink { my ($type,$dis,$value,$marker,$return,$call)=@_; my $winvalue=$value; @@ -592,10 +847,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 { @@ -655,6 +916,15 @@ sub startpage { my %loaditems = ('onunload' => "pclose()", 'onload' => "group_or_section('cgroup')",); + if ((($env{'form.command'} eq 'set') && ($env{'form.url'}) + && (!$env{'form.dis'})) || ($env{'form.symb'})) { + &Apache::lonhtmlcommon::add_breadcrumb({help=>'Problem_Parameters', + text=>"Problem Parameters"}); + } else { + &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable', + text=>"Table Mode", + help => 'Course_Setting_Parameters'}); + } my $start_page = &Apache::loncommon::start_page('Set/Modify Course Parameters', &page_js(), @@ -665,10 +935,10 @@ sub startpage { $start_page $breadcrumbs
- - - - + + + + ENDHEAD } @@ -700,7 +970,7 @@ sub print_row { my $parm=$$display{$which}; if ($parmlev eq 'full') { - $r->print('' + $r->print('' .$$part{$which}.''); } else { $parm=~s|\[.*\]\s||g; @@ -709,7 +979,7 @@ sub print_row { if ($automatic) { $parm.='
'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'
'; } - $r->print(''.$parm.''); + $r->print(''.$parm.''); my $thismarker=$which; $thismarker=~s/^parameter\_//; @@ -786,14 +1056,14 @@ sub print_row { } } # end of $parmlev if/else - $r->print(''.$effective_parm.''); + $r->print(''.$effective_parm.''); if ($parmlev eq 'full') { my $sessionval=&Apache::lonnet::EXT('resource.'.$$part{$which}. '.'.$$name{$which},$$symbp{$rid}); my $sessionvaltype=$typeoutpar[$result]; if (!defined($sessionvaltype)) { $sessionvaltype=$$defaulttype{$which}; } - $r->print(''. + $r->print(''. &valout($sessionval,$sessionvaltype).' '. ''); } @@ -803,8 +1073,8 @@ sub print_row { sub print_td { my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display)=@_; - $r->print(''); + $r->print(''); if ($which<11 || $which > 12) { $r->print(&plink($$typeoutpar[$which], $$display{$value},$$outpar[$which], @@ -830,11 +1100,11 @@ sub print_usergroups { my $grp_parm; if (($coursereply) && ($cgroup ne $resultgroup)) { if ($result > 3) { - $bgcolor = '"#AAFFAA"'; + $bgcolor = '#AAFFAA'; $grp_parm = &valout($coursereply,$resulttype); } $grp_parm = &valout($coursereply,$resulttype); - $output = ''; + $output = ''; if ($resultgroup && $resultlevel) { $output .= ''.$resultgroup.' ('.$resultlevel.'): '.$grp_parm; } else { @@ -842,7 +1112,7 @@ sub print_usergroups { } $output .= ''; } else { - $output .= ' '; + $output .= ' '; } return ($coursereply,$output,$grp_parm,$resultgroup); } @@ -871,39 +1141,7 @@ sub parm_control_group { return($coursereply,$resultitem,$resultgroup,$resultlevel,$resulttype); } -=pod - -=item B: Given the course data hash, extractResourceInformation extracts lots of information about the course's resources into a variety of hashes. - -Input: See list below: - -=over 4 - -=item B: An array that will contain all of the ids in the course. - -=item B: hash, id->type, where "type" contains the extension of the file, thus, I. - -=item B: hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id - -=item B: hash, name of parameter->display value (what is the display value?) -=item B: hash, part identification->text representation of part, where the text representation is "[Part $part]" - -=item B: hash, full key to part->display value (what's display value?) - -=item B: hash, ??? - -=item B: ??? - -=item B: hash, ??? - -=item B: ?? - -=item B: hash, id->full sym? - -=back - -=cut sub extractResourceInformation { my $ids = shift; @@ -933,63 +1171,70 @@ sub extractResourceInformation { $$typep{$id}=$1; $$keyp{$id}=''; $$uris{$id}=$srcf; - foreach (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) { - if ($_=~/^parameter\_(.*)/) { - my $key=$_; + foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) { + next if ($key!~/^parameter_/); + # Hidden parameters - if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq 'parm') { - next; - } - my $display= &Apache::lonnet::metadata($srcf,$key.'.display'); - my $name=&Apache::lonnet::metadata($srcf,$key.'.name'); - my $part= &Apache::lonnet::metadata($srcf,$key.'.part'); + next if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq 'parm'); # # allparms is a hash of parameter names # + my $name=&Apache::lonnet::metadata($srcf,$key.'.name'); + if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) { + my $display= &Apache::lonnet::metadata($srcf,$key.'.display'); my $parmdis = $display; - $parmdis =~ s/\[Part.*$//g; - $$allparms{$name}=$parmdis; - $$defkeytype{$name}=&Apache::lonnet::metadata($srcf,$key.'.type'); + $parmdis =~ s/\s*\[Part.*$//g; + $$allparms{$name}=$parmdis; + if (ref($defkeytype)) { + $$defkeytype{$name}= + &Apache::lonnet::metadata($srcf,$key.'.type'); + } + } + # # allparts is a hash of all parts # - $$allparts{$part} = "Part: $part"; + my $part= &Apache::lonnet::metadata($srcf,$key.'.part'); + $$allparts{$part} = &mt('Part: [_1]',$part); # # Remember all keys going with this resource # - if ($$keyp{$id}) { - $$keyp{$id}.=','.$key; - } else { - $$keyp{$id}=$key; - } + if ($$keyp{$id}) { + $$keyp{$id}.=','.$key; + } else { + $$keyp{$id}=$key; + } # # Put in order # - unless ($$keyorder{$key}) { - $$keyorder{$key}=$keyordercnt; - $keyordercnt++; - } - + unless ($$keyorder{$key}) { + $$keyorder{$key}=$keyordercnt; + $keyordercnt++; } } - $$mapp{$id}= - &Apache::lonnet::declutter($resource->enclosing_map_src()); - $$mapp{$mapid}=$$mapp{$id}; - $$allmaps{$mapid}=$$mapp{$id}; - if ($mapid eq '1') { - $$maptitles{$mapid}='Main Course Documents'; + + + if (!exists($$mapp{$mapid})) { + $$mapp{$id}= + &Apache::lonnet::declutter($resource->enclosing_map_src()); + $$mapp{$mapid}=$$mapp{$id}; + $$allmaps{$mapid}=$$mapp{$id}; + if ($mapid eq '1') { + $$maptitles{$mapid}=&mt('Main Course Documents'); + } else { + $$maptitles{$mapid}= + &Apache::lonnet::gettitle($$mapp{$id}); + } + $$maptitles{$$mapp{$id}}=$$maptitles{$mapid}; + $$symbp{$mapid}=$$mapp{$id}.'___(all)'; } else { - $$maptitles{$mapid}=&Apache::lonnet::gettitle(&Apache::lonnet::clutter($$mapp{$id})); + $$mapp{$id} = $$mapp{$mapid}; } - $$maptitles{$$mapp{$id}}=$$maptitles{$mapid}; $$symbp{$id}=&Apache::lonnet::encode_symb($$mapp{$id},$resid,$srcf); - $$symbp{$mapid}=$$mapp{$id}.'___(all)'; } } -################################################## -################################################## sub isdateparm { my $type=shift; @@ -1065,40 +1310,67 @@ ENDSCRIPT $r->print("\n"); my $cnt=0; foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) { - $r->print("\n'); + $r->print('>'.($$allparms{$tempkey}=~/\S/ ? &mt($$allparms{$tempkey}) + : &mt($tempkey)) + .''); $cnt++; if ($cnt==3) { $r->print("\n"); $cnt=0; } } - $r->print(' - -'); - $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('' + .'' + .'' + .'
'.&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(' function group_or_section(caller) { @@ -1175,7 +1445,7 @@ function group_or_section(caller) { } if (%grouphash) { - $groups=$lt{'gr'}.': -$lt{'oi'} - -$lt{'ad'} -$chooseopt - -ENDMENU + + if (%sectionhash || %grouphash) { + $g_s_header='
'.&mt('Group/Section').'
'; + $g_s_footer='
'; + } + + $r->print('' + .$g_s_header + .$sections + .$groups + .$g_s_footer + .'
'.&mt('User').'
' + .&mt('For User [_1] or Student/Employee ID [_2] at Domain [_3]' + ,'' + ,' ' + ,$chooseopt) + .'
' + .'
' + ); } sub displaymenu { @@ -1217,7 +1493,7 @@ sub displaymenu { $r->print('
'.&mt('Select Parameters to View').''. &mt('Select Parts to View').'
'); &parmmenu($r,$allparms,$pscat,$keyorder); - $r->print(''); + $r->print(''); &partmenu($r,$allparts,$psprt); $r->print('
'); } @@ -1229,7 +1505,7 @@ sub mapmenu { $r->print(''); foreach (sort {$$allmaps{$a} cmp $$allmaps{$b}} keys %{$allmaps}) { $r->print(''); } $r->print(""); @@ -1243,9 +1519,9 @@ sub levelmenu { foreach (reverse sort keys %{$alllevs}) { $r->print(''); + $r->print('>'.&mt($_).''); } $r->print(""); } @@ -1261,7 +1537,7 @@ sub sectionmenu { $r->print('