version 1.539, 2013/04/01 19:39:13
|
version 1.542, 2013/04/02 20:33:41
|
Line 902 sub print_paste_buffer {
|
Line 902 sub print_paste_buffer {
|
my ($pasteform,$form_start,$buttons,$form_end); |
my ($pasteform,$form_start,$buttons,$form_end); |
if ($pasteitems) { |
if ($pasteitems) { |
$pasteitems .= '<div style="padding:0;clear:both;margin:0;border:0"></div>'; |
$pasteitems .= '<div style="padding:0;clear:both;margin:0;border:0"></div>'; |
$form_start = '<form name="pasteform" action="/adm/coursedocs" method="post">'; |
$form_start = '<form name="pasteform" action="/adm/coursedocs" method="post" onsubmit="return validateClipboard();">'; |
if (@pasteable) { |
if (@pasteable) { |
$buttons = '<input type="submit" name="pastemarked" value="'.&mt('Paste selected').'" />'.(' 'x2); |
$buttons = '<input type="submit" name="pastemarked" value="'.&mt('Paste selected').'" />'.(' 'x2); |
} |
} |
Line 1009 sub paste_popup_js {
|
Line 1009 sub paste_popup_js {
|
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
show => 'Show Options', |
show => 'Show Options', |
hide => 'Hide Options', |
hide => 'Hide Options', |
|
none => 'No items selected from clipboard.', |
); |
); |
return <<"END"; |
return <<"END"; |
|
|
Line 1038 function showOptions(caller,suffix) {
|
Line 1039 function showOptions(caller,suffix) {
|
return; |
return; |
} |
} |
|
|
|
function validateClipboard() { |
|
var numchk = 0; |
|
if (document.pasteform.pasting.length > 1) { |
|
for (var i=0; i<document.pasteform.pasting.length; i++) { |
|
if (document.pasteform.pasting[i].checked) { |
|
numchk ++; |
|
} |
|
} |
|
} else { |
|
if (document.pasteform.pasting.type == 'checkbox') { |
|
if (document.pasteform.pasting.checked) { |
|
numchk ++; |
|
} |
|
} |
|
} |
|
if (numchk > 0) { |
|
return true; |
|
} else { |
|
alert("$lt{'none'}"); |
|
return false; |
|
} |
|
} |
|
|
END |
END |
|
|
} |
} |
|
|
|
|
sub do_paste_from_buffer { |
sub do_paste_from_buffer { |
my ($coursenum,$coursedom,$folder,$container,$errors) = @_; |
my ($coursenum,$coursedom,$folder,$container,$errors) = @_; |
|
|
Line 2351 sub editor {
|
Line 2374 sub editor {
|
my ($paste_res,$save_error,$pastemsgarray,$lockerror) = |
my ($paste_res,$save_error,$pastemsgarray,$lockerror) = |
&do_paste_from_buffer($coursenum,$coursedom,$folder,$container, |
&do_paste_from_buffer($coursenum,$coursedom,$folder,$container, |
\%paste_errors); |
\%paste_errors); |
if (ref($pastemsgarray) eq 'ARRAY') { |
if (ref($pastemsgarray) eq 'ARRAY') { |
if (@{$pastemsgarray} > 0) { |
if (@{$pastemsgarray} > 0) { |
|
$r->print('<p class="LC_info">'. |
$r->print('<p class="LC_info">'. |
join('<br />',@{$pastemsgarray}). |
join('<br />',@{$pastemsgarray}). |
|
'</p>'); |
|
} |
|
} |
|
if ($lockerror) { |
|
$r->print('<p class="LC_error">'. |
|
$lockerror. |
|
'</p>'); |
'</p>'); |
} |
} |
if ($save_error ne '') { |
} |
return $save_error; |
if ($lockerror) { |
|
$r->print('<p class="LC_error">'. |
|
$lockerror. |
|
'</p>'); |
|
} |
|
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('<p class="LC_error">'.$errortext{$paste_res}.'</p>'); |
} |
} |
if ($paste_res ne 'ok') { |
|
$r->print('<p class="LC_error">'.$paste_res.'</p>'); |
|
} |
} |
if (keys(%paste_errors) > 0) { |
if (keys(%paste_errors) > 0) { |
$r->print('<p class="LC_warning">'."\n". |
$r->print('<p class="LC_warning">'."\n". |
Line 3036 ENDCOPY
|
Line 3065 ENDCOPY
|
$copylink=(<<ENDCOPY); |
$copylink=(<<ENDCOPY); |
<form name="$formname" method="post" action="/adm/coursedocs"> |
<form name="$formname" method="post" action="/adm/coursedocs"> |
$form_common |
$form_common |
<input type="checkbox" name="copy" id="copy_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','copy');" class="LC_hidden"><a href="$js" class="LC_docs_copy">$lt{'cp'}</a> |
<input type="checkbox" name="copy" id="copy_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','copy');" class="LC_hidden" /><a href="$js" class="LC_docs_copy">$lt{'cp'}</a> |
$form_end |
$form_end |
ENDCOPY |
ENDCOPY |
if (($ishash) && (ref($filtersref->{'cancopy'}) eq 'ARRAY')) { |
if (($ishash) && (ref($filtersref->{'cancopy'}) eq 'ARRAY')) { |
Line 3053 ENDCUT
|
Line 3082 ENDCUT
|
$cutlink=(<<ENDCUT); |
$cutlink=(<<ENDCUT); |
<form name="$formname" method="post" action="/adm/coursedocs"> |
<form name="$formname" method="post" action="/adm/coursedocs"> |
$form_common |
$form_common |
<input type="checkbox" name="cut" id="cut_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','cut');" class="LC_hidden"><a href="$js" class="LC_docs_cut">$lt{'ct'}</a> |
<input type="hidden" name="skip_$orderidx" id="skip_cut_$orderidx" value="$skip_confirm" /> |
|
<input type="checkbox" name="cut" id="cut_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','cut');" class="LC_hidden" /><a href="$js" class="LC_docs_cut">$lt{'ct'}</a> |
$form_end |
$form_end |
ENDCUT |
ENDCUT |
if (($ishash) && (ref($filtersref->{'cancut'}) eq 'ARRAY')) { |
if (($ishash) && (ref($filtersref->{'cancut'}) eq 'ARRAY')) { |
Line 3070 ENDREM
|
Line 3100 ENDREM
|
$removelink=(<<ENDREM); |
$removelink=(<<ENDREM); |
<form name="$formname" method="post" action="/adm/coursedocs"> |
<form name="$formname" method="post" action="/adm/coursedocs"> |
$form_common |
$form_common |
<input type="checkbox" name="remove" id="remove_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','remove');" class="LC_hidden"><a href="$js" class="LC_docs_remove">$lt{'rm'}</a> |
<input type="hidden" name="skip_$orderidx" id="skip_remove_$orderidx" value="$skip_confirm" /> |
|
<input type="checkbox" name="remove" id="remove_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','remove');" class="LC_hidden" /><a href="$js" class="LC_docs_remove">$lt{'rm'}</a> |
$form_end |
$form_end |
ENDREM |
ENDREM |
if (($ishash) && (ref($filtersref->{'canremove'}) eq 'ARRAY')) { |
if (($ishash) && (ref($filtersref->{'canremove'}) eq 'ARRAY')) { |
Line 3102 ENDREN
|
Line 3133 ENDREN
|
$selectbox |
$selectbox |
$form_end |
$form_end |
</td> |
</td> |
<td class="LC_docs_entry_commands"><span class="LC_nobreak"> |
<td class="LC_docs_entry_commands LC_nobreak"> |
$removelink |
$removelink |
$cutlink |
$cutlink |
$copylink |
$copylink |
</span> |
|
</td> |
</td> |
END |
END |
} |
} |
Line 5277 sub editing_js {
|
Line 5307 sub editing_js {
|
p_rmr1 => 'WARNING: Removing a resource makes associated grades and scores inaccessible!', |
p_rmr1 => 'WARNING: Removing a resource makes associated grades and scores inaccessible!', |
p_rmr2a => 'Remove[_99]', |
p_rmr2a => 'Remove[_99]', |
p_rmr2b => '?[_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_ctr1a => 'WARNING: Cutting a resource makes associated grades and scores inaccessible!', |
p_ctr1b => 'Grades remain inaccessible if resource is pasted into another folder.', |
p_ctr1b => 'Grades remain inaccessible if resource is pasted into another folder.', |
p_ctr2a => 'Cut[_98]', |
p_ctr2a => 'Cut[_98]', |
p_ctr2b => '?[_98]', |
p_ctr2b => '?[_98]', |
|
p_ctr3a => 'Cut those[_2]', |
|
p_ctr3b => 'items?[_2]', |
rpck => 'Enter number to pick (e.g., 3)', |
rpck => 'Enter number to pick (e.g., 3)', |
imsfile => 'You must choose an IMS package for import', |
imsfile => 'You must choose an IMS package for import', |
imscms => 'You must select which Course Management System was the source of the IMS package', |
imscms => 'You must select which Course Management System was the source of the IMS package', |
Line 5921 function checkSubmits() {
|
Line 5955 function checkSubmits() {
|
var numchanges = 0; |
var numchanges = 0; |
var form = document.saveactions; |
var form = document.saveactions; |
var doactions = multiActions(); |
var doactions = multiActions(); |
|
var cutwarnings = 0; |
|
var remwarnings = 0; |
if (doactions == 1) { |
if (doactions == 1) { |
var remidxlist = document.cumulativeactions.allremoveidx.value; |
var remidxlist = document.cumulativeactions.allremoveidx.value; |
if ((remidxlist != '') && (remidxlist != null)) { |
if ((remidxlist != '') && (remidxlist != null)) { |
Line 5930 function checkSubmits() {
|
Line 5966 function checkSubmits() {
|
if (document.getElementById('remove_'+remidxs[i]).checked) { |
if (document.getElementById('remove_'+remidxs[i]).checked) { |
form.multiremove.value += remidxs[i]+','; |
form.multiremove.value += remidxs[i]+','; |
numchanges ++; |
numchanges ++; |
|
if (document.getElementById('skip_remove_'+remidxs[i])) { |
|
if (document.getElementById('skip_remove_'+remidxs[i]).value == 0) { |
|
remwarnings ++; |
|
} |
|
} |
} |
} |
} |
} |
} |
} |
Line 5942 function checkSubmits() {
|
Line 5983 function checkSubmits() {
|
if (document.getElementById('cut_'+cutidxs[i]).checked == true) { |
if (document.getElementById('cut_'+cutidxs[i]).checked == true) { |
form.multicut.value += cutidxs[i]+','; |
form.multicut.value += cutidxs[i]+','; |
numchanges ++; |
numchanges ++; |
|
if (document.getElementById('skip_cut_'+cutidxs[i])) { |
|
if (document.getElementById('skip_cut_'+cutidxs[i]).value == 0) { |
|
cutwarnings ++; |
|
} |
|
} |
} |
} |
} |
} |
} |
} |
Line 6004 function checkSubmits() {
|
Line 6050 function checkSubmits() {
|
} |
} |
} |
} |
if ((numchanges > 0) || (dosettings == 1)) { |
if ((numchanges > 0) || (dosettings == 1)) { |
form.submit(); |
if (numchanges > 0) { |
return true; |
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; |
return false; |
} |
} |