--- loncom/interface/lonfeedback.pm 2006/11/28 21:44:37 1.218 +++ loncom/interface/lonfeedback.pm 2006/11/29 03:23:02 1.220 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.218 2006/11/28 21:44:37 albertel Exp $ +# $Id: lonfeedback.pm,v 1.220 2006/11/29 03:23:02 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -92,6 +92,7 @@ sub list_discussion { return ''; } } + my @bgcols = ("#cccccc","#eeeeee"); my $discussiononly=0; if ($mode eq 'board') { $discussiononly=1; } @@ -290,6 +291,13 @@ sub list_discussion { 'disp' => 'Display', 'nolo' => 'Not new', 'togg' => 'Toggle read/unread', + 'aner' => 'An error occurred opening the manifest file.', + 'difo' => 'Discussion for', + 'aerr' => 'An error occurred opening the export file for posting', + 'aysu' => 'Are you sure you want to delete this post?', + 'dpwn' => 'Deleted posts will no longer be visible to you and other students', + 'bwco' => 'but will continue to be visible to your instructor', + 'depo' => 'Deleted posts will no longer be visible to you or anyone else.', ); my $currdisp = $lt{'allposts'}; @@ -384,23 +392,31 @@ identifier="MANIFEST-$ressymb" xsi:schem imscp_v1p1.xsd http://www.imsglobal.org/xsd/imsmd_v1p2 imsmd_v1p2p2.xsd"> - Discussion for $ressymb\n|; + $lt{'difo'} $ressymb\n|; } else { - $discussion .= 'An error occurred opening the manifest file.
'; + $discussion .= $lt{'aner'}.'
'; } } else { my $colspan=$maxdepth+1; $discussion.= qq| |; @@ -454,7 +470,7 @@ imscp_v1p1.xsd http://www.imsglobal.org/ } $discussion .= ''; - my $numhidden = keys %notshown; + my $numhidden = keys(%notshown); if ($numhidden > 0) { my $colspan = $maxdepth+1; $discussion.="\n".''. @@ -558,7 +574,7 @@ imscp_v1p1.xsd http://www.imsglobal.org/ $imsitems{$alldiscussion{$_}}{'attach'}.''."\n"; close($postingfile); } else { - $discussion .= 'An error occurred opening the export file for posting '.$alldiscussion{$_}.'
'; + $discussion .= $lt{'aerr'}.' '.$alldiscussion{$_}.'
'; } $copyresult.=&replicate_attachments($imsitems{$alldiscussion{$_}}{'allattachments'},$tempexport); } else { @@ -618,7 +634,6 @@ END $discussion .= &mt('Posts by').':'; if ($totposters > 0) { foreach my $poster (@posters) { - $poster =~ s/:/\@/; $discussion .= ' '.$poster.','; } $discussion =~ s/,$//; @@ -699,13 +714,13 @@ END open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); close(OUTPUT); chdir $cwd; - $discussion .= 'Download the zip file from Discussion Posting Archive
'; + $discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive','').'
'; if ($copyresult) { - $discussion .= 'The following errors occurred during export -
'.$copyresult; + $discussion .= &mt('The following errors occurred during export').' -
'.$copyresult; } } } else { - $discussion .= '
Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating a manifest file.
'; + $discussion .= '
'.&mt('Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating a manifest file.').'
'; } return $discussion; } @@ -768,15 +783,21 @@ sub postingform_display { my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum, $currnewattach,$currdelold,$group) = @_; my $newattachmsg; + my %lt = &Apache::lonlocal::texthash( + 'note' => 'Note: in anonymous discussion, your name is visible only to course faculty', + 'title' => 'Title', + 'podi' => 'Post Discussion', + 'poan' => 'Post Anonymous Discussion', + 'newa' => 'New attachments', + ); my $postingform = (< - +
+
-Note: in anonymous discussion, your name is visible only -to course faculty
-Title: 

+$lt{'note'}
+$lt{'title'}: 

