[LON-CAPA-cvs] cvs: loncom /publisher loncleanup.pm lonconstruct.pm londiff.pm lonpublisher.pm lonpubmenu.pm lonretrieve.pm lonrights.pm lonunauthorized.pm lonupload.pm testbankimport.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 06 Apr 2006 22:15:21 -0000


This is a MIME encoded message

--albertel1144361721
Content-Type: text/plain

albertel		Thu Apr  6 18:15:21 2006 EDT

  Modified files:              
    /loncom/publisher	loncleanup.pm lonconstruct.pm londiff.pm 
                     	lonpublisher.pm lonpubmenu.pm lonretrieve.pm 
                     	lonrights.pm lonunauthorized.pm lonupload.pm 
                     	testbankimport.pm 
  Log:
  - start_page
  
  
--albertel1144361721
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20060406181521.txt"

Index: loncom/publisher/loncleanup.pm
diff -u loncom/publisher/loncleanup.pm:1.6 loncom/publisher/loncleanup.pm:1.7
--- loncom/publisher/loncleanup.pm:1.6	Wed Jul 13 17:43:02 2005
+++ loncom/publisher/loncleanup.pm	Thu Apr  6 18:15:18 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to cleanup XML files
 #
-# $Id: loncleanup.pm,v 1.6 2005/07/13 21:43:02 www Exp $
+# $Id: loncleanup.pm,v 1.7 2006/04/06 22:15:18 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -364,10 +364,7 @@
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
 
-    my $html=&Apache::lonxml::xmlbegin();
-    $r->print($html.'<head><title>LON-CAPA Construction Space</title></head>');
-
-    $r->print(&Apache::loncommon::bodytag('Cleanup XML Document'));
+    $r->print(&Apache::loncommon::start_page('Cleanup XML Document'));
     $r->print('<h2>'.$fn.'</h2>'.
               '<form action="/adm/cleanup" method="post">'.
               '<input type="hidden" name="filename" value="'.$env{'form.filename'}.'" />');
@@ -387,7 +384,7 @@
     $r->print('</form>'.
 	      '<br /><a href="/priv/'.$uname.'/'.$fn.'">'.&mt('Back to Source File').'</a>'.
               '<br /><a href="/priv/'.$uname.'/'.$dir.'">'.&mt('Back to Source Directory').'</a>'.
-	      '</body></html>');
+	      &Apache::loncommon::end_page());
     return OK;  
 }
 
Index: loncom/publisher/lonconstruct.pm
diff -u loncom/publisher/lonconstruct.pm:1.31 loncom/publisher/lonconstruct.pm:1.32
--- loncom/publisher/lonconstruct.pm:1.31	Tue Nov  8 12:58:35 2005
+++ loncom/publisher/lonconstruct.pm	Thu Apr  6 18:15:18 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construction Space Page Wrapper for Construction
 #
-# $Id: lonconstruct.pm,v 1.31 2005/11/08 17:58:35 albertel Exp $
+# $Id: lonconstruct.pm,v 1.32 2006/04/06 22:15:18 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -109,6 +109,12 @@
        $toprows = '110';
        $topsrc = '/adm/localize/adm/publisher.html';
    }
+   my $extra;
+   &Apache::lontexconvert::jsMath_reset();
+   if ($env{'environment.texengine'} eq 'jsMath' ||
+       $env{'form.texengine'}        eq 'jsMath' ) {
+       $extra.=&Apache::lontexconvert::jsMath_header();
+   }
    my $html=&Apache::lonxml::xmlbegin();
    $r->print(<<ENDPAGE);
 $html
Index: loncom/publisher/londiff.pm
diff -u loncom/publisher/londiff.pm:1.17 loncom/publisher/londiff.pm:1.18
--- loncom/publisher/londiff.pm:1.17	Sat May 28 21:46:16 2005
+++ loncom/publisher/londiff.pm	Thu Apr  6 18:15:18 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to show differences between file versions
 #
-# $Id: londiff.pm,v 1.17 2005/05/29 01:46:16 www Exp $
+# $Id: londiff.pm,v 1.18 2006/04/06 22:15:18 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -104,9 +104,7 @@
   &Apache::loncommon::content_type($r,'text/html');
   $r->send_http_header;
 
-  $r->print('<html><head><title>LON-CAPA Construction Diffs</title></head>');
-
-  $r->print(&Apache::loncommon::bodytag('Resource Differences'));
+  $r->print(&Apache::loncommon::start_page('Resource Differences'));
 
   
   $r->print('<h1>'.($env{'form.filetwo'}?'':&mt('Compare versions of')).
@@ -192,7 +190,8 @@
  } else {
      $r->print('<h1><font color=red>'.&mt('Binary File').'</font></h1>');
  }
