--- loncom/interface/lonparmset.pm 2009/11/01 12:20:16 1.475 +++ loncom/interface/lonparmset.pm 2015/05/10 01:02:35 1.551 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.475 2009/11/01 12:20:16 amueller Exp $ +# $Id: lonparmset.pm,v 1.551 2015/05/10 01:02:35 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -46,8 +46,6 @@ This module sets coursewide and assessme =over -=pod - =item parmval() Figure out a cascading parameter. @@ -137,33 +135,49 @@ javascript function 'pjump'. =item extractResourceInformation() : -Given the course data hash, extractResourceInformation extracts lots of information about the course's resources into a variety of hashes. + extractResourceInformation extracts lots of information about all of the the course's resources into a variety of hashes. + +Input: See list below + +=over 4 -Input: See list below: +=item * B : Current username -=item * B : An array that will contain all of the ids in the course. +=item * B : Domain of current user. -=item * B : hash, id->type, where "type" contains the extension of the file, thus, I. +=item * B : Course -=item * B : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id +=back + +Outputs: See list below: -=item * B : hash, name of parameter->display value (what is the display value?) +=over 4 -=item * B : hash, part identification->text representation of part, where the text representation is "[Part $part]" +=item * B (out) : An array that will contain all of the ids in the course. -=item * B : hash, full key to part->display value (what's display value?) +=item * B(out) : hash, id->type, where "type" contains the extension of the file, thus, I. -=item * B : hash, ??? +=item * B (out) : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id -=item * B : ??? +=item * B (out) : hash, name of parameter->display value (what is the display value?) -=item * B : hash, ??? +=item * B (out) : hash, part identification->text representation of part, where the text representation is "[Part $part]" + +=item * B (out) : hash, ??? =item * B : ?? =item * B : hash, id->full sym? +=item * B + +=item * B +=item * B + +=item * B + +=back =item isdateparm() @@ -196,12 +210,14 @@ Input: See list below: Show assessment data and parameters. This is a large routine that should be simplified and shortened... someday. -Inputs: $r - +Inputs: $r - the Apache request object. + Returns: nothing Variables used (guessed by Jeremy): +=over + =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? @@ -214,6 +230,8 @@ Variables used (guessed by Jeremy): When storing information, store as part 0 When requesting information, request from full part +=back + =item tablestart() =item tableend() @@ -248,37 +266,6 @@ Variables used (guessed by Jeremy): =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 @@ -311,7 +298,6 @@ Set portfolio metadata Main handler. Calls &assessparms subroutine. - =back =cut @@ -333,9 +319,35 @@ use Apache::lonlocal; use Apache::lonnavmaps; use Apache::longroup; use Apache::lonrss; +use HTML::Entities; use LONCAPA qw(:DEFAULT :match); +sub startSettingsScreen { + my ($r,$mode,$crstype)=@_; + + my $tabtext = &mt('Course Settings'); + if ($crstype eq 'Community') { + $tabtext = &mt('Community Settings'); + } + $r->print("\n".''."\n"); + $r->print('
'); +} + +sub endSettingsScreen { + my ($r)=@_; + $r->print('
'); +} + + + sub parmval { my ($what,$id,$def,$uname,$udom,$csec,$cgroup,$courseopt)=@_; return &parmval_by_symb($what,&symbcache($id),$def,$uname,$udom,$csec, @@ -662,7 +674,7 @@ sub storeparm_by_symb { } sub log_parmset { - return &Apache::lonnet::instructor_log('parameterlog',@_); + return &Apache::lonnet::write_log('course','parameterlog',@_); } sub storeparm_by_symb_inner { @@ -769,11 +781,14 @@ sub valout { my $result = ''; # Values of zero are valid. if (! $value && $value ne '0') { - if ($editable) { - $result = '*'; - } else { - $result=' '; - } + if ($editable) { + $result = + ''.&mt('Change').''; + } else { + $result=' '; + } } else { if ($type eq 'date_interval') { my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value); @@ -814,6 +829,7 @@ sub valout { &date_sanity_info($value); } else { $result = $value; + $result=~s/\,/\, /gs; $result = &HTML::Entities::encode($result,'"<>&'); } } @@ -855,16 +871,10 @@ sub page_js { return(< // + $selscript ENDJS } + +sub showhide_js { + return <<"COURSECONTENTSCRIPT"; + +function showHide_courseContent() { + var parmlevValue=document.getElementById("parmlev").value; + if (parmlevValue == 'general') { + document.getElementById('mapmenu').style.display="none"; + } else { + if ((parmlevValue == "full") || (parmlevValue == "map")) { + document.getElementById('mapmenu').style.display =""; + } else { + document.getElementById('mapmenu').style.display="none"; + } + } + return; +} + +COURSECONTENTSCRIPT +} + +sub toggleparmtextbox_js { + return <<"ENDSCRIPT"; + +if (!document.getElementsByClassName) { + function getElementsByClassName(node, classname) { + var a = []; + var re = new RegExp('(^| )'+classname+'( |$)'); + var els = node.getElementsByTagName("*"); + for(var i=0,j=els.length; i$remove'); + }); + + \$(wrapper).delegate(".LC_remove_ipacc","click", function(e){ + e.preventDefault(); \$(this).closest("div").remove(); + }) +}); + + +END +} + sub startpage { - my ($r) = @_; + my ($r,$psymb,$crstype) = @_; - my %loaditems = ('onunload' => "pclose()", - 'onload' => "group_or_section('cgroup')", - 'onload' => "showHide_courseContent()", - ); + my %loaditems = ( + 'onload' => "group_or_section('cgroup')", + ); + if (!$psymb) { + $loaditems{'onload'} = "showHide_courseContent(); group_or_section('cgroup'); resize_scrollbox('mapmenuscroll','1','1');"; + } if ((($env{'form.command'} eq 'set') && ($env{'form.url'}) && (!$env{'form.dis'})) || ($env{'form.symb'})) { @@ -916,20 +1107,31 @@ sub startpage { text=>"Table Mode", help => 'Course_Setting_Parameters'}); } + my $js = &page_js().' + +'; my $start_page = - &Apache::loncommon::start_page('Set/Modify Course Parameters', - &page_js(), - {'add_entries' => \%loaditems,}); + &Apache::loncommon::start_page('Set/Modify Course Parameters',$js, + {'add_entries' => \%loaditems,}); my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode'); + my $escfilter=&Apache::lonhtmlcommon::entity_encode($env{'form.filter'}); + my $escpart=&Apache::lonhtmlcommon::entity_encode($env{'form.part'}); + $r->print($start_page.$breadcrumbs); + &startSettingsScreen($r,'parmset',$crstype); $r->print(< + + ENDHEAD } @@ -962,7 +1164,7 @@ sub print_row { if ($parmlev eq 'full') { $r->print('' - .$$part{$which}.''); + .($$part{$which} eq '0'?'0 ('.&mt('default').')':$$part{$which}).''); } else { $parm=~s|\[.*\]\s||g; } @@ -979,26 +1181,25 @@ sub print_row { my ($othergrp,$grp_parm,$controlgrp); if ($parmlev eq 'general') { - if ($uname) { - &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); } elsif ($cgroup) { - &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); } elsif ($csec) { - &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); } else { - &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); } } elsif ($parmlev eq 'map') { if ($uname) { - &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); } elsif ($cgroup) { - &print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); } elsif ($csec) { - &print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); } else { - &print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); } } else { if ($uname) { @@ -1018,33 +1219,32 @@ sub print_row { } } - &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); - - &print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); - &print_td($r,12,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); - &print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); - &print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); - - if ($csec) { - &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); - &print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); - &print_td($r,7,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); - } + &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); + &print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); + &print_td($r,12,'#FFDDDD',$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); + &print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); + &print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); + + if ($csec) { + &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); + &print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); + &print_td($r,7,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); + } if ($cgroup) { - &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); - &print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); - &print_td($r,4,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); + &print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); + &print_td($r,4,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); } - if ($uname) { + if ($uname) { if ($othergrp) { $r->print($othergrp); } - &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); - &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); - &print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); - } + &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); + &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); + &print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); + } } # end of $parmlev if/else $r->print(''.$effective_parm.''); @@ -1073,6 +1273,10 @@ sub print_td { if ($which > 3) { $nolink = 1; } + } elsif ($mprefix =~ /examcode\&$/) { + unless ($which == 2) { + $nolink = 1; + } } if ($nolink) { $r->print(&valout($$outpar[$which],$$typeoutpar[$which])); @@ -1161,81 +1365,81 @@ sub extractResourceInformation { my $navmap = Apache::lonnavmaps::navmap->new(); my @allres=$navmap->retrieveResources(undef,undef,1,undef,1); foreach my $resource (@allres) { - my $id=$resource->id(); + my $id=$resource->id(); my ($mapid,$resid)=split(/\./,$id); - if ($mapid eq '0') { next; } - $$ids[$#$ids+1]=$id; - my $srcf=$resource->src(); - $srcf=~/\.(\w+)$/; - $$typep{$id}=$1; - $$keyp{$id}=''; + if ($mapid eq '0') { next; } + $$ids[$#$ids+1]=$id; + my $srcf=$resource->src(); + $srcf=~/\.(\w+)$/; + $$typep{$id}=$1; + $$keyp{$id}=''; $$uris{$id}=$srcf; - foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) { - next if ($key!~/^parameter_/); + + foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) { + next if ($key!~/^parameter_/); # Hidden parameters - next if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq 'parm'); + 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,$parmdis); - $display = &standard_parameter_names($name); - if ($display eq '') { - $display= &Apache::lonnet::metadata($srcf,$key.'.display'); - $parmdis = $display; - $parmdis =~ s/\s*\[Part.*$//g; - } else { - $parmdis = &mt($display); - } - $$allparms{$name}=$parmdis; - if (ref($defkeytype)) { - $$defkeytype{$name}= - &Apache::lonnet::metadata($srcf,$key.'.type'); - } - } + my $name=&Apache::lonnet::metadata($srcf,$key.'.name'); + if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) { + my ($display,$parmdis); + $display = &standard_parameter_names($name); + if ($display eq '') { + $display= &Apache::lonnet::metadata($srcf,$key.'.display'); + $parmdis = $display; + $parmdis =~ s/\s*\[Part.*$//g; + } else { + $parmdis = &mt($display); + } + $$allparms{$name}=$parmdis; + if (ref($defkeytype)) { + $$defkeytype{$name}= + &Apache::lonnet::metadata($srcf,$key.'.type'); + } + } # # allparts is a hash of all parts # - my $part= &Apache::lonnet::metadata($srcf,$key.'.part'); - $$allparts{$part} = &mt('Part: [_1]',$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++; + } } - } - 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'); + 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 Content'); + } else { + $$maptitles{$mapid}=&Apache::lonnet::gettitle($$mapp{$id}); + } + $$maptitles{$$mapp{$id}}=$$maptitles{$mapid}; + $$symbp{$mapid}=$$mapp{$id}.'___(all)'; } else { - $$maptitles{$mapid}= - &Apache::lonnet::gettitle($$mapp{$id}); + $$mapp{$id} = $$mapp{$mapid}; } - $$maptitles{$$mapp{$id}}=$$maptitles{$mapid}; - $$symbp{$mapid}=$$mapp{$id}.'___(all)'; - } else { - $$mapp{$id} = $$mapp{$mapid}; - } - $$symbp{$id}=&Apache::lonnet::encode_symb($$mapp{$id},$resid,$srcf); + $$symbp{$id}=&Apache::lonnet::encode_symb($$mapp{$id},$resid,$srcf); } } @@ -1247,8 +1451,9 @@ sub isdateparm { } # -# This function prints a list of parameters, which were selected. It also display a link from which you can -# hide or show the complete parameter list, from which you can choose your parameters. +# parmmenu displays a list of the selected parameters. +# It also offers a link to show/hide the complete parameter list +# from which you can select all desired parameters. # sub parmmenu { my ($r,$allparms,$pscat,$keyorder)=@_; @@ -1269,14 +1474,12 @@ sub parmmenu { ele = document.forms.parmform.elements[i]; if (ele.name == checkName) { document.forms.parmform.elements[i].checked=value; - document.getElementById(document.forms.parmform.elements[i].value.concat(li)).style.display = displayOverview; } } } function checkthis(thisvalue, checkName) { - document.getElementById(thisvalue.concat("_li")).style.display = ""; for (i=0; i ENDSCRIPT - $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View'))); - - #part to print selected parms overview - $r->print(&mt('Selected Parameters:').'
'); - - #print out all possible parms and hide them by default - $r->print('
    '); - foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) { - $r->print('
  • print(' style="display:none"'); - } - $r->print('>' - .($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} : $tempkey) - .'
  • ' - ); - } - $r->print('
