0) {
+ return true;
+ } else {
+ alert("$lt{'none'}");
+ return false;
+ }
+}
+
END
}
-
sub do_paste_from_buffer {
my ($coursenum,$coursedom,$folder,$container,$errors) = @_;
@@ -2351,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".
@@ -3053,6 +3082,7 @@ ENDCUT
$cutlink=(<
$form_common
+
$lt{'ct'}
$form_end
ENDCUT
@@ -3070,6 +3100,7 @@ ENDREM
$removelink=(<
$form_common
+
$lt{'rm'}
$form_end
ENDREM
@@ -5276,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',
@@ -5920,6 +5955,8 @@ function checkSubmits() {
var numchanges = 0;
var form = document.saveactions;
var doactions = multiActions();
+ var cutwarnings = 0;
+ var remwarnings = 0;
if (doactions == 1) {
var remidxlist = document.cumulativeactions.allremoveidx.value;
if ((remidxlist != '') && (remidxlist != null)) {
@@ -5929,6 +5966,11 @@ function checkSubmits() {
if (document.getElementById('remove_'+remidxs[i]).checked) {
form.multiremove.value += remidxs[i]+',';
numchanges ++;
+ if (document.getElementById('skip_remove_'+remidxs[i])) {
+ if (document.getElementById('skip_remove_'+remidxs[i]).value == 0) {
+ remwarnings ++;
+ }
+ }
}
}
}
@@ -5941,6 +5983,11 @@ function checkSubmits() {
if (document.getElementById('cut_'+cutidxs[i]).checked == true) {
form.multicut.value += cutidxs[i]+',';
numchanges ++;
+ if (document.getElementById('skip_cut_'+cutidxs[i])) {
+ if (document.getElementById('skip_cut_'+cutidxs[i]).value == 0) {
+ cutwarnings ++;
+ }
+ }
}
}
}
@@ -6003,8 +6050,25 @@ function checkSubmits() {
}
}
if ((numchanges > 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;
}