--- loncom/interface/loncommon.pm 2010/12/25 16:01:54 1.948.2.17
+++ loncom/interface/loncommon.pm 2011/01/03 14:58:05 1.948.2.22
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.948.2.17 2010/12/25 16:01:54 raeburn Exp $
+# $Id: loncommon.pm,v 1.948.2.22 2011/01/03 14:58:05 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -4496,7 +4496,7 @@ Returns: HTML div with $content
sub head_subbox {
my ($content)=@_;
my $output =
- '
'
+ '
'
.$content
.'
'
}
@@ -4689,11 +4689,11 @@ sub bodytag {
$role = '
('.$role.')' if $role;
&get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']);
- if ($env{'environment.remote'} eq 'off') {
+ if ($env{'environment.remote'} ne 'on') {
# No Remote
if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') {
- return $bodytag;
- }
+ return $bodytag;
+ }
if ($env{'request.state'} eq 'construct') { $forcereg=1; }
@@ -4711,6 +4711,10 @@ sub bodytag {
$realm $dc_info
|;
return $bodytag;
}
+ if (($env{'request.noversionuri'} =~ m{^/adm/navmaps}) &&
+ ($env{'environment.remotenavmap'} eq 'on')) {
+ return $bodytag;
+ }
unless ($env{'request.symb'} =~ m/\.page___\d+___/) {
$bodytag .= qq|$name $role
|;
@@ -5160,7 +5164,7 @@ td.LC_table_cell_checkbox {
display:none;
}
-#LC_head_subbox {
+.LC_head_subbox {
clear:both;
background: #F8F8F8; /* $sidebg; */
border: 1px solid $sidebg;
@@ -8887,6 +8891,7 @@ sub upload_embedded {
if ($env{'form.embedded_ref_'.$i}) {
$pathchange{$i} = 1;
}
+ }
if ($output) {
$output = ''.$output.'
';
}
@@ -9086,7 +9091,7 @@ sub check_for_upload {
&mt('Unable to upload [_1]. (size = [_2] bytes)',
''.$fname.'',
$filesize).'
'.
- &mt('Either the file you uploaded was empty, or your web browser was unable to read its contents.').'
';
+ &mt('Either the file you attempted to upload was empty, or your web browser was unable to read its contents.').'
';
'';
return ('zero_bytes',$msg);
}
@@ -9096,6 +9101,11 @@ sub check_for_upload {
$getpropath);
my $found_file = 0;
my $locked_file = 0;
+ my @lockers;
+ my $navmap;
+ if ($env{'request.course.id'}) {
+ $navmap = Apache::lonnavmaps::navmap->new();
+ }
foreach my $line (@dir_list) {
my ($file_name,$rest)=split(/\&/,$line,2);
if ($file_name eq $fname){
@@ -9104,8 +9114,28 @@ sub check_for_upload {
$file_name = $group.$file_name;
}
$found_file = 1;
- if (&Apache::lonnet::is_locked($file_name,$udom,$uname) eq 'true') {
- $locked_file = 1;
+ if (&Apache::lonnet::is_locked($file_name,$udom,$uname,\@lockers) eq 'true') {
+ foreach my $lock (@lockers) {
+ if (ref($lock) eq 'ARRAY') {
+ my ($symb,$crsid) = @{$lock};
+ if ($crsid eq $env{'request.course.id'}) {
+ if (ref($navmap)) {
+ my $res = $navmap->getBySymb($symb);
+ foreach my $part (@{$res->parts()}) {
+ my ($slot_status,$slot_time,$slot_name)=$res->check_for_slot($part);
+ unless (($slot_status == $res->RESERVED) ||
+ ($slot_status == $res->RESERVED_LOCATION)) {
+ $locked_file = 1;
+ }
+ }
+ } else {
+ $locked_file = 1;
+ }
+ } else {
+ $locked_file = 1;
+ }
+ }
+ }
} else {
my @info = split(/\&/,$rest);
my $currsize = $info[6]/1000;