Diff for /loncom/interface/lonsource.pm between versions 1.22 and 1.23

version 1.22, 2009/04/04 21:47:41 version 1.23, 2009/06/09 13:50:03
Line 1 Line 1
 # The LearningOnline Network with CAPA  # The LearningOnline Network with CAPA
 # Souce Code handler  # Source Code handler
 #  #
 # $Id$  # $Id$
 #  #
Line 129  sub confirm { Line 129  sub confirm {
 sub delete_copy_file {  sub delete_copy_file {
     my ($r, $author_name, $newpath, $filename, $path_to_new_file, $type) = @_;      my ($r, $author_name, $newpath, $filename, $path_to_new_file, $type) = @_;
     if($type eq '1') {      if($type eq '1') {
         $r->print("<b>Cannot delete non-obsolete published file</b><br />Please          $r->print('<p><span class="LC_warning">'
               use the code view in previous window to use shared code<br /><br />");                   .&mt('Cannot delete non-obsolete published file.')
         $r->print('<input type="button" value="Close Window" name="close" onClick="window.close()" />');                   .'</span><br />'
                    .&mt('Please use the code view in previous window to use shared code.')
                    .'<br /><br />');
           $r->print('<input type="button" value="Close Window" name="close"'
                    .' onClick="window.close()" />'
                    .'</p>');
     } else {      } else {
         if(-e $path_to_new_file) {          if(-e $path_to_new_file) {
             unless(unlink($path_to_new_file)) {              unless(unlink($path_to_new_file)) {
                 $r->print('<font color="red">'.&mt('Error').': '.$!.'</font>');                  $r->print('<p class="LC_error"">'.&mt('Error:').' '.$!.'</p>');
                 return 0;                  return 0;
             }              }
         } else {          } else {
             $r->print('<p> '.&mt('No such file').'. </p></form>');              $r->print('<p class="LC_error">'.&mt('No such file').'</p></form>');
             return 0;              return 0;
         }          }
         &copy_file($r, $author_name, $newpath, $filename, $path_to_new_file);          &copy_file($r, $author_name, $newpath, $filename, $path_to_new_file);
Line 158  sub copy_file { Line 163  sub copy_file {
   
             else {              else {
                 unless(mkdir($path, 02770)) {                  unless(mkdir($path, 02770)) {
                     $r->print('<font color="red">'.&mt('Error').': '.$!.'</font>');                      $r->print('<p class="LC_error">'.&mt('Error:').' '.$!.'</p>');
                     return 0;                      return 0;
                 }                  }
                 unless(chmod(02770, ($path))) {                  unless(chmod(02770, ($path))) {
                     $r->print('<font color="red"> '.&mt('Error').': '.$!.'</font>');                      $r->print('<p class="LC_error"> '.&mt('Error:').' '.$!.'</p>');
                     return 0;                      return 0;
                 }                  }
             }              }

Removed from v.1.22  
changed lines
  Added in v.1.23


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