--- loncom/interface/lonhelpmenu.pm 2004/07/03 18:49:42 1.1 +++ loncom/interface/lonhelpmenu.pm 2004/07/03 20:25:51 1.6 @@ -31,22 +31,21 @@ use lib qw(/home/httpd/lib/perl); use Apache::Constants qw(:common); use Apache::loncommon(); -sub handler -{ - my $r = shift; +sub handler { + my ($r) = @_; &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['page','color','function','faq','bug','topic','component_help','origurl']); - $r->content_type('text/html'); + &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; if ($r->header_only) { return OK; } - my $color = &Apache::lonnet::unescape($ENV{'form.color'}); - my $faq = &Apache::lonnet::unescape($ENV{'form.faq'}); - my $bug = &Apache::lonnet::unescape($ENV{'form.bug'}); - my $topic = &Apache::lonnet::unescape($ENV{'form.topic'}); - my $function = &Apache::lonnet::unescape($ENV{'form.function'}); - my $component_help = &Apache::lonnet::unescape($ENV{'form.component_help'}); + my $color = $ENV{'form.color'}; + my $faq = $ENV{'form.faq'}; + my $bug = $ENV{'form.bug'}; + my $topic = $ENV{'form.topic'}; + my $function = $ENV{'form.function'}; + my $component_help = $ENV{'form.component_help'}; my $origurl = $ENV{'form.origurl'}; my $component_url = $component_help; if ($component_url) { @@ -60,9 +59,9 @@ sub handler my $faqbaseurl = $Apache::lonnet::perlvar{'FAQHost'}; my $requestmail = $Apache::lonnet::perlvar{'lonSupportEMail'}; if ($ENV{'form.page'} eq 'banner') { - &display_help_banner ($r,$color,$function,$faq,$bug,$topic,$component_url,$origurl,$bugurl,$faqbaseurl,$requestmail); + &display_help_banner($r,$color,$function,$faq,$bug,$topic,$component_url,$origurl,$bugurl,$faqbaseurl,$requestmail); } elsif ($ENV{'form.page'} eq 'body') { - &display_help_mainpage ($r,$color,$function,$faq,$bug,$topic,$component_url,$origurl,$bugurl,$faqbaseurl,$requestmail); + &display_help_mainpage($r,$color,$function,$faq,$bug,$topic,$component_url,$origurl,$bugurl,$faqbaseurl,$requestmail); } return OK; } @@ -70,6 +69,7 @@ sub handler sub display_help_banner { my ($r,$color,$function,$faq,$bug,$topic,$component_url,$origurl,$bugurl,$faqbaseurl,$requestmail) = @_; 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'); @@ -120,11 +120,12 @@ END if ($component_url) { $r->print("  "); - } elsif ($ENV{'user.adv'}) { + $r->print(' + (Topic help) Topic help '); + } elsif (0 && $ENV{'user.adv'}) { + #FIXME doing this in JS is problematic since JS can't control frames that go to outside sites $r->print(' '); } - $r->print(' - (Topic help) Topic help '); } if ($requestmail) { $r->print(' @@ -167,13 +168,14 @@ END 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; $r->print(< Help Content