Diff for /loncom/homework/inputtags.pm between versions 1.266 and 1.271

version 1.266, 2010/08/07 19:24:03 version 1.271, 2010/09/05 20:57:42
Line 186  sub start_textfield { Line 186  sub start_textfield {
     if ($addchars) {      if ($addchars) {
  $result.=&addchars('HWVAL_'.$resid,$addchars);   $result.=&addchars('HWVAL_'.$resid,$addchars);
     }      }
             $result .= &Apache::lonhtmlcommon::htmlareaselectactive();  
             my $textareaclass = 'class="LC_richDetectHtml"';              my $textareaclass = 'class="LC_richDetectHtml"';
     $result.= '<textarea wrap="hard" name="HWVAL_'.$resid.'" id="HWVAL_'.$resid.'" '.      $result.= '<textarea wrap="hard" name="HWVAL_'.$resid.'" id="HWVAL_'.$resid.'" '.
       'rows="'.$rows.'" cols="'.$cols.'" '.$textareaclass.'>'.        'rows="'.$rows.'" cols="'.$cols.'" '.$textareaclass.'>'.
Line 485  sub file_selector { Line 484  sub file_selector {
     my $current_files_display = &current_file_submissions($part,$id);      my $current_files_display = &current_file_submissions($part,$id);
     my $addfiles;      my $addfiles;
     if ($current_files_display) {      if ($current_files_display) {
         $result .= &Apache::lonhtmlcommon::row_title(&mt('Currently submitted files:')).          $result .= &Apache::lonhtmlcommon::row_title(&mt('Currently submitted files')).
                    $current_files_display.                     $current_files_display.
                    &Apache::lonhtmlcommon::row_closure();                     &Apache::lonhtmlcommon::row_closure();
         $addfiles = &mt('Submit other file(s)');          $addfiles = &mt('Submit other file(s)');
Line 528  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('File').'</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();
     my (undef,$crsid,$udom,$uname)=&Apache::lonnet::whichuser();      my (undef,$crsid,$udom,$uname)=&Apache::lonnet::whichuser();
     my ($cdom,$cnum) = ($crsid =~ /^($LONCAPA::match_domain)_($LONCAPA::match_courseid)$/);      my ($cdom,$cnum) = ($crsid =~ /^($LONCAPA::match_domain)_($LONCAPA::match_courseid)$/);
     my ($result,$header_shown,%okfiles,%rows,@bad_file_list);      my ($result,$header_shown,%okfiles,%rows,%legacy,@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;
               $legacy{$url} = 1;
             &Apache::lonxml::extlink($url);              &Apache::lonxml::extlink($url);
             &Apache::lonnet::allowuploaded('/adm/essayresponse',$url);              &Apache::lonnet::allowuploaded('/adm/essayresponse',$url);
         } else {          } else {
Line 585  sub current_file_submissions { Line 588  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";
                           }
                           my $showname = $rows{$url}{path}.$name;
                           if ($legacy{$url}) {
                               $showname = $name.' '.&mt('not in portfolio');
                           }
                           $result .= 
                             '<td><a href="'.$link.'"><img src="'.$icon.                              '<td><a href="'.$link.'"><img src="'.$icon.
                             '" border="0" />'.$name.'</a></td>'."\n".                              '" border="0" />'.$showname.'</a></td>'."\n".
                             '<td align="right" valign="bottom">'.$rows{$url}{size}.'</td>'."\n".                              '<td align="right" valign="bottom">'.$rows{$url}{size}.'</td>'."\n".
                             '<td align="right" valign="bottom">'.$rows{$url}{lastmodified}.'</td>'."\n".                              '<td align="right" valign="bottom">'.$rows{$url}{lastmodified}.'</td>'."\n".
                             &Apache::loncommon::end_data_table_row();                              &Apache::loncommon::end_data_table_row();

Removed from v.1.266  
changed lines
  Added in v.1.271


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