Diff for /loncom/interface/londocs.pm between versions 1.655 and 1.660

version 1.655, 2018/05/29 19:33:48 version 1.660, 2019/04/11 14:22:35
Line 1819  sub do_paste_from_buffer { Line 1819  sub do_paste_from_buffer {
 # Retrieve information about all course maps in main content area   # Retrieve information about all course maps in main content area 
   
     my $allmaps = {};      my $allmaps = {};
     if ($folder =~ /^default/) {      my (@toclear,%mapurls,%lockerrs,%msgerrs,%results,$donechk);
         $allmaps =  
             &Apache::loncommon::allmaps_incourse($coursedom,$coursenum,  
                                                  $env{"course.$env{'request.course.id'}.home"},  
                                                  $env{'request.course.id'});  
     }  
   
     my (@toclear,%mapurls,%lockerrs,%msgerrs,%results);  
   
 # Loop over the items to paste  # Loop over the items to paste
     foreach my $suffix (@dopaste) {      foreach my $suffix (@dopaste) {
Line 1844  sub do_paste_from_buffer { Line 1837  sub do_paste_from_buffer {
         if ($is_map{$suffix}) {          if ($is_map{$suffix}) {
 # If pasting a map, check if map contains other maps  # If pasting a map, check if map contains other maps
             my (%hierarchy,%titles);              my (%hierarchy,%titles);
               if (($folder =~ /^default/) && (!$donechk)) {
                   $allmaps =
                       &Apache::loncommon::allmaps_incourse($coursedom,$coursenum,
                                                            $env{"course.$env{'request.course.id'}.home"},
                                                            $env{'request.course.id'});
                   $donechk = 1;
               }
             &contained_map_check($url,$folder,$coursenum,$coursedom,              &contained_map_check($url,$folder,$coursenum,$coursedom,
                                  \%removefrommap,\%removeparam,\%addedmaps,                                   \%removefrommap,\%removeparam,\%addedmaps,
                                  \%hierarchy,\%titles,$allmaps);                                   \%hierarchy,\%titles,$allmaps);
Line 4171  END Line 4171  END
             } elsif ($url eq "/public/$coursedom/$coursenum/syllabus") {              } elsif ($url eq "/public/$coursedom/$coursenum/syllabus") {
                 if (($ENV{'SERVER_PORT'} == 443) &&                  if (($ENV{'SERVER_PORT'} == 443) &&
                     ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {                      ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {
                     $url .= '?usehttp=1';                      unless (&Apache::lonnet::uses_sts()) {
                           $url .= '?usehttp=1';
                       }
                     $nomodal = 1;                      $nomodal = 1;
                 }                  }
             }              }
Line 4181  END Line 4183  END
                     if ($url =~ /^([^#]+)#([^#]+)$/) {                      if ($url =~ /^([^#]+)#([^#]+)$/) {
                         $url = $1;                          $url = $1;
                         $anchor = $2;                          $anchor = $2;
                         if ($symb =~ m{^([^#]+)\Q#$anchor\E$}) {                          my $escan = &escape('#');
                             $shownsymb = $1.&escape('#').$anchor;                          $shownsymb =~ s/^([^\#]+)#([^\#]+)$/$1$escan$2/;
                         }  
                     }                      }
                 }                  }
                 unless ($env{'request.role.adv'}) {                  unless ($env{'request.role.adv'}) {
Line 4237  END Line 4238  END
                 $url = $1;                  $url = $1;
                 $anchor = $2;                  $anchor = $2;
                 if (($url =~ m{^(|/adm/wrapper)/ext/(?!https:)}) && ($ENV{'SERVER_PORT'} == 443)) {                  if (($url =~ m{^(|/adm/wrapper)/ext/(?!https:)}) && ($ENV{'SERVER_PORT'} == 443)) {
                     if ($hostname ne '') {                      unless (&Apache::lonnet::uses_sts()) {
                         $url = 'http://'.$hostname.$url;                          if ($hostname ne '') {
                               $url = 'http://'.$hostname.$url;
                           }
                           $url .= (($url =~ /\?/) ? '&':'?').'usehttp=1';
                     }                      }
                     $nomodal = 1;                      $nomodal = 1;
                 }                  }
Line 4246  END Line 4250  END
         } elsif ($url =~ m{^\Q/public/$coursedom/$coursenum/syllabus\E}) {          } elsif ($url =~ m{^\Q/public/$coursedom/$coursenum/syllabus\E}) {
             if (($ENV{'SERVER_PORT'} == 443) &&              if (($ENV{'SERVER_PORT'} == 443) &&
                 ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {                  ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {
                 if ($hostname ne '') {                  unless (&Apache::lonnet::uses_sts()) {
                     $url = 'http://'.$hostname.$url;                      if ($hostname ne '') {
                           $url = 'http://'.$hostname.$url;
                       }
                       $url .= (($url =~ /\?/) ? '&':'?').'usehttp=1';
                 }                  }
                 $url .= (($url =~ /\?/) ? '&':'?').'usehttp=1';  
                 $nomodal = 1;                  $nomodal = 1;
             }              }
         }          }
Line 4430  $form_end; Line 4436  $form_end;
        } else {         } else {
            $link = $url;             $link = $url;
        }         }
        $link = &js_escape($link.(($url=~/\?/)?'&':'?').'inhibitmenu=yes'.         $link = &js_escape($link.(($url=~/\?/)?'&':'?').'inhibitmenu=yes'.$anchor);
                                                (($anchor ne '')?$anchor:''));  
        if ($nomodal) {         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;" />'.             $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>';                    '<img src="'.$icon.'" alt="" class="LC_icon" border="0" /></a>';
Line 7272  sub editing_js { Line 7277  sub editing_js {
                 if ($backtourl =~ m{^\Q/public/$coursedom/$coursenum/syllabus\E}) {                  if ($backtourl =~ m{^\Q/public/$coursedom/$coursenum/syllabus\E}) {
                     if (($ENV{'SERVER_PORT'} == 443) &&                      if (($ENV{'SERVER_PORT'} == 443) &&
                         ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {                          ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {
                         if ($hostname ne '') {                          unless (&Apache::lonnet::uses_sts()) {
                             $backtourl = 'http://'.$hostname.$backtourl;                              if ($hostname ne '') {
                                   $backtourl = 'http://'.$hostname.$backtourl;
                               }
                               $backtourl .= (($backtourl =~ /\?/) ? '&amp;':'?').'usehttp=1';
                         }                          }
                         $backtourl .= (($backtourl =~ /\?/) ? '&amp;':'?').'usehttp=1';  
                     }                      }
                 } elsif ($backtourl =~ m{^/adm/wrapper/ext/(?!https:)}) {                  } elsif ($backtourl =~ m{^/adm/wrapper/ext/(?!https:)}) {
                     if (($ENV{'SERVER_PORT'} == 443) && ($hostname ne '')) {                      if (($ENV{'SERVER_PORT'} == 443) && ($hostname ne '')) {
                         $backtourl = 'http://'.$hostname.$backtourl;                          unless (&Apache::lonnet::uses_sts()) {
                               if ($hostname ne '') {
                                   $backtourl = 'http://'.$hostname.$backtourl;
                               }
                               $backtourl .= (($backtourl =~ /\?/) ? '&amp;':'?').'usehttp=1';
                           }
                     }                      }
                 }                  }
                 if ($anchor ne '') {                  if ($anchor ne '') {
Line 8116  function showPage(current, pageId, nav, Line 8128  function showPage(current, pageId, nav,
                 current.className = 'right';                  current.className = 'right';
             }              }
             activeTab = '';               activeTab = ''; 
               toggleExternal();
             toggleUpload();              toggleUpload();
             toggleMap();              toggleMap();
             toggleCrsRes();              toggleCrsRes();
Line 8128  function showPage(current, pageId, nav, Line 8141  function showPage(current, pageId, nav,
  currentData = document.getElementById(pageId);   currentData = document.getElementById(pageId);
  currentData.style.display = 'block';   currentData.style.display = 'block';
         activeTab = pageId;          activeTab = pageId;
           toggleExternal();
         toggleUpload();          toggleUpload();
         toggleMap();          toggleMap();
         toggleCrsRes();          toggleCrsRes();

Removed from v.1.655  
changed lines
  Added in v.1.660


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