Diff for /loncom/interface/londocs.pm between versions 1.549 and 1.553

version 1.549, 2013/05/21 19:05:05 version 1.553, 2013/07/16 14:08:18
Line 2704  sub editor { Line 2704  sub editor {
             }              }
             $to_show .= &Apache::loncommon::start_scrollbox('400px','380px','200px','contentscroll')              $to_show .= &Apache::loncommon::start_scrollbox('400px','380px','200px','contentscroll')
                        .'<div class="LC_info" id="contentlist">'                         .'<div class="LC_info" id="contentlist">'
                        .&mt('Currently no documents.')                         .&mt('Currently empty')
                        .'</div>'                         .'</div>'
                        .&Apache::loncommon::end_scrollbox();                         .&Apache::loncommon::end_scrollbox();
         }          }
Line 2717  sub editor { Line 2717  sub editor {
                       .'</div>';                        .'</div>';
         } else {          } else {
             $to_show = '<div class="LC_info" id="contentlist">'              $to_show = '<div class="LC_info" id="contentlist">'
                       .&mt('Currently no documents.')                        .&mt('Currently empty')
                       .'</div>'                        .'</div>'
         }          }
     }      }
Line 2802  sub multiple_check_form { Line 2802  sub multiple_check_form {
 }  }
   
 sub process_file_upload {  sub process_file_upload {
     my ($upload_output,$coursenum,$coursedom,$allfiles,$codebase,$uploadcmd) = @_;      my ($upload_output,$coursenum,$coursedom,$allfiles,$codebase,$uploadcmd,$crstype) = @_;
 # upload a file, if present  # upload a file, if present
       my $filesize = length($env{'form.uploaddoc'});
       if (!$filesize) {
           $$upload_output = '<div class="LC_error">'.
                              &mt('Unable to upload [_1]. (size = [_2] bytes)',
                             '<span class="LC_filename">'.$env{'form.uploaddoc.filename'}.'</span>',
                             $filesize).'<br />'.
                             &mt('Either the file you attempted to upload was empty, or your web browser was unable to read its contents.').'<br />'.
                             '</div>';
           return;
       }
       my $quotatype = 'unofficial';
       if ($crstype eq 'Community') {
           $quotatype = 'community';    
       } elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.instcode'}) {
           $quotatype = 'official';
       }
       if (&Apache::loncommon::get_user_quota($coursenum,$coursedom,'course',$quotatype)) {
           $filesize = int($filesize/1000); #expressed in kb
           $$upload_output = &Apache::loncommon::excess_filesize_warning($coursenum,$coursedom,'course',
                                                                         $env{'form.uploaddoc.filename'},$filesize,'upload');
           return if ($$upload_output);
       }
     my ($parseaction,$showupload,$nextphase,$mimetype);      my ($parseaction,$showupload,$nextphase,$mimetype);
     if ($env{'form.parserflag'}) {      if ($env{'form.parserflag'}) {
         $parseaction = 'parse';          $parseaction = 'parse';
Line 3123  ENDREM Line 3145  ENDREM
                 push(@{$filtersref->{'canremove'}},$orderidx);                  push(@{$filtersref->{'canremove'}},$orderidx);
             }              }
         }          }
         unless ($isexternal) {          $renamelink=(<<ENDREN);
             $renamelink=(<<ENDREN);  
 <a href='javascript:changename("$esc_path","$index","$renametitle");' class="LC_docs_rename">$lt{'rn'}</a>  <a href='javascript:changename("$esc_path","$index","$renametitle");' class="LC_docs_rename">$lt{'rn'}</a>
 ENDREN  ENDREN
         }  
  $line.=(<<END);   $line.=(<<END);
 <td>  <td>
 <div class="LC_docs_entry_move">  <div class="LC_docs_entry_move">
