Diff for /loncom/interface/lonmenu.pm between versions 1.224 and 1.230

version 1.224, 2007/08/30 00:13:19 version 1.230, 2007/10/30 23:46:02
Line 121  sub menubuttons { Line 121  sub menubuttons {
     $navmaps=(<<ENDNAV);      $navmaps=(<<ENDNAV);
 <a href="/adm/navmaps?postdata=$escurl&amp;postsymb=$escsymb" target="_top">$lt{'nav'}</a>  <a href="/adm/navmaps?postdata=$escurl&amp;postsymb=$escsymb" target="_top">$lt{'nav'}</a>
 ENDNAV  ENDNAV
             if (($env{'request.noversionuri'}=~/^\/adm\//) &&              if (&show_return_link()) {
          ($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) &&  
          ($env{'request.noversionuri'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) {  
                 my $escreload=&escape('return:');                  my $escreload=&escape('return:');
                 $reloadlink=(<<ENDRELOAD);                  $reloadlink=(<<ENDRELOAD);
 <a href="/adm/flip?postdata=$escreload" target="_top">$lt{'ret'}</a>  <a href="/adm/flip?postdata=$escreload" target="_top">$lt{'ret'}</a>
Line 196  ENDINLINEMENU Line 194  ENDINLINEMENU
     $navmaps=(<<ENDNAV);      $navmaps=(<<ENDNAV);
 <td><a href="$link" target="_top">$lt{'nav'}</a></td>  <td><a href="$link" target="_top">$lt{'nav'}</a></td>
 ENDNAV  ENDNAV
 my $is_group = (&Apache::loncommon::course_type() eq 'Group');              my $is_group = (&Apache::loncommon::course_type() eq 'Group');
     if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {      if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
                 my $text = ($is_group) ? $lt{'gdoc'} : $lt{'docs'};                  my $text = ($is_group) ? $lt{'gdoc'} : $lt{'docs'};
  $docs=(<<ENDDOCS);   $docs=(<<ENDDOCS);
Line 208  ENDDOCS Line 206  ENDDOCS
 <td><a href="/adm/coursegroups" target="_top">$lt{'groups'}</a></td>  <td><a href="/adm/coursegroups" target="_top">$lt{'groups'}</a></td>
 ENDGROUPS  ENDGROUPS
             }              }
     if (      if (&show_return_link()) {
  ($env{'request.noversionuri'}=~m[^/(res|public)/] &&  
  $env{'request.symb'} eq '')  
  ||  
  (($env{'request.noversionuri'}=~/^\/adm\//) &&  
  ($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) &&  
  ($env{'request.noversionuri'}!~  
         m[^/adm/.*/(smppg|bulletinboard|aboutme)($|\?)])  
   )  
  ) {  
                 my $escreload=&escape('return:');                  my $escreload=&escape('return:');
                 $reloadlink=(<<ENDRELOAD);                  $reloadlink=(<<ENDRELOAD);
 <td><a href="/adm/flip?postdata=$escreload" target="_top">$lt{'ret'}</a></td>  <td><a href="/adm/flip?postdata=$escreload" target="_top">$lt{'ret'}</a></td>
Line 274  ENDINLINEMENU Line 263  ENDINLINEMENU
     }      }
 }  }
   
   sub show_return_link {
       return (($env{'request.noversionuri'}=~m{^/(res|public)/} &&
        $env{'request.symb'} eq '')
       ||
       ($env{'request.noversionuri'}=~ m{^/cgi-bin/printout.pl})
       ||
       (($env{'request.noversionuri'}=~/^\/adm\//) &&
        ($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) &&
        ($env{'request.noversionuri'}!~
         m[^/adm/.*/(smppg|bulletinboard|aboutme)($|\?)])
        ));
   }
   
 # ====================================== This gets called in the header section  # ====================================== This gets called in the header section
   
 sub registerurl {  sub registerurl {
Line 573  ENDLINE Line 575  ENDLINE
 $timesync  $timesync
 $tablestart  $tablestart
 $inlinebuttons  $inlinebuttons
 $newmail  
 $tableend  $tableend
   $newmail
 <script type="text/javascript">  <script type="text/javascript">
 // END LON-CAPA Internal  // END LON-CAPA Internal
 </script>  </script>
Line 793  sub load_remote_msg { Line 795  sub load_remote_msg {
 <p>$link</p>  <p>$link</p>
 ENDREMOTEFORM  ENDREMOTEFORM
 }  }
   
   sub get_menu_name {
       my $hostid = $Apache::lonnet::perlvar{'lonHostID'};
       $hostid =~ s/\W//g;
       return 'LCmenu'.$hostid;
   }
   
 # ================================================================= Reopen menu  # ================================================================= Reopen menu
   
 sub reopenmenu {  sub reopenmenu {
    if (($env{'browser.interface'} eq 'textual') ||     if (($env{'browser.interface'} eq 'textual') ||
        ($env{'environment.remote'} eq 'off')) { return ''; }         ($env{'environment.remote'} eq 'off')) { return ''; }
    my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};     my $menuname = &get_menu_name();
    my $nothing = &Apache::lonhtmlcommon::javascript_nothing();     my $nothing = &Apache::lonhtmlcommon::javascript_nothing();
    return('window.open('.$nothing.',"'.$menuname.'","",false);');     return('window.open('.$nothing.',"'.$menuname.'","",false);');
 }   } 
Line 811  sub open { Line 820  sub open {
         ($env{'environment.remote'} eq 'off')) {           ($env{'environment.remote'} eq 'off')) { 
  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 = &get_menu_name();
           
 #    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
Line 887  sub switch { Line 896  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 941  sub secondlevel { Line 948  sub secondlevel {
 }  }
   
 sub openmenu {  sub openmenu {
     my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};      my $menuname = &get_menu_name();
     if (($env{'browser.interface'} eq 'textual') ||      if (($env{'browser.interface'} eq 'textual') ||
         ($env{'environment.remote'} eq 'off')) { return ''; }          ($env{'environment.remote'} eq 'off')) { return ''; }
     my $nothing = &Apache::lonhtmlcommon::javascript_nothing();      my $nothing = &Apache::lonhtmlcommon::javascript_nothing();
Line 1091  sub rawconfig { Line 1098  sub rawconfig {
 sub close {  sub close {
     if (($env{'browser.interface'} eq 'textual') ||      if (($env{'browser.interface'} eq 'textual') ||
         ($env{'environment.remote'} eq 'off')) { return ''; }          ($env{'environment.remote'} eq 'off')) { return ''; }
     my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};      my $menuname = &get_menu_name();
     return(<<ENDCLOSE);      return(<<ENDCLOSE);
 <script type="text/javascript">  <script type="text/javascript">
 window.status='Accessing Remote Control';  window.status='Accessing Remote Control';

Removed from v.1.224  
changed lines
  Added in v.1.230


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