--- loncom/interface/lonfeedback.pm 2006/03/21 18:37:25 1.187 +++ loncom/interface/lonfeedback.pm 2006/06/30 04:49:03 1.207 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.187 2006/03/21 18:37:25 albertel Exp $ +# $Id: lonfeedback.pm,v 1.207 2006/06/30 04:49:03 albertel 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.='
'. '
'; if (&discussion_open($status) && &Apache::lonnet::allowed('pch', $env{'request.course.id'}. ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { if ($outputtarget ne 'tex') { - $discussion.='
'. + $discussion.=''. ''. - &mt('Post Discussion').'
'; - } + &mt('Post Discussion').'
'; + } } + $discussion.=''. + &mt('Send Message').'
'; } return $discussion; } @@ -764,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'}); @@ -1323,12 +1330,15 @@ sub mail_screen { my $attachnum = 0; my $anonchk = (< END - my $onload = 'onLoad="window.focus();setposttype();"'; + my %onload = ('onload' => 'window.focus();setposttype();'); my $start_page= &Apache::loncommon::start_page('Resource Feedback and Discussion',$js, - {'add_entries' => $onload}); + {'add_entries' => \%onload}); $r->print(<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) { @@ -1749,44 +1741,45 @@ END my $end_page = &Apache::loncommon::end_page(); $r->print(< +$start_page + $lt{'sdpf'}
    $lt{'prca'}
    1. $lt{'whpo'}
    2. $lt{'unwh'}
    3. $lt{'wipa'}

    - - - - -
    - - - - -
    - - - - - +END + $r->print(&Apache::loncommon::start_data_table()); + $r->print(< + - +END + $r->print(&Apache::loncommon::start_data_table_row()); + $r->print(<$lt{'disa'} - +END + $r->print(&Apache::loncommon::end_data_table_row()); + $r->print(&Apache::loncommon::start_data_table_row()); + $r->print(<$lt{'npmr'} - +END + $r->print(&Apache::loncommon::end_data_table_row()); + $r->print(&Apache::loncommon::start_data_table_row()); + $r->print(<$lt{'dotm'} - -
    $lt{'pref'}$lt{'curr'}$lt{'actn'}?$lt{'pref'} + $lt{'curr'} + $lt{'actn'}?
    $lt{$discdisp}
    $lt{$discmark}
    $lt{$disctogg}
    -
    -
    +END + $r->print(&Apache::loncommon::end_data_table_row()); + $r->print(&Apache::loncommon::end_data_table()); + $r->print(<
    @@ -1811,23 +1804,21 @@ sub print_sortfilter_options { $r->send_http_header; &Apache::lonenc::check_encrypt(\$symb); - my @sections = (); + my @sections; my $section_sel = ''; - my $numsections = 0; my $numvisible = 5; - my %sectioncount = (); - - $numsections = &Apache::loncommon::get_sections($env{'course.'.$env{'request.course.id'}.'.domain'},$env{'course.'.$env{'request.course.id'}.'.num'},\%sectioncount); + my %sectioncount = &Apache::loncommon::get_sections(); if ($env{'request.course.sec'} !~ /^\s*$/) { #Restrict section choice to current section @sections = ('all',$env{'request.course.sec'}); $numvisible = 2; } else { @sections = sort {$a cmp $b} keys(%sectioncount); - unshift(@sections,'all'); # Put 'all' at the front of the list - if ($numsections < 4) { - $numvisible = $numsections + 1; + if (scalar(@sections) < 4) { + $numvisible = scalar(@sections) + 1; } + unshift(@sections,'all'); # Put 'all' at the front of the list + } foreach (@sections) { $section_sel .= "