[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface londocs.pm
raeburn
raeburn at source.lon-capa.org
Sun Dec 21 14:20:41 EST 2014
raeburn Sun Dec 21 19:20:41 2014 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface londocs.pm
Log:
- For 2.11
- Backport 1.586, 1.589, 1.590, 1.591
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.484.2.56 loncom/interface/londocs.pm:1.484.2.57
--- loncom/interface/londocs.pm:1.484.2.56 Fri Oct 24 00:25:12 2014
+++ loncom/interface/londocs.pm Sun Dec 21 19:20:41 2014
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.484.2.56 2014/10/24 00:25:12 raeburn Exp $
+# $Id: londocs.pm,v 1.484.2.57 2014/12/21 19:20:41 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -977,7 +977,7 @@
sub update_paste_buffer {
my ($coursenum,$coursedom,$folder) = @_;
- my (@possibles,%removals,%cuts);
+ my (@possibles,%removals,%cuts,$output);
if ($env{'form.multiremove'}) {
$env{'form.multiremove'} =~ s/,$//;
map { $removals{$_} = 1; } split(/,/,$env{'form.multiremove'});
@@ -1045,10 +1045,12 @@
next if (exists($pasteurls{$coursedom.'_'.$coursenum.'_'.$url}));
my ($suffix,$errortxt,$locknotfreed) =
&new_timebased_suffix($env{'user.domain'},$env{'user.name'},'paste');
- push(@newpaste,$suffix);
- if ($locknotfreed) {
- return $locknotfreed;
- last;
+ if ($suffix ne '') {
+ push(@newpaste,$suffix);
+ } else {
+ if ($locknotfreed) {
+ return $locknotfreed;
+ }
}
if (&is_supplemental_title($title)) {
&Apache::lonnet::appenv({'docs.markedcopy_supplemental_'.$suffix => $title});
@@ -1082,13 +1084,17 @@
}
}
}
+ if ($locknotfreed) {
+ $output = $locknotfreed;
+ last;
+ }
}
if (@newpaste) {
$addtoenv{'docs.markedcopies'} = join(',',(@currpaste, at newpaste));
}
&Apache::lonnet::appenv(\%addtoenv);
delete($env{'form.markcopy'});
- return;
+ return $output;
}
sub recurse_uploaded_maps {
@@ -1191,10 +1197,14 @@
$icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));
$icon .= '/navmap.folder.closed.gif';
}
+ my $title = $env{'docs.markedcopy_title_'.$suffix};
+ if ($title eq '') {
+ ($title) = ($url =~ m{/([^/]+)$});
+ }
$buffer = '<img src="'.$icon.'" alt="" class="LC_icon" />'.
': '.
&Apache::loncommon::parse_supplemental_title(
- &LONCAPA::map::qtescape($env{'docs.markedcopy_title_'.$suffix}));
+ &LONCAPA::map::qtescape($title));
}
$pasteitems .= '<div class="LC_left_float">';
my ($options,$onclick);
@@ -2810,7 +2820,7 @@
my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]);
$name=&LONCAPA::map::qtescape($name);
$url=&LONCAPA::map::qtescape($url);
- next unless ($name && $url);
+ next unless $url;
my %denied =
&action_restrictions($coursenum,$coursedom,$url,
$env{'form.folderpath'},\%curr_groups);
@@ -3859,9 +3869,19 @@
'<div class="LC_error">'.
&mt('There was a problem removing a lockfile.').' ';
if ($type eq 'paste') {
- &mt('This will prevent use of the paste buffer until th next log-in.');
+ if ($freedlock eq 'nolock') {
+ $locknotfreed =
+ '<div class="LC_error">'.
+ &mt('A lockfile was not released when you added content to the clipboard earlier in this session.').' '.
+
+ &mt('As a result addition of items to the clipboard wll be unavailable until your next log-in.');
+ } else {
+ $locknotfreed .=
+ &mt('This will prevent addition of items to the clipboard until your next log-in.');
+ }
} elsif ($type eq 'map') {
- &mt('This will prevent creation of additional folders or composite pages in this course.');
+ $locknotfreed .=
+ &mt('This will prevent creation of additional folders or composite pages in this course.');
} elsif ($type eq 'smppg') {
$locknotfreed .=
&mt('This will prevent creation of additional simple pages in this course.');
@@ -5815,6 +5835,7 @@
if (&Apache::lonnet::is_on_map($res)) {
$backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($res),'<>&"').'?symb='.
&HTML::Entities::encode($caller,'<>&"');
+ $backtourl = &Apache::loncommon::escape_single($backtourl);
} else {
$backtourl = '/adm/navmaps';
}
More information about the LON-CAPA-cvs
mailing list