Diff for /loncom/interface/loncommon.pm between versions 1.84 and 1.87

version 1.84, 2003/02/25 21:49:45 version 1.87, 2003/03/10 20:21:45
Line 674  sub home_server_option_list { Line 674  sub home_server_option_list {
 ###############################################################  ###############################################################
   
 ###############################################################  ###############################################################
   ###############################################################
   
   =pod
   
   =item &decode_user_agent()
   
   Inputs: $r
   
   Outputs:
   
   =over 4
   
   =item $httpbrowser
   
   =item $clientbrowser
   
   =item $clientversion
   
   =item $clientmathml
   
   =item $clientunicode
   
   =item $clientos
   
   =back
   
   =cut
   
   ###############################################################
   ###############################################################
   sub decode_user_agent {
       my @browsertype=split(/\&/,$Apache::lonnet::perlvar{"lonBrowsDet"});
       my %mathcap=split(/\&/,$$Apache::lonnet::perlvar{"lonMathML"});
       my $httpbrowser=$ENV{"HTTP_USER_AGENT"};
       my $clientbrowser='unknown';
       my $clientversion='0';
       my $clientmathml='';
       my $clientunicode='0';
       for (my $i=0;$i<=$#browsertype;$i++) {
           my ($bname,$match,$notmatch,$vreg,$minv,$univ)=split(/\:/,$browsertype[$i]);
    if (($httpbrowser=~/$match/i)  && ($httpbrowser!~/$notmatch/i)) {
       $clientbrowser=$bname;
               $httpbrowser=~/$vreg/i;
       $clientversion=$1;
               $clientmathml=($clientversion>=$minv);
               $clientunicode=($clientversion>=$univ);
    }
       }
       my $clientos='unknown';
       if (($httpbrowser=~/linux/i) ||
           ($httpbrowser=~/unix/i) ||
           ($httpbrowser=~/ux/i) ||
           ($httpbrowser=~/solaris/i)) { $clientos='unix'; }
       if (($httpbrowser=~/vax/i) ||
           ($httpbrowser=~/vms/i)) { $clientos='vms'; }
       if ($httpbrowser=~/next/i) { $clientos='next'; }
       if (($httpbrowser=~/mac/i) ||
           ($httpbrowser=~/powerpc/i)) { $clientos='mac'; }
       if ($httpbrowser=~/win/i) { $clientos='win'; }
       if ($httpbrowser=~/embed/i) { $clientos='pda'; }
       return ($httpbrowser,$clientbrowser,$clientversion,$clientmathml,
               $clientunicode,$clientos,);
   }
   
   ###############################################################
   ###############################################################
   
   
   ###############################################################
 ##    Authentication changing form generation subroutines    ##  ##    Authentication changing form generation subroutines    ##
 ###############################################################  ###############################################################
 ##  ##
Line 1530  Inputs: Line 1599  Inputs:
  $addentries, extra parameters for the <body> tag.   $addentries, extra parameters for the <body> tag.
  $bodyonly, if defined, only return the <body> tag.   $bodyonly, if defined, only return the <body> tag.
  $domain, if defined, force a given domain.   $domain, if defined, force a given domain.
    $forcereg, if page should register as content page (relevant for 
               text interface only)
   
 Returns: A uniform header for LON-CAPA web pages.    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 nonzero, a string containing a <body> tag will be returned.
Line 1543  other decorations will be returned. Line 1614  other decorations will be returned.
   
 ###############################################  ###############################################
 sub bodytag {  sub bodytag {
     my ($title,$function,$addentries,$bodyonly,$domain)=@_;      my ($title,$function,$addentries,$bodyonly,$domain,$forcereg)=@_;
     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 1587  END Line 1658  END
     if ($bodyonly) {      if ($bodyonly) {
         return $bodytag;          return $bodytag;
     } elsif ($ENV{'browser.interface'} eq 'textual') {      } elsif ($ENV{'browser.interface'} eq 'textual') {
         return $bodytag.&Apache::lonmenu::menubuttons(undef,'web').          return $bodytag.&Apache::lonmenu::menubuttons($forcereg,'web',
                                                         $forcereg).
                '<h1>LON-CAPA: '.$title.'</h1>';                 '<h1>LON-CAPA: '.$title.'</h1>';
     } else {      } else {
         return(<<ENDBODY);          return(<<ENDBODY);
Line 1921  sub csv_samples_select_table { Line 1993  sub csv_samples_select_table {
     return($i);      return($i);
 }  }
   
   =pod
   
   =item check_if_partid_hidden($id,$symb,$udom,$uname)
   
   Returns either 1 or undef
   
   1 if the part is to be hidden, undef if it is to be shown
   
   Arguments are:
   
   $id the id of the part to be checked
   $symb, optional the symb of the resource to check
   $udom, optional the domain of the user to check for
   $uname, optional the username of the user to check for
   
   =cut
   
 sub check_if_partid_hidden {  sub check_if_partid_hidden {
     my ($id,$symb,$udom,$uname) = @_;      my ($id,$symb,$udom,$uname) = @_;

Removed from v.1.84  
changed lines
  Added in v.1.87


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