[LON-CAPA-cvs] cvs: loncom /interface loncreatecourse.pm londropadd.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 21 Mar 2006 18:34:23 -0000


albertel		Tue Mar 21 13:34:23 2006 EDT

  Modified files:              
    /loncom/interface	loncreatecourse.pm londropadd.pm 
  Log:
  - start_page
  
  
Index: loncom/interface/loncreatecourse.pm
diff -u loncom/interface/loncreatecourse.pm:1.85 loncom/interface/loncreatecourse.pm:1.86
--- loncom/interface/loncreatecourse.pm:1.85	Mon Jan 16 18:11:50 2006
+++ loncom/interface/loncreatecourse.pm	Tue Mar 21 13:34:23 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Create a course
 #
-# $Id: loncreatecourse.pm,v 1.85 2006/01/16 23:11:50 albertel Exp $
+# $Id: loncreatecourse.pm,v 1.86 2006/03/21 18:34:23 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -269,7 +269,6 @@
     }
     $course_home .= "\n</select>\n";
     my $domform = &Apache::loncommon::select_dom_form($defdom,'ccdomain');
-    my $bodytag=&Apache::loncommon::bodytag('Create a New Course');
     my $helplink=&Apache::loncommon::help_open_topic('Create_Course',&mt('Help on Creating Courses'));
     my $cloneform=&Apache::loncommon::select_dom_form
 	($env{'request.role.domain'},'clonedomain').
@@ -351,11 +350,8 @@
 		    'rshm' => 'Resource Space Home',
                     'opco' => "Open Course"
 				       );
-    my $html=&Apache::lonxml::xmlbegin();
-    $r->print(<<ENDDOCUMENT);
-$html
-<head>
-<script language="JavaScript" type="text/javascript">
+    my $js = <<END;
+<script type="text/javascript">
 var editbrowser = null;
 function openbrowser(formname,elementname) {
     var url = '/res/?';
@@ -376,9 +372,15 @@
 $javascript_validations
 </script>
 $coursebrowserjs
-<title>The LearningOnline Network with CAPA</title>
-</head>
-$bodytag
+END
+
+    my $start_page = 
+        &Apache::loncommon::start_page('Create a New Course',$js);
+    my $end_page = 
+        &Apache::loncommon::end_page();
+
+    $r->print(<<ENDDOCUMENT);
+$start_page
 $helplink
 <form action="/adm/createcourse" method="post" name="ccrs">
 <h2>$lt{'cinf'}</h2>
@@ -582,8 +584,7 @@
 <input type="button" onClick="verify_message(this.form)" value="$lt{'opco'}" />
 </p>
 </form>
-</body>
-</html>
+$end_page
 ENDDOCUMENT
 }
 
@@ -621,15 +622,8 @@
     }
 
     my $logmsg;
-    my $html=&Apache::lonxml::xmlbegin();
-    my $bodytag=&Apache::loncommon::bodytag('Create a New Course');
-    $r->print(<<ENDENHEAD);
-$html
-<head>
-<title>The LearningOnline Network with CAPA</title>
-</head>
-$bodytag
-ENDENHEAD
+    my $start_page=&Apache::loncommon::start_page('Create a New Course');
+    $r->print($start_page);
 
     my $args = {
                ccuname => $ccuname,
@@ -683,7 +677,7 @@
             <input type="hidden" name="ccdomain" value="'.$ccdomain.'" />
             <input name="userrole" type="submit" value="'.
 		  &mt('Create User').'" />
-	</form></body></html>');
+	</form>'.&Apache::loncommon::end_page());
 	return;
     }
     # Check the proposed home server for the course
@@ -691,7 +685,7 @@
         ($env{'request.role.domain'});
     if (! exists($host_servers{$env{'form.course_home'}})) {
         $r->print(&mt('Invalid home server for course').': '.
-                  $env{'form.course_home'}.'</body></html>');
+                  $env{'form.course_home'}.&Apache::loncommon::end_page());
         return;
     }
     my ($courseid,$crsudom,$crsunum);
