version 1.574, 2013/12/30 21:10:36
|
version 1.575, 2013/12/31 13:38:31
|
Line 1124 sub print_paste_buffer {
|
Line 1124 sub print_paste_buffer {
|
|
|
my @currpaste = split(/,/,$env{'docs.markedcopies'}); |
my @currpaste = split(/,/,$env{'docs.markedcopies'}); |
my ($pasteitems,@pasteable); |
my ($pasteitems,@pasteable); |
|
my $clipboardcount = 0; |
|
|
# Construct identifiers for current contents of user's paste buffer |
# Construct identifiers for current contents of user's paste buffer |
foreach my $suffix (@currpaste) { |
foreach my $suffix (@currpaste) { |
Line 1132 sub print_paste_buffer {
|
Line 1133 sub print_paste_buffer {
|
my $url = $env{'docs.markedcopy_url_'.$suffix}; |
my $url = $env{'docs.markedcopy_url_'.$suffix}; |
if (($cid =~ /^$match_domain\_$match_courseid$/) && |
if (($cid =~ /^$match_domain\_$match_courseid$/) && |
($url ne '')) { |
($url ne '')) { |
|
$clipboardcount ++; |
my ($is_external,$othercourse,$fromsupp,$is_uploaded_map,$parent, |
my ($is_external,$othercourse,$fromsupp,$is_uploaded_map,$parent, |
$canpaste,$nopaste,$othercrs,$areachange); |
$canpaste,$nopaste,$othercrs,$areachange); |
my $extension = (split(/\./,$env{'docs.markedcopy_url_'.$suffix}))[-1]; |
my $extension = (split(/\./,$env{'docs.markedcopy_url_'.$suffix}))[-1]; |
Line 1225 sub print_paste_buffer {
|
Line 1227 sub print_paste_buffer {
|
$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" onsubmit="return validateClipboard();">'; |
$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); |
my $value = &mt('Paste to current folder'); |
|
if ($container eq 'page') { |
|
$value = &mt('Paste to current page'); |
|
} |
|
$buttons = '<input type="submit" name="pastemarked" value="'.$value.'" />'.(' 'x2); |
|
} |
|
$buttons .= '<input type="submit" name="clearmarked" value="'.&mt('Remove from clipboard').'" />'.(' 'x2); |
|
if ($clipboardcount > 1) { |
|
$buttons .= |
|
'<span style="text-decoration:line-through">'.(' 'x20).'</span>'.(' 'x2). |
|
'<input type="button" name="checkallclip" value="'.&mt('Check all').'" style="height:20px;" onclick="checkClipboard();" />'. |
|
(' 'x2). |
|
'<input type="button" name="uncheckallclip" value="'.&mt('Uncheck all').'" style="height:20px;" onclick="uncheckClipboard();" />'. |
|
(' 'x2); |
} |
} |
$buttons .= '<input type="submit" name="clearmarked" value="'.&mt('Clear selected').'" />'. |
$form_end = '<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />'. |
'<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />'; |
'</form>'; |
$form_end = '</form>'; |
|
} else { |
} else { |
$pasteitems = &mt('Clipboard is empty'); |
$pasteitems = &mt('Clipboard is empty'); |
} |
} |
Line 1383 function validateClipboard() {
|
Line 1397 function validateClipboard() {
|
} |
} |
} |
} |
|
|
|
function checkClipboard() { |
|
if (document.pasteform.pasting.length > 1) { |
|
for (var i=0; i<document.pasteform.pasting.length; i++) { |
|
document.pasteform.pasting[i].checked = true; |
|
} |
|
} |
|
return; |
|
} |
|
|
|
function uncheckClipboard() { |
|
if (document.pasteform.pasting.length >1) { |
|
for (var i=0; i<document.pasteform.pasting.length; i++) { |
|
document.pasteform.pasting[i].checked = false; |
|
} |
|
} |
|
return; |
|
} |
|
|
END |
END |
|
|
} |
} |