0) {
+ return true;
+ } else {
+ alert("$lt{'none'}");
+ return false;
+ }
+}
+
END
}
-
sub do_paste_from_buffer {
my ($coursenum,$coursedom,$folder,$container,$errors) = @_;
@@ -2170,7 +2193,9 @@ sub update_parameter {
}
}
} else {
- map { $allchecked{$which}{$_} = 1; } split(/,/,$env{'form.all'.$which});
+ if ($env{'form.all'.$which}) {
+ map { $allchecked{$which}{$_} = 1; } split(/,/,$env{'form.all'.$which});
+ }
}
}
my $haschanges = 0;
@@ -2349,24 +2374,30 @@ sub editor {
my ($paste_res,$save_error,$pastemsgarray,$lockerror) =
&do_paste_from_buffer($coursenum,$coursedom,$folder,$container,
\%paste_errors);
- if (ref($pastemsgarray) eq 'ARRAY') {
- if (@{$pastemsgarray} > 0) {
-
- $r->print(''.
- join('
',@{$pastemsgarray}).
- '
');
- }
- }
- if ($lockerror) {
- $r->print(''.
- $lockerror.
+ if (ref($pastemsgarray) eq 'ARRAY') {
+ if (@{$pastemsgarray} > 0) {
+ $r->print('
'.
+ join('
',@{$pastemsgarray}).
'
');
}
- if ($save_error ne '') {
- return $save_error;
+ }
+ if ($lockerror) {
+ $r->print(''.
+ $lockerror.
+ '
');
+ }
+ if ($save_error ne '') {
+ return $save_error;
+ }
+ if ($paste_res) {
+ my %errortext = &Apache::lonlocal::texthash (
+ fail => 'Storage of folder contents failed',
+ failread => 'Reading folder contents failed',
+ failstore => 'Storage of folder contents failed',
+ );
+ if ($errortext{$paste_res}) {
+ $r->print(''.$errortext{$paste_res}.'
');
}
- if ($paste_res ne 'ok') {
- $r->print(''.$paste_res.'
');
}
if (keys(%paste_errors) > 0) {
$r->print(''."\n".
@@ -3034,7 +3065,7 @@ ENDCOPY
$copylink=(<
$form_common
-$lt{'cp'}
+$lt{'cp'}
$form_end
ENDCOPY
if (($ishash) && (ref($filtersref->{'cancopy'}) eq 'ARRAY')) {
@@ -3051,7 +3082,8 @@ ENDCUT
$cutlink=(<
$form_common
-$lt{'ct'}
+
+$lt{'ct'}
$form_end
ENDCUT
if (($ishash) && (ref($filtersref->{'cancut'}) eq 'ARRAY')) {
@@ -3068,7 +3100,8 @@ ENDREM
$removelink=(<
$form_common
-$lt{'rm'}
+
+$lt{'rm'}
$form_end
ENDREM
if (($ishash) && (ref($filtersref->{'canremove'}) eq 'ARRAY')) {
@@ -3100,11 +3133,10 @@ ENDREN
$selectbox
$form_end
-
+ |
$removelink
$cutlink
$copylink
-
|
END
}
@@ -5275,10 +5307,14 @@ sub editing_js {
p_rmr1 => 'WARNING: Removing a resource makes associated grades and scores inaccessible!',
p_rmr2a => 'Remove[_99]',
p_rmr2b => '?[_99]',
+ p_rmr3a => 'Remove those [_2]',
+ p_rmr3b => 'items?[_2]',
p_ctr1a => 'WARNING: Cutting a resource makes associated grades and scores inaccessible!',
p_ctr1b => 'Grades remain inaccessible if resource is pasted into another folder.',
p_ctr2a => 'Cut[_98]',
p_ctr2b => '?[_98]',
+ p_ctr3a => 'Cut those[_2]',
+ p_ctr3b => 'items?[_2]',
rpck => 'Enter number to pick (e.g., 3)',
imsfile => 'You must choose an IMS package for import',
imscms => 'You must select which Course Management System was the source of the IMS package',
@@ -5643,69 +5679,78 @@ function propagateState(form,param) {
}
function checkForSubmit(targetform,param,context,idx,folderpath,index,oldtitle,skip_confirm,container,folder) {
+ var dosettings;
+ var doaction;
var control = document.togglemultsettings;
if (context == 'actions') {
control = document.togglemultactions;
+ doaction = 1;
+ } else {
+ dosettings = 1;
}
- if (control.showmultpick.length) {
- for (var i=0; i 0) || (dosettings == 1)) {
- form.submit();
- return true;
+ 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"}')) {
+ return false;
+ }
+ }
+ if (cutwarnings > 0) {
+ if (!confirm('$lt{"p_ctr1a"}\\n$lt{"p_ctr1b"}\\n\\n$lt{"p_ctr3a"} '+cutwarnings+' $lt{"p_ctr3b"}')) {
+ return false;
+ }
+ }
+ }
+ form.submit();
+ return true;
+ } else {
+ form.submit();
+ return true;
+ }
}
return false;
}