[LON-CAPA-cvs] cvs: loncom /interface lonhelpmenu.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Tue, 21 Mar 2006 18:37:52 -0000
albertel Tue Mar 21 13:37:52 2006 EDT
Modified files:
/loncom/interface lonhelpmenu.pm
Log:
- start_page
Index: loncom/interface/lonhelpmenu.pm
diff -u loncom/interface/lonhelpmenu.pm:1.21 loncom/interface/lonhelpmenu.pm:1.22
--- loncom/interface/lonhelpmenu.pm:1.21 Fri Jun 3 11:47:29 2005
+++ loncom/interface/lonhelpmenu.pm Tue Mar 21 13:37:51 2006
@@ -71,8 +71,6 @@
sub display_help_banner {
my ($r,$color,$function,$faq,$bug,$topic,$component_url,$origurl,$bugurl,$faqbaseurl,$requestmail,$stayOnPage) = @_;
- my $bodytag = &Apache::loncommon::bodytag('',$function,'rightmargin="0" leftmargin="0" marginwidth="0" topmargin="1" marginheight="1"',1);
- $bodytag=~s/[\n\r]/ /g;
my $fontcolor = &Apache::loncommon::designparm($function.'.font');
my $alinkcolor = &Apache::loncommon::designparm($function.'.alink');
my $vlinkcolor = &Apache::loncommon::designparm($function.'.vlink');
@@ -118,7 +116,7 @@
var str = field.value;
if (window.RegExp) {
var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
- var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$";
+ var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"; //"
var reg1 = new RegExp(reg1str);
var reg2 = new RegExp(reg2str);
if (!reg1.test(str) && reg2.test(str)) {
@@ -138,23 +136,16 @@
</script>
SCRIPT_TWO
}
+
my $html=&Apache::lonxml::xmlbegin();
- $r->print(<<END);
-$html
-<head>
-<title>Help Banner</title>
-<style type="text/css">
-<!--
- a:link {text-decoration: none; color: $fontcolor; }
- a:visited {text-decoration: none; color: $fontcolor; }
- a:active {text-decoration: none; color: $fontcolor; }
- a:hover {text-decoration: underline; color: $vlinkcolor; }
--->
-</style>
-$scripttag
-</head>
-$bodytag
-END
+ my $body_layout = 'rightmargin="0" leftmargin="0" marginwidth="0" topmargin="1" marginheight="1"';
+ my $start_page =
+ &Apache::loncommon::start_page('',$scripttag,
+ {'function' => $function,
+ 'add_entries' => $body_layout,
+ 'only_body' => 1,});
+ $r->print($start_page);
+
if ($stayOnPage) {
$r->print('<table width="700" border="0" cellspacing="0" cellpadding="0" height="55">');
} else {
@@ -226,17 +217,14 @@
<td colspan='3' height='5'> </td>
</tr>
</table>
-</body>
-</html>
END
+ $r->print(&Apache::loncommon::end_page());
}
sub display_help_mainpage {
my ($r,$color,$function,$faq,$bug,$topic,$component_url,$origurl,$bugurl,$faqbaseurl,$requestmail) = @_;
- my $bodytag = &Apache::loncommon::bodytag('',$function,'topmargin="0" marginheight="0"',1);
- $bodytag=~s/[\n\r]/ /g;
+
my %lt =&Apache::lonlocal::texthash(
- 'heco' => 'Help Content',
'topp' => 'Topic Page',
'chen' => 'Choose an entry below to go directly to a relevant help page',
'orto' => 'or to submit a help request to the LON-CAPA support staff at your institution.',
@@ -255,14 +243,13 @@
'crea' => 'Create an account for yourself in the LON-CAPA Bugzilla tracking system, if you wish to report bugs you have encountered in the LON-CAPA software,or if you have suggestions for improvements in LON-CAPA.',
'suim' => ' Suggested improvements may include additional functionality, improved usability, or changes to wording used in LON-CAPA pages, including the embedded help system.'
);
- my $html=&Apache::lonxml::xmlbegin();
- $r->print(<<END);
-$html
- <head>
- <title>$lt{'heco'}</title>
- </head>
-$bodytag
-END
+
+ my $start_page =
+ &Apache::loncommon::start_page('Help Content',undef,
+ {'function' => $function,
+ 'add_entries' => 'topmargin="0" marginheight="0"',
+ 'only_body' => 1,});
+ $r->print($start_page);
$r->print($lt{'chen'});
if ($requestmail =~ m/^[^\@]+\@[^\@]+$/) {
$r->print(', '.$lt{'orto'});
@@ -317,10 +304,7 @@
<p>$lt{'crea'} $lt{'suim'}</p>
");
}
- $r->print(<<END);
- </body>
-</html>
-END
+ $r->print(&Apache::loncommon::end_page());
}
1;