version 1.1, 2004/07/03 18:49:42
|
version 1.7, 2004/07/03 20:45:23
|
Line 31 use lib qw(/home/httpd/lib/perl);
|
Line 31 use lib qw(/home/httpd/lib/perl);
|
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
use Apache::loncommon(); |
use Apache::loncommon(); |
|
|
sub handler |
sub handler { |
{ |
my ($r) = @_; |
my $r = shift; |
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['page','color','function','faq','bug','topic','component_help','origurl']); |
&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; |
$r->send_http_header; |
|
|
if ($r->header_only) { |
if ($r->header_only) { |
return OK; |
return OK; |
} |
} |
my $color = &Apache::lonnet::unescape($ENV{'form.color'}); |
my $color = $ENV{'form.color'}; |
my $faq = &Apache::lonnet::unescape($ENV{'form.faq'}); |
my $faq = $ENV{'form.faq'}; |
my $bug = &Apache::lonnet::unescape($ENV{'form.bug'}); |
my $bug = $ENV{'form.bug'}; |
my $topic = &Apache::lonnet::unescape($ENV{'form.topic'}); |
my $topic = $ENV{'form.topic'}; |
my $function = &Apache::lonnet::unescape($ENV{'form.function'}); |
my $function = $ENV{'form.function'}; |
my $component_help = &Apache::lonnet::unescape($ENV{'form.component_help'}); |
my $component_help = $ENV{'form.component_help'}; |
my $origurl = $ENV{'form.origurl'}; |
my $origurl = $ENV{'form.origurl'}; |
my $component_url = $component_help; |
my $component_url = $component_help; |
if ($component_url) { |
if ($component_url) { |
Line 60 sub handler
|
Line 59 sub handler
|
my $faqbaseurl = $Apache::lonnet::perlvar{'FAQHost'}; |
my $faqbaseurl = $Apache::lonnet::perlvar{'FAQHost'}; |
my $requestmail = $Apache::lonnet::perlvar{'lonSupportEMail'}; |
my $requestmail = $Apache::lonnet::perlvar{'lonSupportEMail'}; |
if ($ENV{'form.page'} eq 'banner') { |
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') { |
} 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; |
return OK; |
} |
} |
Line 70 sub handler
|
Line 69 sub handler
|
sub display_help_banner { |
sub display_help_banner { |
my ($r,$color,$function,$faq,$bug,$topic,$component_url,$origurl,$bugurl,$faqbaseurl,$requestmail) = @_; |
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); |
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 $fontcolor = &Apache::loncommon::designparm($function.'.font'); |
my $alinkcolor = &Apache::loncommon::designparm($function.'.alink'); |
my $alinkcolor = &Apache::loncommon::designparm($function.'.alink'); |
my $vlinkcolor = &Apache::loncommon::designparm($function.'.vlink'); |
my $vlinkcolor = &Apache::loncommon::designparm($function.'.vlink'); |
Line 120 END
|
Line 120 END
|
if ($component_url) { |
if ($component_url) { |
$r->print(" |
$r->print(" |
<td align=\"center\"> <b><a href=\"$component_url\" target=\"bodyframe\">"); |
<td align=\"center\"> <b><a href=\"$component_url\" target=\"bodyframe\">"); |
} elsif ($ENV{'user.adv'}) { |
$r->print(' |
|
<image src="/adm/help/gif/smallHelp.gif" border="0" alt="(Topic help)" valign="middle" /> Topic help</a></b> </td>'); |
|
} 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('<td align="center"> <b><a href="javascript:noTopic()" target="bodyframe">'); |
$r->print('<td align="center"> <b><a href="javascript:noTopic()" target="bodyframe">'); |
} |
} |
$r->print(' |
|
<image src="/adm/help/gif/smallHelp.gif" border="0" alt="(Topic help)" valign="middle" /> Topic help</a></b> </td>'); |
|
} |
} |
if ($requestmail) { |
if ($requestmail) { |
$r->print(' |
$r->print(' |
<td align="center"> <b><a href="/adm/support?origurl='.$origurl.'&function='.$function.'" target="bodyframe"><image src="/adm/lonMisc/feedback.gif" border="0" alt="(Ask helpdesk)" valign="middle" /> Ask helpdesk</a></b> </td>'); |
<td align="center"> <b><a href="/adm/support?origurl='.$origurl.'&function='.$function.'" target="bodyframe"><image src="/adm/lonMisc/feedback.gif" border="0" alt="(Ask helpdesk)" valign="middle" /> Ask helpdesk</a></b> </td>'); |
} |
} |
if ($ENV{'user.adv'}) { |
if ($faq && $ENV{'user.adv'}) { |
$r->print(<<END) |
$r->print(<<END) |
<td align="center"> |
<td align="center"> |
<b><a href="$faqbaseurl/fom/cache/$faq.html" target="bodyframe"><image src="/adm/lonMisc/smallFAQ.gif" border="0" alt="(FAQ)" valign="middle" /> FAQ</a></b> |
<b><a href="$faqbaseurl/fom/cache/$faq.html" target="bodyframe"><image src="/adm/lonMisc/smallFAQ.gif" border="0" alt="(FAQ)" valign="middle" /> FAQ</a></b> |
</td> |
</td> |
|
END |
|
} |
|
if ($ENV{'user.adv'}) { |
|
$r->print(<<END) |
<td align="center"> <b><a href="$bugurl" target="bodyframe"><image src="/adm/lonMisc/smallBug.gif" border="0" alt="(Report a bug)" valign="middle" /> Report a bug</a> </b></td> |
<td align="center"> <b><a href="$bugurl" target="bodyframe"><image src="/adm/lonMisc/smallBug.gif" border="0" alt="(Report a bug)" valign="middle" /> Report a bug</a> </b></td> |
END |
END |
} |
} |
Line 167 END
|
Line 172 END
|
sub display_help_mainpage { |
sub display_help_mainpage { |
my ($r,$color,$function,$faq,$bug,$topic,$component_url,$origurl,$bugurl,$faqbaseurl,$requestmail) = @_; |
my ($r,$color,$function,$faq,$bug,$topic,$component_url,$origurl,$bugurl,$faqbaseurl,$requestmail) = @_; |
my $bodytag = &Apache::loncommon::bodytag('',$function,'topmargin="0" marginheight="0"',1); |
my $bodytag = &Apache::loncommon::bodytag('',$function,'topmargin="0" marginheight="0"',1); |
|
$bodytag=~s/[\n\r]/ /g; |
$r->print(<<END); |
$r->print(<<END); |
<html> |
<html> |
<head> |
<head> |
<title>Help Content</title> |
<title>Help Content</title> |
<script type="text/javascript"> |
<script type="text/javascript"> |
function noTopic() { |
function noTopic() { |
bodyframe.document.write("<html><head><title>Topic Page</title></head>$bodytag") |
bodyframe.document.write('<html><head><title>Topic Page</title></head>$bodytag') |
bodyframe.document.write("The LON-CAPA help system does not currently include a specific pop-up help item for this topic. You may wish to consult the LON-CAPA <a href='/adm/help/author.manual.pdf'>Authoring Manual</a> or the <a href='/adm/help/course.manual.pdf'>Course Coordinator Manual</a>.") |
bodyframe.document.write("The LON-CAPA help system does not currently include a specific pop-up help item for this topic. You may wish to consult the LON-CAPA <a href='/adm/help/author.manual.pdf'>Authoring Manual</a> or the <a href='/adm/help/course.manual.pdf'>Course Coordinator Manual</a>.") |
bodyframe.document.write("</body></html>") |
bodyframe.document.write("</body></html>") |
body.document.close() |
body.document.close() |