-  $r->print('<center><a href="javascript:window.close();">'.&mt('Close This Window').'</a></center></body></html>'); 
+  $r->print('<center><a href="javascript:window.close();">'.&mt('Close This Window').'</a></center>');
+  $r->print(&Apache::loncommon::end_page()); 
   return OK;  
 }
 
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.207 loncom/publisher/lonpublisher.pm:1.208
--- loncom/publisher/lonpublisher.pm:1.207	Tue Jan 24 17:09:36 2006
+++ loncom/publisher/lonpublisher.pm	Thu Apr  6 18:15:18 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.207 2006/01/24 22:09:36 albertel Exp $
+# $Id: lonpublisher.pm,v 1.208 2006/04/06 22:15:18 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1849,8 +1849,7 @@
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
 
-    $r->print('<html><head><title>LON-CAPA Publishing</title></head>');
-    $r->print(&Apache::loncommon::bodytag('Catalog Information Publication'));
+    $r->print(&Apache::loncommon::start_page('Catalog Information Publication'));
 
 # ---------------------------------------------------------------- Write Source
     my $copyfile=$target;
@@ -1886,7 +1885,7 @@
     my $link=$fn;
     $link=~s/^\/home\/$cuname\/public_html\//\/priv\/$cuname\//;
     $r->print("<a href='$link'>".&mt('Back to Catalog Information').'</a>');
-    $r->print('</body></html>');
+    $r->print(&Apache::loncommon::end_page());
     return OK;
 }
 #########################################
@@ -2036,11 +2035,10 @@
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
     
-    my $js=&Apache::loncommon::browser_and_searcher_javascript();
-    $r->print('<html><head><title>LON-CAPA Publishing</title>
-              <script type="text/javascript">'.$js.'
-              </script></head>');
-    $r->print(&Apache::loncommon::bodytag('Resource Publication'));
+    my $js='<script type="text/javascript">'.
+	&Apache::loncommon::browser_and_searcher_javascript().
+	'</script>';
+    $r->print(&Apache::loncommon::start_page('Resource Publication'));
 
 
     my $thisfn=$fn;
@@ -2115,7 +2113,7 @@
 	    $r->print('<hr />');
 	}
     }
-    $r->print('</body></html>');
+    $r->print(&Apache::loncommon::end_page());
 
     return OK;
 }
Index: loncom/publisher/lonpubmenu.pm
diff -u loncom/publisher/lonpubmenu.pm:1.3 loncom/publisher/lonpubmenu.pm:1.4
--- loncom/publisher/lonpubmenu.pm:1.3	Thu Apr  7 02:56:27 2005
+++ loncom/publisher/lonpubmenu.pm	Thu Apr  6 18:15:19 2006
@@ -68,10 +68,7 @@
     if ($env{'request.role'} =~ m#^ca\./[^/]+/([^/]+)#) {
         $defaultdir = '/priv/'.$1.'/';
     }
