Diff for /loncom/interface/londocs.pm between versions 1.484.2.72.2.2 and 1.484.2.72.4.1

version 1.484.2.72.2.2, 2017/09/15 23:15:55 version 1.484.2.72.4.1, 2020/04/07 18:21:04
Line 656  sub group_import { Line 656  sub group_import {
                 my $marker = $2;                  my $marker = $2;
                 my $info = $3;                  my $info = $3;
                 my ($toolid,%toolhash,%toolsettings);                  my ($toolid,%toolhash,%toolsettings);
                 my @extras = ('linktext','explanation','crslabel','crstitle');                   my @extras = ('linktext','explanation','crslabel','crstitle');
                 my @toolinfo = split(/:/,$info);                  my @toolinfo = split(/:/,$info);
                 if ($residx) {                  if ($residx) {
                     %toolsettings=&Apache::lonnet::dump('exttool_'.$marker,$coursedom,$coursenum);                      %toolsettings=&Apache::lonnet::dump('exttool_'.$marker,$coursedom,$coursenum);
Line 1325  sub print_paste_buffer { Line 1325  sub print_paste_buffer {
                         }                          }
                         $is_uploaded_map = 1;                          $is_uploaded_map = 1;
                     }                      }
                 } elsif (($url =~ m{^/res/lib/templates/\w+\.problem$}) ||                  } elsif ($url =~ m{^/adm/($match_domain)/($match_username)/\d+/(bulletinboard|smppg|ext\.tool)$}) {
                          ($url =~ m{^/adm/($match_domain)/($match_username)/\d+/(bulletinboard|smppg|ext\.tool)$})) {  
                     if ($cid ne $env{'request.course.id'}) {                      if ($cid ne $env{'request.course.id'}) {
                         my ($srcdom,$srcnum) = split(/_/,$cid);                          my ($srcdom,$srcnum) = split(/_/,$cid);
                         if ($env{"user.priv.cm./$srcdom/$srcnum"} =~ /\Q:mdc&F\E/) {                          if ($env{"user.priv.cm./$srcdom/$srcnum"} =~ /\Q:mdc&F\E/) {
Line 1347  sub print_paste_buffer { Line 1346  sub print_paste_buffer {
                push(@pasteable,$suffix);                 push(@pasteable,$suffix);
             }              }
             my $buffer;              my $buffer;
             if ($is_external) {               if ($is_external) {
                 $buffer = &mt('External Resource').': '.                  $buffer = &mt('External Resource').': '.
                     &LONCAPA::map::qtescape($env{'docs.markedcopy_title_'.$suffix}).' ('.                      &LONCAPA::map::qtescape($env{'docs.markedcopy_title_'.$suffix}).' ('.
                     &LONCAPA::map::qtescape($url).')';                      &LONCAPA::map::qtescape($url).')';
Line 1660  sub do_paste_from_buffer { Line 1659  sub do_paste_from_buffer {
             }              }
             $srcdom{$suffix} = $srcd;              $srcdom{$suffix} = $srcd;
             $srcnum{$suffix} = $srcn;              $srcnum{$suffix} = $srcn;
         } elsif ($url =~ m{^/adm/$match_domain/$match_courseid/\d+/ext\.tool$}) {          } elsif (($url =~ m{^/adm/$match_domain/$match_username/\d+/(bulletinboard|smppg)$}) || 
                    ($url =~ m{^/adm/$match_domain/$match_courseid/\d+/ext\.tool$})) {
             my ($srcd,$srcn) = split(/_/,$cid);              my ($srcd,$srcn) = split(/_/,$cid);
 # When paste buffer was populated using an active role in a different course  # When paste buffer was populated using an active role in a different course
 # check for mdc privilege in the course from which the resource was pasted  # check for mdc privilege in the course from which the resource was pasted
Line 1728  sub do_paste_from_buffer { Line 1728  sub do_paste_from_buffer {
     %msgs = &Apache::lonlocal::texthash (      %msgs = &Apache::lonlocal::texthash (
                 notinsupp => 'Paste failed: content type is not supported within Supplemental Content',                  notinsupp => 'Paste failed: content type is not supported within Supplemental Content',
                 notincrs  => 'Paste failed: Item is from a different course which you do not have rights to edit.',                  notincrs  => 'Paste failed: Item is from a different course which you do not have rights to edit.',
                 notindom  => 'Paste failed: Item is an external tool from a course in a different donain.',                   notindom  => 'Paste failed: Item is an external tool from a course in a different domain.',
                 duplicate => 'Paste failed: only one instance of a particular published sequence or page is allowed within each course.',                  duplicate => 'Paste failed: only one instance of a particular published sequence or page is allowed within each course.',
             );              );
   
Line 1837  sub do_paste_from_buffer { Line 1837  sub do_paste_from_buffer {
                 }                  }
             }              }
         }          }
         if ($url=~ m{/(ext\.tool)$}) {          if ($url=~ m{/(bulletinboard|smppg|ext\.tool)$}) {
             my $prefix = $1;              my $prefix = $1;
             my $fromothercrs;              my $fromothercrs;
             #need to copy the db contents to a new one, unless this is a move.              #need to copy the db contents to a new one, unless this is a move.
Line 1861  sub do_paste_from_buffer { Line 1861  sub do_paste_from_buffer {
                     $url = $newurl;                      $url = $newurl;
                     $title=&mt('Copy of').' '.$title;                      $title=&mt('Copy of').' '.$title;
                 } else {                  } else {
                     if ($prefix eq 'ext.tool') {                      if ($prefix eq 'smppg') {
                           $msg = &mt('Paste failed: An error occurred when copying the simple page.').' '.$errtext;
                       } elsif ($prefix eq 'bulletinboard') {
                           $msg = &mt('Paste failed: An error occurred when copying the discussion board.').' '.$errtext;
                       } elsif ($prefix eq 'ext.tool') {
                         $msg = &mt('Paste failed: An error occurred when copying the external tool.').' '.$errtext;                          $msg = &mt('Paste failed: An error occurred when copying the external tool.').' '.$errtext;
                     }                      }
                     $results{$suffix} = $result;                      $results{$suffix} = $result;
Line 4086  $form_end; Line 4090  $form_end;
         if ($isexternal) {          if ($isexternal) {
             ($editlink,$extresform) =               ($editlink,$extresform) = 
                 &Apache::lonextresedit::extedit_form(0,$residx,$orig_url,$title,$pathitem,                  &Apache::lonextresedit::extedit_form(0,$residx,$orig_url,$title,$pathitem,
                                                      undef,undef,undef,$disabled);                                                       undef,undef,undef,undef,undef,undef,
                                                        undef,$disabled);
         } elsif ($orig_url =~ m{^/adm/$coursedom/$coursenum/\d+/ext\.tool$}) {          } elsif ($orig_url =~ m{^/adm/$coursedom/$coursenum/\d+/ext\.tool$}) {
             ($editlink,$extresform) =              ($editlink,$extresform) =
                 &Apache::lonextresedit::extedit_form(0,$residx,$orig_url,$title,$pathitem,                  &Apache::lonextresedit::extedit_form(0,$residx,$orig_url,$title,$pathitem,
Line 4951  sub handler { Line 4956  sub handler {
                'Adding_External_Resource','Adding_External_Tool',                 'Adding_External_Resource','Adding_External_Tool',
                        'Navigate_Content','Adding_Folders','Docs_Overview',                         'Navigate_Content','Adding_Folders','Docs_Overview',
                'Load_Map','Supplemental','Score_Upload_Form',                 'Load_Map','Supplemental','Score_Upload_Form',
                        'Adding_Pages','Importing_LON-CAPA_Resource',                 'Adding_Pages','Importing_LON-CAPA_Resource',
                        'Importing_IMS_Course','Uploading_From_Harddrive',                 'Importing_IMS_Course','Uploading_From_Harddrive',
                        'Course_Roster','Web_Page','Dropbox','Simple_Problem') {                         'Course_Roster','Web_Page','Dropbox','Simple_Problem') {
  $help{$topic}=&Apache::loncommon::help_open_topic('Docs_'.$topic);   $help{$topic}=&Apache::loncommon::help_open_topic('Docs_'.$topic);
     }      }
Line 5309  sub handler { Line 5314  sub handler {
   undef($hadchanges);    undef($hadchanges);
           $uploadphase = &process_file_upload(\$upload_output,$coursenum,$coursedom,            $uploadphase = &process_file_upload(\$upload_output,$coursenum,$coursedom,
                                               \%allfiles,\%codebase,$context,$crstype);                                                \%allfiles,\%codebase,$context,$crstype);
           undef($navmap);  
   if ($hadchanges) {    if ($hadchanges) {
       &mark_hash_old();        &mark_hash_old();
   }    }
Line 5537  SEDFFORM Line 5541  SEDFFORM
         my $extresourcesform =          my $extresourcesform =
             &Apache::lonextresedit::extedit_form(0,0,undef,undef,$pathitem,              &Apache::lonextresedit::extedit_form(0,0,undef,undef,$pathitem,
                                                  $help{'Adding_External_Resource'},                                                   $help{'Adding_External_Resource'},
                                                  undef,undef,$disabled);                                                   undef,undef,undef,undef,undef,undef,$disabled);
         my $exttoolform =          my $exttoolform =
             &Apache::lonextresedit::extedit_form(0,0,undef,undef,$pathitem,              &Apache::lonextresedit::extedit_form(0,0,undef,undef,$pathitem,
                                                  $help{'Adding_External_Tool'},undef,                                                   $help{'Adding_External_Tool'},undef,
Line 5843  unless ($container eq 'page') { Line 5847  unless ($container eq 'page') {
              $r->print('<p><span class="LC_error">'.$error.'</span></p>');               $r->print('<p><span class="LC_error">'.$error.'</span></p>');
           }            }
           if ($hadchanges) {            if ($hadchanges) {
              unless (&is_hash_old()) {               &mark_hash_old();
                  &mark_hash_old();  
              }  
           }            }
   
           &changewarning($r,'');            &changewarning($r,'');
         }          }
     }      }
Line 5905  SNFFORM Line 5908  SNFFORM
         my $supextform =          my $supextform =
             &Apache::lonextresedit::extedit_form(1,0,undef,undef,$pathitem,              &Apache::lonextresedit::extedit_form(1,0,undef,undef,$pathitem,
                                                  $help{'Adding_External_Resource'},                                                   $help{'Adding_External_Resource'},
                                                  undef,undef,$disabled);                                                   undef,undef,undef,undef,undef,undef,
                                                    $disabled);
   
         my $supexttoolform =          my $supexttoolform =
             &Apache::lonextresedit::extedit_form(1,0,undef,undef,$pathitem,              &Apache::lonextresedit::extedit_form(1,0,undef,undef,$pathitem,
Line 6449  sub editing_js { Line 6453  sub editing_js {
                 } else {                  } else {
                     $url = $res;                      $url = $res;
                 }                  }
                 $backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($url),'<>&"');                  $backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($url),'<>&"').'?symb='.
                 if ($backtourl =~ m{^\Q/uploaded/$coursedom/$coursenum/\Edefault_\d+\.sequence$}) {                               &HTML::Entities::encode($caller,'<>&"');
                     $backtourl .= '?navmap=1';  
                 } else {  
                     $backtourl .= '?symb='.  
                                   &HTML::Entities::encode($caller,'<>&"');  
                 }  
                 if ($anchor ne '') {                  if ($anchor ne '') {
                     $backtourl .= '#'.&HTML::Entities::encode($anchor,'<>&"');                      $backtourl .= '#'.&HTML::Entities::encode($anchor,'<>&"');
                 }                  }
Line 7670  check on this Line 7669  check on this
   
 Verify Content  Verify Content
   
 =item devalidateversioncache()   =item devalidateversioncache() & checkversions()
   
 =item checkversions()  
   
 Check Versions  Check Versions
   

Removed from v.1.484.2.72.2.2  
changed lines
  Added in v.1.484.2.72.4.1


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