--- loncom/interface/londocs.pm 2023/03/11 21:58:18 1.695 +++ loncom/interface/londocs.pm 2023/03/23 22:54:38 1.697 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.695 2023/03/11 21:58:18 raeburn Exp $ +# $Id: londocs.pm,v 1.697 2023/03/23 22:54:38 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4300,7 +4300,7 @@ END $nomodal = 1; } } - my ($checkencrypt,$shownurl); + my $checkencrypt; if (!$env{'request.role.adv'}) { if (((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i) || ($isencrypted) || (&Apache::lonnet::EXT('resource.0.encrypturl',$symb) =~ /^yes$/i)) { @@ -4320,7 +4320,7 @@ END my $currenc = $env{'request.enc'}; $env{'request.enc'} = 1; $shownsymb = &Apache::lonenc::encrypted($symb); - $shownurl = &Apache::lonenc::encrypted($url); + my $shownurl = &Apache::lonenc::encrypted($url); if (&Apache::lonnet::symbverify($symb,$url)) { $url = $shownurl; } else { @@ -4335,7 +4335,8 @@ END $url = &Apache::lonnet::clutter($url); } } - $shownurl = $url; + } else { + $url = ''; } unless ($env{'request.role.adv'}) { if ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) { @@ -4346,8 +4347,8 @@ END $hiddenres = 1; } } - if ($url ne '') { - $url = $shownurl.(($shownurl=~/\?/)?'&':'?').'symb='.&escape($shownsymb); + if (($url ne '') && ($shownsymb ne '')) { + $url .= (($url=~/\?/)?'&':'?').'symb='.&escape($shownsymb); } } } elsif ($supplementalflag) { @@ -8045,6 +8046,9 @@ function populateDirSelects(form,locsel, selelem.options[selelem.options.length] = new Option(data.dirs[j],data.dirs[j]); } selelem.selectedIndex = 0; + if (len == 1) { + toggleCrsResTitle(); + } } } }