[LON-CAPA-cvs] cvs: loncom /homework lonsimpleproblemedit.pm /publisher loncfile.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 10 Apr 2006 22:47:29 -0000


albertel		Mon Apr 10 18:47:29 2006 EDT

  Modified files:              
    /loncom/publisher	loncfile.pm 
    /loncom/homework	lonsimpleproblemedit.pm 
  Log:
  - start_page
  
  
Index: loncom/publisher/loncfile.pm
diff -u loncom/publisher/loncfile.pm:1.74 loncom/publisher/loncfile.pm:1.75
--- loncom/publisher/loncfile.pm:1.74	Wed Nov  9 04:06:59 2005
+++ loncom/publisher/loncfile.pm	Mon Apr 10 18:47:18 2006
@@ -9,7 +9,7 @@
 #  and displays a page showing the results of the action.
 #
 #
-# $Id: loncfile.pm,v 1.74 2005/11/09 09:06:59 www Exp $
+# $Id: loncfile.pm,v 1.75 2006/04/10 22:47:18 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1273,10 +1273,12 @@
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
 
+    my (%loaditem,$js);
+
     if ( ($env{'form.action'} eq 'newdir') && ($env{'form.phase'} eq 'two') && ( ($env{'form.callingmode'} eq 'testbank') || ($env{'form.callingmode'} eq 'imsimport') ) ) {
 	my $newdirname = $env{'form.newfilename'};
-	$r->print('<html><head><title>LON-CAPA Construction Space</title><script language="Javascript">');
-	$r->print(qq|
+	$js = qq|
+<script type="text/javascript">
 function writeDone() {
     var winName = window.opener
     window.focus();
@@ -1284,14 +1286,13 @@
     setTimeout("self.close()",10000)
 }
   </script>
-  </head>|);
-	my $loaditem = 'onLoad="writeDone()"';
-	$r->print(&Apache::loncommon::bodytag('Construction Space File Operation','',$loaditem));
-    } else {
-	$r->print('<html><head><title>LON-CAPA Construction Space</title></head>');
-	$r->print(&Apache::loncommon::bodytag('Construction Space File Operation'));
+|;
+	$loaditem{'onload'} => "writeDone()";
     }
-
+    
+    $r->print(&Apache::loncommon::start_page('Construction Space File Operation',
+					     $js,
+					     {'add_entries' => \%loaditem,}));
   
     $r->print('<h3>'.&mt('Location').': '.&display($fn).'</h3>');
   
@@ -1325,7 +1326,8 @@
 	     $env{'form.action'} eq 'Select Action' ) {
 	$r->print('<h3>'.&mt('New Resource').'</h3>');
     } else {
-	$r->print('<p>'.&mt('Unknown Action').' '.$env{'form.action'}.' </p></body></html>');
+	$r->print('<p>'.&mt('Unknown Action').' '.$env{'form.action'}.' </p>'.
+		  &Apache::loncommon::end_page());
 	return OK;  
     }
     if ($env{'form.phase'} eq 'two') {
@@ -1336,7 +1338,7 @@
 	&phaseone($r,$fn,$uname,$udom);
     }
 
-    $r->print('</body></html>');
+    $r->print(&Apache::loncommon::end_page());
     return OK;  
 }
 
Index: loncom/homework/lonsimpleproblemedit.pm
diff -u loncom/homework/lonsimpleproblemedit.pm:1.16 loncom/homework/lonsimpleproblemedit.pm:1.17
--- loncom/homework/lonsimpleproblemedit.pm:1.16	Thu May 26 16:35:53 2005
+++ loncom/homework/lonsimpleproblemedit.pm	Mon Apr 10 18:47:29 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Simple Problem Parameter Setting "Editor"
 #
-# $Id: lonsimpleproblemedit.pm,v 1.16 2005/05/26 20:35:53 albertel Exp $
+# $Id: lonsimpleproblemedit.pm,v 1.17 2006/04/10 22:47:29 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -212,14 +212,8 @@
 
 # ------------------------------------------------------------ Print the screen
     my $spell_header=&Apache::lonhtmlcommon::spellheader();
-    $r->print(<<ENDDOCUMENT);
-<html>
-<head>
-<title>The LearningOnline Network with CAPA</title>
-$spell_header
-</head>
-ENDDOCUMENT
-    $r->print(&Apache::loncommon::bodytag('Simple Problem Editor'));
+    $r->print(&Apache::loncommon::start_page('Simple Problem Editor',
+					     $spell_header));
     if ($symb) {
 	$r->print('<h1>'.&Apache::lonnet::gettitle($symb).'</h1>');
 	$r->print('<table width="100%" bgcolor="#FFFFAA" border="2"><tr><td>'.
@@ -317,7 +311,7 @@
     } else {
 	$r->print(&mt('Could not identify problem.'));
     }
-    $r->print('</body></html>');
+    $r->print(&Apache::loncommon::end_page());
     return OK;
 }