[LON-CAPA-cvs] cvs: loncom /interface lonfeedback.pm

raeburn raeburn@source.lon-capa.org
Thu, 26 Aug 2010 03:59:16 -0000


raeburn		Thu Aug 26 03:59:16 2010 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
  Log:
  - Bug 3716.
    - If "Allow limited HTML in discussion" is not "Yes" in course preferences,
      Richtext editor is unavailable when composing discussion posts.
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.300 loncom/interface/lonfeedback.pm:1.301
--- loncom/interface/lonfeedback.pm:1.300	Wed Aug 25 00:46:37 2010
+++ loncom/interface/lonfeedback.pm	Thu Aug 26 03:59:16 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.300 2010/08/25 00:46:37 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.301 2010/08/26 03:59:16 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -850,6 +850,11 @@
     if (&Apache::lonhtmlcommon::htmlareabrowser()) {
         $postingform = &Apache::lonhtmlcommon::htmlareaselectactive();
         $textareaclass = 'class="LC_richDefaultOff"';
+        if ($env{'request.course.id'}) {
+            unless (($env{'course.'.$env{'request.course.id'}.'.allow_limited_html_in_feedback'} =~ /^\s*yes\s*$/i) || ($env{'form.sendmessageonly'})) {
+                undef($textareaclass);
+            }
+        }
     }
     $postingform .= (<<ENDDISCUSS);
 <form action="/adm/feedback" method="post" name="mailform" enctype="multipart/form-data"> <input type="submit" name="discuss" value="$lt{'podi'}" />
@@ -1699,6 +1704,11 @@
   if (&Apache::lonhtmlcommon::htmlareabrowser()) {
       $textareaheader = &Apache::lonhtmlcommon::htmlareaselectactive();
       $textareaclass = 'class="LC_richDefaultOff"';
+      if ($env{'request.course.id'}) {
+          unless (($env{'course.'.$env{'request.course.id'}.'.allow_limited_html_in_feedback'} =~ /^\s*yes\s*$/i) || ($env{'form.sendmessageonly'})) {
+              undef($textareaclass);
+          }
+      }
   }
 
   # Breadcrumbs
@@ -3910,7 +3920,11 @@
           }
       }
 # Filter HTML out of message (could be nasty)
-      my $message=&clear_out_html($env{'form.comment'});
+      my $override;
+      if ($env{'form.discuss'} =~ /^(?:author|question|course|policy)$/) {
+          $override = 1;
+      }
+      my $message=&clear_out_html($env{'form.comment'},$override);
 
 # Assemble email
       my ($email,$citations)=&assemble_email($message,$prevattempts,