Diff for /loncom/interface/lonmenu.pm between versions 1.152 and 1.164

version 1.152, 2005/04/07 06:56:23 version 1.164, 2005/12/01 19:00:46
Line 78  sub menubuttons { Line 78  sub menubuttons {
     ['inhibitmenu']);      ['inhibitmenu']);
     if (($env{'form.inhibitmenu'} eq 'yes') ||      if (($env{'form.inhibitmenu'} eq 'yes') ||
         ($ENV{'REQUEST_URI'} eq '/adm/logout')) { return ''; }          ($ENV{'REQUEST_URI'} eq '/adm/logout')) { return ''; }
       my %lt=&initlittle();
     my $navmaps='';      my $navmaps='';
     my $reloadlink='';      my $reloadlink='';
     my $docs='';      my $docs='';
     my $escurl=&Apache::lonnet::escape(&Apache::lonenc::check_encrypt($env{'request.noversionuri'}));      my $escurl=&Apache::lonnet::escape(&Apache::lonenc::check_encrypt($env{'request.noversionuri'}));
     my $escsymb=&Apache::lonnet::escape(&Apache::lonenc::check_encrypt($env{'request.symb'}));      my $escsymb=&Apache::lonnet::escape(&Apache::lonenc::check_encrypt($env{'request.symb'}));
       my $face= 'face="Arial,Helvetica,sans-serif"';
     if ($env{'request.state'} eq 'construct') {      if ($env{'request.state'} eq 'construct') {
         if (($env{'request.noversionuri'} eq '') || (!defined($env{'request.noversionuri'}))) {          if (($env{'request.noversionuri'} eq '') || (!defined($env{'request.noversionuri'}))) {
             my $returnurl = $env{'request.filename'};              my $returnurl = $env{'request.filename'};
Line 93  sub menubuttons { Line 94  sub menubuttons {
     }      }
     if ($env{'browser.interface'} eq 'textual') {      if ($env{'browser.interface'} eq 'textual') {
 # Textual display only  # Textual display only
  my %lt=&initlittle();  
         $pgbg='#FFFFFF';          $pgbg='#FFFFFF';
         $tabbg='#FFFFFF';          $tabbg='#FFFFFF';
  $font='#000000';   $font='#000000';
Line 106  ENDNAV Line 106  ENDNAV
          ($env{'request.noversionuri'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) {           ($env{'request.noversionuri'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) {
                 my $escreload=&Apache::lonnet::escape('return:');                  my $escreload=&Apache::lonnet::escape('return:');
                 $reloadlink=(<<ENDRELOAD);                  $reloadlink=(<<ENDRELOAD);
 <a href="/adm/flip?postdata=$escreload" target="_top"><font color="$font">$lt{'ret'}</font></a>  <a href="/adm/flip?postdata=$escreload" target="_top"><font $face color="$font">$lt{'ret'}</font></a>
 ENDRELOAD  ENDRELOAD
             }              }
     if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {      if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
                $docs=(<<ENDDOCS);                 $docs=(<<ENDDOCS);
 <a href="/adm/coursedocs" target="_top"><font color="$font">$lt{'docs'}</font></a>  <a href="/adm/coursedocs" target="_top"><font $face color="$font">$lt{'docs'}</font></a>
 ENDDOCS  ENDDOCS
             }              }
  }   }
Line 124  $utility Line 124  $utility
 </script>  </script>
 <a href="/adm/menu" target="_top">$lt{'main'}</a>  <a href="/adm/menu" target="_top">$lt{'main'}</a>
 $reloadlink $navmaps $docs  $reloadlink $navmaps $docs
 <a href="/adm/roles" target="_top"><font color="$font">$lt{'roles'}</font></a>  <a href="/adm/roles" target="_top"><font $face color="$font">$lt{'roles'}</font></a>
 <a href="/adm/logout" target="_top"><font color="$font">$lt{'exit'}</font></a>  <a href="/adm/logout" target="_top"><font $face color="$font">$lt{'exit'}</font></a>
 <br />  <br />
 <script type="text/javascript">  <script type="text/javascript">
 // END LON-CAPA Internal  // END LON-CAPA Internal
Line 157  ENDMAINMENU Line 157  ENDMAINMENU
         my $alink=&Apache::loncommon::designparm($function.'.alink',$domain);          my $alink=&Apache::loncommon::designparm($function.'.alink',$domain);
         my $vlink=&Apache::loncommon::designparm($function.'.vlink',$domain);          my $vlink=&Apache::loncommon::designparm($function.'.vlink',$domain);
         my $sidebg=&Apache::loncommon::designparm($function.'.sidebg',$domain);          my $sidebg=&Apache::loncommon::designparm($function.'.sidebg',$domain);
    if ($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public') {
       my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif");
       return (<<ENDINLINEMENU);
   <font face="Arial,Helvetica,sans-serif">
      <table bgcolor="$pgbg" width="100%" border="0" cellpadding="1" cellspacing="1">
       <tr>
         <td bgcolor="$tabbg">
           <a href="/adm/logout" target="_top"><font color="$font">$lt{'exit'}</font></a>
        </td>
        <td align="right" bgcolor="$tabbg">
          <img align="right" src="$logo" alt="Logo" />
          <b>LON-CAPA</b>&nbsp;
        </td>
      </tr>
     </table>
   </font>
   ENDINLINEMENU
           }
 # Do we have a NAV link?  # Do we have a NAV link?
         if ($env{'request.course.id'}) {          if ($env{'request.course.id'}) {
     my $link='/adm/navmaps?postdata='.$escurl.'&amp;postsymb='.      my $link='/adm/navmaps?postdata='.$escurl.'&amp;postsymb='.
Line 166  ENDMAINMENU Line 184  ENDMAINMENU
     }      }
     $navmaps=(<<ENDNAV);      $navmaps=(<<ENDNAV);
 <td bgcolor="$tabbg">  <td bgcolor="$tabbg">
 <a href="$link"><font color="$font">$lt{'nav'}</font></a></td>  <a href="$link" target="_top"><font $face color="$font">$lt{'nav'}</font></a></td>
 ENDNAV  ENDNAV
     if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {      if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
  $docs=(<<ENDDOCS);   $docs=(<<ENDDOCS);
 <td bgcolor="$tabbg">  <td bgcolor="$tabbg">
 <a href="/adm/coursedocs"><font color="$font">$lt{'docs'}</font></a></td>  <a href="/adm/coursedocs" target="_top"><font $face color="$font">$lt{'docs'}</font></a></td>
 ENDDOCS  ENDDOCS
             }              }
     if (      if (
Line 187  ENDDOCS Line 205  ENDDOCS
                 my $escreload=&Apache::lonnet::escape('return:');                  my $escreload=&Apache::lonnet::escape('return:');
                 $reloadlink=(<<ENDRELOAD);                  $reloadlink=(<<ENDRELOAD);
 <td bgcolor="$tabbg">  <td bgcolor="$tabbg">
 <a href="/adm/flip?postdata=$escreload" target="_top"><font color="$font">$lt{'ret'}</font></a></td>  <a href="/adm/flip?postdata=$escreload" target="_top"><font $face color="$font">$lt{'ret'}</font></a></td>
 ENDRELOAD  ENDRELOAD
             }              }
         }          }
    if (($env{'request.state'} eq 'construct') && ($env{'request.course.id'})) {
       my $escreload=&Apache::lonnet::escape('return:');
       $reloadlink=(<<ENDCRELOAD);
   <td bgcolor="$tabbg">
   <a href="/adm/flip?postdata=$escreload" target="_top"><font $face color="$font">$lt{'ret'}</font></a></td>
   ENDCRELOAD
           }
         my $reg='';          my $reg='';
         if ($registration) {          if ($registration) {
            $reg=&innerregister($forcereg,$target,$titletable);             $reg=&innerregister($forcereg,$target,$titletable);
Line 198  ENDRELOAD Line 223  ENDRELOAD
         my $form=&serverform();          my $form=&serverform();
  my $utility=&utilityfunctions();   my $utility=&utilityfunctions();
  my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif");   my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif");
   
  return (<<ENDINLINEMENU);   return (<<ENDINLINEMENU);
 <script type="text/javascript">  <script type="text/javascript">
 // BEGIN LON-CAPA Internal  // BEGIN LON-CAPA Internal
Line 205  ENDRELOAD Line 231  ENDRELOAD
 $utility  $utility
 // ]]>  // ]]>
 </script>  </script>
 <font face="Arial,Helvetica,sans-serif"><table bgcolor="$pgbg" width="100%" border="0" cellpadding="1" cellspacing="1">  <table bgcolor="$pgbg" width="100%" border="0" cellpadding="1" cellspacing="1">
 <tr>  <tr>
 <td bgcolor="$tabbg">  <td bgcolor="$tabbg">
 <a href="/adm/menu" target="_top"><font color="$font">$lt{'main'}</font></a>  <a href="/adm/menu" target="_top"><font $face color="$font">$lt{'main'}</font></a>
 </td>  </td>
 $reloadlink  $reloadlink
 $navmaps  $navmaps
 $docs  $docs
 <td bgcolor="$tabbg">  <td bgcolor="$tabbg">
 <a href="/adm/remote?action=launch&amp;url=$escurl" target="_top">  <a href="/adm/remote?action=launch&amp;url=$escurl" target="_top">
 <font color="$font">$lt{'launch'}</font></a></td>  <font $face color="$font">$lt{'launch'}</font></a></td>
 <td bgcolor="$tabbg">  <td bgcolor="$tabbg">
 <a href="/adm/roles" target="_top"><font color="$font">$lt{'roles'}</font></a>  <a href="/adm/roles" target="_top"><font $face color="$font">$lt{'roles'}</font></a>
 </td>  </td>
 <td bgcolor="$tabbg">  <td bgcolor="$tabbg">
 <a href="/adm/logout" target="_top"><font color="$font">$lt{'exit'}</font></a>  <a href="/adm/logout" target="_top"><font $face color="$font">$lt{'exit'}</font></a>
 </td>  </td>
 <td bgcolor="$tabbg">  <td bgcolor="$tabbg">
 <img align="right" src="$logo" />  <img align="right" src="$logo" alt="Logo" />
 <b>LON-CAPA</b></td>  <b>LON-CAPA</b></td>
 $form  $form
 </tr>  </tr>
 </table>  </table>
 </font>  
 <script type="text/javascript">  <script type="text/javascript">
 // END LON-CAPA Internal  // END LON-CAPA Internal
 </script>  </script>
Line 301  sub innerregister { Line 326  sub innerregister {
   
     my $newmail='';      my $newmail='';
     if ($noremote) {      if ($noremote) {
  $newmail='<font face="Arial,Helvetica,sans-serif"><table bgcolor="'.$pgbg.'" border="0" cellspacing="1" cellpadding="1" width="100%"><tr><td bgcolor="'.$tabbg.'">';   $newmail='<table bgcolor="'.$pgbg.'" border="0" cellspacing="1" cellpadding="1" width="100%"><tr><td bgcolor="'.$tabbg.'"><font face="Arial,Helvetica,sans-serif">';
     }      }
     if (($textual) && ($env{'request.symb'}) && ($env{'request.course.id'})) {      if (($textual) && ($env{'request.symb'}) && ($env{'request.course.id'})) {
  my ($mapurl,$rid,$resurl)=&Apache::lonnet::decode_symb($env{'request.symb'});   my ($mapurl,$rid,$resurl)=
       &Apache::lonnet::decode_symb(&Apache::lonnet::symbread());
         $newmail.=$env{'course.'.$env{'request.course.id'}.'.description'};          $newmail.=$env{'course.'.$env{'request.course.id'}.'.description'};
         my $maptitle=&Apache::lonnet::gettitle($mapurl);          my $maptitle=&Apache::lonnet::gettitle($mapurl);
  my $restitle=&Apache::lonnet::gettitle($resurl);   my $restitle=&Apache::lonnet::gettitle(&Apache::lonnet::symbread());
         if ($maptitle && $maptitle ne 'default.sequence') {          if ($maptitle && $maptitle ne 'default.sequence') {
     $newmail.=', '.$maptitle;      $newmail.=', '.$maptitle;
         }          }
Line 325  sub innerregister { Line 351  sub innerregister {
         $newmail = $titletable;          $newmail = $titletable;
     } else {      } else {
  if ($noremote) {   if ($noremote) {
     $newmail.='</td></tr></table></font>';      $newmail.='</font></td></tr></table>';
  }   }
     }      }
     my $timesync=($textual?'':'swmenu.syncclock(1000*'.time.');');      my $timesync=($textual?'':'swmenu.syncclock(1000*'.time.');');
Line 343  sub innerregister { Line 369  sub innerregister {
   
         my $hwkadd='';          my $hwkadd='';
         if ($env{'request.symb'} ne '' &&          if ($env{'request.symb'} ne '' &&
     $env{'request.filename'}=~/\.(problem|exam|quiz|assess|survey|form)$/) {      $env{'request.filename'}=~/\.(problem|exam|quiz|assess|survey|form|task)$/) {
     if (&Apache::lonnet::allowed('vgr',$crs)) {  
  $hwkadd.=&switch('','',7,1,'subm.gif','view sub-[_1]','missions[_1]',  
                        "gocmd('/adm/grades','submission')",  
        'View user submissions for this assessment resource');  
             }  
     if (&Apache::lonnet::allowed('mgr',$crs)) {      if (&Apache::lonnet::allowed('mgr',$crs)) {
  $hwkadd.=&switch('','',7,2,'pgrd.gif','problem[_1]','grades[_3]',   $hwkadd.=&switch('','',7,2,'pgrd.gif','problem[_1]','grades[_3]',
                        "gocmd('/adm/grades','gradingmenu')",                         "gocmd('/adm/grades','gradingmenu')",
                        'Modify user grades for this assessment resource');                         'Modify user grades for this assessment resource');
               } elsif (&Apache::lonnet::allowed('vgr',$crs)) {
    $hwkadd.=&switch('','',7,2,'subm.gif','view sub-[_1]','missions[_1]',
                          "gocmd('/adm/grades','submission')",
          'View user submissions for this assessment resource');
             }              }
  }   }
  if ($env{'request.symb'} ne '' &&   if ($env{'request.symb'} ne '' &&
Line 418  sub innerregister { Line 443  sub innerregister {
                     ('','',6,1,'cstr.gif','edit[_1]','resource[_2]',                      ('','',6,1,'cstr.gif','edit[_1]','resource[_2]',
                      "go('".$cfile."');","Edit this resource");                       "go('".$cfile."');","Edit this resource");
             } elsif ($editbutton eq '') {              } elsif ($editbutton eq '') {
                 $editbutton=&clear(6,1);                  $editbutton=&switch('','',6,1,'port.gif',
       'port-[_1]','folio[_1]',
       "go('/adm/portfolio');",
       "Enter my portfolio space");
             }              }
         }          }
         ###          ###
Line 544  var swmenu=null; Line 572  var swmenu=null;
              swmenu.switchbutton               swmenu.switchbutton
              (3,1,'reload.gif','return','location','go(reloadURL)','Return to the last known location in the course sequence');               (3,1,'reload.gif','return','location','go(reloadURL)','Return to the last known location in the course sequence');
   }    }
           swmenu.clearbut(7,1);  
           swmenu.clearbut(7,2);            swmenu.clearbut(7,2);
           swmenu.clearbut(7,3);            swmenu.clearbut(7,3);
           swmenu.menucltim=swmenu.setTimeout(            swmenu.menucltim=swmenu.setTimeout(
Line 1081  function gocstr(url,filename) { Line 1108  function gocstr(url,filename) {
                 this.document.cstrprint.curseed.value = this.document.lonhomework.rndseed.value                  this.document.cstrprint.curseed.value = this.document.lonhomework.rndseed.value
             }              }
             if (this.document.lonhomework.problemtype) {              if (this.document.lonhomework.problemtype) {
                 for (var i=0; i<this.document.lonhomework.problemtype.options.length; i++) {   if (this.document.lonhomework.problemtype.value) {
                     if (this.document.lonhomework.problemtype.options[i].selected) {      this.document.cstrprint.problemtype.value = 
                         if (this.document.lonhomework.problemtype.options[i].value != null && this.document.lonhomework.problemtype.options[i].value != '') {    this.document.lonhomework.problemtype.value;
                             this.document.cstrprint.problemtype.value = this.document.lonhomework.problemtype.options[i].value   } else if (this.document.lonhomework.problemtype.options) {
                         }      for (var i=0; i<this.document.lonhomework.problemtype.options.length; i++) {
                     }   if (this.document.lonhomework.problemtype.options[i].selected) {
                 }      if (this.document.lonhomework.problemtype.options[i].value != null && this.document.lonhomework.problemtype.options[i].value != '') { 
             }   this.document.cstrprint.problemtype.value = this.document.lonhomework.problemtype.options[i].value
         }   }
    }
       }
    }
       }
    }
         this.document.cstrprint.submit();          this.document.cstrprint.submit();
         return;          return;
     }      }
Line 1122  ENDUTILITY Line 1154  ENDUTILITY
   
 sub serverform {  sub serverform {
     return(<<ENDSERVERFORM);      return(<<ENDSERVERFORM);
   
 <form name="server" action="/adm/logout" method="post" target="_top">  <form name="server" action="/adm/logout" method="post" target="_top">
 <input type="hidden" name="postdata" value="none" />  <input type="hidden" name="postdata" value="none" />
 <input type="hidden" name="command" value="none" />  <input type="hidden" name="command" value="none" />
Line 1166  sub get_nav_status { Line 1197  sub get_nav_status {
   
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
       &Apache::loncommon::no_cache($r);
     &Apache::loncommon::content_type($r,'text/html');      &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;      $r->send_http_header;
     return OK if $r->header_only;      return OK if $r->header_only;

Removed from v.1.152  
changed lines
  Added in v.1.164


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