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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Mon, 10 Sep 2007 20:09:13 -0000


albertel		Mon Sep 10 16:09:13 2007 EDT

  Modified files:              
    /loncom/xml	lonxml.pm londefdef.pm 
  Log:
  - get the Edit for .sty to only appear in CSTR space
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.456 loncom/xml/lonxml.pm:1.457
--- loncom/xml/lonxml.pm:1.456	Mon Sep 10 15:46:57 2007
+++ loncom/xml/lonxml.pm	Mon Sep 10 16:09:13 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.456 2007/09/10 19:46:57 albertel Exp $
+# $Id: lonxml.pm,v 1.457 2007/09/10 20:09:13 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1543,10 +1543,13 @@
 						    ['rawmode']);
 	    if ($env{'form.rawmode'}) { $result = $filecontents; }
 	    if ($filetype eq 'sty') {
+		my $controls =
+		    ($env{'request.state'} eq 'construct') ? &Apache::londefdef::edit_controls()
+		                                           : '';
 		my %options = ('bgcolor' => '#FFFFFF');
 		$result = 
 		    &Apache::loncommon::start_page(undef,undef,\%options).
-		    &Apache::londefdef::edit_controls().
+		    $controls.
 		    $result.
 		    &Apache::loncommon::end_page();
 	    }
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.376 loncom/xml/londefdef.pm:1.377
--- loncom/xml/londefdef.pm:1.376	Mon Sep 10 15:50:20 2007
+++ loncom/xml/londefdef.pm	Mon Sep 10 16:09:13 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.376 2007/09/10 19:50:20 albertel Exp $
+# $Id: londefdef.pm,v 1.377 2007/09/10 20:09:13 albertel Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -581,6 +581,7 @@
 
 	}
 	$currentstring.=&Apache::lonxml::message_location();
+	$currentstring.=&Apache::lonmenu::constspaceform();
 	$currentstring.=&Apache::londefdef::edit_controls();
     } elsif ($target eq 'tex') {
 	$currentstring = '\begin{document}';  
@@ -589,8 +590,7 @@
 }
 
 sub edit_controls {
-    my $result = &Apache::lonmenu::constspaceform();
-    $result .= (<<EDITBUTTON);
+    my $result .= (<<EDITBUTTON);
 <form method="post">
 <input type="submit" name="editmode" accesskey="e" value="Edit" />
 </form>