Diff for /loncom/interface/londocs.pm between versions 1.275 and 1.279

version 1.275, 2007/06/11 21:27:23 version 1.279, 2007/06/29 20:14:18
Line 904  sub store_template { Line 904  sub store_template {
 # Imports the given (name, url) resources into the course  # Imports the given (name, url) resources into the course
 # coursenum, coursedom, and folder must precede the list  # coursenum, coursedom, and folder must precede the list
 sub group_import {  sub group_import {
     my $coursenum = shift;      my ($coursenum, $coursedom, $folder, $container, $caller, @files) = @_;
     my $coursedom = shift;  
     my $folder = shift;      while (@files) {
     my $container = shift;   my $name = shift(@files);
     my $caller = shift;   my $url  = shift(@files);
     while (@_) {   #FIXME check if file exists before overwriting, might be restoring it
  my $name = shift;          if (($url =~ m{^/uploaded/\Q$coursedom\E/\Q$coursenum\E/(default_\d+\.)(page|sequence)$}) 
  my $url = shift;       && ($caller eq 'londocs')
         if (($url =~ m{^/uploaded/\Q$coursedom\E/\Q$coursenum\E/(default_\d+\.)(page|sequence)$}) && ($caller eq 'londocs')) {       && (!&Apache::lonnet::stat_file($url))) {
       
             my $errtext = '';              my $errtext = '';
             my $fatal = 0;              my $fatal = 0;
             my $newmapstr = '<map>'."\n".              my $newmapstr = '<map>'."\n".
Line 1154  sub docs_change_log { Line 1155  sub docs_change_log {
  for (my $idx=0;$idx<=$docslog{$id}{'logentry'}{'maxidx'};$idx++) {   for (my $idx=0;$idx<=$docslog{$id}{'logentry'}{'maxidx'};$idx++) {
     my $oldname=(split(/\:/,$docslog{$id}{'logentry'}{'before_resources_'.$idx}))[0];      my $oldname=(split(/\:/,$docslog{$id}{'logentry'}{'before_resources_'.$idx}))[0];
     my $newname=(split(/\:/,$docslog{$id}{'logentry'}{'after_resources_'.$idx}))[0];      my $newname=(split(/\:/,$docslog{$id}{'logentry'}{'after_resources_'.$idx}))[0];
     if ($oldname ne $newname) {      if ($oldname ne '' && $oldname ne $newname) {
  $r->print(&LONCAPA::map::qtescape($newname));   $r->print(&LONCAPA::map::qtescape($newname));
     }      }
  }           }        
Line 1184  sub docs_change_log { Line 1185  sub docs_change_log {
               || $shown<=$env{'form.show'})) { last; }                || $shown<=$env{'form.show'})) { last; }
     }      }
     $r->print(&Apache::loncommon::end_data_table());      $r->print(&Apache::loncommon::end_data_table());
     $r->print(&Apache::loncommon::end_page());  
 }  }
   
 sub editor {  sub editor {
Line 1445  sub editor { Line 1445  sub editor {
            $r->print('<p>'.&mt('Caution: this folder is set to randomly pick a subset of resources. Adding or removing resources from this folder will change the set of resources that the students see, resulting in spurious or missing credit for completed problems, not limited to ones you modify. Do not modify the contents of this folder if it is in active student use.').'</p>');             $r->print('<p>'.&mt('Caution: this folder is set to randomly pick a subset of resources. Adding or removing resources from this folder will change the set of resources that the students see, resulting in spurious or missing credit for completed problems, not limited to ones you modify. Do not modify the contents of this folder if it is in active student use.').'</p>');
         }          }
         $r->print('<table>');          $r->print('<table>');
         foreach (@LONCAPA::map::order) {          foreach my $res (@LONCAPA::map::order) {
            my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$_]);             my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]);
    $name=&LONCAPA::map::qtescape($name);     $name=&LONCAPA::map::qtescape($name);
    $url=&LONCAPA::map::qtescape($url);     $url=&LONCAPA::map::qtescape($url);
            unless ($name) {  $name=(split(/\//,$url))[-1]; }             unless ($name) {  $name=(split(/\//,$url))[-1]; }
            unless ($name) { $idx++; next; }             unless ($name) { $idx++; next; }
            $r->print(&entryline($idx,$name,$url,$folder,$allowed,$_,$coursenum));             $r->print(&entryline($idx,$name,$url,$folder,$allowed,$res,
    $coursenum));
            $idx++;             $idx++;
    $shown++;     $shown++;
         }          }
Line 1465  sub editor { Line 1466  sub editor {
 <input type="hidden" name="markedcopy_url" value="$env{'form.markedcopy_url'}" />  <input type="hidden" name="markedcopy_url" value="$env{'form.markedcopy_url'}" />
 <input type="hidden" name="markedcopy_title" value="$env{'form.markedcopy_title'}" />  <input type="hidden" name="markedcopy_title" value="$env{'form.markedcopy_title'}" />
 ENDPASTE  ENDPASTE
             $r->print(              $r->print('<input type="submit" name="pastemarked" value="'.&mt('Paste').'" /> ');
    '<input type="submit" name="pastemarked" value="'.&mt('Paste').  
       '" /> '.&Apache::loncommon::filedescription(      my $type;
  (split(/\./,$env{'form.markedcopy_url'}))[-1]).': '.      if ($env{'form.markedcopy_url'} =~ m{^/adm/wrapper/ext}) {
       $env{'form.markedcopy_title'});   $type = &mt('External Resource');
    $r->print($type.': '. $env{'form.markedcopy_title'});
       }  else {
    my $extension = (split(/\./,$env{'form.markedcopy_url'}))[-1];
    my $type = &Apache::loncommon::filedescription($extension);
    my $icon = '<img src="'.&Apache::loncommon::icon($extension).
       '" class="LC_icon" />';
    $r->print($icon.$type.': '. $env{'form.markedcopy_title'});
       }
             if ($container eq 'page') {              if ($container eq 'page') {
  $r->print(<<PAGEINFO);   $r->print(<<PAGEINFO);
 <input type="hidden" name="pagepath" value="$env{'form.pagepath'}" />  <input type="hidden" name="pagepath" value="$env{'form.pagepath'}" />
Line 1583  sub ask_for_embedded_content { Line 1592  sub ask_for_embedded_content {
  &Apache::loncommon::start_data_table();   &Apache::loncommon::start_data_table();
   
     my $num = 0;      my $num = 0;
     foreach my $embed_file (keys(%{$allfiles})) {      foreach my $embed_file (sort {lc($a) cmp lc($b)} keys(%{$allfiles})) {
  $upload_output .= &Apache::loncommon::start_data_table_row().   $upload_output .= &Apache::loncommon::start_data_table_row().
     '<td>'.$embed_file.'</td><td>';      '<td>'.$embed_file.'</td><td>';
  if ($args->{'ignore_remote_references'}   if ($args->{'ignore_remote_references'}

Removed from v.1.275  
changed lines
  Added in v.1.279


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