'.
&mt('There was a problem removing a lockfile.').' ';
if ($type eq 'paste') {
- &mt('This will prevent use of the paste buffer until th next log-in.');
+ if ($freedlock eq 'nolock') {
+ $locknotfreed =
+ '
'.
+ &mt('A lockfile was not released when you added content to the clipboard earlier in this session.').' '.
+
+ &mt('As a result addition of items to the clipboard will be unavailable until your next log-in.');
+ } else {
+ $locknotfreed .=
+ &mt('This will prevent addition of items to the clipboard until your next log-in.');
+ }
} elsif ($type eq 'map') {
- &mt('This will prevent creation of additional folders or composite pages in this course.');
+ $locknotfreed .=
+ &mt('This will prevent creation of additional folders or composite pages in this course.');
} elsif ($type eq 'smppg') {
$locknotfreed .=
&mt('This will prevent creation of additional simple pages in this course.');
@@ -4725,7 +4946,9 @@ sub handler {
.'// '."\n"
- .''."\n";
+ .''."\n"
+ .''."\n";
# Breadcrumbs
&Apache::lonhtmlcommon::clear_breadcrumbs();
@@ -4855,9 +5078,30 @@ sub handler {
'webctce4' => 'WebCT 4 Campus Edition',
);
# -----------------------------------------------------------------------------
+
+ # Calculate free quota space for a user or course. A javascript function checks
+ # file size to determine if upload should be allowed.
+ my $quotatype = 'unofficial';
+ if ($crstype eq 'Community') {
+ $quotatype = 'community';
+ } elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.coursecode'}) {
+ $quotatype = 'official';
+ } elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.textbook'}) {
+ $quotatype = 'textbook';
+ }
+ my $disk_quota = &Apache::loncommon::get_user_quota($coursenum,$coursedom,
+ 'course',$quotatype); # expressed in MB
+ my $current_disk_usage = 0;
+ foreach my $subdir ('docs','supplemental') {
+ $current_disk_usage += &Apache::lonnet::diskusage($coursedom,$coursenum,
+ "userfiles/$subdir",1); # expressed in kB
+ }
+ my $free_space = 1024 * ((1024 * $disk_quota) - $current_disk_usage);
+
my $fileupload=(<
-
+
+
FIUP
my $checkbox=(<
- $fileupload
+ $fileupload
$lt{'title'}:
@@ -5460,7 +5704,7 @@ sub decompression_info {
my $docuname=$env{'course.'.$env{'request.course.id'}.'.num'};
my $container='sequence';
my ($pathitem,$hiddenelem);
- my @hiddens = ('newidx','comment','position','folderpath');
+ my @hiddens = ('newidx','comment','position','folderpath','archiveurl');
if ($env{'form.folderpath'} =~ /\:1$/) {
$container='page';
}
@@ -5468,7 +5712,7 @@ sub decompression_info {
foreach my $item (@hiddens) {
if ($env{'form.'.$item}) {
$hiddenelem .= ''."\n";
+ &HTML::Entities::encode($env{'form.'.$item},'<>&"').'" />'."\n";
}
}
return ($destination,$dir_root,$londocroot,$docudom,$docuname,$container,
@@ -5525,25 +5769,34 @@ sub remove_archive {
} else {
$delwarning = &mt('An error occurred retrieving the contents of the current folder.');
}
- $delwarning .= &mt('As a result the archive file has not been removed.');
+ $delwarning .= ' '.&mt('As a result the archive file has not been removed.');
} else {
my $currcmd = $env{'form.cmd'};
my $position = $env{'form.position'};
+ my $archiveidx = $position;
if ($position > 0) {
- $env{'form.cmd'} = 'remove_'.$position;
- my ($title,$url,@rrest) =
- split(/:/,$LONCAPA::map::resources[$LONCAPA::map::order[$position]]);
- if (&handle_edit_cmd($docuname,$docudom)) {
- ($errtext,$fatal) = &storemap($docuname,$docudom,$map,1);
- if ($fatal) {
- if ($container eq 'page') {
- $delwarning = &mt('An error occurred updating the contents of the current page.');
+ if (($env{'form.autoextract_camtasia'}) && (scalar(@LONCAPA::map::order) == 2)) {
+ $archiveidx = $position-1;
+ }
+ $env{'form.cmd'} = 'remove_'.$archiveidx;
+ my ($title,$url,@rrest) =
+ split(/:/,$LONCAPA::map::resources[$LONCAPA::map::order[$archiveidx]]);
+ if ($url eq $env{'form.archiveurl'}) {
+ if (&handle_edit_cmd($docuname,$docudom)) {
+ ($errtext,$fatal) = &storemap($docuname,$docudom,$map,1);
+ if ($fatal) {
+ if ($container eq 'page') {
+ $delwarning = &mt('An error occurred updating the contents of the current page.');
+ } else {
+ $delwarning = &mt('An error occurred updating the contents of the current folder.');
+ }
} else {
- $delwarning = &mt('An error occurred updating the contents of the current folder.');
+ $delresult = &mt('Archive file removed.');
}
- } else {
- $delresult = &mt('Archive file removed.');
}
+ } else {
+ $delwarning .= &mt('Archive file had unexpected item number in folder.').
+ ' '.&mt('As a result the archive file has not been removed.');
}
}
$env{'form.cmd'} = $currcmd;
@@ -5746,7 +5999,7 @@ END
sub editing_js {
my ($udom,$uname,$supplementalflag) = @_;
- my %lt = &Apache::lonlocal::texthash(
+ my %js_lt = &Apache::lonlocal::texthash(
p_mnf => 'Name of New Folder',
t_mnf => 'New Folder',
p_mnp => 'Name of New Page',
@@ -5784,7 +6037,7 @@ sub editing_js {
noch => 'No changes to settings specified.',
noac => 'No actions selected.',
);
-
+ &js_escape(\%js_lt);
my $crstype = &Apache::loncommon::course_type();
my $docs_folderpath = &HTML::Entities::encode($env{'environment.internal.'.$env{'request.course.id'}.'.docs_folderpath.folderpath'},'<>&"');
my $main_container_page;
@@ -5806,6 +6059,7 @@ sub editing_js {
if (&Apache::lonnet::is_on_map($res)) {
$backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($res),'<>&"').'?symb='.
&HTML::Entities::encode($caller,'<>&"');
+ $backtourl = &Apache::loncommon::escape_single($backtourl);
} else {
$backtourl = '/adm/navmaps';
}
@@ -5828,7 +6082,7 @@ sub editing_js {
return <$lt{'more'}';
+ document.getElementById('more'+caller).innerHTML = ' $js_lt{'more'}';
} else {
document.getElementById('more'+caller).innerHTML = '';
}
@@ -6391,10 +6645,10 @@ function togglePick(caller,value) {
function toggleCheckUncheck(caller,more) {
if (more == 1) {
- document.getElementById('more'+caller).innerHTML = ' $lt{'less'}';
+ document.getElementById('more'+caller).innerHTML = ' $js_lt{'less'}';
document.getElementById('allfields'+caller).style.display='block';
} else {
- document.getElementById('more'+caller).innerHTML = ' $lt{'more'}';
+ document.getElementById('more'+caller).innerHTML = ' $js_lt{'more'}';
document.getElementById('allfields'+caller).style.display='none';
}
resize_scrollbox('contentscroll','1','1');
@@ -6550,12 +6804,12 @@ function checkSubmits() {
if (numchanges > 0) {
if ((cutwarnings > 0) || (remwarnings > 0)) {
if (remwarnings > 0) {
- if (!confirm('$lt{"p_rmr1"}\\n\\n$lt{"p_rmr3a"} '+remwarnings+' $lt{"p_rmr3b"}')) {
+ if (!confirm('$js_lt{"p_rmr1"}\\n\\n$js_lt{"p_rmr3a"} '+remwarnings+' $js_lt{"p_rmr3b"}')) {
return false;
}
}
if (cutwarnings > 0) {
- if (!confirm('$lt{"p_ctr1a"}\\n$lt{"p_ctr1b"}\\n\\n$lt{"p_ctr3a"} '+cutwarnings+' $lt{"p_ctr3b"}')) {
+ if (!confirm('$js_lt{"p_ctr1a"}\\n$js_lt{"p_ctr1b"}\\n\\n$js_lt{"p_ctr3a"} '+cutwarnings+' $js_lt{"p_ctr3b"}')) {
return false;
}
}
@@ -6571,12 +6825,12 @@ function checkSubmits() {
}
}
if ((dosettings == 1) && (doactions == 1)) {
- alert("$lt{'noor'}");
+ alert("$js_lt{'noor'}");
} else {
if (dosettings == 1) {
- alert("$lt{'noch'}");
+ alert("$js_lt{'noch'}");
} else {
- alert("$lt{'noac'}");
+ alert("$js_lt{'noac'}");
}
}
return false;
@@ -6691,13 +6945,19 @@ ENDINJECT
sub dump_switchserver_js {
my @hosts = @_;
- my %lt = &Apache::lonlocal::texthash(
+ my %js_lt = &Apache::lonlocal::texthash(
dump => 'Copying content to Authoring Space requires switching server.',
swit => 'Switch server?',
+ );
+ my %html_js_lt = &Apache::lonlocal::texthash(
+ swit => 'Switch server?',
duco => 'Copying Content to Authoring Space',
yone => 'You need to switch to a server housing an Authoring Space for which you are author or co-author.',
chos => 'Choose server',
);
+ &js_escape(\%js_lt);
+ &html_escape(\%html_js_lt);
+ &js_escape(\%html_js_lt);
my $role = $env{'request.role'};
my $js = <<"ENDSWJS";