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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 23 Mar 2006 23:48:11 -0000


albertel		Thu Mar 23 18:48:11 2006 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  - start_page
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.401 loncom/xml/lonxml.pm:1.402
--- loncom/xml/lonxml.pm:1.401	Fri Mar 10 18:49:35 2006
+++ loncom/xml/lonxml.pm	Thu Mar 23 18:48:10 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.401 2006/03/10 23:49:35 albertel Exp $
+# $Id: lonxml.pm,v 1.402 2006/03/23 23:48:10 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1458,17 +1458,13 @@
     my $result = '';
     my $filecontents=&Apache::lonnet::getfile($file);
     if ($filecontents eq -1) {
-	my $bodytag=&Apache::loncommon::bodytag('File Error');
+	my $start_page=&Apache::loncommon::start_page('File Error');
+	my $end_page=&Apache::loncommon::end_page('File Error');
 	my $fnf=&mt('File not found');
 	$result=(<<ENDNOTFOUND);
-<html>
-<head>
-<title>$fnf</title>
-</head>
-$bodytag
+$start_page
 <b>$fnf: $file</b>
-</body>
-</html>
+$end_page
 ENDNOTFOUND
         $filecontents='';
 	if ($env{'request.state'} ne 'published') {
@@ -1506,18 +1502,21 @@
 	if ($env{'form.editmode'} && (!($env{'form.viewmode'}))) {
 	    my $displayfile=$request->uri;
 	    $displayfile=~s/^\/[^\/]*//;
-	    my $bodytag='<body bgcolor="#FFFFFF">';
-	    if ($env{'environment.remote'} eq 'off') {
-		$bodytag=&Apache::loncommon::bodytag();
+	    my %options = ();
+	    if ($env{'environment.remote'} ne 'off') {
+		$options{'bgcolor'}   = '#FFFFFF';
+		$options{'only_body'} = 1;
 	    }
-	    $result='<html>'.$bodytag.
+	    my $start_page = &Apache::loncommon::start_page(undef,undef,
+							    \%options);
+	    $result=$start_page.
 		&Apache::lonxml::message_location().'<h3>'.
 		$displayfile.
-		'</h3></body></html>';
+		'</h3>'.&Apache::loncommon::end_page();
 	    $result=&inserteditinfo($result,$filecontents,$filetype);
 	}
     }
-    if ($filetype eq 'html') { writeallows($request->uri); }
+    if ($filetype eq 'html') { &writeallows($request->uri); }
 	
     
     &Apache::lonxml::add_messages(\$result);