Diff for /loncom/interface/lonmenu.pm between versions 1.131 and 1.138

version 1.131, 2004/11/30 19:08:18 version 1.138, 2004/12/04 18:53:24
Line 78  sub menubuttons { Line 78  sub menubuttons {
     my $reloadlink='';      my $reloadlink='';
     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'}));
       if ($ENV{'request.state'} eq 'construct') {
           if (($ENV{'request.noversionuri'} eq '') || (!defined($ENV{'request.noversionuri'}))) {
               my $returnurl = $ENV{'request.filename'};
               $returnurl =~ s:^/home/([^/]+)/public_html/(.*)$:/priv/$1/$2:;
               $escurl = &Apache::lonnet::escape($returnurl);
           }
       }
     if ($ENV{'browser.interface'} eq 'textual') {      if ($ENV{'browser.interface'} eq 'textual') {
 # Textual display only  # Textual display only
  my %lt=&initlittle();   my %lt=&initlittle();
Line 259  sub innerregister { Line 266  sub innerregister {
         $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($resurl);
         if ($maptitle) {          if ($maptitle && $maptitle ne 'default.sequence') {
     $newmail.=', '.$maptitle;      $newmail.=', '.$maptitle;
         }          }
         if ($restitle) {          if ($restitle) {
Line 386  s&6&1&list.gif&list[_1]&dir[_1]&golist(' Line 393  s&6&1&list.gif&list[_1]&dir[_1]&golist('
 s&6&2&rtrv.gif&retrieve[_1]&version[_1]&gocstr('/adm/retrieve','/~$uname/$thisdisfn')&Retrieve old version  s&6&2&rtrv.gif&retrieve[_1]&version[_1]&gocstr('/adm/retrieve','/~$uname/$thisdisfn')&Retrieve old version
 s&6&3&pub.gif&publish[_1]&resource[_1]&gocstr('/adm/publish','/~$uname/$thisdisfn')&Publish this resource  s&6&3&pub.gif&publish[_1]&resource[_1]&gocstr('/adm/publish','/~$uname/$thisdisfn')&Publish this resource
 s&7&1&del.gif&delete[_1]&resource[_2]&gocstr('/adm/cfile?action=delete','/~$uname/$thisdisfn')&Delete this resource  s&7&1&del.gif&delete[_1]&resource[_2]&gocstr('/adm/cfile?action=delete','/~$uname/$thisdisfn')&Delete this resource
 s&7&2&prt.gif&prepare[_1]&printout[_1]&gopost('/adm/printout','/~$uname/$thisdisfn')&Prepare a printable document  s&7&2&prt.gif&prepare[_1]&printout[_1]&gocstr('/adm/printout','/~$uname/$thisdisfn')&Prepare a printable document
 ENDMENUITEMS  ENDMENUITEMS
             }              }
         } else {          } elsif (defined($ENV{'request.course.id'})) {
     $menuitems=(<<ENDMENUITEMS);      $menuitems=(<<ENDMENUITEMS);
 c&3&1  c&3&1
 s&2&1&back.gif&backward[_1]&&gopost('/adm/flip','back:'+currentURL)&Go to the previous resource in the course sequence&1  s&2&1&back.gif&backward[_1]&&gopost('/adm/flip','back:'+currentURL)&Go to the previous resource in the course sequence&1
Line 544  ENDDONOTREGTHIS Line 551  ENDDONOTREGTHIS
 }  }
   
 sub loadevents() {  sub loadevents() {
     if ($ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; }      if ($ENV{'request.state'} eq 'construct' ||
    $ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; }
     return 'LONCAPAreg();';      return 'LONCAPAreg();';
 }  }
   
 sub unloadevents() {  sub unloadevents() {
     if ($ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; }      if ($ENV{'request.state'} eq 'construct' ||
    $ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; }
     return 'LONCAPAstale();';      return 'LONCAPAstale();';
 }  }
   
Line 960  NAVCONTROL Line 969  NAVCONTROL
 }  }
   
 sub utilityfunctions {  sub utilityfunctions {
       my $caller = shift;
     unless (($ENV{'browser.interface'} eq 'textual')  ||      unless (($ENV{'browser.interface'} eq 'textual')  ||
         ($ENV{'environment.remote'} eq 'off')) { return ''; }          ($ENV{'environment.remote'} eq 'off') || ($caller eq '/adm/menu')) { return ''; }
     my $currenturl=&Apache::lonenc::check_encrypt($ENV{'request.noversionuri'});      my $currenturl=&Apache::lonenc::check_encrypt($ENV{'request.noversionuri'});
           
     my $currentsymb=&Apache::lonenc::check_encrypt($ENV{'request.symb'});      my $currentsymb=&Apache::lonenc::check_encrypt($ENV{'request.symb'});
Line 1010  function gocstr(url,filename) { Line 1020  function gocstr(url,filename) {
         this.document.cstrdelete.submit();          this.document.cstrdelete.submit();
         return;          return;
     }      }
       if (url == '/adm/printout') {
           this.document.cstrprint.postdata.value = filename
           this.document.cstrprint.curseed.value = 0;
           this.document.cstrprint.problemtype.value = 0;
           if (this.document.lonhomework) {
               if ((this.document.lonhomework.rndseed) && (this.document.lonhomework.rndseed.value != null) && (this.document.lonhomework.rndseed.value != '')) {
                   this.document.cstrprint.curseed.value = this.document.lonhomework.rndseed.value
               }
               if (this.document.lonhomework.problemtype) {
                   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();
           return;
       }
     if (url !='') {      if (url !='') {
         this.document.constspace.filename.value = filename;          this.document.constspace.filename.value = filename;
         this.document.constspace.action = url;          this.document.constspace.action = url;
Line 1058  sub constspaceform { Line 1089  sub constspaceform {
 <input type="hidden" name="action" value="delete" />   <input type="hidden" name="action" value="delete" /> 
 <input type="hidden" name="filename" value="" />  <input type="hidden" name="filename" value="" />
 </form>  </form>
   <form name="cstrprint" action="/adm/printout" target="_parent" method="post">
   <input type="hidden" name="postdata" value="" />
   <input type="hidden" name="curseed" value="" />
   <input type="hidden" name="problemtype" value="" />
   </form>
   
 ENDCONSTSPACEFORM  ENDCONSTSPACEFORM
 }  }
   
Line 1102  sub handler { Line 1139  sub handler {
     $pgbg=&Apache::loncommon::designparm($function.'.pgbg',$domain);      $pgbg=&Apache::loncommon::designparm($function.'.pgbg',$domain);
     $tabbg=&Apache::loncommon::designparm($function.'.tabbg',$domain);      $tabbg=&Apache::loncommon::designparm($function.'.tabbg',$domain);
     $font=&Apache::loncommon::designparm($function.'.font',$domain);      $font=&Apache::loncommon::designparm($function.'.font',$domain);
 # ---- Print the screen, pretent to be in text mode to generate text-based menu      my $script_tag;
       if ($ENV{'environment.remote'} eq 'on') {
           my $utility=&utilityfunctions('/adm/menu');
           $script_tag=(<<ENDSCRIPT);
   <script type="text/javascript">
   $utility
   </script>
   ENDSCRIPT
       }
   # ---- Print the screen, pretend to be in text mode to generate text-based menu
     unless ($ENV{'browser.interface'} eq 'textual') {      unless ($ENV{'browser.interface'} eq 'textual') {
  $ENV{'browser.interface'}='faketextual';   $ENV{'browser.interface'}='faketextual';
  $ENV{'environment.remote'}='off';   $ENV{'environment.remote'}='off';
Line 1110  sub handler { Line 1156  sub handler {
     $r->print(<<ENDHEADER);      $r->print(<<ENDHEADER);
 <html><head>  <html><head>
 <title>LON-CAPA Main Menu</title>  <title>LON-CAPA Main Menu</title>
   $script_tag
 </head>  </head>
 $bodytag  $bodytag
 ENDHEADER  ENDHEADER

Removed from v.1.131  
changed lines
  Added in v.1.138


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