--- loncom/interface/lonfeedback.pm 2013/01/03 20:41:45 1.362 +++ loncom/interface/lonfeedback.pm 2022/01/19 01:35:58 1.370.2.6 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.362 2013/01/03 20:41:45 raeburn Exp $ +# $Id: lonfeedback.pm,v 1.370.2.6 2022/01/19 01:35:58 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -44,8 +44,8 @@ use HTML::LCParser(); #use HTML::Tidy::libXML; use Apache::lonspeller(); use Apache::longroup; -use Cwd; -use LONCAPA; +use Archive::Zip qw( :ERROR_CODES ); +use LONCAPA qw(:DEFAULT :match); sub discussion_open { my ($status,$symb)=@_; @@ -336,12 +336,15 @@ sub list_discussion { 'aner' => 'An error occurred opening the manifest file.', 'difo' => 'Discussion for', 'aerr' => 'An error occurred opening the export file for posting', + 'discussions' => 'DISCUSSIONS' + ); + my %js_lt = &Apache::lonlocal::texthash( '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.', - 'discussions' => 'DISCUSSIONS' ); + &js_escape(\%js_lt); my $currdisp = $lt{'allposts'}; my $currmark = $lt{'onmark'}; @@ -447,12 +450,12 @@ imscp_v1p1.xsd http://www.imsglobal.org/ prevparm = "&previous="+previous } if (caller == 'studentdelete') { - if (confirm("$lt{'aysu'}\\n$lt{'dpwn'},\\n$lt{'bwco'}")) { + if (confirm("$js_lt{'aysu'}\\n$js_lt{'dpwn'},\\n$js_lt{'bwco'}")) { document.location.href = "/adm/feedback?hide="+symbparm+prevparm+groupparm } } else { if (caller == 'seeiddelete') { - if (confirm("$lt{'aysu'}\\n$lt{'depo'}")) { + if (confirm("$js_lt{'aysu'}\\n$js_lt{'depo'}")) { document.location.href = "/adm/feedback?deldisc="+symbparm+prevparm+groupparm } } @@ -468,18 +471,18 @@ imscp_v1p1.xsd http://www.imsglobal.org/ my $numhidden = keys(%notshown); if ($numhidden > 0) { my $colspan = $maxdepth+1; - $discussion.="\n".'
'. + &mt('Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating the zip file.').'
'; } } } else { - $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; } @@ -840,7 +855,7 @@ sub send_feedback_link { &discussion_link($ressymb, ' ', + '" /> ', 'replydisc'). ''; } @@ -851,7 +866,7 @@ sub send_message_link { &discussion_link($ressymb, ' ', + '" /> ', 'sendmessageonly'). ''; return $output; @@ -926,7 +941,7 @@ sub postingform_display { $currnewattach,$currdelold,$group,$crstype) = @_; my $newattachmsg; my %lt = &Apache::lonlocal::texthash( - 'note' => 'Note: in anonymous discussion, your name is visible only to course faculty', + 'note' => 'Note: in anonymous discussion, your name is visible only to course faculty', 'title' => 'Title', 'podi' => 'Post Discussion', 'poan' => 'Post Anonymous Discussion', @@ -1278,7 +1293,7 @@ sub build_posting_display { if (&editing_allowed($escsymb.':::'.$idx,$group)) { if (($env{'user.domain'} eq $contrib{$idx.':senderdomain'}) && ($env{'user.name'} eq $contrib{$idx.':sendername'})) { $sender.=' '. - &discussion_link($symb,&mt('Edit'),'editdisc',$idx,$$newpostsflag,$prevread,&group_args($group)); + &discussion_link($ressymb,&mt('Edit'),'editdisc',$idx,$$newpostsflag,$prevread,&group_args($group)); unless ($seehidden) { my $grpargs = &group_args($group); $sender.=" '. ' '. @@ -1505,12 +1521,12 @@ sub build_posting_display { if ($userlikes{$idx}) { $$discussionitems[$idx].=''; } else { - $$discussionitems[$idx].=' '.&discussion_link($symb,'','like',$idx,$$newpostsflag,$prevread,&group_args($group),&mt("Like this posting")); + $$discussionitems[$idx].=' '.&discussion_link($ressymb,'','like',$idx,$$newpostsflag,$prevread,&group_args($group),&mt("Like this posting")); } if ($userunlikes{$idx}) { $$discussionitems[$idx].=''; } else { - $$discussionitems[$idx].=' '.&discussion_link($symb,'','unlike',$idx,$$newpostsflag,$prevread,&group_args($group),&mt("Unlike this posting")); + $$discussionitems[$idx].=' '.&discussion_link($ressymb,'','unlike',$idx,$$newpostsflag,$prevread,&group_args($group),&mt("Unlike this posting")); } } } @@ -1528,7 +1544,7 @@ sub build_posting_display { $$discussionitems[$idx] .= ' '.&mt('This post has been edited by the author.'); if ($seehidden) { $$discussionitems[$idx] .= ' '. - &discussion_link($symb,&mt('Display all versions'),'allversions',$idx,$$newpostsflag,$prevread,&group_args($group)); + &discussion_link($ressymb,&mt('Display all versions'),'allversions',$idx,$$newpostsflag,$prevread,&group_args($group)); } $$discussionitems[$idx].='