Diff for /loncom/interface/lonmenu.pm between versions 1.315.2.5 and 1.315.2.12

version 1.315.2.5, 2010/12/25 00:32:05 version 1.315.2.12, 2011/06/16 22:55:17
Line 205  sub prep_menuitem { Line 205  sub prep_menuitem {
     } else {             # textual Link      } else {             # textual Link
         $link = &mt($$menuitem[3]);          $link = &mt($$menuitem[3]);
     }      }
     if($$menuitem[4] eq 'newmsg'){   #special style for New Messages      return '<li><a'
         return '<li><a href="'.$$menuitem[0].'"><span class="LC_new_message">'.$link.'</span></a></li>';             # highlighting for new messages
     }             . ( $$menuitem[4] eq 'newmsg' ? ' class="LC_new_message"' : '')
     return '<li><a href="'.$$menuitem[0].'">'.$link.'</a></li>';             . qq| href="$$menuitem[0]" target="_top">$link</a></li>|;
 }  }
   
 # primary_menu() evaluates @primary_menu and returns XHTML for the menu  # primary_menu() evaluates @primary_menu and returns XHTML for the menu
Line 258  sub primary_menu { Line 258  sub primary_menu {
                 $menu .= '<li>'.&Apache::loncommon::top_nav_help('Help').'</li>';                  $menu .= '<li>'.&Apache::loncommon::top_nav_help('Help').'</li>';
             }              }
         } else {          } else {
             my @items = @{$menuitem};              $menu .= &prep_menuitem($menuitem);
             $items[0] = 'javascript:'.$menuitem->[0].';';  
             $menu .= &prep_menuitem(\@items);  
         }          }
     }      }
   
