Diff for /loncom/interface/lonfeedback.pm between versions 1.134 and 1.135

version 1.134, 2004/11/15 21:51:19 version 1.135, 2004/11/15 22:16:59
Line 1475  END Line 1475  END
   
 sub print_display_options {  sub print_display_options {
     my ($r,$symb,$previous,$dispchgA,$dispchgB,$markchg,$toggchg,$feedurl) = @_;      my ($r,$symb,$previous,$dispchgA,$dispchgB,$markchg,$toggchg,$feedurl) = @_;
     &dewrapper(\$feedurl);      &Apache::loncommon::content_type($r,'text/html');
       $r->send_http_header;
   
     my $function = &Apache::loncommon::get_users_function();      my $function = &Apache::loncommon::get_users_function();
     my $tabcolor = &Apache::loncommon::designparm($function.'.tabbg',      my $tabcolor = &Apache::loncommon::designparm($function.'.tabbg',
Line 1674  END Line 1675  END
 sub print_sortfilter_options {  sub print_sortfilter_options {
     my ($r,$symb,$previous,$feedurl) = @_;      my ($r,$symb,$previous,$feedurl) = @_;
   
     &dewrapper(\$feedurl);      &Apache::loncommon::content_type($r,'text/html');
       $r->send_http_header;
   
     my @sections = ();      my @sections = ();
     my $section_sel = '';      my $section_sel = '';
     my $numsections = 0;      my $numsections = 0;
Line 1997  sub redirect_back { Line 2000  sub redirect_back {
   my $qrystr = '';    my $qrystr = '';
   my $prevtag = '';    my $prevtag = '';
   
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
   
   &dewrapper(\$feedurl);    &dewrapper(\$feedurl);
   if ($feedurl=~/^\/adm\//) { $feedurl.='?register=1' };    if ($feedurl=~/^\/adm\//) { $feedurl.='?register=1' };
   if ($previous > 0) {    if ($previous > 0) {
Line 2396  sub adddiscuss { Line 2402  sub adddiscuss {
   
 sub show_preview {  sub show_preview {
     my $r=shift;      my $r=shift;
       &Apache::loncommon::content_type($r,'text/html');
       $r->send_http_header;
     my $message=&clear_out_html($ENV{'form.comment'});      my $message=&clear_out_html($ENV{'form.comment'});
     $message=~s/\n/\<br \/\>/g;      $message=~s/\n/\<br \/\>/g;
     $message=&Apache::lonspeller::markeduptext($message);      $message=&Apache::lonspeller::markeduptext($message);
Line 2752  sub handler { Line 2760  sub handler {
           &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',            &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',
   \%readinghash,$ENV{'user.domain'},$ENV{'user.name'});    \%readinghash,$ENV{'user.domain'},$ENV{'user.name'});
       }        }
       &Apache::loncommon::content_type($r,'text/html');  
       $r->send_http_header;  
       &redirect_back($r,$feedurl,&mt('Marked postings read/unread').'<br />',        &redirect_back($r,$feedurl,&mt('Marked postings read/unread').'<br />',
      '0','0','',$ENV{'form.previous'},'','','',);       '0','0','',$ENV{'form.previous'},'','','',);
       return OK;        return OK;
Line 2793  END Line 2799  END
       return OK;        return OK;
   }    }
   if ($ENV{'form.posterlist'}) {    if ($ENV{'form.posterlist'}) {
       &Apache::loncommon::content_type($r,'text/html');  
       $r->send_http_header;  
       my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.applysort'});        my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.applysort'});
       &print_showposters($r,$symb,$ENV{'form.previous'},$feedurl,        &print_showposters($r,$symb,$ENV{'form.previous'},$feedurl,
  $ENV{'form.sortposts'});   $ENV{'form.sortposts'});
       return OK;        return OK;
   }    }
   if ($ENV{'form.userpick'}) {    if ($ENV{'form.userpick'}) {
       &Apache::loncommon::content_type($r,'text/html');  
       $r->send_http_header;  
       my @posters = &Apache::loncommon::get_env_multiple('form.stuinfo');        my @posters = &Apache::loncommon::get_env_multiple('form.stuinfo');
       my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.userpick'});        my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.userpick'});
       my $numpicks = @posters;        my $numpicks = @posters;
Line 2816  END Line 2818  END
       return OK;        return OK;
   }    }
   if ($ENV{'form.applysort'}) {    if ($ENV{'form.applysort'}) {
       &Apache::loncommon::content_type($r,'text/html');  
       $r->send_http_header;  
       my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.applysort'});        my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.applysort'});
       &redirect_back($r,$feedurl,&mt('Changed sort/filter').'<br />','0','0',        &redirect_back($r,$feedurl,&mt('Changed sort/filter').'<br />','0','0',
      '',$ENV{'form.previous'},$ENV{'form.sortposts'},       '',$ENV{'form.previous'},$ENV{'form.sortposts'},
Line 2825  END Line 2825  END
      $ENV{'form.secpick'});       $ENV{'form.secpick'});
       return OK;        return OK;
   } elsif ($ENV{'form.sortfilter'}) {    } elsif ($ENV{'form.sortfilter'}) {
       &Apache::loncommon::content_type($r,'text/html');  
       $r->send_http_header;  
       my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.sortfilter'});        my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.sortfilter'});
       &print_sortfilter_options($r,$symb,$ENV{'form.previous'},$feedurl);        &print_sortfilter_options($r,$symb,$ENV{'form.previous'},$feedurl);
       return OK;        return OK;
Line 2889  $textline Line 2887  $textline
 ENDREDIR  ENDREDIR
       return OK;        return OK;
   } elsif ($ENV{'form.modifydisp'}) {    } elsif ($ENV{'form.modifydisp'}) {
       &Apache::loncommon::content_type($r,'text/html');  
       $r->send_http_header;  
       my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.modifydisp'});        my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.modifydisp'});
       my ($dispchgA,$dispchgB,$markchg,$toggchg) =         my ($dispchgA,$dispchgB,$markchg,$toggchg) = 
   split(/_/,$ENV{'form.changes'});    split(/_/,$ENV{'form.changes'});
Line 2901  ENDREDIR Line 2897  ENDREDIR
    $ENV{'form.allposts'}   || $ENV{'form.onlyunread'} ||     $ENV{'form.allposts'}   || $ENV{'form.onlyunread'} ||
    $ENV{'form.onlyunmark'} || $ENV{'form.toggoff'}    ||     $ENV{'form.onlyunmark'} || $ENV{'form.toggoff'}    ||
    $ENV{'form.toggon'} ) {     $ENV{'form.toggon'} ) {
       &Apache::loncommon::content_type($r,'text/html');  
       $r->send_http_header;  
       my $feedurl;        my $feedurl;
       if ( ($ENV{'form.toggoff'}) || ($ENV{'form.toggon'}) ) {        if ( ($ENV{'form.toggoff'}) || ($ENV{'form.toggon'}) ) {
 # ------------------------ Modify setting for read/unread toggle for each post   # ------------------------ Modify setting for read/unread toggle for each post 
Line 2964  ENDREDIR Line 2958  ENDREDIR
       return OK;        return OK;
   } elsif ($ENV{'form.markread'}) {    } elsif ($ENV{'form.markread'}) {
 # ----------------------------------------------------- Mark new posts not NEW   # ----------------------------------------------------- Mark new posts not NEW 
       &Apache::loncommon::content_type($r,'text/html');  
       $r->send_http_header;  
       my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.markread'});        my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.markread'});
       &Apache::lonnet::logthis("\n last read w symb ".$symb);        &Apache::lonnet::logthis("\n last read w symb ".$symb);
       my %discinfo;        my %discinfo;
Line 2977  ENDREDIR Line 2969  ENDREDIR
       return OK;        return OK;
   } elsif (($ENV{'form.hide'}) || ($ENV{'form.unhide'})) {    } elsif (($ENV{'form.hide'}) || ($ENV{'form.unhide'})) {
 # ----------------------------------------------------------------- Hide/unhide  # ----------------------------------------------------------------- Hide/unhide
       &Apache::loncommon::content_type($r,'text/html');  
       $r->send_http_header;  
   
       my $entry=$ENV{'form.hide'}?$ENV{'form.hide'}:$ENV{'form.unhide'};        my $entry=$ENV{'form.hide'}?$ENV{'form.hide'}:$ENV{'form.unhide'};
       my ($symb,$idx)=split(/\:\:\:/,$entry);        my ($symb,$idx)=split(/\:\:\:/,$entry);
       ($symb,my $feedurl)=&get_feedurl_and_clean_symb($symb);        ($symb,my $feedurl)=&get_feedurl_and_clean_symb($symb);
Line 3017  ENDREDIR Line 3006  ENDREDIR
   
       &redirect_back($r,$feedurl,&mt('Changed discussion status').'<br />',        &redirect_back($r,$feedurl,&mt('Changed discussion status').'<br />',
      '0','0','',$ENV{'form.previous'});       '0','0','',$ENV{'form.previous'});
         return OK;
   } elsif (($ENV{'form.threadedon'}) || ($ENV{'form.threadedoff'})) {    } elsif (($ENV{'form.threadedon'}) || ($ENV{'form.threadedoff'})) {
       &Apache::loncommon::content_type($r,'text/html');  
       $r->send_http_header;  
       my $symb;        my $symb;
       if ($ENV{'form.threadedon'}) {        if ($ENV{'form.threadedon'}) {
   $symb=$ENV{'form.threadedon'};    $symb=$ENV{'form.threadedon'};
Line 3033  ENDREDIR Line 3021  ENDREDIR
       my ($symb,$feedurl)=&get_feedurl_and_clean_symb($symb);        my ($symb,$feedurl)=&get_feedurl_and_clean_symb($symb);
       &redirect_back($r,$feedurl,&mt('Changed discussion view mode').'<br />',        &redirect_back($r,$feedurl,&mt('Changed discussion view mode').'<br />',
      '0','0','',$ENV{'form.previous'});       '0','0','',$ENV{'form.previous'});
         return OK;
   } elsif ($ENV{'form.deldisc'}) {    } elsif ($ENV{'form.deldisc'}) {
 # --------------------------------------------------------------- Hide for good  # --------------------------------------------------------------- Hide for good
       &Apache::loncommon::content_type($r,'text/html');  
       $r->send_http_header;  
   
       my ($symb,$idx)=split(/\:\:\:/,$ENV{'form.deldisc'});        my ($symb,$idx)=split(/\:\:\:/,$ENV{'form.deldisc'});
       ($symb,my $feedurl)=&get_feedurl_and_clean_symb($symb);        ($symb,my $feedurl)=&get_feedurl_and_clean_symb($symb);
       my %contrib=&Apache::lonnet::restore($symb,$ENV{'request.course.id'},        my %contrib=&Apache::lonnet::restore($symb,$ENV{'request.course.id'},
                           $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},                            $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
           $ENV{'course.'.$ENV{'request.course.id'}.'.num'});            $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
     my %newhash=('deleted' => $contrib{'deleted'}.".$idx.");        my %newhash=('deleted' => $contrib{'deleted'}.".$idx.");
     &Apache::lonnet::store(\%newhash,$symb,$ENV{'request.course.id'},        &Apache::lonnet::store(\%newhash,$symb,$ENV{'request.course.id'},
                           $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},     $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
           $ENV{'course.'.$ENV{'request.course.id'}.'.num'});     $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
     &redirect_back($r,$feedurl,&mt('Changed discussion status').'<br />',        &redirect_back($r,$feedurl,&mt('Changed discussion status').'<br />',
    '0','0','',$ENV{'form.previous'});       '0','0','',$ENV{'form.previous'});
         return OK;
   } elsif ($ENV{'form.preview'}) {    } elsif ($ENV{'form.preview'}) {
 # -------------------------------------------------------- User wants a preview  # -------------------------------------------------------- User wants a preview
       &Apache::loncommon::content_type($r,'text/html');  
       $r->send_http_header;  
       &show_preview($r);        &show_preview($r);
         return OK;
   } elsif ($ENV{'form.attach'}) {    } elsif ($ENV{'form.attach'}) {
 # -------------------------------------------------------- Work on attachments  # -------------------------------------------------------- Work on attachments
       &Apache::loncommon::content_type($r,'text/html');        &Apache::loncommon::content_type($r,'text/html');
Line 3079  ENDREDIR Line 3065  ENDREDIR
       }        }
       &modify_attachments($r,\@currnewattach,\@currdelold,$symb,$idx,        &modify_attachments($r,\@currnewattach,\@currdelold,$symb,$idx,
   $attachmenturls);    $attachmenturls);
         return OK;
   } elsif ($ENV{'form.chgreads'}) {    } elsif ($ENV{'form.chgreads'}) {
       &Apache::loncommon::content_type($r,'text/html');  
       $r->send_http_header;  
       my ($map,$ind,$url)=&Apache::lonnet::decode_symb($ENV{'form.chgreads'});        my ($map,$ind,$url)=&Apache::lonnet::decode_symb($ENV{'form.chgreads'});
       &redirect_back($r,&Apache::lonnet::clutter($url),        &redirect_back($r,&Apache::lonnet::clutter($url),
      &mt('Changed read status').'<br />','0','0');       &mt('Changed read status').'<br />','0','0');
         return OK;
   } elsif ($ENV{'form.export'}) {    } elsif ($ENV{'form.export'}) {
       &Apache::loncommon::content_type($r,'text/html');        &Apache::loncommon::content_type($r,'text/html');
       $r->send_http_header;        $r->send_http_header;
Line 3144  ENDREDIR Line 3130  ENDREDIR
   return OK;    return OK;
       }        }
 # Go ahead with feedback, no ambiguous reference  # Go ahead with feedback, no ambiguous reference
       &Apache::loncommon::content_type($r,'text/html');  
       $r->send_http_header;  
     
       unless (        unless (
   (    (
    ($feedurl=~m:^/res:) && ($feedurl!~m:^/res/adm:)     ($feedurl=~m:^/res:) && ($feedurl!~m:^/res/adm:)
Line 3156  ENDREDIR Line 3139  ENDREDIR
   ||    ||
   ($ENV{'request.course.id'} && ($symb=~/^bulletin\_\_\_/))    ($ENV{'request.course.id'} && ($symb=~/^bulletin\_\_\_/))
   ) {    ) {
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
 # Unable to give feedback  # Unable to give feedback
   &no_redirect_back($r,$feedurl);    &no_redirect_back($r,$feedurl);
       }        }
 # --------------------------------------------------- Print login screen header  # --------------------------------------------------- Print login screen header
       unless ($ENV{'form.sendit'}) {        unless ($ENV{'form.sendit'}) {
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
   my $options=&screen_header($feedurl);    my $options=&screen_header($feedurl);
   if ($options) {    if ($options) {
       &mail_screen($r,$feedurl,$options);        &mail_screen($r,$feedurl,$options);

Removed from v.1.134  
changed lines
  Added in v.1.135


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>