Diff for /loncom/interface/lonhelpmenu.pm between versions 1.1 and 1.6

version 1.1, 2004/07/03 18:49:42 version 1.6, 2004/07/03 20:25:51
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\">&nbsp;<b><a href=\"$component_url\" target=\"bodyframe\">");              <td align=\"center\">&nbsp;<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" />&nbsp;Topic help</a></b>&nbsp;</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">&nbsp;<b><a href="javascript:noTopic()" target="bodyframe">');              $r->print('<td align="center">&nbsp;<b><a href="javascript:noTopic()" target="bodyframe">');
         }          }
         $r->print('  
    <image src="/adm/help/gif/smallHelp.gif" border="0" alt="(Topic help)" valign="middle" />&nbsp;Topic help</a></b>&nbsp;</td>');  
     }      }
     if ($requestmail) {      if ($requestmail) {
         $r->print('          $r->print('
Line 167  END Line 168  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()

Removed from v.1.1  
changed lines
  Added in v.1.6


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>