Line 455  sub innerregister { Line 453  sub innerregister {
         $newmail= 'swmenu.setstatus("you have","messages");';          $newmail= 'swmenu.setstatus("you have","messages");';
     }       } 
   
     my ($breadcrumb,$separator);      my ($breadcrumb,$separator,$resurl);
     if ($noremote      if ($noremote
      && ($env{'request.symb'})        && ($env{'request.symb'}) 
      && ($env{'request.course.id'})) {       && ($env{'request.course.id'})) {
   
         my ($mapurl,$rid,$resurl) = &Apache::lonnet::decode_symb(&Apache::lonnet::symbread());          (my $mapurl, my $rid,$resurl) = &Apache::lonnet::decode_symb(&Apache::lonnet::symbread());
         my $coursetitle = $env{'course.'.$env{'request.course.id'}.'.description'};          my $coursetitle = $env{'course.'.$env{'request.course.id'}.'.description'};
   
         my $maptitle = &Apache::lonnet::gettitle($mapurl);          my $maptitle = &Apache::lonnet::gettitle($mapurl);
Line 474  sub innerregister { Line 472  sub innerregister {
         my @crumbs;          my @crumbs;
         unless (($forcereg) && ($env{'request.noversionuri'} eq '/adm/navmaps')          unless (($forcereg) && ($env{'request.noversionuri'} eq '/adm/navmaps')
                 && ($mapurl eq $env{'course.'.$env{'request.course.id'}.'.url'})) {                  && ($mapurl eq $env{'course.'.$env{'request.course.id'}.'.url'})) {
               my $navhref = "javascript:gopost('/adm/navmaps','')";
               if ($env{'environment.remotenavmap'} eq 'on') {
                    $navhref = "javascript:gonav('/adm/navmaps');";
               }
             @crumbs = ({text  => $contentstext,              @crumbs = ({text  => $contentstext,
                         href  => "Javascript:gopost('/adm/navmaps','')"});                          href  => $navhref});
         }          }
         if ($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'}) {           if ($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'}) { 
             push(@crumbs, {text  => '...',              push(@crumbs, {text  => '...',
Line 668  sub innerregister { Line 670  sub innerregister {
                 }                  }
             }              }
         }          }
           if ($env{'request.course.id'}) {
               if ($resurl eq "public/$cdom/$cnum/syllabus") {
                   if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ /\w/) {
                       if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
                           $editbutton=&switch('','',6,1,'pcstr.png','Edit',
                                               'resource[_2]',
                                               "go('/adm/courseprefs?phase=display&actions=courseinfo')",
                                               'Edit this resource');
                       }
                   }
               }
           }
         ###          ###
         ###          ###
 # Prepare the rest of the buttons  # Prepare the rest of the buttons
Line 710  ENDMENUITEMS Line 724  ENDMENUITEMS
 # We are in a course and looking at a registred URL  # We are in a course and looking at a registred URL
 # Should probably be in mydesk.tab  # Should probably be in mydesk.tab
 #  #
   
               my %icon_text;
               if ($noremote) {
                   %icon_text = &Apache::lonlocal::texthash (
                                  annotate => 'Notes',
                                  bookmark => 'Bookmark',
                                  catalog  => 'Info',
                                  evaluate => 'Evaluate',
                                  feedback => 'Communicate',
                                  printout => 'Print',
                                );
               }
     $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 717  s&2&3&forw.gif&forward[_1]&&gopost('/adm Line 743  s&2&3&forw.gif&forward[_1]&&gopost('/adm
 c&6&3  c&6&3
 c&8&1  c&8&1
 c&8&2  c&8&2
 s&8&3&prt.gif&prepare[_1]&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document  s&8&3&prt.gif&prepare[_1]&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document&&&$icon_text{'printout'}
 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&$icon_text{'bookmark'}
 ENDMENUITEMS  ENDMENUITEMS
   
 my $currentURL = &Apache::loncommon::get_symb();  my $currentURL = &Apache::loncommon::get_symb();
Line 731  if(length($annotation) > 0){ Line 757  if(length($annotation) > 0){
  $menuitems.="anot.gif";   $menuitems.="anot.gif";
 }  }
 $menuitems.="&anno-[_1]&tations[_1]&annotate()&";  $menuitems.="&anno-[_1]&tations[_1]&annotate()&";
 $menuitems.="Make notes and annotations about this resource&&1\n";  $menuitems.="Make notes and annotations about this resource&&1&$icon_text{'annotate'}\n";
   
             unless ($noremote) {               unless ($noremote) { 
                 my $showreqcrs = &check_for_rcrs();                  my $showreqcrs = &check_for_rcrs();
Line 742  $menuitems.="Make notes and annotations Line 768  $menuitems.="Make notes and annotations
             }              }
             unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|viewclasslist|portfolio)(\?|$)/) {              unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|viewclasslist|portfolio)(\?|$)/) {
  if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/})) {   if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/})) {
                       my $tail;
                       unless ($env{'request.state'} eq 'construct') {
                           $tail = '&&&'.$icon_text{'catalog'};
                       }
     $menuitems.=(<<ENDREALRES);      $menuitems.=(<<ENDREALRES);
 s&6&3&catalog.gif&catalog[_2]&info[_1]&catalog_info()&Show Metadata  s&6&3&catalog.gif&catalog[_2]&info[_1]&catalog_info()&Show Metadata$tail
 ENDREALRES  ENDREALRES
                 }                  }
         $menuitems.=(<<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&&&$icon_text{'evaluate'}
 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&&&$icon_text{'feedback'}
 ENDREALRES  ENDREALRES
     }      }
         }          }
  if ($env{'request.uri'} =~ /^\/res/) {   if ($env{'request.uri'} =~ /^\/res/) {
               my $icontext = &mt('Print');
     $menuitems .= (<<ENDMENUITEMS);      $menuitems .= (<<ENDMENUITEMS);
 s&8&3&prt.gif&prepare[_1]&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document  s&8&3&prt.gif&prepare[_1]&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document&&&$icontext
 ENDMENUITEMS  ENDMENUITEMS
  }   }
         my $buttons='';          my $buttons='';