@@ -711,7 +705,8 @@
     }
 # Flush the course logs so reverse user roles immediately updated
     &Apache::lonnet::flushcourselogs();
-    $r->print('<p>'.&mt('Roles will be active at next login').'.</p></body></html>');
+    $r->print('<p>'.&mt('Roles will be active at next login').'.</p>'.
+	      &Apache::loncommon::end_page());
 }
 
 sub construct_course {
Index: loncom/interface/londropadd.pm
diff -u loncom/interface/londropadd.pm:1.137 loncom/interface/londropadd.pm:1.138
--- loncom/interface/londropadd.pm:1.137	Fri Feb 17 20:27:07 2006
+++ loncom/interface/londropadd.pm	Tue Mar 21 13:34:23 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to drop and add students in courses 
 #
-# $Id: londropadd.pm,v 1.137 2006/02/18 01:27:07 raeburn Exp $
+# $Id: londropadd.pm,v 1.138 2006/03/21 18:34:23 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -43,15 +43,9 @@
 ###############################################################
 ###############################################################
 sub header {
-    my $html=&Apache::lonxml::xmlbegin();
-    my $bodytag=&Apache::loncommon::bodytag('Enrollment Manager');
-    my $title = &mt('LON-CAPA Enrollment Manager');
+    my $start_page=&Apache::loncommon::start_page('Enrollment Manager');
     return(<<ENDHEAD);
-$html
-<head>
-<title>$title</title>
-</head>
-$bodytag
+$start_page
 <form method="post" enctype="multipart/form-data"  
       action="/adm/dropadd" name="studentform">
 ENDHEAD
@@ -1586,7 +1580,7 @@
                   '<p>'.
                   &mt('Unable to retrieve environment data for').' '.$sname.
                   &mt('in domain').' '.$sdom.'</p><p>'.
-                  &mt('Please contact your LON-CAPA administrator regarding this situation.').'</p></body></html>');
+                  &mt('Please contact your LON-CAPA administrator regarding this situation.').'</p>'.&Apache::loncommon::end_page());
         return;
     }
     # determine the students starting and ending times and section
@@ -1675,8 +1669,8 @@
 <p>$current_date_description</p>
 <p>$date_table</p>
 <input type="submit" value="$lt{'sm'}" />
-</body></html>
 END
+    $r->print(&Apache::loncommon::end_page());
     return;
 }
 
@@ -1684,7 +1678,7 @@
 # modify a single students section 
 #
 sub modify_single_student {
-    my $r = shift;
+    my ($r) = @_;
     #
     # Remove non alphanumeric values from the section
     $env{'form.section'} =~ s/\W//g;
@@ -1826,8 +1820,8 @@
 <input type="hidden" name="sortby" value="$sortby" />
 <input type="hidden" name="Status" value="$status" />
 <a href="javascript:document.studentform.submit();">$Masd</a>
-</body></html>
 END
+    $r->print(&Apache::loncommon::end_page());
     return;
 }
 
@@ -2056,7 +2050,7 @@
     $str .= &Apache::loncommon::help_open_topic("Course_Convert_To_CSV",
                            &mt("How do I create a CSV file from a spreadsheet")).
                                "<br />\n";
-    $str .= "</body>\n</html>\n";
+    $str .= &Apache::loncommon::end_page();
     $r->print($str);
     return;
 }
@@ -2112,7 +2106,7 @@
         if (! exists($home_servers{$desiredhost})) {
             $r->print('<font color="#ff0000">'.&mt('Error').'</font>'.
                       &mt('Invalid home server specified'));
-            $r->print("</body>\n</html>\n");
+            $r->print(&Apache::loncommon::end_page());
             return;
         }
     }
@@ -2484,7 +2478,7 @@
     }
     #
     # Finish up
-    $r->print('</form></body></html>');
+    $r->print('</form>'.&Apache::loncommon::end_page());
     return OK;
 }