Diff for /loncom/interface/londocs.pm between versions 1.484.2.65 and 1.484.2.66

version 1.484.2.65, 2016/08/08 13:37:42 version 1.484.2.66, 2016/10/31 20:48:30
Line 3608  END Line 3608  END
  }   }
     }      }
   
     my ($editlink,$extresform);      my ($editlink,$extresform,$anchor);
     my $orig_url = $url;      my $orig_url = $url;
     $orig_url=~s{http(:|:)//https(:|:)//}{https$2//};      $orig_url=~s{http(:|:)//https(:|:)//}{https$2//};
     $url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/};      $url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/};
Line 3630  END Line 3630  END
         $url='/adm/wrapper'.$url;          $url='/adm/wrapper'.$url;
     }      }
             if (&Apache::lonnet::symbverify($symb,$url)) {              if (&Apache::lonnet::symbverify($symb,$url)) {
         $url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb);                  my $shownsymb = $symb;
                   if ($isexternal) {
                       if ($url =~ /^([^#]+)#([^#]+)$/) {
                           $url = $1;
                           $anchor = $2;
                           if ($symb =~ m{^([^#]+)\Q#$anchor\E$}) {
                               $shownsymb = $1.&escape('#').$anchor;
                           }
                       }
                   }
           $url.=(($url=~/\?/)?'&':'?').'symb='.&HTML::Entities::encode($shownsymb,'"<>&');
             } else {              } else {
                 $url='';                  $url='';
             }              }
  }   }
       } elsif ($supplementalflag) {
           if ($isexternal) {
               if ($url =~ /^([^#]+)#([^#]+)$/) {
                   $url = $1;
                   $anchor = $2;
               }
           }
     }      }
     my ($rand_pick_text,$rand_order_text);      my ($rand_pick_text,$rand_order_text);
     if ($isfolder || $ispage || $extension eq 'sequence' || $extension eq 'page') {      if ($isfolder || $ispage || $extension eq 'sequence' || $extension eq 'page') {
Line 3702  $form_end; Line 3719  $form_end;
         if ($isexternal && $orderidx) {          if ($isexternal && $orderidx) {
             $url .= '&amp;idx='.$orderidx;              $url .= '&amp;idx='.$orderidx;
         }          }
           if ($anchor ne '') {
               $url .= '&amp;anchor='.&HTML::Entities::encode($anchor,'"<>&');
           }
     }      }
     my ($tdalign,$tdwidth);      my ($tdalign,$tdwidth);
     if ($allowed) {      if ($allowed) {
Line 3714  $form_end; Line 3734  $form_end;
             my ($cfile,$home,$switchserver,$forceedit,$forceview) =               my ($cfile,$home,$switchserver,$forceedit,$forceview) = 
                 &Apache::lonnet::can_edit_resource($fileloc,$coursenum,$coursedom,$orig_url);                  &Apache::lonnet::can_edit_resource($fileloc,$coursenum,$coursedom,$orig_url);
             if (($cfile ne '') && ($symb ne '' || $supplementalflag)) {              if (($cfile ne '') && ($symb ne '' || $supplementalflag)) {
                   my $suppanchor;
                   if ($supplementalflag) {
                       $suppanchor = $anchor;
                   }
                 my $jscall =                   my $jscall = 
                     &Apache::lonhtmlcommon::jump_to_editres($cfile,$home,                      &Apache::lonhtmlcommon::jump_to_editres($cfile,$home,
                                                             $switchserver,                                                              $switchserver,
                                                             $forceedit,                                                              $forceedit,
                                                             undef,$symb,                                                              undef,$symb,
                                                             &escape($env{'form.folderpath'}),                                                              &escape($env{'form.folderpath'}),
                                                             $renametitle,'','',1);                                                              $renametitle,'','',1,$suppanchor);
                 if ($jscall) {                  if ($jscall) {
                     $editlink = '<a class="LC_docs_ext_edit" href="javascript:'.                      $editlink = '<a class="LC_docs_ext_edit" href="javascript:'.
                                 $jscall.'" >'.&mt('Edit').'</a>&nbsp;'."\n";                                  $jscall.'" >'.&mt('Edit').'</a>&nbsp;'."\n";
Line 3740  $form_end; Line 3764  $form_end;
     if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) {      if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) {
        $line.='<a href="'.$url.'"><img src="'.$icon.'" alt="" class="LC_icon" /></a>';         $line.='<a href="'.$url.'"><img src="'.$icon.'" alt="" class="LC_icon" /></a>';
     } elsif ($url) {      } elsif ($url) {
        $line.=&Apache::loncommon::modal_link($url.(($url=~/\?/)?'&amp;':'?').'inhibitmenu=yes',         if ($anchor ne '') {
              if ($supplementalflag) {
                  $anchor = '&amp;anchor='.&HTML::Entities::encode($anchor,'"<>&');
              } else {
                  $anchor = '#'.&HTML::Entities::encode($anchor,'"<>&');
              }
          }
          $line.=&Apache::loncommon::modal_link($url.(($url=~/\?/)?'&amp;':'?').'inhibitmenu=yes'.
                                                (($anchor ne '')?$anchor:''),
                                              '<img src="'.$icon.'" alt="" class="LC_icon" />',600,500);                                               '<img src="'.$icon.'" alt="" class="LC_icon" />',600,500);
     } else {      } else {
        $line.='<img src="'.$icon.'" alt="" class="LC_icon" />';         $line.='<img src="'.$icon.'" alt="" class="LC_icon" />';
Line 3749  $form_end; Line 3781  $form_end;
     if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) {      if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) {
        $line.='<a href="'.$url.'">'.$title.'</a>';         $line.='<a href="'.$url.'">'.$title.'</a>';
     } elsif ($url) {      } elsif ($url) {
        $line.=&Apache::loncommon::modal_link($url.(($url=~/\?/)?'&amp;':'?').'inhibitmenu=yes',         $line.=&Apache::loncommon::modal_link($url.(($url=~/\?/)?'&amp;':'?').'inhibitmenu=yes'.
                                                (($anchor ne '')?$anchor:''),
                                              $title,600,500);                                               $title,600,500);
     } else {      } else {
        $line.=$title.' <span class="LC_docs_reinit_warn">'.$reinit.'</span>';         $line.=$title.' <span class="LC_docs_reinit_warn">'.$reinit.'</span>';
Line 5898  sub editing_js { Line 5931  sub editing_js {
             my ($map,$id,$res)=&Apache::lonnet::decode_symb($caller);              my ($map,$id,$res)=&Apache::lonnet::decode_symb($caller);
             $res = &Apache::lonnet::clutter($res);              $res = &Apache::lonnet::clutter($res);
             if (&Apache::lonnet::is_on_map($res)) {              if (&Apache::lonnet::is_on_map($res)) {
                 $backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($res),'<>&"').'?symb='.                  my ($url,$anchor);
                   if ($res =~ /^([^#]+)#([^#]+)$/) {
                       $url = $1;
                       $anchor = $2;
                       if (($caller =~ m{^([^#]+)\Q#$anchor\E$})) {
                           $caller = $1.&escape('#').$anchor;
                       }
                   }
                   $backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($url),'<>&"').'?symb='.
                              &HTML::Entities::encode($caller,'<>&"');                               &HTML::Entities::encode($caller,'<>&"');
                   if ($anchor ne '') {
                       $backtourl .= '#'.&HTML::Entities::encode($anchor,'<>&"');
                   }
                 $backtourl = &Apache::loncommon::escape_single($backtourl);                   $backtourl = &Apache::loncommon::escape_single($backtourl); 
             } else {              } else {
                 $backtourl = '/adm/navmaps';                  $backtourl = '/adm/navmaps';

Removed from v.1.484.2.65  
changed lines
  Added in v.1.484.2.66


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