Diff for /loncom/interface/loncommon.pm between versions 1.59 and 1.60

version 1.59, 2002/08/26 12:47:28 version 1.60, 2002/08/26 14:32:29
Line 1148  sub findallcourses { Line 1148  sub findallcourses {
 }  }
   
 ###############################################  ###############################################
   ###############################################
   
   =pod
   
   =item &domainlogo()
   
   Inputs: $domain (usually will be undef)
   
   Returns: A link to a domain logo, if the domain logo exists.
   If the domain logo does not exist, a description of the domain.
   
   =cut
   
   ###############################################
   ###############################################
 sub domainlogo {  sub domainlogo {
 # Determine domain      my ($domain) = @_;    
     my $domain=$Apache::lonnet::perlvar{'lonDefDomain'};      if (! $domain) {
     if ($ENV{'user.domain'}) { $domain=$ENV{'user.domain'}; }          # Determine domain if we have not been given one
     if ($ENV{'request.role.domain'}) { $domain=$ENV{'request.role.domain'}; }          $domain = $Apache::lonnet::perlvar{'lonDefDomain'};
 # See if there is a logo          if ($ENV{'user.domain'}) { $domain=$ENV{'user.domain'}; }
           if ($ENV{'request.role.domain'}) { 
               $domain=$ENV{'request.role.domain'}; 
           }
       }
       # See if there is a logo
     if (-e '/home/httpd/html/adm/lonDomLogos/'.$domain.'.gif') {      if (-e '/home/httpd/html/adm/lonDomLogos/'.$domain.'.gif') {
  return '<img src="/adm/lonDomLogos/'.$domain.'.gif" />';          return '<img src="/adm/lonDomLogos/'.$domain.'.gif" />';
     } else {      } elsif(exists($Apache::lonnet::domaindescription{$domain})) {
         return $Apache::lonnet::domaindescription{$domain};          return $Apache::lonnet::domaindescription{$domain};
       } else {
           return '';
     }      }
 }  }
   
   ###############################################
   ###############################################
   
   =pod
   
   =item &bodytag()
   
   Returns a uniform header for LON-CAPA web pages.
   
   Inputs: 
   
    $title, A title to be displayed on the page.
    $function, the current role (can be undef).
    $addentries, extra parameters for the <body> tag.
    $bodyonly, if defined, only return the <body> tag.
    $domain, if defined, force a given domain.
   
   Returns: A uniform header for LON-CAPA web pages.  
   If $bodyonly is nonzero, a string containing a <body> tag will be returned.
   If $bodyonly is undef or zero, an html string containing a <body> tag and 
   other decorations will be returned.
   
   =cut
   
   ###############################################
   ###############################################
 sub bodytag {  sub bodytag {
     my ($title,$function,$addentries)=@_;      my ($title,$function,$addentries,$bodyonly,$domain)=@_;
     unless ($function) {      unless ($function) {
  $function='student';   $function='student';
         if ($ENV{'request.role'}=~/^(cc|in|ta|ep)/) {          if ($ENV{'request.role'}=~/^(cc|in|ta|ep)/) {
Line 1223  sub bodytag { Line 1270  sub bodytag {
     }      }
     unless ($realm) { $realm='&nbsp;'; }      unless ($realm) { $realm='&nbsp;'; }
 # Set messages  # Set messages
     my $messages=&domainlogo();      my $messages=&domainlogo($domain);
 # Output  # Output
     return(<<ENDBODY);      my $bodytag = <<END;
 <body bgcolor="$pgbg" text="$font" alink="$alink" vlink="$vlink" link="$link"  <body bgcolor="$pgbg" text="$font" alink="$alink" vlink="$vlink" link="$link"
 $addentries>  $addentries>
   END
       if ($bodyonly) {
           return $bodytag;
       } else {
           return(<<ENDBODY);
   $bodytag
 <table width="100%" cellspacing="0" border="0" cellpadding="0">  <table width="100%" cellspacing="0" border="0" cellpadding="0">
 <tr><td bgcolor="$font">  <tr><td bgcolor="$font">
 <img src="/adm/lonInterFace/$img.jpg" /></td>  <img src="/adm/lonInterFace/$img.jpg" /></td>
Line 1252  $addentries> Line 1305  $addentries>
 <td bgcolor="$tabbg" align="right"><font size="2">$realm</font>&nbsp;</td></tr>  <td bgcolor="$tabbg" align="right"><font size="2">$realm</font>&nbsp;</td></tr>
 </table><br>  </table><br>
 ENDBODY  ENDBODY
       }
 }  }
 ###############################################  ###############################################
   

Removed from v.1.59  
changed lines
  Added in v.1.60


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