Diff for /loncom/homework/inputtags.pm between versions 1.269 and 1.270

version 1.269, 2010/08/27 17:21:01 version 1.270, 2010/08/29 19:39:16
Line 527  sub current_file_submissions { Line 527  sub current_file_submissions {
     my ($part,$id) = @_;      my ($part,$id) = @_;
     my $jspart=$part;      my $jspart=$part;
     $jspart=~s/\./_/g;      $jspart=~s/\./_/g;
     my $uploadedfile=&HTML::Entities::encode($Apache::lonhomework::history{"resource.$part.$id.uploadedfile"},'<>&"');      my $uploadedfile=$Apache::lonhomework::history{"resource.$part.$id.uploadedfile"};
     my $portfiles=$Apache::lonhomework::history{"resource.$part.$id.portfiles"};      my $portfiles=$Apache::lonhomework::history{"resource.$part.$id.portfiles"};
     return if (($uploadedfile eq '') && ($portfiles !~/[^\s]/));      return if (($uploadedfile eq '') && ($portfiles !~/[^\s]/));
     my $header = &Apache::loncommon::start_data_table().      my $header = &Apache::loncommon::start_data_table().
                  &Apache::loncommon::start_data_table_header_row().                   &Apache::loncommon::start_data_table_header_row();
                  '<th>'.&mt('Delete?').'</th>'.      if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
                  '<th>'.&mt('Name').'</th>'.          $header .= '<th>'.&mt('Delete?').'</th>';
       }
       $header .=   '<th>'.&mt('Name').'</th>'.
                  '<th>'.&mt('Size (MB)').'</th>'.                   '<th>'.&mt('Size (MB)').'</th>'.
                  '<th>'.&mt('Last Modified').'</th>'.                   '<th>'.&mt('Last Modified').'</th>'.
                  &Apache::loncommon::end_data_table_header_row();                   &Apache::loncommon::end_data_table_header_row();
Line 542  sub current_file_submissions { Line 544  sub current_file_submissions {
     my ($result,$header_shown,%okfiles,%rows,@bad_file_list);      my ($result,$header_shown,%okfiles,%rows,@bad_file_list);
     if ($uploadedfile) {      if ($uploadedfile) {
         my $url=$Apache::lonhomework::history{"resource.$part.$id.uploadedurl"};          my $url=$Apache::lonhomework::history{"resource.$part.$id.uploadedurl"};
         my ($path,$name) = ($url =~ m{^/uploaded/\Q$cdom\E/\Q$cnum\E/(essayresponse/.+/)([^/]+)});          my $link = &HTML::Entities::encode($url,'<>&"');
           my ($path,$name) = ($url =~ m{^(/uploaded/\Q$udom\E/\Q$uname\E/essayresponse.*/)([^/]+)$});
         my ($status,$hashref,$error) =          my ($status,$hashref,$error) =
             &current_file_info($url,$uploadedfile,$name,$path);              &current_file_info($url,$link,$name,$path);
         if ($status eq 'ok') {          if ($status eq 'ok') {
             push(@{$okfiles{$name}},$url);              push(@{$okfiles{$name}},$url);
             $rows{$url} = $hashref;              $rows{$url} = $hashref;
Line 584  sub current_file_submissions { Line 587  sub current_file_submissions {
                             $header_shown = 1;                              $header_shown = 1;
                         }                          }
                         $result.=                          $result.=
                             &Apache::loncommon::start_data_table_row()."\n".                              &Apache::loncommon::start_data_table_row()."\n";
                             '<td valign="bottom"><input type="checkbox" name="HWFILE'.$jspart.'_'.$id.'_delete" value="'.                          if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
                             $portfile.'" /></td>'."\n".                              $result .=
                                    '<td valign="bottom"><input type="checkbox" name="HWFILE'.$jspart.'_'.$id.'_delete"'.
                                    ' value="'.$portfile.'" /></td>'."\n";
                           }
                           $result .= 
                             '<td><a href="'.$link.'"><img src="'.$icon.                              '<td><a href="'.$link.'"><img src="'.$icon.
                             '" border="0" />'.$name.'</a></td>'."\n".                              '" border="0" />'.$name.'</a></td>'."\n".
                             '<td align="right" valign="bottom">'.$rows{$url}{size}.'</td>'."\n".                              '<td align="right" valign="bottom">'.$rows{$url}{size}.'</td>'."\n".

Removed from v.1.269  
changed lines
  Added in v.1.270


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