--- loncom/interface/lonfeedback.pm 2013/01/03 20:51:23 1.363 +++ loncom/interface/lonfeedback.pm 2015/09/30 21:04:04 1.371 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.363 2013/01/03 20:51:23 raeburn Exp $ +# $Id: lonfeedback.pm,v 1.371 2015/09/30 21:04:04 musolffc Exp $ # # Copyright Michigan State University Board of Trustees # @@ -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".''. - ''; + my $href = '/adm/feedback?allposts=1&symb='.$escsymb; if ($newpostsflag) { - $discussion .= '&previous='.$prevread; + $href .= '&previous='.$prevread; } - $discussion .= &group_args($group); - $discussion .= '">'.&mt('Show all posts').' '.&mt('to display').' '. - $numhidden.' '; + $href .= &group_args($group); if ($showunmark) { - $discussion .= &mt('posts previously marked read'); + $discussion .= &mt('[_1]Show all posts[_2] to display [quant,_3,post] previously marked read', + '','',$numhidden); } else { - $discussion .= &mt('previously viewed posts'); + $discussion .= &mt('[_1]Show all posts[_2] to display [quant,_3,post] previously viewed', + '','',$numhidden); } $discussion .= '
'; } @@ -562,7 +565,7 @@ imscp_v1p1.xsd http://www.imsglobal.org/ my $postingfile; my $postingfilename = $tempexport.'/'.$postfilename; if ($postingfile = Apache::File->new('>'.$postingfilename)) { - print $postingfile 'Discussion Post'. + print $postingfile ''.&mt('Discussion Post').''. $imsitems{$alldiscussion{$post}}{'title'}.' '. $imsitems{$alldiscussion{$post}}{'sender'}. $imsitems{$alldiscussion{$post}}{'timestamp'}.'

'. @@ -702,13 +705,17 @@ END open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); close(OUTPUT); chdir $cwd; - $discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive','').'
'; + $discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive[_2]', + '','').'
'; if ($copyresult) { - $discussion .= &mt('The following errors occurred during export').' -
'.$copyresult; + $discussion .= ''. + &mt('The following errors occurred during export:'). + '
'.$copyresult; } } } 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.').'
'; + $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; } @@ -1496,6 +1503,7 @@ sub build_posting_display { } else { $novote = &mt('No voting for hidden posts.'); } + &html_escape(\$novote); $$discussionitems[$idx].= ''. ''.$novote.' '. @@ -1896,6 +1904,7 @@ END my $latexHelp=&Apache::loncommon::helpLatexCheatsheet(undef,undef,1,($env{'form.modal'}?'popup':0)); my $send=&mt('Send'); my $alert = &mt('Please select a feedback type.'); + &js_escape(\$alert); my $js= < // + END my ($textareaheader,$textareaclass); @@ -2040,7 +2050,8 @@ END } else { $r->print(< -$lt{'atta'} $attachmaxtext: +$lt{'atta'} $attachmaxtext: +

END } @@ -2129,6 +2140,11 @@ sub print_display_options { 'yhni' => 'You have not indicated that you wish to change any of the discussion settings', 'ywbr' => 'You will be returned to the previous page if you click OK.' ); + my %js_lt = &Apache::lonlocal::texthash( + 'yhni' => 'You have not indicated that you wish to change any of the discussion settings', + 'ywbr' => 'You will be returned to the previous page if you click OK.' + ); + &js_escape(\%js_lt); my $dispchangeA = $lt{'unread'}; my $dispchangeB = $lt{'unmark'}; @@ -2222,7 +2238,7 @@ function setDisp() { if (chktotal > 0) { document.modifydisp.submit() } else { - if(confirm("$lt{'yhni'}. \\n$lt{'ywbr'}")) { + if(confirm("$js_lt{'yhni'}. \\n$js_lt{'ywbr'}")) { if (prev > 0) { location.href = "$feedurl?previous=$previous" } else { @@ -2582,7 +2598,7 @@ sub print_showposters { my $table_start =&Apache::loncommon::start_data_table(); $r->print(< +

$table_start @@ -3484,6 +3500,7 @@ sub modify_attachments { document.modattachments.submit(); } + END # Breadcrumbs @@ -3525,7 +3542,10 @@ END $r->print(''.$subject.''); $r->print(&Apache::lonhtmlcommon::row_closure()); $r->print(&Apache::lonhtmlcommon::row_title($lt{'adda'})); - $r->print(' '.$attachmaxtext); + $r->print('' + .'' + .' '.$attachmaxtext); if(($idx)||(ref($currnewattach) eq 'ARRAY') && (@{$currnewattach} > 0)){ $r->print(&Apache::lonhtmlcommon::row_closure()); $r->print(&Apache::lonhtmlcommon::row_title(&mt('Attachments'))); @@ -3990,7 +4010,7 @@ sub handler { $discinfo{$lastkey} = $env{'form.navtime'}; } my $textline = ''. - &mt('Marked "New" posts as read in a total of [_1] resources/bulletin boards.', + &mt('Marked "New" posts as read in a total of [_1] resources/discussion boards.', $numitems). ''; if ($numitems > 0) { @@ -4423,6 +4443,7 @@ ENDREDIR $cdom,$cnum); $contrib{'deleted'} =~ s/^\.//; $contrib{'deleted'} =~ s/\.$//; + my $confirm_msg; if ($contrib{'deleted'} ne '') { if (&Apache::lonnet::store({'deleted' => ''},$symb,$env{'request.course.id'}, $cdom,$cnum) eq 'ok') { @@ -4450,14 +4471,19 @@ ENDREDIR $uname,$udom,$env{'request.course.id'}, 'undelete'); } - $r->print(&Apache::lonhtmlcommon::confirm_success(&mt("Undeleted all entries"))); + $confirm_msg = &Apache::lonhtmlcommon::confirm_success(&mt("Undeleted all entries")); } else { - $r->print(&Apache::lonhtmlcommon::confirm_success(&mt("Failed to undelete entries"),1)); + $confirm_msg = &Apache::lonhtmlcommon::confirm_success(&mt("Failed to undelete entries"),1); } } else { - $r->print(&Apache::lonhtmlcommon::confirm_success(&mt("No entries to undelete"),1)); + $confirm_msg = &Apache::lonhtmlcommon::confirm_success(&mt("No entries to undelete"),1); } - $r->print("
".&mt("Return and reload").""); + $r->print( + '
' + .&Apache::loncommon::confirmwrapper($confirm_msg) + .&Apache::lonhtmlcommon::actionbox( + ["".&mt("Return and reload").""]) + ); } $r->print(&Apache::loncommon::end_page()); return OK;