');
+ } # end "if can_upload"
+
my @tree = split (/\//,$current_path);
my %anchor_fields = (
'selectfile' => $port_path,
@@ -176,7 +191,7 @@ sub display_directory_line {
$href_location, $url, $current_path, $access_admin_text, $versions)=@_;
my $fullpath = &prepend_group($current_path.$filename);
- $r->print('
');
+ $r->print(&Apache::loncommon::start_data_table_row());
$r->print($line); # contains first two cells of table
my $lock_info;
if ($version_flag) { # versioned can't be versioned, so TRUE when root file
@@ -212,15 +227,19 @@ sub display_directory_line {
$r->print('
');
}
$r->print('');
}
@@ -1534,7 +1575,7 @@ sub additional_item {
sub actionbox {
my ($status,$num,$scope) = @_;
- my $output = ' '.
''.&mt('Update');
}
@@ -1564,7 +1605,7 @@ sub dateboxes {
undef,undef,1);
my $enddate = &Apache::lonhtmlcommon::date_setter('portform',
'enddate_'.$num,$end,undef,undef,undef,1,undef,
- undef,undef,1). ' '.
+ undef,undef,1). ' '.
''.&mt('No end date').
'';
@@ -1738,15 +1779,28 @@ ENDSMP
ENDSMP
$r->print($javascript);
- $r->print("
".&mt('Select portfolio files')."
".
- &mt('Check as many as you wish in response to the problem.')." ");
+ $r->print("
".&mt('Select portfolio files')."
");
my @otherfiles=&Apache::lonnet::files_not_in_path($env{'user.name'}, $env{'form.currentpath'});
if (@otherfiles) {
- $r->print("".&mt('Files selected from other directories:')." ");
+ $r->print(&Apache::loncommon::start_data_table()
+ .&Apache::loncommon::start_data_table_header_row()
+ .'
'
+ .&mt('Check as many files as you wish in response to the problem:')
+ .'
'
+ );
}
@@ -1801,10 +1855,17 @@ sub check_for_upload {
sub upload {
my ($r,$url,$group)=@_;
my $fname=&Apache::lonnet::clean_filename($env{'form.uploaddoc.filename'});
-
- my ($state,$msg) = &check_for_upload($env{'form.currentpath'},
- $fname,$group,'uploaddoc');
-
+ my $disk_quota = &get_quota($group);
+ my $portfolio_root = &get_portfolio_root();
+ my $port_path = &get_port_path();
+ my ($uname,$udom) = &get_name_dom($group);
+ my $getpropath = 1;
+ my $current_disk_usage = &Apache::lonnet::diskusage($udom,$uname,$portfolio_root,$getpropath);
+ my ($state,$msg) =
+ &Apache::loncommon::check_for_upload($env{'form.currentpath'},$fname,
+ $group,'uploaddoc',$portfolio_root,
+ $port_path,$disk_quota,
+ $current_disk_usage,$uname,$udom);
if ($state eq 'will_exceed_quota'
|| $state eq 'file_locked'
|| $state eq 'file_exists' ) {
@@ -1812,11 +1873,11 @@ sub upload {
return;
}
- my $port_path = &get_port_path();
my (%allfiles,%codebase,$mode);
if ($env{'form.uploaddoc.filename'} =~ m/(\.htm|\.html|\.shtml)$/i) {
- $mode = 'parse';
-
+ if ($env{'form.parserflag'}) {
+ $mode = 'parse';
+ }
}
my $result=
&Apache::lonnet::userfileupload('uploaddoc','',
@@ -1828,73 +1889,27 @@ sub upload {
$r->print(&done('Back',$url));
} else {
if (%allfiles) {
- my $state = <
STATE
- $r->print("
".&mt("Reference Warning")."
");
- $r->print("
".&mt("Completed upload of the file. This file contained references to other files. You must upload the referenced files or else the uploaded file may not work properly.")."
");
- $r->print("
".&mt("Please select the locations from which the referenced files are to be uploaded.")."
".&mt("Completed upload of the file. This file contained references to other files. You must upload the referenced files or else the uploaded file may not work properly.")."
");
+ $r->print("
".&mt("Please select the locations from which the referenced files are to be uploaded.")."