Diff for /loncom/interface/portfolio.pm between versions 1.182 and 1.184

version 1.182, 2007/06/11 20:59:17 version 1.184, 2007/06/11 21:29:44
Line 1829  sub upload { Line 1829  sub upload {
     <input type="hidden" name="fieldname"   value="$env{'form.fieldname'}" />      <input type="hidden" name="fieldname"   value="$env{'form.fieldname'}" />
     <input type="hidden" name="mode"        value="$env{'form.mode'}" />      <input type="hidden" name="mode"        value="$env{'form.mode'}" />
 STATE  STATE
     $r->print("<p>Completed upload of the file. This file contained references to other files. You can upload these now: </p>");              $r->print("<h2>".&mt("Reference Warning")."</h2>");
               $r->print("<p>".&mt("Completed upload of the file. This file contained references to other files. You must upload the referenced files or else the uploaded file may not work properly.")."</p>");
               $r->print("<p>".&mt("Please select the locations from which the referenced files are to be uploaded.")."</p>");
     $r->print(&Apache::londocs::ask_for_embedded_content('/adm/portfolio',$state,\%allfiles,\%codebase,      $r->print(&Apache::londocs::ask_for_embedded_content('/adm/portfolio',$state,\%allfiles,\%codebase,
       {'error_on_invalid_names'   => 1,        {'error_on_invalid_names'   => 1,
        'ignore_remote_references' => 1,}));         'ignore_remote_references' => 1,}));
Line 1844  sub upload_embedded { Line 1846  sub upload_embedded {
     my ($r,$url,$group)=@_;      my ($r,$url,$group)=@_;
     for (my $i=0; $i<$env{'form.number_embedded_items'}; $i++) {      for (my $i=0; $i<$env{'form.number_embedded_items'}; $i++) {
  next if (!exists($env{'form.embedded_item_'.$i.'.filename'}));   next if (!exists($env{'form.embedded_item_'.$i.'.filename'}));
    my $orig_uploaded_filename = 
       $env{'form.embedded_item_'.$i.'.filename'};
   
  $env{'form.embedded_orig_'.$i} =    $env{'form.embedded_orig_'.$i} = 
     &unescape($env{'form.embedded_orig_'.$i});      &unescape($env{'form.embedded_orig_'.$i});
  my ($path,$fname) =    my ($path,$fname) = 
     ($env{'form.embedded_orig_'.$i} =~ m{(.*/)([^/]*)});      ($env{'form.embedded_orig_'.$i} =~ m{(.*/)([^/]*)});
    # no path, whole string is fname
    if (!$fname) { $fname = $env{'form.embedded_orig_'.$i} };
   
  $path = $env{'form.currentpath'}.$path;   $path = $env{'form.currentpath'}.$path;
  $fname = &Apache::lonnet::clean_filename($fname);   $fname = &Apache::lonnet::clean_filename($fname);
   
Line 1871  sub upload_embedded { Line 1878  sub upload_embedded {
     $port_path.$path);      $port_path.$path);
  if ($result !~ m|^/uploaded/|) {   if ($result !~ m|^/uploaded/|) {
     $r->print('<span class="LC_error">'.'An error occurred ('.$result.      $r->print('<span class="LC_error">'.'An error occurred ('.$result.
       ') while trying to upload '.&display_file($path,$fname).'</span><br />');        ') while trying to upload '.$orig_uploaded_filename.' for embedded element '.$env{'form.embedded_orig_'.$i}.'</span><br />');
     next;      next;
  } else {   } else {
     $r->print("<p> Uploaded ".      $r->print("<p> Uploaded ".

Removed from v.1.182  
changed lines
  Added in v.1.184


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