--- loncom/interface/londocs.pm 2025/01/07 21:01:37 1.722
+++ loncom/interface/londocs.pm 2025/03/15 01:03:33 1.727
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.722 2025/01/07 21:01:37 raeburn Exp $
+# $Id: londocs.pm,v 1.727 2025/03/15 01:03:33 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1704,7 +1704,7 @@ sub group_import {
my $marker = $2;
my $info = $3;
my ($toolid,$toolprefix,$tooltype,%toolhash,%toolsettings);
- my @extras = ('linktext','explanation','crslabel','crstitle','crsappend');
+ my @extras = ('linktext','explanation','crslabel','crstitle','crsappend','returnurl','backtourl');
my @toolinfo = split(/:/,$info);
if ($residx) {
%toolsettings=&Apache::lonnet::dump('exttool_'.$marker,$coursedom,$coursenum);
@@ -1721,7 +1721,8 @@ sub group_import {
$toolid =~ s/\D//g;
($toolhash{'target'},$toolhash{'width'},$toolhash{'height'},
$toolhash{'linktext'},$toolhash{'explanation'},$toolhash{'crslabel'},
- $toolhash{'crstitle'},$toolhash{'crsappend'},$toolhash{'gradable'}) = @toolinfo;
+ $toolhash{'crstitle'},$toolhash{'crsappend'},$toolhash{'gradable'},
+ $toolhash{'returnurl'},$toolhash{'backtourl'}) = @toolinfo;
foreach my $item (@extras) {
$toolhash{$item} = &unescape($toolhash{$item});
}
@@ -1808,6 +1809,14 @@ sub group_import {
}
}
}
+ if ($tools{'crsconf'}{'returnurl'}) {
+ unless ($toolhash{'returnurl'} eq 'custom') {
+ delete($toolhash{'backtourl'});
+ }
+ } else {
+ delete($toolhash{'returnurl'});
+ delete($toolhash{'backtourl'});
+ }
}
if ($toolhash{'passback'}) {
my $gradesecret = UUID::Tiny::create_uuid_as_string(UUID_V4);
@@ -1836,6 +1845,14 @@ sub group_import {
}
}
}
+ if ($residx) {
+ if (($toolsettings{'backtourl'} ne '') && (!exists($toolhash{'backtourl'}))) {
+ push(@deleted,'backtourl');
+ }
+ if (($toolsettings{'returnurl'} ne '') && (!exists($toolhash{'returnurl'}))) {
+ push(@deleted,'returnurl');
+ }
+ }
my $putres = &Apache::lonnet::put('exttool_'.$marker,\%toolhash,$coursedom,$coursenum);
if ($putres eq 'ok') {
if (@deleted) {
@@ -2526,6 +2543,15 @@ sub print_paste_buffer {
&LONCAPA::map::qtescape($env{'docs.markedcopy_title_'.$suffix});
} else {
my $icon = &Apache::loncommon::icon($extension);
+ my $icontext;
+ if ($extension eq 'sequence') {
+ $icontext = &mt('folder icon');
+ } elsif ($extension eq 'page') {
+ $icontext = &mt('composite page icon');
+ } else {
+ $icontext = &mt('file icon');
+ }
+ $icontext = &HTML::Entities::encode($icontext);
if ($extension eq 'sequence' &&
$url =~ m{/default_\d+\.sequence$}x) {
$icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));
@@ -2535,7 +2561,7 @@ sub print_paste_buffer {
if ($title eq '') {
($title) = ($url =~ m{/([^/]+)$});
}
- $buffer = ''.
+ $buffer = '
'.
': '.
&Apache::loncommon::parse_supplemental_title(
&LONCAPA::map::qtescape($title));
@@ -4971,16 +4997,18 @@ sub editor {
if (!$allowed) {
$helpitem = 'Supplemental_Navigation';
}
- $toolslink = '
'
+ $toolslink = ' '
+ .' '
.&Apache::loncommon::help_open_menu('Navigation Screen',
$helpitem,undef,'RAT')
- .' | '.&mt('Tools:').' | ' - .'
'.&mt('Tools:').' '
+ .''."\n".'
|