Diff for /loncom/interface/lonmenu.pm between versions 1.219 and 1.227

version 1.219, 2007/07/10 23:38:09 version 1.227, 2007/09/11 23:37:58
Line 507  ENDMENUITEMS Line 507  ENDMENUITEMS
         my $buttons='';          my $buttons='';
         foreach (split(/\n/,$menuitems)) {          foreach (split(/\n/,$menuitems)) {
     my ($command,@rest)=split(/\&/,$_);      my ($command,@rest)=split(/\&/,$_);
             if ($command eq 's') {              my $idx=10*$rest[0]+$rest[1];
  $buttons.=&switch('','',@rest);              if (&hidden_button_check() eq 'yes') {
             } else {                  if ($idx == 21 ||$idx == 23) {
                 $buttons.=&clear(@rest);                      $buttons.=&switch('','',@rest);
                   } else {
                       $buttons.=&clear(@rest);
                   }
               } else {  
                   if ($command eq 's') {
               $buttons.=&switch('','',@rest);
                   } else {
                       $buttons.=&clear(@rest);
                   }
             }              }
         }          }
   
Line 520  ENDMENUITEMS Line 529  ENDMENUITEMS
     my $inlinebuttons='';      my $inlinebuttons='';
     if ($addremote) {      if ($addremote) {
 # Registered, textual output  # Registered, textual output
   
  if ($env{'browser.interface'} eq 'textual') {   if ($env{'browser.interface'} eq 'textual') {
     $inlinebuttons=      $inlinebuttons=
                         join('',map { (defined($_)?$_:'') } @inlineremote);                          join('',map { (defined($_)?$_:'') } @inlineremote);
  } else {   } else {
                     if ($env{'environment.icons'} eq 'iconsonly') {                      if ($env{'environment.icons'} eq 'iconsonly') {
                        $inlinebuttons=(<<ENDINLINEICONS);                          $inlinebuttons=(<<ENDARROWSINLINE);
 <tr><td>  <tr><td>
 $inlineremote[21] $inlineremote[23]  $inlineremote[21] $inlineremote[23]
   ENDARROWSINLINE
                           if (&hidden_button_check() ne 'yes') {
                               $inlinebuttons .= (<<ENDINLINEICONS);
 $inlineremote[61] $inlineremote[63]  $inlineremote[61] $inlineremote[63]
 $inlineremote[71] $inlineremote[72] $inlineremote[73]  $inlineremote[71] $inlineremote[72] $inlineremote[73]
 $inlineremote[81] $inlineremote[82] $inlineremote[83]  $inlineremote[81] $inlineremote[82] $inlineremote[83]
 $inlineremote[91] $inlineremote[92] $inlineremote[93]</td></tr>  $inlineremote[91] $inlineremote[92] $inlineremote[93]</td></tr>
 ENDINLINEICONS  ENDINLINEICONS
                           }
                     } else {                      } else {
        $inlinebuttons=(<<ENDINLINE);   if ($inlineremote[21] ne '' || $inlineremote[23] ne '') {
       $inlinebuttons=(<<ENDFIRSTLINE);
 <tr><td>$inlineremote[21]</td><td>&nbsp;</td><td>$inlineremote[23]</td></tr>  <tr><td>$inlineremote[21]</td><td>&nbsp;</td><td>$inlineremote[23]</td></tr>
 <tr><td>$inlineremote[61]</td><td>$inlineremote[62]</td><td>$inlineremote[63]</td></tr>  ENDFIRSTLINE
 <tr><td>$inlineremote[71]</td><td>$inlineremote[72]</td><td>$inlineremote[73]</td></tr>                          }
 <tr><td>$inlineremote[81]</td><td>$inlineremote[82]</td><td>$inlineremote[83]</td></tr>                          if (&hidden_button_check() ne 'yes') { 
 <tr><td>$inlineremote[91]</td><td>$inlineremote[92]</td><td>$inlineremote[93]</td></tr>      foreach my $row (6..9) {
 ENDINLINE   if ($inlineremote[${row}.'1'] ne ''
                     }      || $inlineremote[$row.'2'] ne ''
                 }      || $inlineremote[$row.'3'] ne '') {
       $inlinebuttons .= <<"ENDLINE";
   <tr><td>$inlineremote["${row}1"]</td><td>$inlineremote["${row}2"]</td><td>$inlineremote["${row}3"]</td></tr>
   ENDLINE
    }
       }
    }
       }
    }
     }      }
     $result =(<<ENDREGTEXT);      $result =(<<ENDREGTEXT);
 <script type="text/javascript">  <script type="text/javascript">
 // BEGIN LON-CAPA Internal  // BEGIN LON-CAPA Internal
 </script>  </script>
 $timesync  $timesync
 $newmail  
 $tablestart  $tablestart
 $inlinebuttons  $inlinebuttons
 $tableend  $tableend
   $newmail
 <script type="text/javascript">  <script type="text/javascript">
 // END LON-CAPA Internal  // END LON-CAPA Internal
 </script>  </script>
Line 791  sub open { Line 812  sub open {
  return '<script type="text/javascript">self.name="loncapaclient";</script>';   return '<script type="text/javascript">self.name="loncapaclient";</script>';
     }      }
     my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};      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);
 if (window.screen) {  #if (window.screen) {
     self.resizeTo(screen.availWidth-215,screen.availHeight-55);  #    self.resizeTo(screen.availWidth-215,screen.availHeight-55);
     self.moveTo(190,15);  #    self.moveTo(190,15);
 }  #}
 ENDRESIZE  #ENDRESIZE
     }  #    }
     $returnval.=(<<ENDOPEN);      $returnval.=(<<ENDOPEN);
 window.status='Opening LON-CAPA Remote Control';  window.status='Opening LON-CAPA Remote Control';
 var menu=window.open("/res/adm/pages/menu.html","$menuname",  var menu=window.open("/res/adm/pages/menu.html","$menuname",
Line 865  sub switch { Line 887  sub switch {
        my $text=$top.' '.$bot;         my $text=$top.' '.$bot;
        $text=~s/\s*\-\s*//gs;         $text=~s/\s*\-\s*//gs;
   
        my $lonhttpdPort=$Apache::lonnet::perlvar{'lonhttpdPort'};  
        if (!defined($lonhttpdPort)) { $lonhttpdPort='8080'; }  
        my $pic=         my $pic=
    '<img alt="'.$text.'" src="http://'.$ENV{'HTTP_HOST'}.     '<img alt="'.$text.'" src="'.
    ':'.$lonhttpdPort.'/res/adm/pages/'.$img.'" align="'.     &Apache::loncommon::lonhttpdurl('/res/adm/pages/'.$img).
    ($nobreak==3?'right':'left').'" />';     '" align="'.($nobreak==3?'right':'left').'" />';
        if ($env{'browser.interface'} eq 'faketextual') {         if ($env{'browser.interface'} eq 'faketextual') {
 # Accessibility  # Accessibility
    if ($nobreak==3) {     if ($nobreak==3) {
Line 1337  sub convert_menu_function { Line 1357  sub convert_menu_function {
     return $rolename;      return $rolename;
 }  }
   
   sub hidden_button_check {
       my $hidden;
       if ($env{'request.course.id'} eq '') {
           return;
       }
       if ($env{'request.role.adv'}) {
           return;
       }
       return &Apache::lonnet::EXT('resource.0.buttonshide'); 
   }
   
 # ================================================================ Main Program  # ================================================================ Main Program
   

Removed from v.1.219  
changed lines
  Added in v.1.227


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