Diff for /loncom/interface/lonmenu.pm between versions 1.214 and 1.225

version 1.214, 2007/04/13 20:22:15 version 1.225, 2007/08/30 22:35:41
Line 61  sub initlittle { Line 61  sub initlittle {
        'main' => 'Main Menu',         'main' => 'Main Menu',
                                        'roles' => ($env{'user.adv'}?                                         'roles' => ($env{'user.adv'}?
                                                     'Roles':'Courses'),                                                      'Roles':'Courses'),
                                        'docs' => 'Course Documents',                                         'docs' => 'Edit Course',
                                        'exit' => 'Exit',                                         'exit' => 'Exit',
                                        'login' => 'Log In',                                         'login' => 'Log In',
        'launch' => 'Launch Remote Control',         'launch' => 'Launch Remote Control',
Line 486  s&8&3&prt.gif&prepare[_1]&printout[_1]&g Line 486  s&8&3&prt.gif&prepare[_1]&printout[_1]&g
 s&9&1&sbkm.gif&set[_1]&bookmark[_2]&set_bookmark()&Set a bookmark for this resource&&1  s&9&1&sbkm.gif&set[_1]&bookmark[_2]&set_bookmark()&Set a bookmark for this resource&&1
 s&9&3&anot.gif&anno-[_1]&tations[_1]&annotate()&Make notes and annotations about this resource&&1  s&9&3&anot.gif&anno-[_1]&tations[_1]&annotate()&Make notes and annotations about this resource&&1
 ENDMENUITEMS  ENDMENUITEMS
   
             unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme)(\?|$)/) {              unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme)(\?|$)/) {
         $menuitems.=(<<ENDREALRES);   if (!$env{'request.enc'}) {
       $menuitems.=(<<ENDREALRES);
 s&6&3&catalog.gif&catalog[_1]&info[_1]&catalog_info()&Show catalog information  s&6&3&catalog.gif&catalog[_1]&info[_1]&catalog_info()&Show catalog information
   ENDREALRES
                   }
           $menuitems.=(<<ENDREALRES);
 s&8&1&eval.gif&evaluate[_1]&this[_1]&gopost('/adm/evaluate',currentURL,1)&Provide my evaluation of this resource  s&8&1&eval.gif&evaluate[_1]&this[_1]&gopost('/adm/evaluate',currentURL,1)&Provide my evaluation of this resource
 s&8&2&fdbk.gif&feedback[_1]&discuss[_1]&gopost('/adm/feedback',currentURL,1)&Provide feedback messages or contribute to the course discussion about this resource  s&8&2&fdbk.gif&feedback[_1]&discuss[_1]&gopost('/adm/feedback',currentURL,1)&Provide feedback messages or contribute to the course discussion about this resource
 ENDREALRES  ENDREALRES
Line 502  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 515  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 {
     $inlinebuttons=(<<ENDINLINE);                      if ($env{'environment.icons'} eq 'iconsonly') {
                           $inlinebuttons=(<<ENDARROWSINLINE);
   <tr><td>
   $inlineremote[21] $inlineremote[23]
   ENDARROWSINLINE
                           if (&hidden_button_check() ne 'yes') {
                               $inlinebuttons .= (<<ENDINLINEICONS);
   $inlineremote[61] $inlineremote[63]
   $inlineremote[71] $inlineremote[72] $inlineremote[73]
   $inlineremote[81] $inlineremote[82] $inlineremote[83]
   $inlineremote[91] $inlineremote[92] $inlineremote[93]</td></tr>
   ENDINLINEICONS
                           }
                       } else {
    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
   $newmail
 $tableend  $tableend
 <script type="text/javascript">  <script type="text/javascript">
 // END LON-CAPA Internal  // END LON-CAPA Internal
Line 775  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 852  sub switch { Line 890  sub switch {
        my $lonhttpdPort=$Apache::lonnet::perlvar{'lonhttpdPort'};         my $lonhttpdPort=$Apache::lonnet::perlvar{'lonhttpdPort'};
        if (!defined($lonhttpdPort)) { $lonhttpdPort='8080'; }         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 866  sub switch { Line 904  sub switch {
        $inlineremote[$idx]="\n<tr>".         $inlineremote[$idx]="\n<tr>".
    '<td class="LC_menubuttons_img" align="left">'.     '<td class="LC_menubuttons_img" align="left">'.
    '<a href="javascript:'.$act.';">'.$pic.'</a></td>     '<a href="javascript:'.$act.';">'.$pic.'</a></td>
                     <td class="LC_menubuttons_text" align="left">'.$text.'</td>';                      <td class="LC_menubuttons_text" align="left"><a class="LC_menubuttons_link" href="javascript:'.$act.';"><span class="LC_menubuttons_inline_text">'.$text.'</span></a></td>';
    } else {     } else {
        $inlineremote[$idx]="\n<tr>".         $inlineremote[$idx]="\n<tr>".
    '<td class="LC_menubuttons_img" align="left">'.     '<td class="LC_menubuttons_img" align="left">'.
    '<a href="javascript:'.$act.';">'.$pic.     '<a href="javascript:'.$act.';">'.$pic.
    '</a></td><td class="LC_menubuttons_text" colspan="3">'.     '</a></td><td class="LC_menubuttons_text" colspan="3">'.
    $desc.'</td></tr>';     '<a class="LC_menubuttons_link" href="javascript:'.$act.';"><span class="LC_menubuttons_inline_text">'.$desc.'</span></a></td></tr>';
    }     }
        } else {         } else {
 # Inline Menu  # Inline Menu
    $inlineremote[$idx]=             if ($env{'environment.icons'} eq 'iconsonly') {
    '<a href="javascript:'.$act.';">'.$pic.                $inlineremote[$idx]='<a title="'.$desc.'" href="javascript:'.$act.';">'.$pic.'</a>';
    '</a><span class="LC_menubuttons_inline_text">'.$desc.'</span>';             } else {
         $inlineremote[$idx]=
      '<a class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic.
      '<span class="LC_menubuttons_inline_text">'.$desc.'</span></a>';
              }
        }         }
    }     }
     return '';      return '';
Line 1233  function annotate() { Line 1275  function annotate() {
    '$start_page_annotate'     '$start_page_annotate'
   +"<form name='goannotate' target='Annotator' method='post' "    +"<form name='goannotate' target='Annotator' method='post' "
   +"action='/adm/annotations'>"    +"action='/adm/annotations'>"
   +"<input type='hidden' name='urlnew' value='"+currentURL+"' />"    +"<input type='hidden' name='symbnew' value='"+currentSymb+"' />"
   +"<\\/form>"    +"<\\/form>"
   +'$end_page_annotate');    +'$end_page_annotate');
    annotator.document.close();     annotator.document.close();
Line 1317  sub convert_menu_function { Line 1359  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.214  
changed lines
  Added in v.1.225


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