version 1.540, 2013/04/01 22:09:56
|
version 1.541, 2013/04/02 00:07:08
|
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 |
|
|
} |
} |
Line 2351 sub editor {
|
Line 2375 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". |