-    $r->print(<<"ENDONE");
-<html>
-<head>
-<title>LON-CAPA Publishing Frame</title>
+    my $js=
 <script type="text/javascript">
 //<!--
 function frameloc() {
@@ -166,7 +163,7 @@
 ENDONE
 
     if ($disp eq 'dir') {
-        $r->print(<<"ENDDIR");
+        $js .= <<"ENDDIR";
 function getdirname() {
     document.publishdir.filename.value=frameloc();
     pubdir(document.publishdir)
@@ -201,7 +198,7 @@
 }
 ENDDIR
     } else {
-        $r->print(<<"ENDRES");
+        $js.=<<"ENDRES";
 function getfilename() {
     document.publisher.filename.value=frameloc();
     if ((document.publisher.filename.value.charAt(
@@ -230,11 +227,13 @@
 }
 ENDRES
     }
+    my $start_page = 
+	&Apache::loncommon::start_page('Publishing Frame',$js,
+				       {'only_body' => 1,});
+    my $end_page = 
+	&Apache::loncommon::end_page();
     $r->print(<<"END");
-//-->
-</script>
-    </head>
-    <body bgcolor="#ccffdd" text='#002200' link='#003333' vlink='#006666'>
+$start_page
 	<table border="0" align="center"><tr><th bgcolor="#004400" height="20">
 	      <table border="0" cellspacing="2" cellpadding="2"><tr valign="middle">
 		  <td bgcolor="#ccddaa" align="center">
@@ -351,8 +350,7 @@
 	    </th>
 	  </tr>
 	</table>
-    </body>
-  </html>
+$end_page
 ENDPAGE
 }
 
Index: loncom/publisher/lonretrieve.pm
diff -u loncom/publisher/lonretrieve.pm:1.29 loncom/publisher/lonretrieve.pm:1.30
--- loncom/publisher/lonretrieve.pm:1.29	Tue Jan 31 17:37:04 2006
+++ loncom/publisher/lonretrieve.pm	Thu Apr  6 18:15:19 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to retrieve an old version of a file
 #
-# $Id: lonretrieve.pm,v 1.29 2006/01/31 22:37:04 albertel Exp $
+# $Id: lonretrieve.pm,v 1.30 2006/04/06 22:15:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -205,9 +205,7 @@
   &Apache::loncommon::content_type($r,'text/html');
   $r->send_http_header;
 
-  $r->print('<html><head><title>LON-CAPA Construction Space</title></head>');
-
-  $r->print(&Apache::loncommon::bodytag('Retrieve Published Resources'));
+  $r->print(&Apache::loncommon::start_page('Retrieve Published Resources'));
 
   
   $r->print('<h1>'.&mt('Retrieve previous versions of').' <tt>'.$fn.'</tt></h1>');
@@ -225,7 +223,7 @@
       &phaseone($r,$fn,$uname,$udom);
   }
 
-  $r->print('</body></html>');
+  $r->print(&Apache::loncommon::end_page());
   return OK;  
 }
 
Index: loncom/publisher/lonrights.pm
diff -u loncom/publisher/lonrights.pm:1.17 loncom/publisher/lonrights.pm:1.18
--- loncom/publisher/lonrights.pm:1.17	Thu Apr  7 02:56:27 2005
+++ loncom/publisher/lonrights.pm	Thu Apr  6 18:15:19 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to show and edit custom distribution rights
 #
-# $Id: lonrights.pm,v 1.17 2005/04/07 06:56:27 albertel Exp $
+# $Id: lonrights.pm,v 1.18 2006/04/06 22:15:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -55,11 +55,9 @@
   &Apache::loncommon::content_type($r,'text/html');
   $r->send_http_header;
 
-  $r->print(
-     '<html><head><title>LON-CAPA Custom Distribution Rights</title>'.
-   &Apache::loncommon::coursebrowser_javascript().'</head>');
+  my $js = &Apache::loncommon::coursebrowser_javascript();
 
-  $r->print(&Apache::loncommon::bodytag('Custom Distribution Rights'));
+  $r->print(&Apache::loncommon::start_page('Custom Distribution Rights',$js));
   $r->rflush();
 
   my $uri=$r->uri;
@@ -307,7 +305,7 @@
   if ($constructmode) { 
      $r->print('<input type="submit" name="store" value="'.&mt('Store').'" /></form>'); 
   }
-  $r->print('</body></html>');
+  $r->print(&Apache::loncommon::end_page());
   return OK;  
 }
 
Index: loncom/publisher/lonunauthorized.pm
diff -u loncom/publisher/lonunauthorized.pm:1.4 loncom/publisher/lonunauthorized.pm:1.5
--- loncom/publisher/lonunauthorized.pm:1.4	Thu Apr  7 02:56:27 2005
+++ loncom/publisher/lonunauthorized.pm	Thu Apr  6 18:15:19 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Unauthorized to access construction space
 #
-# $Id: lonunauthorized.pm,v 1.4 2005/04/07 06:56:27 albertel Exp $
+# $Id: lonunauthorized.pm,v 1.5 2006/04/06 22:15:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -42,19 +42,14 @@
     return OK if $r->header_only;
 
 # ------------------------------------------------------------ Print the screen
-    $r->print(<<ENDDOCUMENT);
-<html>
-<head>
-<title>The LearningOnline Network with CAPA</title>
-</head>
-ENDDOCUMENT
 # Figure out who the user is and what they wanted to access
 
     my ($ownername,$ownerdomain)=
      &Apache::loncacc::constructaccess($env{'request.editurl'},$r->dir_config('lonDefDomain'));
 # print header
-    $r->print(&Apache::loncommon::bodytag
-           ("Failed Access to Construction Space",'','','',$ownerdomain));
+    $r->print(&Apache::loncommon::start_page("Failed Access to Construction Space",
+					     undef,
+					     {'domain' => $ownerdomain,}));
 # figure out what went wrong
 
     if ($ownerdomain) {
@@ -87,7 +82,7 @@
         }
     }
     
-    $r->print('</body></html>');
+    $r->print(&Apache::loncommon::end_page());
     return OK;
 } 
 
Index: loncom/publisher/lonupload.pm
diff -u loncom/publisher/lonupload.pm:1.30 loncom/publisher/lonupload.pm:1.31
--- loncom/publisher/lonupload.pm:1.30	Tue Nov  8 12:58:35 2005
+++ loncom/publisher/lonupload.pm	Thu Apr  6 18:15:19 2006
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # Handler to upload files into construction space
 #