Line 794  ENDMENUITEMS Line 825  ENDMENUITEMS
             #publish button in construction space              #publish button in construction space
             if ($env{'request.state'} eq 'construct'){              if ($env{'request.state'} eq 'construct'){
                 Apache::lonhtmlcommon::add_breadcrumb_tool(                  Apache::lonhtmlcommon::add_breadcrumb_tool(
                      'advtools', @inlineremote[63]);                       'advtools', $inlineremote[63]);
             }else{              }else{
                 Apache::lonhtmlcommon::add_breadcrumb_tool(                  Apache::lonhtmlcommon::add_breadcrumb_tool(
                      'tools', @inlineremote[63]);                       'tools', $inlineremote[63]);
             }              }
   
             unless ($env{'request.noversionuri'}=~ m{^/adm/(navmaps|viewclasslist)(\?|$)}) {              unless ($env{'request.noversionuri'}=~ m{^/adm/(navmaps|viewclasslist)(\?|$)}) {
Line 1180  sub clear { Line 1211  sub clear {
 # The javascript is usually similar to "go('/adm/roles')" or "cstrgo(..)".  # The javascript is usually similar to "go('/adm/roles')" or "cstrgo(..)".
   
 sub switch {  sub switch {
     my ($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat,$nobreak)=@_;      my ($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat,$nobreak,$inlinetools)=@_;
     $act=~s/\$uname/$uname/g;      $act=~s/\$uname/$uname/g;
     $act=~s/\$udom/$udom/g;      $act=~s/\$udom/$udom/g;
     $top=&mt($top);      $top=&mt($top);
Line 1190  sub switch { Line 1221  sub switch {
        $img=&mt($img);         $img=&mt($img);
     }      }
     my $idx=10*$row+$col;      my $idx=10*$row+$col;
     $category_members{$cat}.=':'.$idx;      if ($cat ne '') {
           $category_members{$cat}.=':'.$idx;
       }
   
     unless ($env{'environment.remote'} eq 'off') {      unless ($env{'environment.remote'} eq 'off') {
        if (($row<1) || ($row>13)) { return ''; }         if (($row<1) || ($row>13)) { return ''; }
Line 1234  sub switch { Line 1267  sub switch {
            if ($env{'environment.icons'} eq 'iconsonly') {             if ($env{'environment.icons'} eq 'iconsonly') {
               $inlineremote[$idx]='<a title="'.$desc.'" href="javascript:'.$act.';">'.$pic.'</a>';                $inlineremote[$idx]='<a title="'.$desc.'" href="javascript:'.$act.';">'.$pic.'</a>';
            } else {             } else {
                 my $icon_text = $desc;
                 if ($inlinetools) {
                     $icon_text = $inlinetools.'&nbsp;';
                 }
       $inlineremote[$idx]=        $inlineremote[$idx]=
    '<a title="'.$desc.'" class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic.     '<a title="'.$desc.'" class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic.
    '<span class="LC_menubuttons_inline_text">'.$desc.'</span></a>';     '<span class="LC_menubuttons_inline_text">'.$icon_text.'&nbsp;</span></a>';
            }             }
        }         }
    }     }
Line 1336  sub rawconfig { Line 1373  sub rawconfig {
         my ($row,$col,$pro,$prt,$img,$top,$bot,$act,$desc,$cat)=split(/\:/,$line);          my ($row,$col,$pro,$prt,$img,$top,$bot,$act,$desc,$cat)=split(/\:/,$line);
         $prt=~s/\$uname/$uname/g;          $prt=~s/\$uname/$uname/g;
         $prt=~s/\$udom/$udom/g;          $prt=~s/\$udom/$udom/g;
           if ($env{'environment.remotenavmap'} eq 'on') {
                unless ($env{'environment.remote'} eq 'on') {
                    if ($img eq 'nav.gif') {
                        $act = "gonav('/adm/navmaps','')";
                    }
                }
           }
         if ($prt =~ /\$crs/) {          if ($prt =~ /\$crs/) {
             next unless ($env{'request.course.id'});              next unless ($env{'request.course.id'});
             next if ($crstype eq 'Community');              next if ($crstype eq 'Community');
Line 1652  function go(url) { Line 1696  function go(url) {
    }     }
 }  }
   
 function gotop(url) {  
     if (url!='' && url!= null) {  
         top.location.href = url;  
     }  
 }  
   
 function need_switchserver(url) {  function need_switchserver(url) {
     if (url!='' && url!= null) {      if (url!='' && url!= null) {
         if (confirm("$confirm_switch")) {          if (confirm("$confirm_switch")) {

Removed from v.1.315.2.5  
changed lines
  Added in v.1.315.2.12


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