Diff for /loncom/interface/lonmenu.pm between versions 1.54 and 1.56

version 1.54, 2003/04/03 21:32:23 version 1.56, 2003/04/04 21:21:51
Line 45  use Apache::lonhtmlcommon(); Line 45  use Apache::lonhtmlcommon();
 use Apache::loncommon;  use Apache::loncommon;
 use Apache::File;  use Apache::File;
 use vars qw(@desklines $readdesk);  use vars qw(@desklines $readdesk);
   my @inlineremote;
   
 # ============================= This gets called at the top of the body section  # ============================= This gets called at the top of the body section
   
Line 52  sub menubuttons { Line 53  sub menubuttons {
     my $forcereg=shift;      my $forcereg=shift;
     my $target  =shift;      my $target  =shift;
     my $registration=shift;      my $registration=shift;
       my $navmaps='';
       my $escurl=&Apache::lonnet::escape($ENV{'REQUEST_URI'});
       my $escsymb=&Apache::lonnet::escape($ENV{'request.symb'});
     if ($ENV{'browser.interface'} eq 'textual') {      if ($ENV{'browser.interface'} eq 'textual') {
 # Textual display only  # Textual display only
           if ($ENV{'request.course.id'}) {
       $navmaps=(<<ENDNAV);
   <a href="/adm/navmaps?postdata=$escurl&postsymb=$escsymb" target="_top">Navigate Contents</a>
   ENDNAV
           }
  my $output=(<<ENDMAINMENU);   my $output=(<<ENDMAINMENU);
 <script>  <script>
 // BEGIN LON-CAPA Internal  // BEGIN LON-CAPA Internal
 </script>  </script>
 <a href="/adm/menu" target="_top">Main Menu</a><br />  <a href="/adm/menu" target="_top">Main Menu</a>
   $navmaps<br />
 <script>  <script>
 // END LON-CAPA Internal  // END LON-CAPA Internal
 </script>  </script>
Line 67  ENDMAINMENU Line 77  ENDMAINMENU
  return $output."<hr />";   return $output."<hr />";
     } elsif ($ENV{'environment.remote'} eq 'off') {      } elsif ($ENV{'environment.remote'} eq 'off') {
 # Remote Control is switched off  # Remote Control is switched off
         my $escurl=&Apache::lonnet::escape($ENV{'REQUEST_URI'});          if ($ENV{'request.course.id'}) {
       $navmaps=(<<ENDNAVREM);
   <a href="/adm/navmaps?postdata=$escurl&postsymb=$escsymb" target="_top">Navigate Contents</a>
   ENDNAVREM
           }
  my $output=(<<ENDINLINEMENU);   my $output=(<<ENDINLINEMENU);
 <script>  <script>
 // BEGIN LON-CAPA Internal  // BEGIN LON-CAPA Internal
 </script>  </script>
 <table bgcolor="#AAAAAA" width="100%" border="2"><tr><td>  <table bgcolor="#AAAAAA" width="100%" border="2"><tr><td>
 <a href="/adm/menu" target="_top">Main Menu</a>  <a href="/adm/menu" target="_top">Main Menu</a>
   $navmaps
 <a href="/adm/remote?action=launch&url=$escurl" target="_top">Launch Remote Control</a>  <a href="/adm/remote?action=launch&url=$escurl" target="_top">Launch Remote Control</a>
 <br />  <br />
 <script>  <script>
Line 129  sub innerregister { Line 144  sub innerregister {
           
     my $textual=($textinter || $noremote);      my $textual=($textinter || $noremote);
   
       @inlineremote=();
       undef @inlineremote;
   
     my $reopen=&Apache::lonmenu::reopenmenu();      my $reopen=&Apache::lonmenu::reopenmenu();
   
     my $newmail='';      my $newmail='';
Line 244  ENDMENUITEMS Line 262  ENDMENUITEMS
 # Registered, textual output  # Registered, textual output
             my $utility=&utilityfunctions();              my $utility=&utilityfunctions();
             my $form=&serverform();              my $form=&serverform();
               my $inlinebuttons=
                           join('',map { (defined($_)?$_:'') } @inlineremote);
     $result =(<<ENDREGTEXT);      $result =(<<ENDREGTEXT);
 <script>  <script>
 // BEGIN LON-CAPA Internal  // BEGIN LON-CAPA Internal
Line 251  $utility Line 271  $utility
 </script>  </script>
 $timesync  $timesync
 $newmail  $newmail
 $buttons  $inlinebuttons
 $hwkadd  
 $editbutton  
 $form  $form
 <script>  <script>
 //END LON-CAPA Internal  //END LON-CAPA Internal
Line 477  sub clear { Line 495  sub clear {
     unless (($ENV{'browser.interface'} eq 'textual') ||      unless (($ENV{'browser.interface'} eq 'textual') ||
             ($ENV{'environment.remote'} eq 'off')) {              ($ENV{'environment.remote'} eq 'off')) {
        return "\n".qq(window.status+='.';swmenu.clearbut($row,$col););         return "\n".qq(window.status+='.';swmenu.clearbut($row,$col););
    } else { return ''; }     } else { 
          $inlineremote[10*$row+$col]='';
          return ''; 
      }
 }  }
   
 # ============================================ Switch a button or create a link  # ============================================ Switch a button or create a link
Line 498  sub switch { Line 519  sub switch {
        if ($nobreak==2) { return ''; }         if ($nobreak==2) { return ''; }
        my $text=$top.' '.$bot;         my $text=$top.' '.$bot;
        $text=~s/\- //;         $text=~s/\- //;
        return "\n".($nobreak?' ':'<br />').         $inlineremote[10*$row+$col]="\n".($nobreak?' ':'<br />').
         '<a href="javascript:'.$act.';" target="_top">'.$text.'</a> '.          '<a href="javascript:'.$act.';" target="_top">'.$text.'</a> '.
         ($nobreak?'':$desc);          ($nobreak?'':$desc);
    } else {     } else {
Line 506  sub switch { Line 527  sub switch {
        if ($nobreak==2) { return ''; }         if ($nobreak==2) { return ''; }
        my $text=$top.' '.$bot;         my $text=$top.' '.$bot;
        $text=~s/\- //;         $text=~s/\- //;
        return "\n".($nobreak?' ':'<br />').         $inlineremote[10*$row+$col]="\n".($nobreak?' ':'<br />').
         '<a href="javascript:'.$act.';" target="_top">'.$text.'</a> '.          '<a href="javascript:'.$act.';" target="_top">'.$text.'</a> '.
         ($nobreak?'':$desc);          ($nobreak?'':$desc);
    }     }
       return '';
 }  }
   
 sub secondlevel {  sub secondlevel {
Line 534  sub openmenu { Line 556  sub openmenu {
     return "window.open(".$nothing.",'".$menuname."');";      return "window.open(".$nothing.",'".$menuname."');";
 }  }
   
   sub inlinemenu {
       @inlineremote=();
       undef @inlineremote;
       &rawconfig(1);
       return join('',map { (defined($_)?$_:'') } @inlineremote);
   }
   
 sub rawconfig {  sub rawconfig {
     my $textualoverride=shift;      my $textualoverride=shift;
     my $output='';      my $output='';
Line 724  $utility Line 753  $utility
 </head>  </head>
 $bodytag  $bodytag
 ENDHEADER  ENDHEADER
     $r->print(&rawconfig(1).$form);      $r->print(&inlinemenu().$form);
     $r->print('</body></html>');      $r->print('</body></html>');
     return OK;      return OK;
 }  }

Removed from v.1.54  
changed lines
  Added in v.1.56


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