Diff for /loncom/publisher/loncfile.pm between versions 1.118 and 1.123

version 1.118, 2013/04/11 14:59:58 version 1.123, 2015/01/19 15:36:11
Line 37 Line 37
   
 =head1 NAME  =head1 NAME
   
 Apache::loncfile - Construction space file management.  Apache::loncfile - Authoring space file management.
   
 =head1 SYNOPSIS  =head1 SYNOPSIS
     
Line 700  sub Copy1 { Line 700  sub Copy1 {
  my ($type,$return)=&exists($user, $domain, $newfilename);   my ($type,$return)=&exists($user, $domain, $newfilename);
  $request->print($return);   $request->print($return);
  if ($type eq 'error') {   if ($type eq 'error') {
     $request->print('<br /><a href="'.&url($fn).'">'.&mt('Cancel').'</a>');      $request->print('<br /><a href="'.&url($fn).'">'.&mt('Cancel').'</a></form>');
     return;      return;
  }   }
   # Check if there is enough space.
           my @fileinfo = stat($fn);
           my ($dir,$fname) = ($fn =~ m{^(.+/)([^/]+)$});
           my $filesize = $fileinfo[7];
           $filesize = int($filesize/1000); #expressed in kb
           my $output = &Apache::loncommon::excess_filesize_warning($user,$domain,'author',
                                                                    $fname,$filesize,'copy');
           if ($output) {
               $request->print($output.'<br /><a href="'.&url($dir).'">'.&mt('Cancel').'</a></form>');
               return;
           }
     $request->print(      $request->print(
         '<input type="hidden" name="newfilename"'          '<input type="hidden" name="newfilename"'
        .' value="'.$newfilename.'" />'         .' value="'.$newfilename.'" />'
Line 884  sub NewFile1 { Line 895  sub NewFile1 {
                 '</span></form></p>'.                  '</span></form></p>'.
                 '<p><form action="'.&url($fn).                  '<p><form action="'.&url($fn).
                 '" method="post"><p><input type="submit" value="'.&mt('Cancel').'" /></form></p>');                  '" method="post"><p><input type="submit" value="'.&mt('Cancel').'" /></form></p>');
             return;          } elsif ($type ne 'warning') {
               my $query = "";
               $query .= "?mode=" . $env{'form.mode'} unless (!exists($env{'form.mode'}) || !length($env{'form.mode'}));
               $request->print('
                   <script type="text/javascript">
                       window.location = "'.&url($newfilename). $query .'";
                   </script>');
           } else {
               $request->print('<p>'.&mt('Make new file').' '.&display($newfilename).'?</p>');
               $request->print('</form>');
               $request->print('<form action="'.&url($newfilename).
                           '" method="post"><p><input type="submit" value="'.&mt('Continue').'" /></p></form>');
               $request->print('<form action="'.&url($fn).
                           '" method="post"><p><input type="submit" value="'.&mt('Cancel').'" /></p></form>');
         }          }
   
  $request->print('<p>'.&mt('Make new file').' '.&display($newfilename).'?</p>');  
  $request->print('</form>');  
   
  $request->print('<form action="'.&url($newfilename).  
  '" method="post"><p><input type="submit" value="'.&mt('Continue').'" /></p></form>');  
  $request->print('<form action="'.&url($fn).  
  '" method="post"><p><input type="submit" value="'.&mt('Cancel').'" /></p></form>');  
     }      }
     return;      return;
 }  }
Line 1410  sub handler { Line 1426  sub handler {
   
     $r=shift;      $r=shift;
   
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['decompress','action','filename','newfilename']);      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['decompress','action','filename','newfilename','mode']);
   
     &Debug($r, "loncfile.pm - handler entered");      &Debug($r, "loncfile.pm - handler entered");
     &Debug($r, " filename: ".$env{'form.filename'});      &Debug($r, " filename: ".$env{'form.filename'});
Line 1488  function writeDone() { Line 1504  function writeDone() {
     # Breadcrumbs      # Breadcrumbs
     &Apache::lonhtmlcommon::clear_breadcrumbs();      &Apache::lonhtmlcommon::clear_breadcrumbs();
     &Apache::lonhtmlcommon::add_breadcrumb({      &Apache::lonhtmlcommon::add_breadcrumb({
         'text'  => 'Construction Space',          'text'  => 'Authoring Space',
         'href'  => &Apache::loncommon::authorspace($fn),          'href'  => &Apache::loncommon::authorspace($fn),
     });      });
     &Apache::lonhtmlcommon::add_breadcrumb({      &Apache::lonhtmlcommon::add_breadcrumb({
         'text'  => 'File Operation',          'text'  => 'File Operation',
         'title' => 'Construction Space File Operation',          'title' => 'Authoring Space File Operation',
         'href'  => '',          'href'  => '',
     });      });
   
     $r->print(&Apache::loncommon::start_page('Construction Space File Operation',      $r->print(&Apache::loncommon::start_page('Authoring Space File Operation',
      $js,       $js,
      {'add_entries' => \%loaditem,})       {'add_entries' => \%loaditem,})
              .&Apache::lonhtmlcommon::breadcrumbs()               .&Apache::lonhtmlcommon::breadcrumbs()

Removed from v.1.118  
changed lines
  Added in v.1.123


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