[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm

raeburn raeburn@source.lon-capa.org
Mon, 30 Nov 2009 21:17:41 -0000


raeburn		Mon Nov 30 21:17:41 2009 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  - Link to enable/disable WYSIWYG editor for HTML editor in CSTR.
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.500 loncom/xml/lonxml.pm:1.501
--- loncom/xml/lonxml.pm:1.500	Thu Oct 15 21:12:51 2009
+++ loncom/xml/lonxml.pm	Mon Nov 30 21:17:41 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.500 2009/10/15 21:12:51 raeburn Exp $
+# $Id: lonxml.pm,v 1.501 2009/11/30 21:17:41 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -111,6 +111,7 @@
 use Apache::lonmaxima();
 use Apache::lonr();
 use Apache::lonlocal;
+use Apache::lonhtmlcommon();
 
 #====================================   Main subroutine: xmlparse  
 
@@ -1625,6 +1626,7 @@
       }
 
       my $titledisplay=&display_title();
+      my $wysiwyglink;
       my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit',
 					 'vi' => 'Save and View',
 					 'dv' => 'Discard Edits and View',
@@ -1639,6 +1641,13 @@
           if ($htmlerror) {
               $htmlerror='<span class="LC_error">'.$htmlerror.'</span>';
           }
+          if (&Apache::lonhtmlcommon::htmlareabrowser()) {
+              if (&Apache::lonhtmlcommon::htmlareablocked()) {
+                  $wysiwyglink = &Apache::lonhtmlcommon::enablelink($textarea_id);
+              } else {
+                  $wysiwyglink = &Apache::lonhtmlcommon::disablelink($textarea_id);
+              }
+          }
       }
       my $editfooter=(<<ENDFOOTER);
 $initialize
@@ -1663,6 +1672,7 @@
   </div>
   <textarea $textarea_events style="width:100%" cols="80" rows="44" name="filecont" id="filecont">$filecontents</textarea>
   <div id="LC_aftertextarea">
+    $wysiwyglink
     <br />
     $titledisplay
   </div>
@@ -1884,7 +1894,7 @@
         }
     }
     if ($filetype eq 'html') { &writeallows($request->uri); }
-    
+
     &Apache::lonxml::add_messages(\$result);
     $request->print($result);