[LON-CAPA-cvs] cvs: loncom /interface lonpickcode.pm lonpickcourse.pm lonpickstudent.pm lonpopulate.pm lonpreferences.pm lonprintout.pm lonquickgrades.pm lonremote.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Wed, 15 Mar 2006 22:11:06 -0000
This is a MIME encoded message
--albertel1142460666
Content-Type: text/plain
albertel Wed Mar 15 17:11:06 2006 EDT
Modified files:
/loncom/interface lonpickcode.pm lonpickcourse.pm lonpickstudent.pm
lonpopulate.pm lonpreferences.pm lonprintout.pm
lonquickgrades.pm lonremote.pm
Log:
- mode <head> </headh> <</body> elimination
--albertel1142460666
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20060315171106.txt"
Index: loncom/interface/lonpickcode.pm
diff -u loncom/interface/lonpickcode.pm:1.8 loncom/interface/lonpickcode.pm:1.9
--- loncom/interface/lonpickcode.pm:1.8 Tue Dec 20 13:54:54 2005
+++ loncom/interface/lonpickcode.pm Wed Mar 15 17:11:04 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Pick a CODE from the list of possible CODEs
#
-# $Id: lonpickcode.pm,v 1.8 2005/12/20 18:54:54 albertel Exp $
+# $Id: lonpickcode.pm,v 1.9 2006/03/15 22:11:04 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -60,13 +60,6 @@
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
return OK if $r->header_only;
- my $html=&Apache::lonxml::xmlbegin();
- $r->print(<<ENDDOCUMENT);
-$html
- <head>
- <title>The LearningOnline Network with CAPA</title>
- </head>
-ENDDOCUMENT
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['curCODE','scantron_selectfile',
@@ -75,7 +68,9 @@
if (!($env{'request.course.id'}) &&
(&Apache::lonnet::allowed('usc',$env{'request.course.id'}))) {
- $r->print('<body>Access not allowed.</body>');
+ $r->print(&Apache::loncommon::start_page().
+ &mt('Access not allowed.').
+ &Apache::loncommon::end_page());
return OK;
}
if ($env{'form.command'} eq 'codelist') {
@@ -85,14 +80,14 @@
} else {
&picking_a_code($r);
}
- $r->print('</body></html>');
+ $r->print(&Apache::loncommon::end_page());
return OK;
}
sub code_list {
my ($r,$secondview)=@_;
if (!$secondview) {
- $r->print(&Apache::loncommon::bodytag("View CODEs"));
+ $r->print(&Apache::loncommon::start_page("View CODEs"));
$r->print("<p>".&mt('Select a set of saved CODEs to view.')."</p>");
} else {
$r->print("<p>".&mt('Select another set of saved CODEs to view.')."</p>");
@@ -110,7 +105,7 @@
sub show_codes {
my ($r)=@_;
- $r->print(&Apache::loncommon::bodytag("View CODEs"));
+ $r->print(&Apache::loncommon::start_page("View CODEs"));
my %codes=&Apache::grades::get_codes();
$r->print("<h2>".$env{'form.scantron_CODElist'}."</h2>");
$r->print('<pre>');
@@ -123,7 +118,7 @@
sub picking_a_code {
my ($r)=@_;
- $r->print(&Apache::loncommon::bodytag("Selecting a CODE"));
+ $r->print(&Apache::loncommon::start_page("Selecting a CODE"));
$r->print(<<ENDSCRIPT);
<script>
function gochoose(newcode) {
Index: loncom/interface/lonpickcourse.pm
diff -u loncom/interface/lonpickcourse.pm:1.39 loncom/interface/lonpickcourse.pm:1.40
--- loncom/interface/lonpickcourse.pm:1.39 Thu Feb 2 12:57:40 2006
+++ loncom/interface/lonpickcourse.pm Wed Mar 15 17:11:04 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Pick a course
#
-# $Id: lonpickcourse.pm,v 1.39 2006/02/02 17:57:40 albertel Exp $
+# $Id: lonpickcourse.pm,v 1.40 2006/03/15 22:11:04 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -42,13 +42,9 @@
return OK if $r->header_only;
# ------------------------------------------------------------ Print the screen
- my $html=&Apache::lonxml::xmlbegin();
- $r->print(<<ENDDOCUMENT);
-$html
-<head>
-<title>The LearningOnline Network with CAPA</title>
-</head>
-ENDDOCUMENT
+ $r->print(&Apache::lonxml::xmlbegin().
+ &Apache::loncommon::head());
+
# Get parameters from query string
&Apache::loncommon::get_unprocessed_cgi
($ENV{'QUERY_STRING'},['domainfilter','descriptfilter',
@@ -336,7 +332,7 @@
}
$r->print("</form>\n");
}
- $r->print('</body></html>');
+ $r->print(&Apache::loncommon::end_page());
return OK;
}
Index: loncom/interface/lonpickstudent.pm
diff -u loncom/interface/lonpickstudent.pm:1.10 loncom/interface/lonpickstudent.pm:1.11
--- loncom/interface/lonpickstudent.pm:1.10 Mon Jan 9 15:38:52 2006
+++ loncom/interface/lonpickstudent.pm Wed Mar 15 17:11:04 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Pick a student from the classlist
#
-# $Id: lonpickstudent.pm,v 1.10 2006/01/09 20:38:52 albertel Exp $
+# $Id: lonpickstudent.pm,v 1.11 2006/03/15 22:11:04 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -42,15 +42,7 @@
return OK if $r->header_only;
# ------------------------------------------------------------ Print the screen
- my $html=&Apache::lonxml::xmlbegin();
- $r->print(<<ENDDOCUMENT);
-$html
-<head>
-<title>The LearningOnline Network with CAPA</title>
-</head>
-ENDDOCUMENT
-
-
+ $r->print(&Apache::loncommon::start_page("Selecting a User"));
&Apache::loncommon::get_unprocessed_cgi
@@ -67,7 +59,8 @@
unless (($env{'form.roles'}) ||
(($env{'request.course.id'}) && ($allowed))) {
- $r->print('<body>No context.</body>');
+ $r->print(&mt('No context.').
+ &Apache::loncommon::end_page());
return OK;
}
@@ -81,7 +74,6 @@
# --------------------------------------- There is such a user, get environment
- $r->print(&Apache::loncommon::bodytag("Selecting a User"));
$r->print(<<ENDSCRIPT);
<script>
function gochoose(uname,udom) {
@@ -176,7 +168,7 @@
}
$r->print('</table></p>');
}
- $r->print('</form></body></html>');
+ $r->print('</form>'.&Apache::loncommon::end_page());
return OK;
}
Index: loncom/interface/lonpopulate.pm
diff -u loncom/interface/lonpopulate.pm:1.40 loncom/interface/lonpopulate.pm:1.41
--- loncom/interface/lonpopulate.pm:1.40 Thu Feb 9 21:59:02 2006
+++ loncom/interface/lonpopulate.pm Wed Mar 15 17:11:04 2006
@@ -1,5 +1,5 @@
# automated enrollment configuration handler
-# $Id: lonpopulate.pm,v 1.40 2006/02/10 02:59:02 raeburn Exp $
+# $Id: lonpopulate.pm,v 1.41 2006/03/15 22:11:04 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -38,22 +38,14 @@
###############################################################
sub header {
- my $html=&Apache::lonxml::xmlbegin();
- my $bodytag=&Apache::loncommon::bodytag('Classlist Manager');
- return(<<ENDHEAD);
-$html
-<head>
-<title>LON-CAPA Classlist Manager</title>
-</head>
-$bodytag
-ENDHEAD
+ return &Apache::loncommon::start_page('Classlist Manager');
}
###############################################################
sub choose_header {
- my $action = shift;
- my $bodytag=&Apache::loncommon::bodytag('Classlist Manager');
+ my ($action) = @_;
+
my $scripttag = qq|
<script language='javascript' type='text/javascript'>
<!--
@@ -175,14 +167,9 @@
// End hiding -->
</script>
|;
- my $html=&Apache::lonxml::xmlbegin();
- return(<<ENDHEAD);
-$html
-<head>
-<title>LON-CAPA Classlist Manager</title>
-$scripttag
-$bodytag
-ENDHEAD
+
+ return &Apache::loncommon::start_page('Classlist Manager',
+ $scripttag);
}
sub print_mainbox {
@@ -1267,15 +1254,14 @@
###############################################################
sub print_doc_base {
- my $r = shift;
+ my ($r) = @_;
$r->print(<<ENDBASE);
</td>
</tr>
</table>
-<br/>
-</body>
-</html>
+<br />
ENDBASE
+ $r->print(&Apache::loncommon::end_page());
}
###################################################################
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.75 loncom/interface/lonpreferences.pm:1.76
--- loncom/interface/lonpreferences.pm:1.75 Wed Mar 15 16:19:10 2006
+++ loncom/interface/lonpreferences.pm Wed Mar 15 17:11:04 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Preferences
#
-# $Id: lonpreferences.pm,v 1.75 2006/03/15 21:19:10 albertel Exp $
+# $Id: lonpreferences.pm,v 1.76 2006/03/15 22:11:04 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1249,13 +1249,9 @@
subroutine => \&toggle_debug,
}));
}
- my $html=&Apache::lonxml::xmlbegin();
- $r->print(<<ENDHEADER);
-$html
-<head>
-<title>LON-CAPA Preferences</title>
-</head>
-ENDHEADER
+
+ $r->print(&Apache::loncommon::start_page('Change Preferences'));
+
my $call = undef;
my $help = undef;
my $printmenu = 'yes';
@@ -1270,7 +1266,6 @@
$help=$option->{'help'};
}
}
- $r->print(&Apache::loncommon::bodytag('Change Preferences'));
$r->print(&Apache::lonhtmlcommon::breadcrumbs
(undef,'Change Preferences',$help));
my $error;
@@ -1323,7 +1318,7 @@
$r->print('<br /><a href="'.$env{'form.returnurl'}.'"><font size="+1">'.
&mt('Return').'</font></a>');
}
- $r->print(&Apache::loncommon::endbodytag().'</html>');
+ $r->print(&Apache::loncommon::end_page());
return OK;
}
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.430 loncom/interface/lonprintout.pm:1.431
--- loncom/interface/lonprintout.pm:1.430 Wed Mar 15 11:17:53 2006
+++ loncom/interface/lonprintout.pm Wed Mar 15 17:11:04 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.430 2006/03/15 16:17:53 albertel Exp $
+# $Id: lonprintout.pm,v 1.431 2006/03/15 22:11:04 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1023,10 +1023,12 @@
my %parmhash = %$rparmhash;
my $resources_printed = '';
my $html=&Apache::lonxml::xmlbegin();
- my $bodytag=&Apache::loncommon::bodytag('Preparing Printout');
+ my $headtag = &Apache::loncommon::headtag('Preparing Printout');
+ my $end_headtag = &Apache::loncommon::endheadtag();
+ my $bodytag = &Apache::loncommon::bodytag('Preparing Printout');
$r->print(<<ENDPART);
$html
-<head>
+$headtag
<script type="text/javascript" language="Javascript">
var editbrowser;
function openbrowser(formname,elementname,only,omit) {
@@ -1051,8 +1053,7 @@
editbrowser.focus();
}
</script>
-<title>LON-CAPA output for printing</title>
-</head>
+$end_headtag
$bodytag
<p>
Please stand by while processing your print request, this may take some time ...
@@ -1770,12 +1771,12 @@
"cgi.$identifier.coursedom" => $cdom,
"cgi.$identifier.resources" => $resources_printed);
-$r->print(<<FINALEND);
+ my $end_page = &Apache::loncommon::end_page();
+ $r->print(<<FINALEND);
<br />
<meta http-equiv="Refresh" content="0; url=/cgi-bin/printout.pl?$identifier" />
<a href="/cgi-bin/printout.pl?$identifier">Continue</a>
-</body>
-</html>
+$end_page
FINALEND
}
Index: loncom/interface/lonquickgrades.pm
diff -u loncom/interface/lonquickgrades.pm:1.39 loncom/interface/lonquickgrades.pm:1.40
--- loncom/interface/lonquickgrades.pm:1.39 Mon Feb 27 14:40:43 2006
+++ loncom/interface/lonquickgrades.pm Wed Mar 15 17:11:04 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Quick Student Grades Display
#
-# $Id: lonquickgrades.pm,v 1.39 2006/02/27 19:40:43 albertel Exp $
+# $Id: lonquickgrades.pm,v 1.40 2006/03/15 22:11:04 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -48,22 +48,17 @@
&Apache::loncommon::get_unprocessed_cgi($ENV{QUERY_STRING});
# Handle header-only request
+ if ($env{'browser.mathml'}) {
+ &Apache::loncommon::content_type($r,'text/xml');
+ } else {
+ &Apache::loncommon::content_type($r,'text/html');
+ }
if ($r->header_only) {
- if ($env{'browser.mathml'}) {
- &Apache::loncommon::content_type($r,'text/xml');
- } else {
- &Apache::loncommon::content_type($r,'text/html');
- }
- $r->send_http_header;
+ $r->send_http_header;
return OK;
}
# Send header, don't cache this page
- if ($env{'browser.mathml'}) {
- &Apache::loncommon::content_type($r, 'text/xml');
- } else {
- &Apache::loncommon::content_type($r, 'text/html');
- }
&Apache::loncommon::no_cache($r);
$r->send_http_header;
@@ -87,7 +82,7 @@
# Header
my $title = $showPoints ? "Points Display" : "Completed Problems Display";
- $r->print(&Apache::loncommon::bodytag($title, '', ''));
+ $r->print(&Apache::loncommon::start_page($title));
if (!$showPoints && !$notshowSPRSlink ) {
$r->print(<<HEADER);
@@ -287,7 +282,7 @@
$r->print(&mt("Total $title In Course").": <b>$totalParts</b></td></tr>\n\n");
}
- $r->print("</table></body></html>");
+ $r->print("</table>".&Apache::loncommon::end_page());
return OK;
}
Index: loncom/interface/lonremote.pm
diff -u loncom/interface/lonremote.pm:1.18 loncom/interface/lonremote.pm:1.19
--- loncom/interface/lonremote.pm:1.18 Thu Apr 7 02:56:23 2005
+++ loncom/interface/lonremote.pm Wed Mar 15 17:11:04 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# User Authentication Module
#
-# $Id: lonremote.pm,v 1.18 2005/04/07 06:56:23 albertel Exp $
+# $Id: lonremote.pm,v 1.19 2006/03/15 22:11:04 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -42,51 +42,41 @@
&Apache::lonnet::appenv('environment.remote' => 'on');
# -------------------------------------------------------- Menu script and info
my $windowinfo=&Apache::lonmenu::open($env{'browser.os'});
- my $html=&Apache::lonxml::xmlbegin();
my $startupremote=&Apache::lonmenu::startupremote($lowerurl);
+ my $start_page = &Apache::loncommon::start_page('Remote Control',
+ $startupremote);
+ my $end_page = &Apache::loncommon::end_page();
my $remoteinfo=&Apache::lonmenu::load_remote_msg($lowerurl);
my $setflags=&Apache::lonmenu::setflags();
my $maincall=&Apache::lonmenu::maincall();
- my $bodytag=&Apache::loncommon::bodytag('Launch Remote Control');
my $message=&mt("Launching of the Remote Control menu will fail if pop-up window filters are active. To use the Remote Control, disable the filter for this site.");
$r->print(<<ENDLAUNCH);
-$html
-<head>
-<title>The LearningOnline Network with CAPA</title>
-$startupremote
-</head>
-$bodytag
+$start_page
$setflags
$windowinfo
$message
$remoteinfo
$maincall
-</body>
-</html>
+$end_page
ENDLAUNCH
}
sub collapseremote {
my ($r,$lowerurl)=@_;
# -------------------------------------------------------- Menu script and info
- my $html=&Apache::lonxml::xmlbegin();
- my $bodytag=&Apache::loncommon::bodytag('Collapse Remote Control');
+ my $start_page = &Apache::loncommon::start_page('Collapse Remote Control');
+ my $end_page = &Apache::loncommon::start_page('Collapse Remote Control');
my $windowinfo=&Apache::lonmenu::close();
# my $switch='<meta HTTP-EQUIV="Refresh" CONTENT="0.5; url='.$lowerurl.'">';
my $message='<p>'.&mt("The external menu (Remote Control) has been disabled, and you will be working with the smaller inline menu.\nYou may have either closed the Remote Control window, or it was blocked by a pop-up window filter in your browser.\nTo use the Remote Control, disable the filter for this site, and re-launch the Remote Control from the inline menu.").'</p>';
$r->print(<<ENDCOLLAPSE);
-$html
-<head>
-<title>The LearningOnline Network with CAPA</title>
-</head>
-$bodytag
+$start_page
$windowinfo
<p>
$message
</p>
<a href="$lowerurl">Continue</a>
-</body>
-</html>
+$end_page
ENDCOLLAPSE
&Apache::lonnet::put('environment',{'remote' => 'off'});
&Apache::lonnet::appenv('environment.remote' => 'off');
--albertel1142460666--