ENDDISCUSS if ($env{'form.origpage'}) { @@ -800,7 +821,7 @@ ENDDISCUSS $now,$currnewattach, $currdelold,'',$mode); if ((ref($currnewattach) eq 'ARRAY') && (@{$currnewattach} > 0)) { - $newattachmsg = '
New attachments
'; + $newattachmsg = '
'.$lt{'newa'}.'
'; if (@{$currnewattach} > 1) { $newattachmsg .= '
    '; foreach my $item (@{$currnewattach}) { @@ -982,7 +1003,8 @@ sub build_posting_display { $sender .= '" '.$target.'>'.&mt('Edit').''; unless ($seeid) { - $sender.=" '; } } @@ -1005,14 +1027,11 @@ sub build_posting_display { } $sender .= &group_args($group); $sender .= '">'.&mt('Hide').''; - } - $sender.=' '.&mt('Delete').''; + } + my $grpargs = &group_args($group); + $sender.= + " "; + $sender .= &mt('Delete').''; } } else { if ($screenname) { @@ -1328,7 +1347,7 @@ sub get_post_contents { if ($type eq 'export') { $$imsfiles{$idx}{$i} = ''; if ($attachmsg) { - $$attachtxt{$i} = '
    Attachments:
    '; + $$attachtxt{$i} = '
    '.&mt('Attachments').':
    '; foreach (sort keys %currattach) { if ($$allattachments{$_}{'filename'} =~ m-^/uploaded/([^/]+/[^/]+)(/feedback)?(/?\d*)/([^/]+)$-) { my $fname = $1.$3.'/'.$4; @@ -1339,7 +1358,7 @@ sub get_post_contents { } } else { if ($attachmsg) { - $$attachtxt{$i} = '
    Attachments:'.$attachmsg.'
    '; + $$attachtxt{$i} = '
    '.&mt('Attachments').':'.$attachmsg.'
    '; } else { $$attachtxt{$i} = ''; } @@ -1386,11 +1405,11 @@ sub replicate_attachments { print $attachcopy $content; close($attachcopy); } else { - $response .= 'Error copying file attachment - '.$5.' to IMS package: '.$!.'
    '."\n"; + $response .= &mt('Error copying file attachment - [_1] to IMS package',$5).': '.$!.'
    '."\n"; } } else { &Apache::lonnet::logthis("Replication of attachment failed when building IMS export of discussion posts - domain: $1, course: $2, file: $$attachrefs{$id}{'filename'} -error: $rtncode"); - $response .= 'Error copying file attachment - '.$5.' to IMS package: '.$rtncode.'
    '."\n"; + $response .= &mt('Error copying file attachment - [_1] to IMS package: ',$5).$rtncode.'
    '."\n"; } } } @@ -1404,6 +1423,13 @@ sub mail_screen { &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','currnewattach','addnewattach','deloldattach','delnewattach','timestamp','idx','anondiscuss','discuss','blog','group','ref']); } + my %lt = &Apache::lonlocal::texthash( + 'plch' => 'Please check at least one of the following feedback types:', + 'myqu' => 'My question/comment/feedback:', + 'title' => 'Title', + 'reta' => 'Retained attachments', + 'atta' => 'Attachment (128 KB max size)', + ); my $title=&Apache::lonnet::gettitle($feedurl); if (!$title) { $title = $feedurl; } my $quote=''; @@ -1494,7 +1520,7 @@ END if ($idx > 0) { my %subversions = (); &get_post_versions(\%subversions,$contrib{$idx.':subject'},1,$numoldver); - $subject = 'Re: '.$subversions{$numoldver}; + $subject = &mt('Re: ')..$subversions{$numoldver}; } $subject = &HTML::Entities::encode($subject,'<>&"'); } else { @@ -1541,6 +1567,7 @@ END } my $latexHelp=&Apache::loncommon::helpLatexCheatsheet(); my $send=&mt('Send'); + my $alert = &mt('Please select a feedback type.'); my $js= < //