--- loncom/interface/loncoursegroups.pm 2008/12/03 21:59:37 1.81 +++ loncom/interface/loncoursegroups.pm 2009/05/11 16:51:27 1.101 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursegroups.pm,v 1.81 2008/12/03 21:59:37 schafran Exp $ +# $Id: loncoursegroups.pm,v 1.101 2009/05/11 16:51:27 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -75,10 +75,10 @@ sub handler { my $crstype = &Apache::loncommon::course_type(); my %functions = ( - email => 'E-mail', + email => 'Send Messages', discussion => 'Discussion Boards', - chat => 'Chat', - files => 'File Repository', + chat => 'Chat Room', + files => 'Group Portfolio', roster => 'Membership Roster', homepage => $ucgpterm.' home page', ); @@ -141,7 +141,7 @@ function openGroupRoster(group,status) { rosterbrowser = open(url,title,options,'1'); rosterbrowser.focus(); }\n|; - $r->print(&header('Groups',$jscript,$action,$state)); + $r->print(&header('My Space',$jscript,$action,$state)); if ($env{'form.refpage'} eq 'cusr') { &Apache::lonhtmlcommon::add_breadcrumb ({href=>"/adm/createuser", @@ -349,8 +349,8 @@ END ''.$quota.''. ''.$totalmembers.''. ''. - '
'.&mt('Files: [_1]',$totalfiles).'
'. - '
'.&mt('Folders: [_1]',$totaldirs).'
'. + ''.&mt('Files: [_1]',$totalfiles).'
'. + ''.&mt('Folders: [_1]',$totaldirs).''. ''. ''.$boards.''. ''.$diskuse.''. @@ -785,7 +785,7 @@ sub group_administration { } var maxposs = '.sprintf("%.2f",$maxposs).'; if (newquota > maxposs) { - alert("The file repository quota you entered for this group ("+newquota+" Mb) exceeds the maximum possible ("+maxposs+" Mb). Please enter a smaller number."); + alert("The group portfolio quota you entered for this group ("+newquota+" Mb) exceeds the maximum possible ("+maxposs+" Mb). Please enter a smaller number."); return; } var re_quota = '.$float_check.'; @@ -804,7 +804,7 @@ sub group_administration { } } if (warn_zero == 1) { - alert("You have indicated that the file repository should be enabled, but you have set the respository quota to 0 Mb.\nThis will prevent any upload of files.\nPlease set a value or disable the repository feature."); + alert("You have indicated that the group portfolio should be enabled, but you have set the respository quota to 0 Mb.\nThis will prevent any upload of files.\nPlease set a value or disable the repository feature."); return; } } @@ -915,11 +915,11 @@ function changeSort(caller) { result => 'Re-enabled' ); my %navbuttons = &Apache::lonlocal::texthash( - gtns => 'Go to next step', - gtps => 'Go to previous step', + gtns => 'Next',#'Go to next step', + gtps => 'Back',#'Go to previous step', crgr => 'Create '.$gpterm, - mose => 'Modify settings', - gtpp => 'Go to previous page', + mose => 'Save',#'Modify settings', + gtpp => 'Back',#'Go to previous page', adme => 'Add members', ); if ((($action eq 'create') || ($action eq 'modify') || ($action eq 'delete') || ($action eq 'reenable')) && @@ -1259,12 +1259,18 @@ sub reenable_folder { sub modify_folders { my ($cdom,$cnum,$groupname) = @_; - my $outcome; + my ($outcome,$groupmap,$groupmapres,$map,$id,$src); my $navmap = Apache::lonnavmaps::navmap->new(); - my $groupmap = '/uploaded/'.$cdom.'/'.$cnum.'/'.'group_folder_'. + if (!defined($navmap)) { + $outcome = '
'. + &mt('Error reading course contents.').' '. + &mt('You need to re-initialize the course.'). + '
'; + return $outcome; + } + $groupmap = '/uploaded/'.$cdom.'/'.$cnum.'/'.'group_folder_'. $groupname.'.sequence'; - my $groupmapres = $navmap->getResourceByUrl($groupmap); - my ($map,$id,$src); + $groupmapres = $navmap->getResourceByUrl($groupmap); if ($groupmapres) { ($map,$id,$src)=&Apache::lonnet::decode_symb($groupmapres->symb()); } @@ -1434,7 +1440,7 @@ sub header { {'add_entries' => $loaditems,}); my $output = <<"END"; $start_page -
+ END if ($action eq 'create' || $action eq 'modify') { @@ -1553,11 +1559,11 @@ sub open_list_window { my ($group,$status,$count,$text) = @_; my $entry; if ($count > 0) { - $entry = ''.$text.' - '.$count. - '
'; + '
'; } else { - $entry = ''.$text.' - '.$count.'
'; + $entry = ''.$text.' - '.$count.'
'; } return $entry; } @@ -1582,7 +1588,7 @@ sub general_settings_form { @{$tools} = sort(keys(%{$functions})); &privilege_specificity($r,$action,3,$tools,$stored,$toolprivs, $fixedprivs,\@available,$formname, - $gpterm,$ucgpterm); + $gpterm,$ucgpterm,$functions); &mapping_options($r,$action,$formname,$page,$sectioncount, $states,$stored,$navbuttons,4,5, $gpterm,$ucgpterm,$crstype,$cdom,$cnum); @@ -1606,33 +1612,34 @@ sub groupsettings_options { 'lett' => 'Letters, numbers and underscore only', 'doyo' => 'Different subsets of the chosen collaborative tools '. 'for different group members?', + 'gran' => 'Granularity', + 'dquo' => 'Disk quota', ); my ($crsquota,$freespace,$maxposs) = &get_quota_constraints($action,$stored); - $r->print(&Apache::lonhtmlcommon::topic_bar($image,$lt{'gnde'}).' - - - - - - - - - - - -END + $r->print(&Apache::lonhtmlcommon::row_closure()); + + # Group Title + $r->print(&Apache::lonhtmlcommon::row_title($lt{'desc'}) + .'' + .&Apache::lonhtmlcommon::row_closure() + ); + + # Collaborative Tools my $numitems = keys(%{$functions}); my $halfnum = int($numitems/2); my $remnum = $numitems%2; @@ -1640,48 +1647,61 @@ END $halfnum ++; } my @allfunctions = sort(keys (%{$functions})); - for (my $i=0; $i<$halfnum; $i++) { - $r->print(' - '); - } - $r->print(''); - for (my $j=$halfnum; $j<@allfunctions; $j++) { - $r->print(' - '); - } - if ($remnum) { - $r->print(''); + + $r->print(&Apache::lonhtmlcommon::row_title($lt{'func'}) + .'
' + .'' + .' ' + .'
' + .'
'.$lt{'gnam'}.': -'); + $r->print(&Apache::lonhtmlcommon::topic_bar($image,$lt{'gnde'})); + + # Group Name + $r->print(&Apache::lonhtmlcommon::start_pick_box() + .&Apache::lonhtmlcommon::row_title($lt{'gnam'}) + ); if ($action eq 'create') { - $r->print(' ('. - $lt{'lett'}.')'); + $r->print('' + .' (' + .$lt{'lett'}.')' + ); } else { $r->print(''.$env{'form.groupname'}); } - $r->print(<<"END"); -
$lt{'desc'}: -
$lt{'func'}:  '. - '
    
' # FIXME Get rid of inflexible table (-> float) + ); + for (my $i=0; $i<@allfunctions; $i++) { + $r->print('' + ); + if ($i == $halfnum - 1) { + $r->print(''); + } } - $r->print(' - - - - -
- -
'.&mt('Granularity:').''.$lt{'doyo'}.'  '); + $r->print('
' + .&Apache::lonhtmlcommon::row_closure() + ); + + # Granularity + $r->print(&Apache::lonhtmlcommon::row_title($lt{'gran'}) + .$lt{'doyo'}.'
' + .' ' + ); if ($action eq 'modify') { - $r->print('  ('.&mt('Currently set to "[_1]"', - &mt($$stored{'granularity'})).')'); + $r->print(' (' + .&mt('Currently set to [_1].' + ,'"'.&mt($$stored{'granularity'}).'"') + .')' + ); } - $r->print(' - - - - '.&mt('Disk quota: ').''); + $r->print(&Apache::lonhtmlcommon::row_closure()); + + # Disk Quota + $r->print(&Apache::lonhtmlcommon::row_title($lt{'dquo'})); if ($action eq 'create') { - $r->print(&mt('If you enable the file repository for the '.$gpterm.', allocate a disk quota.')); + $r->print('' + .&mt('If you enable the group portfolio for the '.$gpterm + .', allocate a disk quota.') + .'' + ); } else { - $r->print(&mt('Quota allocated to file repository:')); + $r->print(&mt('Quota allocated to group portfolio:')); } - $r->print(' '.&mt('[_1] Mb','')); + $r->print(' '.&mt('[_1] Mb','')); if ($action eq 'create') { $r->print('
' .&mt('A total of [_1] Mb can be divided amongst all '.$gpterm.'s in the ' @@ -1697,11 +1717,10 @@ END .'by adding all unallocated space for '.$gpterm.'s in the '.lc($crstype).'.' ,sprintf("%.2f",$maxposs))); } - $r->print(' - - - -'); + $r->print(&Apache::lonhtmlcommon::row_closure(1)); + + $r->print(&Apache::lonhtmlcommon::end_pick_box()); + return; } @@ -1798,7 +1817,7 @@ sub sections_selection { } } my $output = ' - '.$section_sel.' '; return $output; @@ -1966,42 +1985,25 @@ sub print_current_settings { '.$description.' '); + if (@{$available} > 0) { - $r->print(''.&mt('Available for assignment to members:').''. - ''); - my $rowcell = int(@{$available}/2) + @{$available}%2; + $r->print(''.&mt('Available for assignment to members:').''); + $r->print(''); - } - } - $r->print(''); + $r->print('
  • '.&mt($$functions{$$available[$i]}).'
  • '); } - if ((@{$available} > 3) && (@{$available}%2)) { - $r->print(''); - } - $r->print('
    '.$$functions{$$available[$i]}. - '   

    '); + $r->print(''); } + if (@{$unavailable} > 0) { - $r->print(''.&mt('Unavailable for assignment:').''. - ''); - my $rowcell = int(@{$unavailable}/2) + @{$unavailable}%2; - for (my $j=0; $j<@{$unavailable}; $j++) { - if (@{$unavailable} > 3) { - if ($j==$rowcell) { - $r->print(''); - } - } - $r->print(''); + $r->print(''.&mt('Unavailable for assignment:').''); + $r->print(''); - } - $r->print('
    '.$$functions{$$unavailable[$j]}. - '   
    '); + $r->print(''); } + my $quota_text=&mt('[_1] Mb',$quota); my $granu_text=&mt($granularity); $r->print(<<"END"); @@ -2065,13 +2067,13 @@ sub pick_new_members { if (@{$available} > 0 && $granularity eq 'Yes') { $r->print('
    '.$lt{'setf'}.' - +    - +
    '); } $r->print(' @@ -2094,13 +2096,13 @@ sub pick_new_members { if ($granularity eq 'Yes') { $r->print(&Apache::loncommon::start_data_table_row('LC_data_table_dense LC_data_table_highlight').'   - '.&mt('All:').' '); + '.&mt('All:').' '); foreach my $tool (@{$available}) { $r->print('   '); } - $r->print(''); + $r->print(''); } } my %Sortby = (); @@ -2134,7 +2136,7 @@ sub pick_new_members { ''.$id.''. ''.$section.''); if (@{$available} > 0) { - $r->print(''. + $r->print(''. '       '); foreach my $tool (@{$available}) { if ($granularity eq 'Yes') { @@ -2145,7 +2147,7 @@ sub pick_new_members { $tool.'" value="'.$user.'" />'.$tool.'   '); } } - $r->print(''); + $r->print(''); } $r->print(&Apache::loncommon::end_data_table_row()."\n"); } @@ -2163,7 +2165,7 @@ sub pick_new_members { sub privilege_specificity { my ($r,$action,$img,$tools,$stored,$toolprivs,$fixedprivs,$available, - $formname,$gpterm,$ucgpterm) = @_; + $formname,$gpterm,$ucgpterm,$functions) = @_; my %lt = &Apache::lonlocal::texthash ( 'uprv' => 'User privileges for collaborative tools', 'frty' => 'For each collaborative tool you have chosen to include, '. @@ -2232,8 +2234,8 @@ sub privilege_specificity { if ($totaloptionalprivs) { $r->print('
    -
    -

    '); +
    +

    '); } else { $r->print(''); } @@ -2260,7 +2262,7 @@ sub privilege_specificity { $r->print($lt{'algm'}.'

    '); } &default_privileges($r,$action,$tools,$toolprivs,$fixedprivs, - $available); + $available,$functions); } else { if ($action eq 'create') { $r->print($lt{'asyo'}); @@ -2284,7 +2286,7 @@ sub privilege_specificity { } sub default_privileges { - my ($r,$action,$tools,$toolprivs,$fixedprivs,$available) = @_; + my ($r,$action,$tools,$toolprivs,$fixedprivs,$available,$functions) = @_; my %lt = &Apache::lonlocal::texthash( 'addp' => 'Additional privileges', 'fixp' => 'Fixed privileges', @@ -2293,8 +2295,12 @@ sub default_privileges { ); $r->print(&Apache::lonhtmlcommon::start_pick_box('LC_group_priv_box'). &Apache::lonhtmlcommon::row_title($lt{'func'},undef, - 'LC_groups_functionality')); - $r->print(join('',@{$tools})); + 'LC_groups_functionality')); + my @tableHeader; + foreach my $key (sort(keys(%{$functions}))){ + push (@tableHeader,&mt(${$functions}{$key})); + } + $r->print(join('', @tableHeader)); $r->print(&Apache::lonhtmlcommon::row_closure(1)); my $fixed = ''; my $dynamic = ''; @@ -2310,7 +2316,7 @@ sub default_privileges { $fixed .= ''; } $fixed .= '' - .''.$$toolprivs{$tool}{$priv}.' '; + .''.&mt($$toolprivs{$tool}{$priv}).' '; if ($action eq 'modify') { if (grep(/^$tool$/,@{$available})) { $fixed .= ''.&mt('(on)').' '; @@ -2325,7 +2331,7 @@ sub default_privileges { $dynamic .= ' '."\n"; } - $dynamic .= ''."\n"; + $dynamic .= ''."\n"; } } if ($privcount == 0) { @@ -2509,7 +2515,7 @@ sub current_membership { $r->print(&check_uncheck_tools($r,$available)); $r->print(' - +
    '.$lt{'curf'}.' @@ -2517,7 +2523,7 @@ sub current_membership {
    -
    +
    '); } @@ -2552,14 +2558,14 @@ END if ($granularity eq 'Yes') { $r->print(&Apache::loncommon::start_data_table_row('LC_data_table_dense LC_data_table_highlight').'   - '.&mt('All:'). + '.&mt('All:'). ' '); foreach my $tool (@{$available}) { $r->print('   '); } - $r->print(''); + $r->print('
    '); } } my %Sortby = (); @@ -2587,25 +2593,25 @@ END $r->print(&Apache::loncommon::start_data_table_row('LC_data_table_dense').' '); if ($$current{$user}{changestate} eq 'reenable') { - $r->print('
    '); + $lt{'reen'}.'
    '); } elsif ($$current{$user}{changestate} eq 'expire') { - $r->print('
    '); + $lt{'expi'}.'
    '); } elsif ($$current{$user}{changestate} eq 'activate') { - $r->print('
    '); + $lt{'acti'}.'
    '); } - $r->print(''); + $lt{'dele'}.''); if ($specificity eq 'Yes') { - $r->print('
    '); + ''); } $r->print(' '. @@ -2616,7 +2622,7 @@ END ''.$start.''. ''.$end.''); if ($hastools) { - $r->print(''. + $r->print(''. '      '); foreach my $tool (@{$$current{$user}{currtools}}) { if ($granularity eq 'Yes') { @@ -2632,23 +2638,23 @@ END } $r->print('   '); } - $r->print(''); + $r->print(''); } if ($addtools) { $r->print(''); if ($granularity eq 'Yes') { foreach my $tool (@{$$current{$user}{newtools}}) { - $r->print('   '); + '   '); } } else { foreach my $tool (@{$$current{$user}{newtools}}) { - $r->print('print(''.$tool. - '   '); + '   '); } } $r->print(''); @@ -2669,13 +2675,13 @@ sub check_uncheck_buttons {
    '.$title.' - +    - +
    '); @@ -2952,9 +2958,8 @@ sub member_privileges_form { foreach my $tool (@{$tools}) { if (@{$showboxes{$tool}} > 0) { $r->print(''); - $r->print(''. - ''); + $r->print('
    '.&mt($tool).''); + $r->print('
    '. - &mt($tool).'
    '); my $privcount = 0; foreach my $priv (@{$showboxes{$tool}}) { $privcount ++; @@ -2989,7 +2994,7 @@ sub member_privileges_form { } } } - $r->print('
     '); + $r->print(' '); } } $r->print(''); @@ -3122,7 +3127,7 @@ sub write_group_data { if ($quota !~ /^\d*\.?\d*$/) { $quota = 0; $r->print('
    ' - .&mt('The value you entered for the quota for the file repository in this '.$gpterm + .&mt('The value you entered for the quota for the group portfolio in this '.$gpterm .' contained invalid characters, so it has been set to 0 Mb. You can change this by' .' modifying the '.$gpterm.' settings.') .'
    '); @@ -3130,7 +3135,7 @@ sub write_group_data { if ($quota > $maxposs) { $quota = $maxposs; $r->print('
    ' - .&mt('The value you entered for the quota for the file repository in this '.$gpterm + .&mt('The value you entered for the quota for the group portfolio in this '.$gpterm .' exceeded the maximum possible value, so it has been set to [_1] Mb ' .'(the maximum possible value).',sprintf("%.2f",$maxposs)) .'
    '); @@ -3222,36 +3227,49 @@ sub write_group_data { my $crspath = '/uploaded/'.$cdom.'/'.$cnum.'/'; my $boardsmap = $crspath.'group_boards_'.$groupname.'.sequence'; my $navmap = Apache::lonnavmaps::navmap->new(); - my $bbmapres = $navmap->getResourceByUrl($boardsmap); - undef($navmap); - if (!$bbmapres) { - my $grpmap = $crspath.'group_folder_'.$groupname.'.sequence'; - my $disctitle = &mt('Discussion Boards'); - my $outcome = &map_updater($cdom,$cnum,'group_boards_'. - $groupname.'.sequence','bbseq', - $disctitle,$grpmap); - my ($furl,$ferr) = - &Apache::lonuserstate::readmap($cdom.'/'.$cnum); - $navmap = Apache::lonnavmaps::navmap->new(); - # modify parameter - if ($outcome eq 'ok') { - my $parm_result = &parm_setter($navmap,$cdom,$boardsmap, - $groupname); - if ($parm_result) { - $r->print('
    ' - .&mt('An error occurred while setting parameters ' - .'for Discussion Boards folder: ' - .'[_1]',$parm_result) - .'
    '); + my ($bbmapres,$error); + if (defined($navmap)) { + $bbmapres = $navmap->getResourceByUrl($boardsmap); + undef($navmap); + if (!$bbmapres) { + my $grpmap = $crspath.'group_folder_'.$groupname.'.sequence'; + my $disctitle = &mt('Discussion Boards'); + my $outcome = &map_updater($cdom,$cnum,'group_boards_'. + $groupname.'.sequence','bbseq', + $disctitle,$grpmap); + my ($furl,$ferr) = + &Apache::lonuserstate::readmap($cdom.'/'.$cnum); + # modify parameter + if ($outcome eq 'ok') { + $navmap = Apache::lonnavmaps::navmap->new(); + if (defined($navmap)) { + my $parm_result = &parm_setter($navmap,$cdom,$boardsmap, + $groupname); + if ($parm_result) { + $error = &mt('An error occurred while setting parameters ' + .'for Discussion Boards folder: ' + .'[_1]',$parm_result); + } else { + $r->print('
    '. + &mt('Discussion Boards Folder created.') + .'
    '); + } + undef($navmap); + } else { + $error = &mt('An error occurred while setting parameters '. + 'for Discussion Boards folder: '. + 'Could not retrieve course information' ); + } } else { - $r->print('
    ' - .&mt('Discussion Boards Folder created.') - .'
    '); + $r->print($outcome); } - } else { - $r->print($outcome); } - undef($navmap); + } else { + $error = &mt("An error occurred while retrieving the contents of the group's folder.").'
    '. + &mt('You need to re-initialize the course.'); + } + if ($error ne '') { + $r->print('
    '.$error.'
    '); } } $r->print('
    ' @@ -3509,7 +3527,6 @@ sub mapping_options { 'adds' => "If automatic $gpterm enrollment is enabled, when a user is newly assigned a ".lc($crstype)."-wide or section-specific role, he/she will automatically be added as a member of the $gpterm, with start and end access dates defined by the default dates set for the $gpterm, unless he/she is already a $gpterm member, with access dates that permit either current or future $gpterm access.", 'drops' => "If automatic $gpterm disenrollment is enabled, when a user's role is expired, access to the $gpterm will be terminated unless the user continues to have other ".lc($crstype)."-wide or section-specific active or future roles which receive automatic membership in the $gpterm.", 'pirs' => "Pick roles and sections for automatic $gpterm enrollment", - 'curr' => 'Currently set to', 'on' => 'on', 'off' => 'off', 'auad' => "Automatically enable $gpterm membership when roles are added?", @@ -3534,19 +3551,19 @@ sub automapping { } $r->print(&Apache::lonhtmlcommon::topic_bar($image,$$lt{'endi'}).' '.$$lt{'gmma'}.':
    '.$$lt{'adds'}.'
    '.$$lt{'drops'}.'

    - '.$$lt{'auad'}.':  + '.$$lt{'auad'}.':  '); if ($action eq 'modify') { - $r->print('    ('.$$lt{'curr'}.' '.$$lt{$add}.')'); + $r->print('    ('.&mt('Currently set to [_1].',''.$$lt{$add}.'').')'); } $r->print(' -
    - '.$$lt{'auex'}.':  +
    + '.$$lt{'auex'}.':  '); if ($action eq 'modify') { - $r->print('    ('.$$lt{'curr'}.' '.$$lt{$drop}.')'); + $r->print('    ('.&mt('Currently set to [_1].',''.$$lt{$drop}.'').')'); } - $r->print('


    '.$$lt{'mapr'}); + $r->print('

    '.$$lt{'mapr'}); } sub mapping_settings { @@ -3706,16 +3723,16 @@ sub member_privs_entries { if ($privcount == 3) { $dynamic .= ''; } - $dynamic .=''; + ''; } } - $r->print(''.$fixed.''.$dynamic.''); + $r->print(''.$fixed.''.$dynamic.''); } else { $r->print('
    '.$tool.'
     
     
    '); } @@ -3741,17 +3758,19 @@ sub date_setting_table { 'startdate',$starttime); my $endform = &Apache::lonhtmlcommon::date_setter($formname, 'enddate',$endtime); - my $perpetual = - ''; - my $table = "\n". - ''. - ''. - ''."\n". - ''. - ''. - ''."\n". - "
    '.&mt('Start:').''.$startform.' 
    '.&mt('End:').''.$endform.''.$perpetual.'
    \n"; + my $perpetual = ' '; + my $table = &Apache::lonhtmlcommon::start_pick_box() + .&Apache::lonhtmlcommon::row_title(&mt('Start Date')) + .$startform + .&Apache::lonhtmlcommon::row_closure() + .&Apache::lonhtmlcommon::row_title(&mt('End Date')) + .$endform + .$perpetual + .&Apache::lonhtmlcommon::row_closure(1) + .&Apache::lonhtmlcommon::end_pick_box(); return $table; } @@ -3787,7 +3806,7 @@ sub add_group_folder { if ($delresult ne 'ok') { $warning = $delresult; } - return $outcome; + return $outcome.$warning; } } my $delresult = &release_folder_lock($cdom,$cnum,'group_allfolders'); @@ -3797,7 +3816,7 @@ sub add_group_folder { } else { $outcome = '' .&mt('Could not obtain exclusive lock to check status of the folder for all groups. No group folder added.') - .'
    '; + .''; return $outcome; } my $grpfolder = &mt($ucgpterm.' Folder - [_1]',$description); @@ -3828,6 +3847,10 @@ sub add_group_folder { } my ($furl,$ferr)= &Apache::lonuserstate::readmap($cdom.'/'.$cnum); my $navmap = Apache::lonnavmaps::navmap->new(); + if (!defined($navmap)) { + return $warning.''.&mt('Error retrieving course contents'). + ' '.&mt('You need to re-initialize the course.').''; + } # modify parameters my $parm_result; if ($action eq 'create') { @@ -3933,6 +3956,13 @@ sub new_map { sub parm_setter { my ($navmap,$cdom,$url,$groupname) = @_; my $allresults; + if (!defined($navmap)) { + $allresults = '
    '. + &mt('Parameters not set for [_1] because the contents of the course could not be retrieved.',$url).' '. + &mt('You need to reinitialize the course.'). + '
    '; + return $allresults; + } my %hide_settings = ( 'course' => { 'num' => 13,