[LON-CAPA-cvs] cvs: loncom /homework imagechoice.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 13 Apr 2006 18:49:29 -0000


albertel		Thu Apr 13 14:49:29 2006 EDT

  Modified files:              
    /loncom/homework	imagechoice.pm 
  Log:
  - start_page
  
  
Index: loncom/homework/imagechoice.pm
diff -u loncom/homework/imagechoice.pm:1.9 loncom/homework/imagechoice.pm:1.10
--- loncom/homework/imagechoice.pm:1.9	Thu Aug 25 15:33:14 2005
+++ loncom/homework/imagechoice.pm	Thu Apr 13 14:49:29 2006
@@ -1,4 +1,4 @@
-# $Id: imagechoice.pm,v 1.9 2005/08/25 19:33:14 albertel Exp $
+# $Id: imagechoice.pm,v 1.10 2006/04/13 18:49:29 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -37,20 +37,31 @@
     if ($needimage) {
 	$needimage="<img name=\"pickimg\" src=\"$filename\" />";
     }
-    $r->print(<<"ENDSUBM");
-<html>
-<script>
+    my $js=<<"ENDSUBM";
+<script type="text/javascript">
     function submitthis() {
 	$output
 	self.close();
     }
 </script>
-<body bgcolor="#FFFFFF" onLoad="submitthis()">
+ENDSUBM
+
+    my $start_page =
+        &Apache::loncommon::start_page('Close Window',$js,
+				       {'bgcolor'     => '#FFFFFF',
+					'only_body'   => 1,
+					'add_entries' => {
+					    onload => 'submitthis();'},});
+
+    my $end_page =
+        &Apache::loncommon::end_page();
+
+    my $js=<<"ENDSUBM";
+$start_page
 <h3>Position Selected</h3>
 $display
 $needimage
-</body>
-</html>
+$end_page
 ENDSUBM
 }
 
@@ -121,9 +132,16 @@
 	$heading='Click to select a Coordinate or click Finish to store current selection.';
 	$nextstage='<input type="submit" name="finish" value="Finish" />';
     }
+
+    my $start_page =
+        &Apache::loncommon::start_page('Get Coordinates',undef,
+				       {'bgcolor'     => '#FFFFFF',
+					'only_body'   => 1,});
+
+    my $end_page =
+        &Apache::loncommon::end_page();
     $r->print(<<"END");
-<html>
-<body bgcolor="#FFFFFF">
+$start_page
 <h3>$heading</h3>
 <form method="POST" action="/adm/imagechoice?token=$id">
 $nextstage
@@ -131,8 +149,7 @@
 <br />
 <input name="image" type="image" src="$filename" />
 </form>
-</body>
-</html>
+$end_page
 END
 }