[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface londocs.pm
raeburn
raeburn at source.lon-capa.org
Tue Dec 31 10:03:56 EST 2013
raeburn Tue Dec 31 15:03:56 2013 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface londocs.pm
Log:
- For 2.11
- Backport 1.575.
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.484.2.46 loncom/interface/londocs.pm:1.484.2.47
--- loncom/interface/londocs.pm:1.484.2.46 Tue Dec 31 02:57:10 2013
+++ loncom/interface/londocs.pm Tue Dec 31 15:03:56 2013
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.484.2.46 2013/12/31 02:57:10 raeburn Exp $
+# $Id: londocs.pm,v 1.484.2.47 2013/12/31 15:03:56 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1124,6 +1124,7 @@
my @currpaste = split(/,/,$env{'docs.markedcopies'});
my ($pasteitems, at pasteable);
+ my $clipboardcount = 0;
# Construct identifiers for current contents of user's paste buffer
foreach my $suffix (@currpaste) {
@@ -1132,6 +1133,7 @@
my $url = $env{'docs.markedcopy_url_'.$suffix};
if (($cid =~ /^$match_domain\_$match_courseid$/) &&
($url ne '')) {
+ $clipboardcount ++;
my ($is_external,$othercourse,$fromsupp,$is_uploaded_map,$parent,
$canpaste,$nopaste,$othercrs,$areachange);
my $extension = (split(/\./,$env{'docs.markedcopy_url_'.$suffix}))[-1];
@@ -1225,11 +1227,23 @@
$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();">';
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('Clear selected').'" />'.(' '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').'" />'.
- '<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />';
- $form_end = '</form>';
+ $form_end = = '<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />'.
+ '</form>';
} else {
$pasteitems = &mt('Clipboard is empty');
}
@@ -1383,6 +1397,24 @@
}
}
+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
}
More information about the LON-CAPA-cvs
mailing list