Diff for /loncom/interface/lonmenu.pm between versions 1.28 and 1.30

version 1.28, 2002/11/18 15:23:32 version 1.30, 2003/01/15 23:59:26
Line 38  use strict; Line 38  use strict;
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::File;  use Apache::File;
 use vars qw(@desklines $readdesk);  use vars qw(@desklines $readdesk);
    
   # ================================================================= Reopen menu
   
   sub reopenmenu {
      my $nothing='';
      my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
      if ($ENV{'browser.type'} eq 'explorer') { $nothing='javascript:void(0);'; }
      return('window.open("'.$nothing.'","'.$menuname.'","",false);');
   } 
   
 # =============================================================== Open the menu  # =============================================================== Open the menu
   
 sub open {  sub open {
     my $returnval='';      my $returnval='';
       my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
     unless (shift eq 'unix') {      unless (shift eq 'unix') {
 # resizing does not work on linux because of virtual desktop sizes  # resizing does not work on linux because of virtual desktop sizes
        $returnval.=(<<ENDRESIZE);         $returnval.=(<<ENDRESIZE);
Line 53  if (window.screen) { Line 63  if (window.screen) {
 ENDRESIZE  ENDRESIZE
     }      }
     $returnval.=(<<ENDOPEN);      $returnval.=(<<ENDOPEN);
 var menu=window.open("/res/adm/pages/menu.html","LONCAPAmenu",  var menu=window.open("/res/adm/pages/menu.html","$menuname",
 "height=350,width=150,scrollbars=no,menubar=no,top=5,left=5,screenX=5,screenY=5");  "height=350,width=150,scrollbars=no,menubar=no,top=5,left=5,screenX=5,screenY=5");
 ENDOPEN  ENDOPEN
     return '<script>'.$returnval.'</script>';      return '<script>'.$returnval.'</script>';
Line 104  sub secondlevel { Line 114  sub secondlevel {
 }  }
   
 sub openmenu {  sub openmenu {
       my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
     if ($ENV{'browser.type'} eq 'explorer') {      if ($ENV{'browser.type'} eq 'explorer') {
        return "window.open('javascript:void(0);','LONCAPAmenu');";         return "window.open('javascript:void(0);','".$menuname."');";
    } else {     } else {
        return "window.open('','LONCAPAmenu');";         return "window.open('','".$menuname."');";
    }     }
 }  }
   
Line 161  sub rawconfig { Line 172  sub rawconfig {
     }      }
         } elsif ($pro eq 'author') {          } elsif ($pro eq 'author') {
             if ($author) {              if ($author) {
                 if (($prt eq 'rca') && ($ENV{'request.role'}=~/^ca/)) {                  if ((($prt eq 'rca') && ($ENV{'request.role'}=~/^ca/)) ||
                       (($prt eq 'rau') && ($ENV{'request.role'}=~/^au/))) {
                     # Check that we are on the correct machine                      # Check that we are on the correct machine
     my ($cadom,$caname)=                      my $cadom=$requested_domain;
                       my $caname=$ENV{'user.name'};
                       if ($prt eq 'rca') {
          ($cadom,$caname)=
                                ($ENV{'request.role'}=~/(\w+)\/(\w+)$/);                                 ($ENV{'request.role'}=~/(\w+)\/(\w+)$/);
                       }                       
                       $act =~ s/\$caname/$caname/g;
                     my $home = &Apache::lonnet::homeserver($caname,$cadom);                      my $home = &Apache::lonnet::homeserver($caname,$cadom);
                     if ($home eq $r->dir_config('lonHostID')) {                      if ($home eq $r->dir_config('lonHostID')) {
                         $output.=switch($caname,$cadom,                          $output.=switch($caname,$cadom,
                                         $row,$col,$img,$top,$bot,$act,$desc);                                          $row,$col,$img,$top,$bot,$act,$desc);
                     }                      }
                 } elsif ($prt eq 'any') {  
                     my $home = &Apache::lonnet::homeserver  
                         ($ENV{'user.name'},$ENV{'user.domain'});  
                     if ($home eq $r->dir_config('lonHostID')) {  
                         $output.=switch  
                             ($ENV{'user.name'},$ENV{'user.domain'},  
                              $row,$col,$img,$top,$bot,$act,$desc);  
                     }  
                 }                  }
             }              }
         }          }
Line 189  sub rawconfig { Line 198  sub rawconfig {
 # ======================================================================= Close  # ======================================================================= Close
   
 sub close {  sub close {
       my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
     return(<<ENDCLOSE);      return(<<ENDCLOSE);
 <script>  <script>
 menu=window.open("/adm/rat/empty.html","LONCAPAmenu",  menu=window.open("/adm/rat/empty.html","$menuname",
                  "height=350,width=150,scrollbars=no,menubar=no");                   "height=350,width=150,scrollbars=no,menubar=no");
 menu.close();  menu.close();
 </script>  </script>
Line 223  BEGIN { Line 233  BEGIN {
    $readdesk='done';     $readdesk='done';
   }    }
 }  }
   
 1;  1;
 __END__  __END__
   

Removed from v.1.28  
changed lines
  Added in v.1.30


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