Diff for /loncom/interface/lonfeedback.pm between versions 1.296 and 1.297

version 1.296, 2010/06/08 16:56:57 version 1.297, 2010/08/07 19:23:50
Line 847  sub postingform_display { Line 847  sub postingform_display {
     if ($crstype eq 'Community') {      if ($crstype eq 'Community') {
         $lt{'note'} = &mt('Note: in anonymous discussion, your name is visible only to community facilitators');          $lt{'note'} = &mt('Note: in anonymous discussion, your name is visible only to community facilitators');
     }      }
     my $postingform = (<<ENDDISCUSS);      my ($postingform,$textareaclass);
       if (&Apache::lonhtmlcommon::htmlareabrowser()) {
           $postingform = &Apache::lonhtmlcommon::htmlareaselectactive();
           $textareaclass = 'class="LC_richDefaultOff"';
       }
       $postingform .= (<<ENDDISCUSS);
 <form action="/adm/feedback" method="post" name="mailform" enctype="multipart/form-data"> <input type="submit" name="discuss" value="$lt{'podi'}" />  <form action="/adm/feedback" method="post" name="mailform" enctype="multipart/form-data"> <input type="submit" name="discuss" value="$lt{'podi'}" />
 <input type="submit" name="anondiscuss" value="$lt{'poan'}" /> <input type="hidden" name="symb" value="$ressymb" />  <input type="submit" name="anondiscuss" value="$lt{'poan'}" /> <input type="hidden" name="symb" value="$ressymb" />
 <input type="hidden" name="sendit" value="true" />  <input type="hidden" name="sendit" value="true" />
Line 855  sub postingform_display { Line 860  sub postingform_display {
 <br /><a name="newpost"></a>  <br /><a name="newpost"></a>
 <font size="1">$lt{'note'}</font><br />  <font size="1">$lt{'note'}</font><br />
 <b>$lt{'title'}:</b>&nbsp;<input type="text" name="subject" value="$subject" size="30" /><br /><br />  <b>$lt{'title'}:</b>&nbsp;<input type="text" name="subject" value="$subject" size="30" /><br /><br />
 <textarea name="comment" cols="80" rows="14" >$comment</textarea>  <textarea name="comment" cols="80" rows="14" id="comment" $textareaclass>$comment</textarea>
 ENDDISCUSS  ENDDISCUSS
     if ($env{'form.origpage'}) {      if ($env{'form.origpage'}) {
         $postingform .= '<input type="hidden" name="origpage" value="'.          $postingform .= '<input type="hidden" name="origpage" value="'.
Line 1674  END Line 1679  END
 </script>  </script>
 END  END
   
     my ($textareaheader,$textareaclass);
     if (&Apache::lonhtmlcommon::htmlareabrowser()) {
         $textareaheader = &Apache::lonhtmlcommon::htmlareaselectactive();
         $textareaclass = 'class="LC_richDefaultOff"';
     }
   
   # Breadcrumbs    # Breadcrumbs
   my $brcrum = [{'href' => '',    my $brcrum = [{'href' => '',
                  'text' => 'Resource Feedback and Discussion'}];                   'text' => 'Resource Feedback and Discussion'}];
Line 1713  END Line 1724  END
   $r->print(<<END);    $r->print(<<END);
 $options<hr />  $options<hr />
 $quote  $quote
 <p>$lt{'myqu'}</p>  <p>$lt{'myqu'}
   $textareaheader
   </p>
 <p>  <p>
 $latexHelp  $latexHelp
 </p>  </p>
 <p>  <p>
 $lt{'title'}: <input type="text" name="subject" size="30" value="$subject" /></p>  $lt{'title'}: <input type="text" name="subject" size="30" value="$subject" /></p>
 <p>  <p>
 <textarea name="comment" id="comment" cols="60" rows="10">$comment  <textarea name="comment" id="comment" cols="60" rows="10" $textareaclass>$comment
 </textarea></p>  </textarea></p>
 END  END
     if ( ($env{'form.editdisc'}) || ($env{'form.replydisc'}) ) {      if ( ($env{'form.editdisc'}) || ($env{'form.replydisc'}) ) {
Line 1798  END Line 1811  END
         }          }
     }      }
     $r->print(&generate_preview_button().      $r->print(&generate_preview_button().
               &Apache::lonhtmlcommon::htmlareaselectactive('comment').  
       &Apache::loncommon::end_page());        &Apache::loncommon::end_page());
   
 }  }
Line 2672  sub resource_output { Line 2684  sub resource_output {
 }  }
   
 sub clear_out_html {  sub clear_out_html {
   my ($message,$override,$ignore_htmlarea)=@_;    my ($message,$override)=@_;
   if (!$ignore_htmlarea  
       && !&Apache::lonhtmlcommon::htmlareablocked()) { return $message; }  
 # Always allow the <m>-tag  # Always allow the <m>-tag
   my %html=(M=>1);    my %html=(M=>1);
 # Check if more is allowed  # Check if more is allowed
Line 2685  sub clear_out_html { Line 2695  sub clear_out_html {
       # <BLOCKQUOTE> <DIV .*> <DIV> <IMG> <M> <SPAN> <H1> <H2> <H3> <H4> <SUB>        # <BLOCKQUOTE> <DIV .*> <DIV> <IMG> <M> <SPAN> <H1> <H2> <H3> <H4> <SUB>
       # <SUP> <TABLE> <TR> <TD> <TH> <TBODY>        # <SUP> <TABLE> <TR> <TD> <TH> <TBODY>
       %html=(B=>1, I=>1, P=>1, A=>1, LI=>1, OL=>1, UL=>1, EM=>1,        %html=(B=>1, I=>1, P=>1, A=>1, LI=>1, OL=>1, UL=>1, EM=>1,
      BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, DIV=>1, IMG=>1,       BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, PRE=>1, DIV=>1, IMG=>1,
      M=>1, ALGEBRA=>1, SUB=>1, SUP=>1, SPAN=>1,        M=>1, CHEM=>1, ALGEBRA=>1, SUB=>1, SUP=>1, SPAN=>1,  
      H1=>1, H2=>1, H3=>1, H4=>1, H5=>1, H6=>1,        H1=>1, H2=>1, H3=>1, H4=>1, H5=>1, H6=>1, 
      TABLE=>1, TR=>1, TD=>1, TH=>1, TBODY=>1);       TABLE=>1, TR=>1, TD=>1, TH=>1, TBODY=>1);
   }    }
Line 2934  sub show_preview { Line 2944  sub show_preview {
     &newline_to_br(\$message);      &newline_to_br(\$message);
     $message=&Apache::lonspeller::markeduptext($message);      $message=&Apache::lonspeller::markeduptext($message);
     $message=&Apache::lontexconvert::msgtexconverted($message);      $message=&Apache::lontexconvert::msgtexconverted($message);
     my $subject=&clear_out_html($env{'form.subject'},undef,1);      my $subject=&clear_out_html($env{'form.subject'});
     $subject=~s/\n/\<br \/\>/g;      $subject=~s/\n/\<br \/\>/g;
     $subject=&Apache::lontexconvert::msgtexconverted($subject);      $subject=&Apache::lontexconvert::msgtexconverted($subject);
   
Line 3046  END Line 3056  END
                                    {'bread_crumbs' => $brcrum,});                                     {'bread_crumbs' => $brcrum,});
   
     my $orig_subject = &unescape($env{'form.subject'});      my $orig_subject = &unescape($env{'form.subject'});
     my $subject=&clear_out_html($orig_subject,undef,1);      my $subject=&clear_out_html($orig_subject);
     $subject=~s/\n/\<br \/\>/g;      $subject=~s/\n/\<br \/\>/g;
     $subject=&Apache::lontexconvert::msgtexconverted($subject);      $subject=&Apache::lontexconvert::msgtexconverted($subject);
     my $timestamp=$env{'form.timestamp'};      my $timestamp=$env{'form.timestamp'};
Line 3894  ENDREDIR Line 3904  ENDREDIR
       my ($typestyle,%to) = &Apache::lonmsg::decide_receiver($feedurl);        my ($typestyle,%to) = &Apache::lonmsg::decide_receiver($feedurl);
   
 # Actually send mail  # Actually send mail
       my ($status,$numsent)=&send_msg(&clear_out_html($env{'form.subject'},        my ($status,$numsent)=&send_msg(&clear_out_html($env{'form.subject'}),
       undef,1),  
       $feedurl,$email,$citations,        $feedurl,$email,$citations,
       $attachmenturl,$usersymb,%to);        $attachmenturl,$usersymb,%to);
   
Line 3904  ENDREDIR Line 3913  ENDREDIR
       if (  ($env{'form.discuss'} ne ''        if (  ($env{'form.discuss'} ne ''
      && $env{'form.discuss'} !~ /^(?:author|question|course|policy)/)       && $env{'form.discuss'} !~ /^(?:author|question|course|policy)/)
    || $env{'form.anondiscuss'} ne '') {     || $env{'form.anondiscuss'} ne '') {
   my $subject = &clear_out_html($env{'form.subject'},undef,1);    my $subject = &clear_out_html($env{'form.subject'});
   my $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} );    my $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} );
   $typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl,    $typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl,
   $subject);    $subject);
Line 3915  ENDREDIR Line 3924  ENDREDIR
   
       my $blog='';        my $blog='';
       if ($env{'form.blog'}) {        if ($env{'form.blog'}) {
   my $subject = &clear_out_html($env{'form.subject'},undef,1);    my $subject = &clear_out_html($env{'form.subject'});
   $status.=&Apache::lonrss::addentry($env{'user.name'},    $status.=&Apache::lonrss::addentry($env{'user.name'},
     $env{'user.domain'},      $env{'user.domain'},
     'CourseBlog_'.$env{'request.course.id'},      'CourseBlog_'.$env{'request.course.id'},

Removed from v.1.296  
changed lines
  Added in v.1.297


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