--- loncom/interface/lonfeedback.pm 2006/05/09 15:09:27 1.197 +++ loncom/interface/lonfeedback.pm 2006/06/29 21:22:09 1.205 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.197 2006/05/09 15:09:27 albertel Exp $ +# $Id: lonfeedback.pm,v 1.205 2006/06/29 21:22:09 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -43,6 +43,8 @@ use Apache::lonrss(); use HTML::LCParser(); use Apache::lonspeller(); use Cwd; +use lib '/home/httpd/lib/perl/'; +use LONCAPA; sub discussion_open { my ($status,$symb)=@_; @@ -394,7 +396,7 @@ imscp_v1p1.xsd http://www.imsglobal.org/ $discussion.='
'; $discussion .='
'. ''; - my $escsymb=&Apache::lonnet::escape($ressymb); + my $escsymb=&escape($ressymb); if ($visible>2) { $discussion.='
'. ''. + &escape($ressymb).':::" '.$target.'>'. ''. &mt('Post Discussion').'
'; } } $discussion.=''. &mt('Send Message').'
'; } @@ -769,7 +771,7 @@ sub build_posting_display { my @original=(); my @index=(); my $symb=&Apache::lonenc::check_decrypt($ressymb); - my $escsymb=&Apache::lonnet::escape($ressymb); + my $escsymb=&escape($ressymb); my %contrib=&Apache::lonnet::restore($symb,$env{'request.course.id'}, $env{'course.'.$env{'request.course.id'}.'.domain'}, $env{'course.'.$env{'request.course.id'}.'.num'}); @@ -1328,12 +1330,15 @@ sub mail_screen { my $attachnum = 0; my $anonchk = (<print(&generate_attachments_button($postidx,$attachnum,$ressymb,$now,\@currnewattach,\@currdelold,$numoldver)); if ($attachnum > 0) { if (@currnewattach > 0) { - $newattachmsg .= 'New attachments
'; + $newattachmsg .= '
New attachments
'; if (@currnewattach > 1) { $newattachmsg .= '
    '; foreach my $item (@currnewattach) { @@ -2204,7 +2191,11 @@ sub redirect_back { } $feedurl=&Apache::lonenc::check_encrypt($feedurl); my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); - my %onload = ('onload' => "if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }"); + my %onload; + if ($env{'environment.remote'} ne 'off') { + $onload{'onload'} = + "if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }"; + } my $start_page= &Apache::loncommon::start_page('New posts marked as read',undef, {'redirect' => [2,$feedurl], @@ -2235,9 +2226,15 @@ sub no_redirect_back { my ($r,$feedurl) = @_; my $nofeed=&mt('Sorry, no feedback possible on this resource ...'); + my %onload; + if ($env{'environment.remote'} ne 'off') { + $onload{'onload'} = + "if (window.name!='loncapaclient') { self.window.close(); }"; + } + my %body_options = ('only_body' => 1, 'bgcolor' => '#FFFFFF', - 'add_entries' => {'onload' => "if (window.name!='loncapaclient') { self.window.close(); }"}); + 'add_entries' => \%onload,); if ($feedurl !~ m{^/adm/feedback}) { $body_options{'rediect'} = [2,$feedurl]; @@ -2266,23 +2263,23 @@ sub screen_header { unless (($env{'form.replydisc'}) || ($env{'form.editdisc'})) { if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/) && ($env{'user.adv'})) { $msgoptions= - '

    '; } if (&feedback_available(1)) { $msgoptions.= - '

    '; } if (&feedback_available(0,1)) { $msgoptions.= - '

    '; } if (&feedback_available(0,0,1)) { $msgoptions.= - '

    '; } @@ -2292,10 +2289,9 @@ sub screen_header { &Apache::lonnet::allowed('pch', $env{'request.course.id'}. ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { - $discussoptions='