[LON-CAPA-cvs] cvs: loncom /homework edit.pm inputtags.pm structuretags.pm /interface loncommon.pm lonhtmlcommon.pm /xml lonxml.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 18 Apr 2006 22:36:24 -0000


albertel		Tue Apr 18 18:36:24 2006 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonhtmlcommon.pm 
    /loncom/xml	lonxml.pm 
    /loncom/homework	inputtags.pm structuretags.pm edit.pm 
  Log:
  - moving htmlare filed handling to be in htmlcommon like the rest of the htmlarea handling
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.341 loncom/interface/loncommon.pm:1.342
--- loncom/interface/loncommon.pm:1.341	Tue Apr 18 16:55:14 2006
+++ loncom/interface/loncommon.pm	Tue Apr 18 18:35:41 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.341 2006/04/18 20:55:14 albertel Exp $
+# $Id: loncommon.pm,v 1.342 2006/04/18 22:35:41 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3143,7 +3143,8 @@
 sub xml_begin {
     my $output='';
 
-    @Apache::lonxml::htmlareafields=();
+    &Apache::lonhtmlcommon::init_htmlareafields();
+
     if ($env{'browser.mathml'}) {
 	$output='<?xml version="1.0"?>'
             #.'<?xml-stylesheet type="text/css" href="/adm/MathML/mathml.css"?>'."\n"
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.123 loncom/interface/lonhtmlcommon.pm:1.124
--- loncom/interface/lonhtmlcommon.pm:1.123	Tue Mar 21 15:19:41 2006
+++ loncom/interface/lonhtmlcommon.pm	Tue Apr 18 18:35:41 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.123 2006/03/21 20:19:41 albertel Exp $
+# $Id: lonhtmlcommon.pm,v 1.124 2006/04/18 22:35:41 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1015,6 +1015,22 @@
 
 # ------------------------------------------------- Output headers for HTMLArea
 
+{
+    my @htmlareafields;
+    sub init_htmlareafields {
+	undef(@htmlareafields);
+    }
+    
+    sub add_htmlareafields {
+	my (@newfields) = @_;
+	push(@htmlareafields,@newfields);
+    }
+
+    sub get_htmlareafields {
+	return @htmlareafields;
+    }
+}
+
 sub htmlareaheaders {
     if (&htmlareablocked()) { return ''; }
     unless (&htmlareabrowser()) { return ''; }
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.409 loncom/xml/lonxml.pm:1.410
--- loncom/xml/lonxml.pm:1.409	Tue Apr 18 16:55:26 2006
+++ loncom/xml/lonxml.pm	Tue Apr 18 18:35:55 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.409 2006/04/18 20:55:26 albertel Exp $
+# $Id: lonxml.pm,v 1.410 2006/04/18 22:35:55 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -40,7 +40,7 @@
 
 package Apache::lonxml; 
 use vars 
-qw(@pwd @outputstack $redirection $import @extlinks $metamode $evaluate %insertlist @namespace $errorcount $warningcount @htmlareafields);
+qw(@pwd @outputstack $redirection $import @extlinks $metamode $evaluate %insertlist @namespace $errorcount $warningcount);
 use strict;
 use HTML::LCParser();
 use HTML::TreeBuilder();
@@ -604,7 +604,6 @@
   my ($request,$target)=@_;
   $Apache::lonxml::request=$request;
   $Apache::lonxml::registered = 0;
-  @Apache::lonxml::htmlareafields=();
   $errorcount=0;
   $warningcount=0;
   $Apache::lonxml::default_homework_loaded=0;
@@ -1293,8 +1292,7 @@
       my $initialize='';
       if ($filetype eq 'html') {
 	  my $addbuttons=&Apache::lonhtmlcommon::htmlareaaddbuttons();
-	  $initialize=&Apache::lonhtmlcommon::htmlareaheaders().
-	      &Apache::lonhtmlcommon::spellheader();
+	  $initialize=&Apache::lonhtmlcommon::spellheader();
 	  if (!&Apache::lonhtmlcommon::htmlareablocked() &&
 	      &Apache::lonhtmlcommon::htmlareabrowser()) {
 	      $initialize.=(<<FULLPAGE);
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.190 loncom/homework/inputtags.pm:1.191
--- loncom/homework/inputtags.pm:1.190	Wed Mar  8 20:11:12 2006
+++ loncom/homework/inputtags.pm	Tue Apr 18 18:36:23 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.190 2006/03/09 01:11:12 albertel Exp $
+# $Id: inputtags.pm,v 1.191 2006/04/18 22:36:23 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -149,7 +149,7 @@
 	    if ($addchars) {
 		$result.=&addchars('HWVAL_'.$resid,$addchars);
 	    }
-	    push @Apache::lonxml::htmlareafields,'HWVAL_'.$resid;
+	    &Apache::lonhtmlcommon::add_htmlareafields('HWVAL_'.$resid);
 	    $result.= '<textarea wrap="hard" name="HWVAL_'.$resid.'" id="HWVAL_'.$resid.'" '.
 		"rows=\"$rows\" cols=\"$cols\">".$oldresponse;
 	    if ($oldresponse ne '') {
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.346 loncom/homework/structuretags.pm:1.347
--- loncom/homework/structuretags.pm:1.346	Fri Apr 14 21:06:59 2006
+++ loncom/homework/structuretags.pm	Tue Apr 18 18:36:23 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.346 2006/04/15 01:06:59 albertel Exp $
+# $Id: structuretags.pm,v 1.347 2006/04/18 22:36:23 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -250,7 +250,7 @@
 sub problem_edit_footer {
     return '</td></tr></table><br /><input type="submit" name="submit" value="'.&mt('Submit Changes and Edit').'" />
     <input type="submit" name="submit" value="'.&mt('Submit Changes and View').'" />'.
-    &Apache::lonhtmlcommon::htmlareaselectactive(@Apache::lonxml::htmlareafields).
+    &Apache::lonhtmlcommon::htmlareaselectactive(&Apache::lonhtmcommon::get_htmlareafields()).
     "\n</form>\n".&Apache::loncommon::end_page();
 }
 
@@ -861,7 +861,7 @@
 	    if ($target ne 'tex' &&
 		$env{'form.answer_output_mode'} ne 'tex') {
 		$result.="</form>";
-		$result.=&Apache::lonhtmlcommon::htmlareaselectactive(@Apache::lonxml::htmlareafields);
+		$result.= &Apache::lonhtmlcommon::htmlareaselectactive(&Apache::lonhtmcommon::get_htmlareafields());
 	    }
 	    if ($target eq 'web') {
 		$result.= &Apache::loncommon::end_page({'discussion' => 1});
Index: loncom/homework/edit.pm
diff -u loncom/homework/edit.pm:1.100 loncom/homework/edit.pm:1.101
--- loncom/homework/edit.pm:1.100	Mon Feb  6 16:59:44 2006
+++ loncom/homework/edit.pm	Tue Apr 18 18:36:23 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # edit mode helpers
 #
-# $Id: edit.pm,v 1.100 2006/02/06 21:59:44 albertel Exp $
+# $Id: edit.pm,v 1.101 2006/04/18 22:36:23 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -577,8 +577,8 @@
     if ($rows < $minheight) { $rows = $minheight; }
     if ($description) { $description="<br />".$description."<br />"; }
     if ($usehtmlarea) {
-	push @Apache::lonxml::htmlareafields,'homework_edit_'.
-	    $Apache::lonxml::curdepth;
+	&Apache::lonhtmlcommon::add_htmlareafields('homework_edit_'.
+						   $Apache::lonxml::curdepth);
     }
     return $description."\n".'&nbsp;&nbsp;&nbsp;<textarea style="width:100%" rows="'.$rows.
 	'" cols="'.$cols.'" name="homework_edit_'.