Diff for /loncom/interface/lonmenu.pm between versions 1.335 and 1.336

version 1.335, 2010/08/20 08:13:41 version 1.336, 2010/08/20 17:53:40
Line 525  sub innerregister { Line 525  sub innerregister {
                 if ($nocrsedit) {                  if ($nocrsedit) {
                     $editbutton=&clear(6,1);                      $editbutton=&clear(6,1);
                 } else {                  } else {
                       my $bot = "go('$cfile')";
                     if ($switchserver) {                      if ($switchserver) {
                         if ( $env{'request.symb'} && $env{'request.course.id'} ) {                          if ( $env{'request.symb'} && $env{'request.course.id'} ) {
                             my ($mapurl,$rid,$resurl) = &Apache::lonnet::decode_symb(&Apache::lonnet::symbread());                              $cfile = '/adm/switchserver?otherserver='.$home.'&role='.
                             $cfile = '/adm/switchserver?otherserver='.$home.'&amp;role='.$env{'request.role'}.'&amp;symb='.$env{'request.symb'}.'&amp;origurl='.$resurl;                                       &HTML::Entities::encode($env{'request.role'},'"<>&').'&amp;symb='.
                                        &HTML::Entities::encode($env{'request.symb'},'"<>&');
                               $bot = "need_switchserver('$cfile');";
                         }                          }
                     }                      }
                     $editbutton=&switch                      $editbutton=&switch
                        ('','',6,1,'pcstr.png','edit[_1]','resource[_2]',                         ('','',6,1,'pcstr.png','edit[_1]','resource[_2]',
                      "go('".$cfile."');","Edit this resource");                          $bot,"Edit this resource");
                     $noeditbutton = 0;                      $noeditbutton = 0;
                 }                  }
             } elsif ($editbutton eq '') {              } elsif ($editbutton eq '') {
Line 1113  sub utilityfunctions { Line 1116  sub utilityfunctions {
     my $end_page_bookmark =       my $end_page_bookmark = 
         &Apache::loncommon::end_page({'js_ready' => 1});          &Apache::loncommon::end_page({'js_ready' => 1});
   
       my $confirm_switch = &mt("Editing requires switching to the resource's home server.").'\n'.
                            &mt('Switch server?');
   
     my $start_page_wishlistlink =       my $start_page_wishlistlink = 
         &Apache::loncommon::start_page('Set link to wishlist',undef,          &Apache::loncommon::start_page('Set link to wishlist',undef,
        {'only_body' => 1,         {'only_body' => 1,
Line 1172  function go(url) { Line 1178  function go(url) {
    }     }
 }  }
   
   function need_switchserver(url) {
       if (url!='' && url!= null) {
           if (confirm("$confirm_switch")) {
               go(url); 
           }
       }
       return;
   }
   
 function gopost(url,postdata) {  function gopost(url,postdata) {
    if (url!='') {     if (url!='') {
       this.document.server.action=url;        this.document.server.action=url;

Removed from v.1.335  
changed lines
  Added in v.1.336


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