-# $Id: lonupload.pm,v 1.30 2005/11/08 17:58:35 albertel Exp $
+# $Id: lonupload.pm,v 1.31 2006/04/06 22:15:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -249,6 +249,15 @@
     }
 
     unless ($env{'form.phase'} eq 'two') {
+	my $start_page = 
+	    &Apache::loncommon::start_page('Importing a Testbank file into LON-CAPA',
+					   undef,
+					   {'only_body'   => 1,
+					    'add_entries' => "topmargin='0' leftmargin='0' marginheight='0'marginwidth='0' rightmargin='0'",
+					    'js_ready'    => 1,});
+	my $end_page = 
+	    &Apache::loncommon::end_page({'js_ready' => 1,});
+
         $javascript = qq|
 function verifyForm() {
     var mode = document.fileupload.filetype.options[document.fileupload.filetype.selectedIndex].value
@@ -267,8 +276,7 @@
 function testbankWin() {
   newWindow = window.open("","testbankinfo","HEIGHT=400,WIDTH=750,scrollbars=yes")
   newWindow.document.open()
-  newWindow.document.write("<html><head><title>'Importing a Testbank file into LON-CAPA</title><meta http-equiv='pragma' content='no-cache'>\\n")
-  newWindow.document.write("</head><body bgcolor='#CCFFDD' topmargin='0' leftmargin='0' marginheight='0'marginwidth='0' rightmargin='0'>\\n")
+  newWindow.document.write('$start_page')
   newWindow.document.write("<img border='0' src='/adm/lonInterFace/author.jpg' alt='[Author Header]'>\\n")
   newWindow.document.write("<table border='0' cellspacing='0' cellpadding='0' width='95%' bgcolor='#CCFFDD'>\\n")
   newWindow.document.write("<tr><td width='2'>&nbsp;</td><td width='3'>&nbsp;</td>\\n")
@@ -280,7 +288,8 @@
     newWindow.document.write("<li><i>Multiple choice</i> and <i>multiple answer correct</i> questions should consist of (i) the question number followed by (ii) a question stem beginning on the same line and (iii) two or more foils, with each foil beginning on a new line and prefixed by a unique letter, or Roman numeral, listed in alphabetic or numeric order, beginning at a (alphabetic) or i (Roman numeral), followed by a period, or enclosed in parentheses, i.e., a., (a), i., or (i) .</li>")
      newWindow.document.write("<li>If <i>fill-in-the-blank</i> or <i>multiple answer</i> questions have more than one correct answer, each answer should appear in a comma-, tab-, space-, or new line-delimited list. </li></ol>")
   newWindow.document.write("</td></tr>\\n")
-  newWindow.document.write("</table></body></html>")
+  newWindow.document.write("</table>")
+  newWindow.document.write('$end_page')
   newWindow.document.close()
   newWindow.focus()
 }
@@ -316,9 +325,11 @@
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
 
-    $r->print("<html><head><title>LON-CAPA Construction Space</title><script type=\"text/javascript\">\n//<!--\n$javascript\n// --></script>\n</head>");
+   $javascript = "<script type=\"text/javascript\">\n//<!--\n".
+	$javascript."\n// --></script>\n";
 
-    $r->print(&Apache::loncommon::bodytag('Upload file to Construction Space'));
+    $r->print(&Apache::loncommon::start_page('Upload file to Construction Space',
+					     $javascript));
   
     if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
 	$r->print('<h3><font color=red>'.&mt('Co-Author').': '.$uname.
@@ -331,7 +342,7 @@
 	&phaseone($r,$fn,$uname,$udom);
     }
 
-    $r->print('</body></html>');
+    $r->print(&Apache::loncommon::end_page());
     return OK;  
 }
 
Index: loncom/publisher/testbankimport.pm
diff -u loncom/publisher/testbankimport.pm:1.8 loncom/publisher/testbankimport.pm:1.9
--- loncom/publisher/testbankimport.pm:1.8	Thu Apr  6 15:31:03 2006
+++ loncom/publisher/testbankimport.pm	Thu Apr  6 18:15:19 2006
@@ -1,5 +1,5 @@
 # Handler for parsing text upload problem descriptions into .problems
-# $Id: testbankimport.pm,v 1.8 2006/04/06 19:31:03 albertel Exp $
+# $Id: testbankimport.pm,v 1.9 2006/04/06 22:15:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -349,7 +349,7 @@
     }
 
     my $start_page = 
-	&Apache::loncommon::start_page('Create IMS import directory',undef,
+	&Apache::loncommon::start_page('Create Testbank directory',undef,
 				       {'only_body'   => 1,
 					'add_entries' => "topmargin='0' leftmargin='0' marginheight='0'marginwidth='0' rightmargin='0'",
 					'js_ready'    => 1,});

--albertel1144361721--