--- loncom/interface/loncoursegroups.pm 2012/12/17 17:27:20 1.116 +++ loncom/interface/loncoursegroups.pm 2014/02/11 17:09:30 1.123 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursegroups.pm,v 1.116 2012/12/17 17:27:20 raeburn Exp $ +# $Id: loncoursegroups.pm,v 1.123 2014/02/11 17:09:30 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,6 +31,7 @@ use strict; use Apache::lonnet; use Apache::loncommon(); use Apache::lonhtmlcommon(); +use Apache::lonhtmlgateway; use Apache::lonlocal; use Apache::lonnavmaps(); use Apache::longroup(); @@ -188,7 +189,7 @@ sub display_groups { crtd => 'Created', last => 'Last Modified', func => 'Collaborative Tools', - quot => 'Quota (Mb)', + quot => 'Quota (MB)', memb => 'Members', file => 'Files', dibd => 'Discussion Boards', @@ -811,7 +812,7 @@ sub group_administration { } var maxposs = '.sprintf("%.2f",$maxposs).'; if (newquota > maxposs) { - alert("The group portfolio 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.'; @@ -830,7 +831,7 @@ sub group_administration { } } if (warn_zero == 1) { - 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."); + 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; } } @@ -1492,7 +1493,7 @@ sub header { {'add_entries' => $loaditems,}); my $output = <<"END"; $start_page -
+ END if ($action eq 'create' || $action eq 'modify') { @@ -1756,19 +1757,19 @@ sub groupsettings_options { } else { $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 ' - .lc($crstype).', and [_2] Mb are currently unallocated.' + .&mt('A total of [_1] MB can be divided amongst all '.$gpterm.'s in the ' + .lc($crstype).', and [_2] MB are currently unallocated.' ,$crsquota,sprintf("%.2f",$freespace)) ); } else { - $r->print('  ('.&mt('The quota is currently [_1] Mb', + $r->print('  ('.&mt('The quota is currently [_1] MB', $$stored{'quota'}).').'); $r->print('
' - .&mt('The quota can be increased to [_1] Mb, ' + .&mt('The quota can be increased to [_1] MB, ' .'by adding all unallocated space for '.$gpterm.'s in the '.lc($crstype).'.' ,sprintf("%.2f",$maxposs))); } @@ -2016,10 +2017,10 @@ sub print_current_settings { dfac => 'Default access dates', ygrs => "Your group selections - ", tfwa => "The following settings will apply to the group:", - difn => 'Different collaborative tools
for different members:', stda => 'Start date:', enda => 'End date:', ); + $lt{'difn'} = &mt('Different collaborative tools[_1]for different members:','
'); my $showstart = &Apache::lonlocal::locallocaltime($startdate); my $showend; if ($enddate == 0) { @@ -2069,7 +2070,7 @@ sub print_current_settings { $r->print(''); } - my $quota_text=&mt('[_1] Mb',$quota); + my $quota_text=&mt('[_1] MB',$quota); my $granu_text=&mt($granularity); $r->print(<<"END"); @@ -2548,6 +2549,7 @@ sub current_membership { 'actn' => 'Action?', 'name' => 'Name', 'usnm' => 'Username', + 'stid' => 'ID', 'doma' => 'Domain', 'stda' => 'Start Date', 'enda' => 'End Date', @@ -2609,7 +2611,7 @@ END $lt{'name'} $lt{'usnm'} $lt{'doma'} - ID + $lt{'ID'} $lt{'stda'} $lt{'enda'} END @@ -2733,7 +2735,10 @@ END } $r->print(&Apache::loncommon::end_data_table()); } else { - $r->print(&mt('There are no active, future or previous group members to modify.')); + $r->print( + '

' + .&mt('There are no active, future or previous group members to modify.') + .'

'); } return $numcurrent; } @@ -2801,7 +2806,7 @@ sub change_privs_form { } } if (!$exp_or_del) { - $r->print($lt{'nome'}.'
'); + $r->print('

'.$lt{'nome'}.'

'); } $r->print(&Apache::lonhtmlcommon::topic_bar(4,&mt('Setting optional privileges for specific group members'))); @@ -3197,7 +3202,7 @@ sub write_group_data { $quota = 0; $r->print('
' .&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' + .' contained invalid characters, so it has been set to 0 MB. You can change this by' .' modifying the '.$gpterm.' settings.') .'
'); } @@ -3205,7 +3210,7 @@ sub write_group_data { $quota = $maxposs; $r->print('
' .&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 ' + .' exceeded the maximum possible value, so it has been set to [_1] MB ' .'(the maximum possible value).',sprintf("%.2f",$maxposs)) .'
'); } @@ -3364,10 +3369,10 @@ sub write_group_data { &Apache::lonnet::logthis("Failed to store $gpterm $groupname ". 'in '.lc($crstype).': '.$cnum. ' in domain: '.$cdom); - $r->print('
' - .&mt('An error occurred when [_1] the '.$gpterm.'. ' - .'Please try again.',$actiontype{$action}) - .'
'); + $r->print('

' + .&mt('An error occurred when '.$actiontype{$action}.' the '.$gpterm.'. ' + .'Please try again.') + .''; foreach my $user (@{$added{$type}}) { my $privlist = ''; if (!($type eq 'deleted' || $type eq 'expired')) { @@ -4120,10 +4128,9 @@ sub create_homepage { my ($cdom,$cnum,$name,$groupinfo,$tools,$gpterm,$ucgpterm,$now) = @_; my $functionality = join(',',@{$tools}); my $content = &unescape($$groupinfo{description}); - $content=~s/\s+$//s; - $content=~s/^\s+//s; - $content=~s/\$//s; - $content=&Apache::lonfeedback::clear_out_html($content,1); + chomp($content); + my $gateway = Apache::lonhtmlgateway->new(); + $content = $gateway->process_incoming_html($content,1); my %pageinfo = ( 'aaa_title' => "$ucgpterm: $name", @@ -4209,15 +4216,15 @@ sub validate_groupname { } if ($action eq 'create') { if (exists($curr_groups{$groupname})) { - return $exitmsg.$lt{'cnnb'}.&mt('an existing [_1]',$gpterm). + return $exitmsg.$lt{'cnnb'}.&mt("an existing $gpterm"). $lt{'inth'}.'.
'.$lt{'grna'}; } elsif (exists($deleted_groups{$groupname})) { - return $exitmsg.$lt{'cnnb'}.&mt('a [_1] which previously existed',$gpterm). + return $exitmsg.$lt{'cnnb'}.&mt("a $gpterm which previously existed"). $lt{'inth'}.'.
'.$lt{'grna'}; } } elsif ($action eq 'modify') { unless(exists($curr_groups{$groupname})) { - $earlyout = &mt('[_1] name:',$ucgpterm).' '.$groupname.$lt{'thgr'}. + $earlyout = &mt("$ucgpterm name:").' '.$groupname.$lt{'thgr'}. $lt{'inth'}; return $earlyout; }