--- loncom/interface/londocs.pm 2025/02/26 20:32:54 1.724 +++ 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.724 2025/02/26 20:32:54 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) { @@ -5044,6 +5061,9 @@ sub editor { } else { $to_show .= $toolslink .&Apache::loncommon::start_data_table('LC_tableOfContent') + .&Apache::loncommon::start_data_table_header_row('LC_visually_hidden') + .''.&mt('Resource Type (Icon)').''.&mt('Resource or Folder').'' + .&Apache::loncommon::end_data_table_header_row() .$output.' ' .&Apache::loncommon::end_data_table(); } @@ -5908,18 +5928,21 @@ $form_end; } else { $reinit = &mt('(re-initialize course to access)'); } - $line.=''.$editlink.$renamelink.''; - if ($orig_url =~ /$LONCAPA::assess_re/) { - $line.= '
'; - if ($curralias ne '') { - $line.=''. - $lt{'da'}.''; - } else { - $line.=''. - $lt{'sa'}.''; + if ($allowed) { + $line.=''.$editlink.$renamelink.''; + if ($orig_url =~ /$LONCAPA::assess_re/) { + $line.= '
'; + if ($curralias ne '') { + $line.=''. + $lt{'da'}.''; + } else { + $line.=''. + $lt{'sa'}.''; + } } + $line.=''; } - $line.=''; + $line .= ''; my ($link,$nolink); if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { if ($allowed && !$env{'request.role.adv'} && !$isfolder && !$ispage) { @@ -7336,10 +7359,10 @@ sub handler { @tabids = ('002','dd2','ee2','ff2'); $tid = 2; } else { - @tabids = ('aa1','bb1','cc1','ff1'); + @tabids = ('aa1','bb1','cc1','dd1','ff1'); unless ($env{'form.folderpath'} =~ /\:1$/) { unshift(@tabids,'001'); - push(@tabids,('dd1','ee1')); + push(@tabids,'ee1'); } } my $tabidstr = join("','",@tabids);