[LON-CAPA-cvs] cvs: loncom /interface lonhelp.pm lonhelper.pm

albertel lon-capa-cvs@mail.lon-capa.org
Sun, 19 Mar 2006 23:09:20 -0000


albertel		Sun Mar 19 18:09:20 2006 EDT

  Modified files:              
    /loncom/interface	lonhelp.pm lonhelper.pm 
  Log:
  - start_page
  
  
Index: loncom/interface/lonhelp.pm
diff -u loncom/interface/lonhelp.pm:1.23 loncom/interface/lonhelp.pm:1.24
--- loncom/interface/lonhelp.pm:1.23	Sat Mar 18 08:22:07 2006
+++ loncom/interface/lonhelp.pm	Sun Mar 19 18:09:20 2006
@@ -53,16 +53,15 @@
 # Serve out the text
 sub servetext {
     my ($r,$text) = @_;
-    my $html=&Apache::lonxml::xmlbegin();
-    my $htmlend=&Apache::lonxml::xmlend();
     my $bugs=&Apache::loncommon::help_open_bug('Documentation');
+    my $start_page=
+	&Apache::loncommon::start_page('LON-CAPA Help',undef,
+				       {'only_body' => 1,});
+    my $end_page=
+	&Apache::loncommon::end_page();
     my $header=&mt('LON-CAPA Help');
     $r->print(<<HEADER);
-$html
-    <head>
-        <title>LON-CAPA Help</title>
-    </head>
-    <body bgcolor="#FFFFFF">
+    $start_page
     <h3 style="font: sans-serif"><img align="right"
     src="/adm/help/gif/lonhelpheader.gif"/>$header<hr />$bugs</h3>
     <!-- BEGIN -->
@@ -73,21 +72,20 @@
     if (&Apache::lonnavmaps::advancedUser()) {
 	my $search=&mt('Search LON-CAPA help');
 	my $about=&mt('About LON-CAPA help and More Help');
+
 	$r->print(<<FOOTER);
-    <!-- END -->
     <hr /><form method="post">
 $search: <input type="text" name="searchterm" size="40" /><br />
 <a href="/adm/help/abouthelp.html">$about</a>
-    </body>
-$htmlend
 FOOTER
-   } else {
-       $r->print(<<ENDBODY);
+ 
+    }
+
+    $r->print(<<ENDBODY);
     <!-- END -->
-    </body>
-$htmlend
+    $end_page
 ENDBODY
-   }
+
 }
 
 # Render takes a tex fragment, transforms it for TtH, and returns the
Index: loncom/interface/lonhelper.pm
diff -u loncom/interface/lonhelper.pm:1.134 loncom/interface/lonhelper.pm:1.135
--- loncom/interface/lonhelper.pm:1.134	Tue Mar  7 16:36:49 2006
+++ loncom/interface/lonhelper.pm	Sun Mar 19 18:09:20 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # .helper XML handler to implement the LON-CAPA helper
 #
-# $Id: lonhelper.pm,v 1.134 2006/03/07 21:36:49 albertel Exp $
+# $Id: lonhelper.pm,v 1.135 2006/03/19 23:09:20 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -573,26 +573,20 @@
     }
 
     # Phase 4: Display.
-    my $html=&Apache::lonxml::xmlbegin();
     my $stateTitle=&mt($state->title());
-    my $helperTitle = &mt($self->{TITLE});
-    my $browser_searcher_js = &Apache::loncommon::browser_and_searcher_javascript();
-    my $bodytag = &Apache::loncommon::bodytag($helperTitle,'','');
+    my $browser_searcher_js = 
+	'<script type="text/javascript">'."\n".
+	&Apache::loncommon::browser_and_searcher_javascript().
+	"\n".'</script>';
+
+    $result .= &Apache::loncommon::start_page($self->{TITLE},
+					      $browser_searcher_js);
+    
     my $previous = HTML::Entities::encode(&mt("<- Previous"), '<>&"');
     my $next = HTML::Entities::encode(&mt("Next ->"), '<>&"');
     # FIXME: This should be parameterized, not concatenated - Jeremy
-    my $loncapaHelper = &mt("LON-CAPA Helper:");
 
-    $result .= <<HEADER;
-$html
-    <head>
-        <title>$loncapaHelper: $helperTitle</title>
-        <script type="text/javascript">
-$browser_searcher_js
-        </script>
-    </head>
-    $bodytag
-HEADER
+
     if (!$state->overrideForm()) { $result.="<form name='helpform' method='POST'>"; }
     $result .= <<HEADER;
         <table border="0" width='100%'><tr><td>
@@ -655,10 +649,9 @@
             </tr>
           </table>
         </form>
-    </body>
-</html>
 FOOTER
 
+    $result .= &Apache::loncommon::end_page();
     # Handle writing out the vars to the file
     my $file = Apache::File->new('>'.$self->{FILENAME});
     print $file $self->_varsInFile();