Line 4360  sub handler { Line 4380  sub handler {
           # Process file upload - phase one - upload and parse primary file.            # Process file upload - phase one - upload and parse primary file.
   undef($hadchanges);    undef($hadchanges);
           $uploadphase = &process_file_upload(\$upload_output,$coursenum,$coursedom,            $uploadphase = &process_file_upload(\$upload_output,$coursenum,$coursedom,
                                               \%allfiles,\%codebase,$context);                                                \%allfiles,\%codebase,$context,$crstype);
   if ($hadchanges) {    if ($hadchanges) {
       &mark_hash_old();        &mark_hash_old();
   }    }
Line 4412  sub handler { Line 4432  sub handler {
        my %lt=&Apache::lonlocal::texthash(         my %lt=&Apache::lonlocal::texthash(
  'copm' => 'All documents out of a published map into this folder',   'copm' => 'All documents out of a published map into this folder',
                 'upfi' => 'Upload File',                  'upfi' => 'Upload File',
                 'upld' => 'Import Content',                  'upld' => 'Upload Content',
                 'srch' => 'Search',                  'srch' => 'Search',
                 'impo' => 'Import',                  'impo' => 'Import',
  'lnks' => 'Import from Stored Links',   'lnks' => 'Import from Stored Links',
Line 4433  sub handler { Line 4453  sub handler {
                 'grpo' => 'Group Portfolio',                  'grpo' => 'Group Portfolio',
                 'rost' => 'Course Roster',                  'rost' => 'Course Roster',
                 'abou' => 'Personal Information Page for a User',                  'abou' => 'Personal Information Page for a User',
                 'imsf' => 'IMS Import',                  'imsf' => 'IMS Upload',
                 'imsl' => 'Import IMS package',                  'imsl' => 'Upload IMS package',
                 'cms'  => 'Origin of IMS package',                  'cms'  => 'Origin of IMS package',
                 'se'   => 'Select',                  'se'   => 'Select',
                 'file' =>  'File',                  'file' =>  'File',
Line 4807  NGFFORM Line 4827  NGFFORM
         $communityform = &create_form_ul(&create_list_elements(@communityforma));          $communityform = &create_form_ul(&create_list_elements(@communityforma));
   
 my %orderhash = (  my %orderhash = (
                 'aa' => ['Import Content',$fileuploadform],                  'aa' => ['Upload',$fileuploadform],
                 'bb' => ['Published Content',$importpubform],                  'bb' => ['Import',$importpubform],
                 'cc' => ['Grading Resources',$gradingform],                  'cc' => ['Grading',$gradingform],
                 );                  );
 unless ($container eq 'page') {  unless ($container eq 'page') {
     $orderhash{'00'} = ['Newfolder',$newfolderform];      $orderhash{'00'} = ['Newfolder',$newfolderform];
     $orderhash{'dd'} = ['Collaboration',$communityform];      $orderhash{'dd'} = ['Collaboration',$communityform];
     $orderhash{'ee'} = ['Special Pages',$specialdocumentsform];      $orderhash{'ee'} = ['Other',$specialdocumentsform];
 }  }
   
  $hadchanges=0;   $hadchanges=0;
Line 4948  my @supimportdoc = ( Line 4968  my @supimportdoc = (
 $supupdocform =  &create_form_ul(&create_list_elements(@supimportdoc));  $supupdocform =  &create_form_ul(&create_list_elements(@supimportdoc));
 my %suporderhash = (  my %suporderhash = (
  '00' => ['Supnewfolder', $supnewfolderform],   '00' => ['Supnewfolder', $supnewfolderform],
                 'ee' => ['Import Content',$supupdocform],                  'ee' => ['Upload',$supupdocform],
                 'ff' => ['Special Pages',&create_form_ul(&create_list_elements(@specialdocs))]                  'ff' => ['Other',&create_form_ul(&create_list_elements(@specialdocs))]
                 );                  );
         if ($supplementalflag) {          if ($supplementalflag) {
            my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype,             my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype,

Removed from v.1.549  
changed lines
  Added in v.1.553


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