Diff for /loncom/interface/portfolio.pm between versions 1.187 and 1.188

version 1.187, 2008/01/21 11:36:07 version 1.188, 2008/01/21 18:00:30
Line 339  sub display_directory { Line 339  sub display_directory {
     undef($colspan);      undef($colspan);
                 }                  }
  $r->print('<tr class="LC_browser_folder"><td '.$colspan.'><img alt="'.&mt('closed folder').'" src="'.$iconpath.'folder_closed.gif" /></td>');   $r->print('<tr class="LC_browser_folder"><td '.$colspan.'><img alt="'.&mt('closed folder').'" src="'.$iconpath.'folder_closed.gif" /></td>');
                 $r->print('<td>Go to ...</td>');                  $r->print('<td>'.&mt('Go to ...').'</td>');
                 my %anchor_fields = (                  my %anchor_fields = (
                     'selectfile'    => $filename.'/',                      'selectfile'    => $filename.'/',
                     'currentpath'   => $current_path.$filename.'/',                      'currentpath'   => $current_path.$filename.'/',
Line 363  sub display_directory { Line 363  sub display_directory {
                         my %anchor_fields = (                          my %anchor_fields = (
                             'lockinfo' => $fullpath                              'lockinfo' => $fullpath
                         );                          );
                         $line.='<td colspan="2">'.&make_anchor($url,\%anchor_fields,'Locked').'</td>';                          $line.='<td colspan="2">'.&make_anchor($url,\%anchor_fields,&mt('Locked')).'</td>';
  $css_class= 'LC_browser_file_locked';   $css_class= 'LC_browser_file_locked';
                     } else {                      } else {
                         if (!$can_modify) {                          if (!$can_modify) {
Line 381  sub display_directory { Line 381  sub display_directory {
                                 'rename' => $filename,                                  'rename' => $filename,
                                 currentpath => $current_path                                  currentpath => $current_path
                             );                              );
                             $line .= &make_anchor($url,\%anchor_fields,'Rename');                              $line .= &make_anchor($url,\%anchor_fields,&mt('Rename'));
                             $line .= '</td><td>'.&make_anchor($href_edit_location.$filename.'.meta',\%anchor_fields,$cat);                              $line .= '</td><td>'.&make_anchor($href_edit_location.$filename.'.meta',\%anchor_fields,$cat);
                             # '<a href="'.$href_edit_location.$filename.'.meta">'.$cat.'</a>';                              # '<a href="'.$href_edit_location.$filename.'.meta">'.$cat.'</a>';
                         }                          }
Line 543  sub delete { Line 543  sub delete {
     } else {      } else {
         if (scalar(@files)) {          if (scalar(@files)) {
             &open_form($r,$url);              &open_form($r,$url);
             $r->print('<p>'.&mt('Delete').' '.&display_file(undef,\@files).'?</p>');              $r->print('<p>'.&mt('Delete [_1]?',&display_file(undef,\@files)).'</p>');
             &close_form($r,$url);              &close_form($r,$url);
         } else {          } else {
             $r->print("No file was checked to delete.<br />");              $r->print("No file was checked to delete.<br />");
Line 610  sub delete_confirmed { Line 610  sub delete_confirmed {
 sub delete_dir {  sub delete_dir {
     my ($r,$url)=@_;      my ($r,$url)=@_;
     &open_form($r,$url);      &open_form($r,$url);
     $r->print('<p>'.&mt('Delete').' '.&display_file().'?</p>');       $r->print('<p>'.&mt('Delete [_1]?',&display_file()).'</p>');
     &close_form($r,$url);      &close_form($r,$url);
 }   } 
   
Line 625  sub delete_dir_confirmed { Line 625  sub delete_dir_confirmed {
        $directory_name);         $directory_name);
                 
     if ($result ne 'ok') {      if ($result ne 'ok') {
  $r->print('<span class="LC_error"> An error occurred (dir) ('.$result.   $r->print('<span class="LC_error">'
   ') while trying to delete '.$directory_name.'</span><br />');                    .&mt('An error occurred (dir) ([_1]) while trying to delete [_2].'
                          ,$result,$directory_name)
                     .'</span><br />');
     } else {      } else {
         # now remove from recent          # now remove from recent
         &Apache::lonhtmlcommon::remove_recent($namespace,[$directory_name.'/']);          &Apache::lonhtmlcommon::remove_recent($namespace,[$directory_name.'/']);
Line 650  sub rename { Line 652  sub rename {
         $r->print(&done(undef,$url));          $r->print(&done(undef,$url));
     } else {      } else {
         &open_form($r,$url);          &open_form($r,$url);
         $r->print('<p>'.&mt('Rename').' '.&display_file().' to           $r->print('<p>'.&mt('Rename [_1] to [_2]?', &display_file()
                    <input name="filenewname" type="input" size="50" />?</p>');                    , '<input name="filenewname" type="input" size="50" />').'</p>');
         &close_form($r,$url);          &close_form($r,$url);
     }      }
 }  }
Line 677  sub rename_confirmed { Line 679  sub rename_confirmed {
         $chg_access = &access_for_renamed($filenewname,$group,$udom,$uname);          $chg_access = &access_for_renamed($filenewname,$group,$udom,$uname);
     } else {            } else {      
  $r->print('<span class="LC_error">'.   $r->print('<span class="LC_error">'.
   &mt('An error occurred ([_1]) while trying to rename [_2]'    &mt('An error occurred ([_1]) while trying to rename [_2] to [_3]'
       .' to [_3]',$result,&display_file(),                        ,$result,&display_file(),&display_file('',$filenewname))
       &display_file('',$filenewname)).'</span><br />');                    .'</span><br />');
         return;          return;
     }      }
     if ($filenewname ne $env{'form.filenewname'}) {      if ($filenewname ne $env{'form.filenewname'}) {
Line 782  sub display_access { Line 784  sub display_access {
                               $action);                                $action);
         my $button_text = {          my $button_text = {
                         'continue' => &mt('Proceed'),                          'continue' => &mt('Proceed'),
                         'cancel' => &mt('Back to Directory'),                          'cancel' => &mt('Return to directory'),
                       };                        };
         &close_form($r,$url,$button_text);          &close_form($r,$url,$button_text);
     } else {      } else {
Line 810  sub view_access_settings { Line 812  sub view_access_settings {
         $todisplay{$scope}{$key} = $$access_controls{$key};          $todisplay{$scope}{$key} = $$access_controls{$key};
     }      }
     if ($aclcount) {      if ($aclcount) {
         $r->print(&mt('<h4>Current access controls defined for this file:</h4>'));          $r->print('<h4>'.&mt('Current access controls defined for this file:').'</h4>');
         $r->print(&Apache::loncommon::start_data_table());          $r->print(&Apache::loncommon::start_data_table());
         $r->print(&Apache::loncommon::start_data_table_header_row());          $r->print(&Apache::loncommon::start_data_table_header_row());
         $r->print('<th>'.&mt('Access control').'</th><th>'.&mt('Dates available').          $r->print('<th>'.&mt('Access control').'</th><th>'.&mt('Dates available').
Line 821  sub view_access_settings { Line 823  sub view_access_settings {
         &build_access_summary($r,$count,$chg,%todisplay);          &build_access_summary($r,$count,$chg,%todisplay);
         $r->print(&Apache::loncommon::end_data_table());          $r->print(&Apache::loncommon::end_data_table());
     } else {      } else {
         $r->print(&mt('No access control settings currently exist for this file.<br />' ));          $r->print(&mt('No access controil settings currently exist for this file.').'<br />');
     }      }
     my %anchor_fields = (      my %anchor_fields = (
         'currentpath' => $env{'form.currentpath'}          'currentpath' => $env{'form.currentpath'}
     );      );
     $r->print('<br />'.&make_anchor($url, \%anchor_fields, &mt('Return to directory listing')));      $r->print('<br />'.&make_anchor($url, \%anchor_fields, &mt('Return to directory')));
     return;      return;
 }  }
   
Line 1031  sub update_access { Line 1033  sub update_access {
         &open_form($r,$url);          &open_form($r,$url);
         foreach my $newitem ('course','domains','users') {          foreach my $newitem ('course','domains','users') {
             if ($env{'form.new'.$newitem} > 0) {              if ($env{'form.new'.$newitem} > 0) {
                 $r->print('<br />'.&mt('Add new <b>[_1]-based</b> access control for portfolio file: <b>[_2]</b>',$newitem,$env{'form.currentpath'}.$env{'form.selectfile'}).'<br /><br />');                  $r->print('<br />'.&mt('Add new <b>[_1]-based</b> access control for portfolio file: <b>[_2]</b>',&mt($newitem),$env{'form.currentpath'}.$env{'form.selectfile'}).'<br /><br />');
                 $firstitem = $totalnew;                  $firstitem = $totalnew;
                 $lastitem = $totalnew + $env{'form.new'.$newitem};                  $lastitem = $totalnew + $env{'form.new'.$newitem};
                 $totalnew = $lastitem;                  $totalnew = $lastitem;
Line 1051  sub update_access { Line 1053  sub update_access {
         );          );
         $r->print('<br />'.&make_anchor($url, \%anchor_fields, &mt('Display all access settings for this file')));          $r->print('<br />'.&make_anchor($url, \%anchor_fields, &mt('Display all access settings for this file')));
         delete $anchor_fields{'access'};          delete $anchor_fields{'access'};
         $r->print('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.&make_anchor($url,\%anchor_fields,&mt('Return to directory listing')));          $r->print('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.&make_anchor($url,\%anchor_fields,&mt('Return to directory')));
     }      }
     return;      return;
 }  }
Line 1311  sub access_element { Line 1313  sub access_element {
     my $title = $type;      my $title = $type;
     $title =~ s/s$//;      $title =~ s/s$//;
     $title =~ s/^(\w)/uc($1)/e;      $title =~ s/^(\w)/uc($1)/e;
     $r->print('<h3>'.&mt('[_1]-based conditional access: ',$title));      $r->print('<h3>'.&mt('[_1]-based conditional access: ',&mt($title)));
     if ($$acl_count{$type}) {      if ($$acl_count{$type}) {
         $r->print($$acl_count{$type}.' ');          $r->print($$acl_count{$type}.' ');
         if ($$acl_count{$type} > 1) {          if ($$acl_count{$type} > 1) {
Line 1366  sub display_access_row { Line 1368  sub display_access_row {
         }          }
         $r->print(&Apache::loncommon::end_data_table());          $r->print(&Apache::loncommon::end_data_table());
     } else {      } else {
         $r->print(&mt('No [_1]-based conditions defined.',$type).'<br />'          $r->print(&mt('No [_1]-based conditions defined.',&mt($type)).'<br />'
                   .&additional_item($type));                    .&additional_item($type));
     }      }
     return;      return;
Line 1526  sub users_row { Line 1528  sub users_row {
   
 sub additional_item {  sub additional_item {
     my ($type) = @_;      my ($type) = @_;
     my $output = &mt('Add new [_1] condition(s)?',$type).'&nbsp;'.&mt('Number to add: ').'<input type="text" name="new'.$type.'" size="3" value="0" />';      my $output = &mt('Add new [_1] condition(s)?',&mt($type)).'&nbsp;'.&mt('Number to add: ').'<input type="text" name="new'.$type.'" size="3" value="0" />';
     return $output;      return $output;
 }  }
   
Line 1781  sub check_for_upload { Line 1783  sub check_for_upload {
     } elsif ($found_file) {      } elsif ($found_file) {
         if ($locked_file) {          if ($locked_file) {
             my $msg = '<span class="LC_error">';              my $msg = '<span class="LC_error">';
             $msg .= &mt('Unable to upload [_1] a locked file by that name was found in [_2].','<span class="LC_filename">'.$fname.'</span>','<span class="LC_filename">'.$port_path.$env{'form.currentpath'}.'</span>');              $msg .= &mt('Unable to upload [_1]. A locked file by that name was found in [_2].','<span class="LC_filename">'.$fname.'</span>','<span class="LC_filename">'.$port_path.$env{'form.currentpath'}.'</span>');
             $msg .= '</span><br />';              $msg .= '</span><br />';
             $msg .= &mt('You will be able to rename or delete existing [_1] after a grade has been assigned.','<span class="LC_filename">'.$fname.'</span>');              $msg .= &mt('You will be able to rename or delete existing [_1] after a grade has been assigned.','<span class="LC_filename">'.$fname.'</span>');
     return ('file_locked',$msg);      return ('file_locked',$msg);
Line 1821  sub upload { Line 1823  sub upload {
  $port_path.$env{'form.currentpath'},   $port_path.$env{'form.currentpath'},
  $mode,\%allfiles,\%codebase);   $mode,\%allfiles,\%codebase);
     if ($result !~ m|^/uploaded/|) {      if ($result !~ m|^/uploaded/|) {
  $r->print('<span class="LC_error">'.'An error occurred ('.$result.   $r->print('<span class="LC_error">'.&mt('An error occurred ([_1]) while trying to upload [_2].'
   ') while trying to upload '.&display_file().'</span><br />');                    ,$result,&display_file()).'</span><br />');
  $r->print(&done('Back',$url));   $r->print(&done('Back',$url));
     } else {      } else {
  if (%allfiles) {   if (%allfiles) {
Line 1838  STATE Line 1840  STATE
     $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,}));
     $r->print('<p>Or '.&done('Return to directory listing',$url).'</p>');      $r->print('<p>Or '.&done('Return to directory',$url).'</p>');
  } else {   } else {
     $r->print(&done(undef,$url));      $r->print(&done(undef,$url));
  }   }
Line 1880  sub upload_embedded { Line 1882  sub upload_embedded {
     &Apache::lonnet::userfileupload('embedded_item_'.$i,'',      &Apache::lonnet::userfileupload('embedded_item_'.$i,'',
     $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">'
       ') while trying to upload '.$orig_uploaded_filename.' for embedded element '.$env{'form.embedded_orig_'.$i}.'</span><br />');                        .&mt('An error occurred ([_1]) while trying to upload [_2] for embedded element [_3].'
                              ,$result,$orig_uploaded_filename,$env{'form.embedded_orig_'.$i})
                         .'</span><br />');
     next;      next;
  } else {   } else {
     $r->print("<p> Uploaded ".      $r->print("<p> Uploaded ".
Line 1926  sub lock_info { Line 1930  sub lock_info {
     my %course_description =       my %course_description = 
  &Apache::lonnet::coursedescription($$array_item[1]);   &Apache::lonnet::coursedescription($$array_item[1]);
     if ( $course_description{'description'} ne '') {      if ( $course_description{'description'} ne '') {
  $r->print(&mt('In the course: <strong>[_1]</strong><br />',   $r->print(&mt('In the course:').' <strong>'.$course_description{'description'}.'</strong><br />');
       $course_description{'description'}));  
     }      }
         }          }
     }      }
Line 1955  sub createdir { Line 1958  sub createdir {
         }          }
     }      }
     if ($found_file){      if ($found_file){
        $r->print('<span class="LC_error">'.&mt('Unable to create a directory named').' <strong>'.$newdir.         $r->print('<span class="LC_error">'
                '</strong>. '.&mt('A file or directory by that name already exists.').'</span><br />');                        .&mt('Unable to create a directory named [_1].','<strong>'.$newdir.'</strong>')
                         .' '.&mt('A file or directory by that name already exists.').'</span><br />');
     } else {      } else {
         my ($uname,$udom) = &get_name_dom();          my ($uname,$udom) = &get_name_dom();
         my $port_path = &get_port_path();          my $port_path = &get_port_path();
         my $result=&Apache::lonnet::mkdiruserfile($uname,$udom,          my $result=&Apache::lonnet::mkdiruserfile($uname,$udom,
          $port_path.$env{'form.currentpath'}.$newdir);           $port_path.$env{'form.currentpath'}.$newdir);
         if ($result ne 'ok') {          if ($result ne 'ok') {
        $r->print('<span class="LC_error">'.'An error occurred ('.$result.         $r->print('<span class="LC_error">'
           ') while trying to create a new directory '.&display_file().'</span><br />');                        .&mt('An error occurred ([_1]) while trying to create a new directory [_2].'
                              ,$result,&display_file())
                         .'</span><br />');
         }          }
     }      }
     if ($newdir ne $env{'form.newdir'}) {      if ($newdir ne $env{'form.newdir'}) {
         $r->print(&mt("The new directory name was changed from:")."<br /><strong>".$env{'form.newdir'}."</strong> ".&mt('to')." <strong>$newdir </strong>");            $r->print(&mt('The new directory name was changed from [_1] to [_2].'
                         ,'<strong>'.$env{'form.newdir'}.'</strong>','<strong>'.$newdir.'</strong>'));  
     }      }
     $r->print(&done(undef,$url));      $r->print(&done(undef,$url));
 }  }
Line 2069  sub missing_priv { Line 2076  sub missing_priv {
         $rtnlink .= '?';          $rtnlink .= '?';
     }      }
     $rtnlink .= 'currentpath='.$escpath;      $rtnlink .= 'currentpath='.$escpath;
     $r->print(&mt('<h3>Action disallowed</h3>'));      $r->print('<h3>'.&mt('Action disallowed').'</h3>');
     $r->print(&mt('You do not have sufficient privileges to [_1] ',      $r->print(&mt('You do not have sufficient privileges to [_1] ',
                   $longtext->{$priv}));                    $longtext->{$priv}));
     if (defined($env{'form.group'})) {      if (defined($env{'form.group'})) {
Line 2078  sub missing_priv { Line 2085  sub missing_priv {
     } else {      } else {
         $r->print(&mt('in this portfolio.'));          $r->print(&mt('in this portfolio.'));
     }      }
     $rtnlink .= '">'.&mt('Return to directory listing page').'</a>';      $rtnlink .= '">'.&mt('Return to directory').'</a>';
     $r->print('<br />'.$rtnlink);      $r->print('<br />'.$rtnlink);
     $r->print(&Apache::loncommon::end_page());      $r->print(&Apache::loncommon::end_page());
     return;      return;
Line 2170  sub handler { Line 2177  sub handler {
                 $r->print(&mt('Not a valid group for this course'));                  $r->print(&mt('Not a valid group for this course'));
                 $earlyout = 1;                  $earlyout = 1;
             }              }
             $title = &mt('Group files').' for '.$group;               $title = &mt('Group files for [_1]', $group); 
         } else {          } else {
             $r->print(&mt('Invalid group'));              $r->print(&mt('Invalid group'));
             $earlyout = 1;              $earlyout = 1;
Line 2229  sub handler { Line 2236  sub handler {
     }      }
  if (($env{'form.storeupl'}) & (!$env{'form.uploaddoc.filename'})){   if (($env{'form.storeupl'}) & (!$env{'form.uploaddoc.filename'})){
        $r->print('<span class="LC_error">');         $r->print('<span class="LC_error">');
        $r->print(&mt('No file was selected to upload. '));         $r->print(&mt('No file was selected to upload.').' ');
     $r->print(&mt('To upload a file, click <strong>Browse...</strong> select a file, then click <strong>Upload</strong>.'));      $r->print(&mt('To upload a file, click <strong>Browse...</strong> and select a file, then click <strong>Upload</strong>.'));
     $r->print('</span>');      $r->print('</span>');
  }   }
     if ($env{'form.meta'}) {      if ($env{'form.meta'}) {

Removed from v.1.187  
changed lines
  Added in v.1.188


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