Diff for /loncom/interface/londocs.pm between versions 1.484.2.69 and 1.484.2.70

version 1.484.2.69, 2017/01/24 15:54:02 version 1.484.2.70, 2017/03/15 02:05:20
Line 3065  sub editor { Line 3065  sub editor {
         $output .= &entryline($idx,$name,$url,$folder,$allowed,$res,          $output .= &entryline($idx,$name,$url,$folder,$allowed,$res,
                               $coursenum,$coursedom,$crstype,                                $coursenum,$coursedom,$crstype,
                               $pathitem,$supplementalflag,$container,                                $pathitem,$supplementalflag,$container,
                               \%filters,\%curr_groups,$canedit,$isencrypted,$navmapref);                                \%filters,\%curr_groups,$canedit,
                                 $isencrypted,$navmapref);
         $idx++;          $idx++;
         $shown++;          $shown++;
     }      }
Line 3691  END Line 3692  END
  }   }
     }      }
   
     my ($editlink,$extresform,$anchor,$hiddenres);      my ($editlink,$extresform,$anchor,$hiddenres,$nomodal);
     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 3709  END Line 3710  END
         } elsif ($url!~/\.(sequence|page)$/) {          } elsif ($url!~/\.(sequence|page)$/) {
     $url='/adm/coursedocs/showdoc'.$url;      $url='/adm/coursedocs/showdoc'.$url;
         }          }
     } elsif ($url=~m|^/ext/|) {              } elsif ($url=~m{^(|/adm/wrapper)/ext/([^#]+)}) {
         $url='/adm/wrapper'.$url;                  my $wrapped = $1;
                   my $exturl = $2;
                   if ($wrapped eq '') {
                       $url='/adm/wrapper'.$url;
                   }
                   if (($ENV{'SERVER_PORT'} == 443) && ($exturl !~ /^https:/)) {
                       $nomodal = 1;
                   }
               } elsif ($url eq "/public/$coursedom/$coursenum/syllabus") {
                   if (($ENV{'SERVER_PORT'} == 443) &&
                       ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {
                       $nomodal = 1;
                   }
     }      }
             if (&Apache::lonnet::symbverify($symb,$url)) {              if (&Apache::lonnet::symbverify($symb,$url)) {
                 my $shownsymb = $symb;                  my $shownsymb = $symb;
Line 3740  END Line 3753  END
                 if (((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i) ||                  if (((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i) ||
                       $isencrypted || (&Apache::lonnet::EXT('resource.0.encrypturl',$symb) =~ /^yes$/i)) {                        $isencrypted || (&Apache::lonnet::EXT('resource.0.encrypturl',$symb) =~ /^yes$/i)) {
                     $checkencrypt = 1;                      $checkencrypt = 1;
                 } else {                  } elsif (ref($navmapref)) {
                     unless (ref($$navmapref)) {                      unless (ref($$navmapref)) {
                         $$navmapref = Apache::lonnavmaps::navmap->new();                          $$navmapref = Apache::lonnavmaps::navmap->new();
                     }                      }
Line 3773  END Line 3786  END
             if ($url =~ /^([^#]+)#([^#]+)$/) {              if ($url =~ /^([^#]+)#([^#]+)$/) {
                 $url = $1;                  $url = $1;
                 $anchor = $2;                  $anchor = $2;
                   if (($url =~ m{^(|/adm/wrapper)/ext/(?!https:)}) && ($ENV{'SERVER_PORT'} == 443)) {
                       $nomodal = 1;
                   }
               }
           } elsif ($url =~ m{^\Q/public/$coursedom/$coursenum/syllabus\E}) {
               if (($ENV{'SERVER_PORT'} == 443) &&
                   ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {
                   $nomodal = 1;
             }              }
         }          }
     }      }
Line 3795  END Line 3816  END
             my $encryptmap = ((&LONCAPA::map::getparameter($orderidx,              my $encryptmap = ((&LONCAPA::map::getparameter($orderidx,
                                               'parameter_encrypturl'))[0]=~/^yes$/i);                                                'parameter_encrypturl'))[0]=~/^yes$/i);
             unless ($hiddenmap) {              unless ($hiddenmap) {
                 unless (ref($$navmapref)) {                  if (ref($navmapref)) {
                     $$navmapref = Apache::lonnavmaps::navmap->new();                      unless (ref($$navmapref)) {
                 }                          $$navmapref = Apache::lonnavmaps::navmap->new();
                 if (ref($$navmapref)) {                      }
                     if (lc($$navmapref->get_mapparam(undef,$folderurl,"0.hiddenresource")) eq 'yes') {                      if (ref($$navmapref)) {
                         my @resources = $$navmapref->retrieveResources($folderurl,$filterFunc,1,1);                          if (lc($$navmapref->get_mapparam(undef,$folderurl,"0.hiddenresource")) eq 'yes') {
                         unless (@resources) {                              my @resources = $$navmapref->retrieveResources($folderurl,$filterFunc,1,1);
                             $hiddenmap = 1;                              unless (@resources) {
                             unless ($env{'request.role.adv'}) {                                  $hiddenmap = 1;
                                 $url = '';                                  unless ($env{'request.role.adv'}) {
                                 $hiddenfolder = 1;                                      $url = '';
                                       $hiddenfolder = 1;
                                   }
                             }                              }
                         }                          }
                     }                      }
                 }                  }
             }              }
             unless ($encryptmap) {              unless ($encryptmap) {
                 if (lc($$navmapref->get_mapparam(undef,$folderurl,"0.encrypturl")) eq 'yes') {                  if ((ref($navmapref)) && (ref($$navmapref))) {
                     $encryptmap = 1;                      if (lc($$navmapref->get_mapparam(undef,$folderurl,"0.encrypturl")) eq 'yes') {
                           $encryptmap = 1;
                       }
                 }                  }
             }              }
   
Line 3909  $form_end; Line 3934  $form_end;
         $reinit = &mt('(re-initialize course to access)');          $reinit = &mt('(re-initialize course to access)');
     }      }
     $line.='<td class="LC_docs_entry_commands"'.$tdalign.'><span class="LC_nobreak">'.$editlink.$renamelink;      $line.='<td class="LC_docs_entry_commands"'.$tdalign.'><span class="LC_nobreak">'.$editlink.$renamelink;
       my $link;
     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 3919  $form_end; Line 3945  $form_end;
                $anchor = '#'.&HTML::Entities::encode($anchor,'"<>&');                 $anchor = '#'.&HTML::Entities::encode($anchor,'"<>&');
            }             }
        }         }
        $line.=&Apache::loncommon::modal_link(&js_escape($url.(($url=~/\?/)?'&amp;':'?').'inhibitmenu=yes'.         $link = &js_escape($url.(($url=~/\?/)?'&amp;':'?').'inhibitmenu=yes'.
                                              (($anchor ne '')?$anchor:'')),                                                 (($anchor ne '')?$anchor:''));
                                              '<img src="'.$icon.'" alt="" class="LC_icon" />',600,500);         if ($nomodal) {
              $line.='<a href="#" onclick="javascript:window.open('."'$link','syllabuspreview','height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1')".'; return false;" />'.
                     '<img src="'.$icon.'" alt="" class="LC_icon" border="0" /></a>';
          } else {
              $line.=&Apache::loncommon::modal_link($link,
                                                    '<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 3929  $form_end; Line 3961  $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(&js_escape($url.(($url=~/\?/)?'&amp;':'?').'inhibitmenu=yes'.         if ($nomodal) {
                                              (($anchor ne '')?$anchor:'')),             $line.='<a href="#" onclick="javascript:window.open('."'$link','syllabuspreview','height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1')".'; return false;" />'.
                                              $title,600,500);                    $title.'</a>';
          } else {
              $line.=&Apache::loncommon::modal_link($link,$title,600,500);
          }
     } elsif (($hiddenfolder) || ($hiddenres)) {      } elsif (($hiddenfolder) || ($hiddenres)) {
        $line.=$title.' <span class="LC_warning LC_docs_reinit_warn">'.&mt('(Hidden)').'</span>';         $line.=$title.' <span class="LC_warning LC_docs_reinit_warn">'.&mt('(Hidden)').'</span>';
     } else {      } else {

Removed from v.1.484.2.69  
changed lines
  Added in v.1.484.2.70


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