' - .'

' - .&mt('Show detailed Parameter Selection') - .'

' - ); + $r->print('
'); &shortCuts($r,$allparms,$pscat,$keyorder); - - $r->print(&Apache::lonhtmlcommon::row_closure(1)); + $r->print('
'); } # return a hash sub categories { @@ -1398,10 +1564,13 @@ sub lookUpTableParameter { 'contentopen' => 'time_settings', 'contentclose' => 'time_settings', 'discussend' => 'time_settings', + 'printstartdate' => 'time_settings', + 'printenddate' => 'time_settings', 'weight' => 'grading', 'handgrade' => 'grading', 'maxtries' => 'tries', 'hinttries' => 'tries', + 'randomizeontries' => 'tries', 'type' => 'problem_appearance', 'problemstatus' => 'problem_appearance', 'display' => 'problem_appearance', @@ -1428,7 +1597,10 @@ sub lookUpTableParameter { 'acc' => 'misc', 'maxcollaborators' => 'misc', 'scoreformat' => 'misc', - + 'lenient' => 'grading', + 'retrypartial' => 'tries', + 'discussvote' => 'misc', + 'examcode' => 'high_level_randomization', ); } @@ -1480,9 +1652,7 @@ sub category_order { sub parmboxes { my ($r,$allparms,$pscat,$keyorder)=@_; - my $tempkey; - my $tempparameter; - my %categories = &categories; + my %categories = &categories(); my %category_order = &category_order(); my %categoryList = ( 'time_settings' => [], @@ -1495,47 +1665,31 @@ sub parmboxes { 'slots' => [], 'file_submission' => [], 'misc' => [], - ); - foreach $tempparameter (keys %$allparms) { + ); + + foreach my $tempparameter (keys(%$allparms)) { &whatIsMyCategory($tempparameter, \%categoryList); } #part to print the parm-list - $r->print(''); + $r->print("\n"); } # # This function offers some links on the parameter section to get with one click a group a parameters @@ -1543,51 +1697,43 @@ sub parmboxes { sub shortCuts { my ($r,$allparms,$pscat,$keyorder)=@_; - #part to print out the shortcuts for parmselection - $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').'' - .'' - .'
' - .'
'); + # Parameter Selection + $r->print( + &Apache::lonhtmlcommon::start_funclist(&mt('Parameter Selection')) + .&Apache::lonhtmlcommon::add_item_funclist( + ''.&mt('Select All').'') + .&Apache::lonhtmlcommon::add_item_funclist( + ''.&mt('Select Common Only').'') + .&Apache::lonhtmlcommon::add_item_funclist( + ''.&mt('Unselect All').'') + .&Apache::lonhtmlcommon::end_funclist() + ); + + # Add Selection for... + $r->print( + &Apache::lonhtmlcommon::start_funclist(&mt('Add Selection for...')) + .&Apache::lonhtmlcommon::add_item_funclist( + ''.&mt('Problem Dates').'') + .&Apache::lonhtmlcommon::add_item_funclist( + ''.&mt('Content Dates').'') + .&Apache::lonhtmlcommon::add_item_funclist( + ''.&mt('Discussion Settings').'') + .&Apache::lonhtmlcommon::add_item_funclist( + ''.&mt('Visibilities').'') + .&Apache::lonhtmlcommon::add_item_funclist( + ''.&mt('Part Parameters').'') + .&Apache::lonhtmlcommon::end_funclist() + ); } sub partmenu { my ($r,$allparts,$psprt)=@_; + my $selsize = 1+scalar(keys(%{$allparts})); + if ($selsize > 8) { + $selsize = 8; + } - $r->print(''); $r->print(''); @@ -1628,7 +1774,7 @@ sub usermenu { $sections .= qq| onchange="group_or_section('csec')" |; } $sections .= '>'; - foreach my $section ('',sort keys %sectionhash) { + foreach my $section ('',sort(keys(%sectionhash))) { $sections.=''; @@ -1673,7 +1819,7 @@ function group_or_section(caller) { $groups .= qq| onchange="group_or_section('cgroup')" |; } $groups .= '>'; - foreach my $grp ('',sort keys %grouphash) { + foreach my $grp ('',sort(keys(%grouphash))) { $groups.='