[LON-CAPA-cvs] cvs: loncom /imspackages imsimport.pm imsimportdocs.pm

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


albertel		Thu Mar 23 18:12:24 2006 EDT

  Modified files:              
    /loncom/imspackages	imsimport.pm imsimportdocs.pm 
  Log:
  - start_page
  
  
Index: loncom/imspackages/imsimport.pm
diff -u loncom/imspackages/imsimport.pm:1.13 loncom/imspackages/imsimport.pm:1.14
--- loncom/imspackages/imsimport.pm:1.13	Tue Nov  8 12:58:22 2005
+++ loncom/imspackages/imsimport.pm	Thu Mar 23 18:12:21 2006
@@ -38,6 +38,15 @@
 # ----------------------------------------------------------------  Jscript One
 sub jscript_one {
     my ($fullpath,$jsref) = @_;
+
+    my $start_page = 
+	&Apache::loncommon::start_page('Create IMS import directory',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,});
+
     $$jsref = <<"END_OF_ONE";
 function verify() {
  if ((document.forms.dataForm.newdir.value == '')  || (!document.forms.dataForm.newdir.value)) {
@@ -61,9 +70,8 @@
   document.dataForm.newdir.value = "";
   newWindow = window.open("","CreateDir","HEIGHT=400,WIDTH=750,scrollbars=yes")
   newWindow.document.open()
-  newWindow.document.write("<html><head><title>Create IMS import directory</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("<img border='0' src='/adm/lonInterFace/author.jpg' alt='[Author Header]'>\\n")
+  newWindow.document.write('$start_page')
+  newWindow.document.write("\\n<img border='0' src='/adm/lonInterFace/author.jpg' alt='[Author Header]'>\\n")
   newWindow.document.write("<table border='0' cellspacing='0' cellpadding='0' width='600' bgcolor='#CCFFDD'>\\n")
   newWindow.document.write("<tr><td width='2'>&nbsp;</td><td width='3'>&nbsp;</td>\\n")
   newWindow.document.write("<td><h3>Location: <tt>$fullpath</tt></h3><h3>New Directory</h3></td></tr>\\n")
@@ -76,7 +84,8 @@
   newWindow.document.write("$fullpath<input type='text' name='newfilename' value=''/>")
   newWindow.document.write("<input type='button' value='Go' onClick='document.fileaction.submit();' />")
   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()
 }
@@ -860,10 +869,13 @@
     } elsif ($env{'form.phase'} eq 'four') {
         &jscript_three(\$javascript);
     }
-    $r->print("<html><head><title>LON-CAPA Construction Space</title><script type=\"text/javascript\">\n//<!--\n$javascript\n// --></script>\n</head>");
-                                                                                             
-    $r->print(&Apache::loncommon::bodytag('Upload IMS package to Construction Space',undef,$loadentries));
-                                                                                             
+    $javascript = "<script type=\"text/javascript\">\n//<!--\n$javascript\n// --></script>\n";
+
+    my $title = 'Upload IMS package to Construction Space';
+    $r->print(&Apache::loncommon::start_page($title, $javascript,
+					     {'add_entries' =>
+						  $loadentries,}));
+
     if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
         $r->print('<h3><font color=red>'.&mt('Co-Author').': '.$uname.
                   &mt(' at ').$udom.'</font></h3>');
@@ -887,7 +899,7 @@
     } else {
         &Apache::lonupload::phaseone($r,$fn,$uname,$udom,'imsimport');
     }
-    $r->print('</body></html>');
+    $r->print(&Apache::loncommon::end_page());
     return OK;
 }
 1;
Index: loncom/imspackages/imsimportdocs.pm
diff -u loncom/imspackages/imsimportdocs.pm:1.14 loncom/imspackages/imsimportdocs.pm:1.15
--- loncom/imspackages/imsimportdocs.pm:1.14	Thu Oct 27 14:19:36 2005
+++ loncom/imspackages/imsimportdocs.pm	Thu Mar 23 18:12:21 2006
@@ -156,9 +156,10 @@
 # does this user have privileges to post, etc?
     my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
     unless ($allowed) {
-        $r->print("<html><head><title>The LearningOnline Network with CAPA</title></head>");
-        $r->print(&Apache::loncommon::bodytag('Import IMS package',undef,'',1));  
-        $r->print('<h3>'.&mt('Modification of Course Contents Disallowed').'</h3>'.&mt('Your current role does not grant you the right to modify course content in this course.').'</body></html>');
+        $r->print(&Apache::loncommon::start_page('Import IMS package',undef,
+						 {'only_body' => 1,}));  
+        $r->print('<h3>'.&mt('Modification of Course Contents Disallowed').'</h3>'.&mt('Your current role does not grant you the right to modify course content in this course.').
+		  &Apache::loncommon::end_page());
         return OK;
     }
 
@@ -173,20 +174,15 @@
         &jscript_three(\$javascript);
     }
 
+    $javascript = 
+	 "<script type=\"text/javascript\">\n".
+	 "//<!--\n$javascript\n// --></script>\n";
+    my $start_page = &Apache::loncommon::start_page('Import IMS package',
+						    $javascript,
+						    {'only_body' => 1,});
 # print screen
-    $r->print(<<ENDHEAD);
-<html>
-<head>
-<title>The LearningOnline Network with CAPA</title>
-<script type="text/javascript">
-<!--
-$javascript
--->
-</script>
-</head>
-ENDHEAD
-# -------------------------------------------------------------------- Body tag
-    $r->print(&Apache::loncommon::bodytag('Import IMS package',undef,'',1));
+    $r->print($start_page);
+
     if ($env{'form.phase'} eq 'one') {
         &display_one($r);       
     } elsif ($env{'form.phase'} eq 'two') {
@@ -194,7 +190,7 @@
     } elsif ($env{'form.phase'} eq 'three') {
         &display_three($r,$coursenum,$coursedom,$uname,$udom,\@areas,%cmsmap);
     }   
-    $r->print("</body><html>");
+    $r->print(&Apache::loncommon::end_page());
     return OK;
 }