--- loncom/interface/londocs.pm 2025/01/17 14:10:05 1.484.2.93.2.18 +++ loncom/interface/londocs.pm 2024/07/03 15:15:00 1.484.2.95 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.484.2.93.2.18 2025/01/17 14:10:05 raeburn Exp $ +# $Id: londocs.pm,v 1.484.2.95 2024/07/03 15:15:00 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -43,14 +43,12 @@ use Apache::lonnavdisplay(); use Apache::lonextresedit(); use Apache::lontemplate(); use Apache::lonsimplepage(); -use Apache::loncourserespicker(); use HTML::Entities; use HTML::TokeParser; use GDBM_File; use File::MMagic; use Apache::lonlocal; use Cwd; -use UUID::Tiny ':std'; use LONCAPA qw(:DEFAULT :match); my $iconpath; @@ -87,7 +85,7 @@ sub storemap { if ($map =~ /^default/) { $hadchanges=1; - } elsif ($contentchg) { + } else { $suppchanges=1; } return ($errtext,0); @@ -179,62 +177,43 @@ sub default_folderpath { } } -sub validate_supppath { - my ($coursenum,$coursedom) = @_; - my $backto; +sub validate_folderpath { + my ($supplementalflag) = @_; + if ($env{'form.folderpath'} ne '') { + my @items = split(/\&/,$env{'form.folderpath'}); + my $badpath; + for (my $i=0; $i<@items; $i++) { + my $odd = $i%2; + if (($odd) && (!$supplementalflag) && ($items[$i] !~ /^[^:]*:(|\d+):(|1):(|1):(|1):(|1)$/)) { + $badpath = 1; + } elsif ((!$odd) && ($items[$i] !~ /^(default|supplemental)(|_\d+)$/)) { + $badpath = 1; + } + last if ($badpath); + } + if ($badpath) { + delete($env{'form.folderpath'}); + } + } + return; +} + +sub validate_suppath { if ($env{'form.supppath'} ne '') { my @items = split(/\&/,$env{'form.supppath'}); - my ($badpath,$got_supp,$supppath,%supphidden,%suppids); + my $badpath; for (my $i=0; $i<@items; $i++) { my $odd = $i%2; if ((!$odd) && ($items[$i] !~ /^supplemental(|_\d+)$/)) { $badpath = 1; - last; - } elsif ($odd) { - my $suffix; - my $idx = $i-1; - if ($items[$i] =~ /^([^:]*)::(|1):::$/) { - $backto .= '&'.$1; - } elsif ($items[$idx] eq 'supplemental') { - $backto .= '&'.$items[$i]; - } else { - $backto .= '&'.$items[$i]; - my $is_hidden; - unless ($got_supp) { - my ($supplemental) = &Apache::loncommon::get_supplemental($coursenum,$coursedom); - if (ref($supplemental) eq 'HASH') { - if (ref($supplemental->{'hidden'}) eq 'HASH') { - %supphidden = %{$supplemental->{'hidden'}}; - } - if (ref($supplemental->{'ids'}) eq 'HASH') { - %suppids = %{$supplemental->{'ids'}}; - } - } - $got_supp = 1; - } - if (ref($suppids{"/uploaded/$coursedom/$coursenum/$items[$idx].sequence"}) eq 'ARRAY') { - my $mapid = $suppids{"/uploaded/$coursedom/$coursenum/$items[$idx].sequence"}->[0]; - if ($supphidden{$mapid}) { - $is_hidden = 1; - } - } - $suffix = '::'.$is_hidden.':::'; - } - $supppath .= '&'.$items[$i].$suffix; - } else { - $supppath .= '&'.$items[$i]; - $backto .= '&'.$items[$i]; } + last if ($badpath); } if ($badpath) { delete($env{'form.supppath'}); - } else { - $supppath =~ s/^\&//; - $backto =~ s/^\&//; - $env{'form.supppath'} = $supppath; } } - return $backto; + return; } sub dumpcourse { @@ -682,7 +661,7 @@ sub recurse_html { } sub group_import { - my ($coursenum, $coursedom, $folder, $container, $caller, $ltitoolsref, @files) = @_; + my ($coursenum, $coursedom, $folder, $container, $caller, @files) = @_; my ($donechk,$allmaps,%hierarchy,%titles,%addedmaps,%removefrommap, %removeparam,$importuploaded,$fixuperrors); $allmaps = {}; @@ -711,166 +690,6 @@ sub group_import { } } if ($url) { - if ($url =~ m{^(/adm/$coursedom/$coursenum/(\d+)/ext\.tool)\:?(.*)$}) { - $url = $1; - my $marker = $2; - my $info = $3; - my ($toolid,$toolprefix,$tooltype,%toolhash,%toolsettings); - my @extras = ('linktext','explanation','crslabel','crstitle','crsappend'); - my @toolinfo = split(/:/,$info); - if ($residx) { - %toolsettings=&Apache::lonnet::dump('exttool_'.$marker,$coursedom,$coursenum); - $toolid = $toolsettings{'id'}; - } else { - $toolid = shift(@toolinfo); - } - if ($toolid =~ /^c/) { - $tooltype = 'crs'; - $toolprefix = 'c'; - } else { - $tooltype = 'dom'; - } - $toolid =~ s/\D//g; - ($toolhash{'target'},$toolhash{'width'},$toolhash{'height'}, - $toolhash{'linktext'},$toolhash{'explanation'},$toolhash{'crslabel'}, - $toolhash{'crstitle'},$toolhash{'crsappend'},$toolhash{'gradable'}) = @toolinfo; - foreach my $item (@extras) { - $toolhash{$item} = &unescape($toolhash{$item}); - } - if ($folder =~ /^supplemental/) { - delete($toolhash{'gradable'}); - } else { - $toolhash{'gradable'} =~ s/\D+//g; - } - if (ref($ltitoolsref) eq 'HASH') { - if (ref($ltitoolsref->{$tooltype}) eq 'HASH') { - if (ref($ltitoolsref->{$tooltype}->{$toolid}) eq 'HASH') { - my %tools = %{$ltitoolsref->{$tooltype}->{$toolid}}; - my @deleted; - $toolhash{'id'} = $toolprefix.$toolid; - if (($toolhash{'target'} eq 'iframe') || ($toolhash{'target'} eq 'tab') || - ($toolhash{'target'} eq 'window')) { - if ($toolhash{'target'} eq 'window') { - foreach my $item ('width','height') { - $toolhash{$item} =~ s/^\s+//; - $toolhash{$item} =~ s/\s+$//; - if ($toolhash{$item} =~ /\D/) { - delete($toolhash{$item}); - if ($residx) { - if ($toolsettings{$item}) { - push(@deleted,$item); - } - } - } - } - } - } elsif ($residx) { - $toolhash{'target'} = $toolsettings{'target'}; - if ($toolhash{'target'} eq 'window') { - foreach my $item ('width','height') { - $toolhash{$item} = $toolsettings{$item}; - } - } - } elsif (ref($tools{'display'}) eq 'HASH') { - $toolhash{'target'} = $tools{'display'}{'target'}; - if ($toolhash{'target'} eq 'window') { - $toolhash{'width'} = $tools{'display'}{'width'}; - $toolhash{'height'} = $tools{'display'}{'height'}; - } - } - if ($toolhash{'target'} eq 'iframe') { - foreach my $item ('width','height','linktext','explanation') { - delete($toolhash{$item}); - if ($residx) { - if ($toolsettings{$item}) { - push(@deleted,$item); - } - } - } - } elsif ($toolhash{'target'} eq 'tab') { - foreach my $item ('width','height') { - delete($toolhash{$item}); - if ($residx) { - if ($toolsettings{$item}) { - push(@deleted,$item); - } - } - } - } - if (ref($tools{'crsconf'}) eq 'HASH') { - foreach my $item ('label','title','linktext','explanation') { - my $crsitem; - if (($item eq 'label') || ($item eq 'title')) { - $crsitem = 'crs'.$item; - } else { - $crsitem = $item; - } - if ($tools{'crsconf'}{$item}) { - $toolhash{$crsitem} =~ s/^\s+//; - $toolhash{$crsitem} =~ s/\s+$//; - if ($toolhash{$crsitem} eq '') { - delete($toolhash{$crsitem}); - } - } else { - delete($toolhash{$crsitem}); - } - if (($residx) && (exists($toolsettings{$crsitem}))) { - unless (exists($toolhash{$crsitem})) { - push(@deleted,$crsitem); - } - } - } - } - if ($toolhash{'passback'}) { - my $gradesecret = UUID::Tiny::create_uuid_as_string(UUID_V4); - $toolhash{'gradesecret'} = $gradesecret; - $toolhash{'gradesecretdate'} = time; - } - if ($toolhash{'roster'}) { - my $rostersecret = UUID::Tiny::create_uuid_as_string(UUID_V4); - $toolhash{'rostersecret'} = $rostersecret; - $toolhash{'rostersecretdate'} = time; - } - my $changegradable; - if (($residx) && ($folder =~ /^default/)) { - if ($toolsettings{'gradable'}) { - unless (($toolhash{'gradable'}) || (defined($LONCAPA::map::zombies[$residx]))) { - push(@deleted,'gradable'); - $changegradable = 1; - } - } elsif ($toolhash{'gradable'}) { - $changegradable = 1; - } - if (($caller eq 'londocs') && (defined($LONCAPA::map::zombies[$residx]))) { - $changegradable = 1; - if ($toolsettings{'gradable'}) { - $toolhash{'gradable'} = 1; - } - } - } - my $putres = &Apache::lonnet::put('exttool_'.$marker,\%toolhash,$coursedom,$coursenum); - if ($putres eq 'ok') { - if (@deleted) { - &Apache::lonnet::del('exttool_'.$marker,\@deleted,$coursedom,$coursenum); - } - if (($changegradable) && ($folder =~ /^default/)) { - my $val; - if ($toolhash{'gradable'}) { - $val = 'yes'; - } else { - $val = 'no'; - } - &LONCAPA::map::storeparameter($residx,'parameter_0_gradable',$val, - 'string_yesno'); - &remember_parms($residx,'gradable','set',$val); - } - } else { - return (&mt('Failed to save update to external tool.'),1); - } - } - } - } - } if (($caller eq 'londocs') && ($folder =~ /^default/)) { if (($url =~ /\.(page|sequence)$/) && (!$donechk)) { @@ -882,8 +701,8 @@ sub group_import { $donechk = 1; } if ($url =~ m{^/uploaded/\Q$coursedom\E/\Q$coursenum\E/(default_\d+\.)(page|sequence)$}) { - &contained_map_check($url,$folder,$coursenum,$coursedom,\%removefrommap, - \%removeparam,\%addedmaps,\%hierarchy,\%titles,$allmaps); + &contained_map_check($url,$folder,\%removefrommap,\%removeparam, + \%addedmaps,\%hierarchy,\%titles,$allmaps); $importuploaded = 1; } elsif ($url =~ m{^/res/.+\.(page|sequence)$}) { next if ($allmaps->{$url}); @@ -979,6 +798,7 @@ END &storemap($coursenum, $coursedom, $folder.'.'.$container,1); unless ($fatal) { if ($folder =~ /^supplemental/) { + &Apache::lonnet::get_numsuppfiles($coursenum,$coursedom,1); my ($errtext,$fatal) = &mapread($coursenum,$coursedom, $folder.'.'.$container); } @@ -1055,7 +875,7 @@ sub docs_change_log { '// '."\n". @@ -1105,7 +925,6 @@ sub docs_change_log { 'encrypturl' => 'URL hidden', 'randompick' => 'Randomly pick', 'randomorder' => 'Randomly ordered', - 'gradable' => 'Grade can be assigned to External Tool', 'set' => 'set to', 'del' => 'deleted'); my $filter = &Apache::loncommon::display_filter('docslog')."\n". @@ -1215,11 +1034,9 @@ sub docs_change_log { my ($title,$url) = split(/\:/,$docslog{$id}{'logentry'}{'parameter_res'},3); if ($title eq '') { ($title) = ($url =~ m{/([^/]+)$}); - } elsif ($is_supp) { - $title = &Apache::loncommon::parse_supplemental_title($title); } $r->print(&LONCAPA::map::qtescape($title).':
' .&Apache::loncommon::help_open_menu('Navigation Screen', - $helpitem,undef,'RAT') + 'Navigation_Screen',undef,'RAT') .' | '.&mt('Tools:').' | ' .'
| '.
''. ' | '. - ' | '. + ' | '. &multiple_check_form('settings',\%lists,$canedit). ' | '. &Apache::loncommon::end_data_table_row(); @@ -4307,14 +3690,12 @@ sub is_supplemental_title { sub entryline { my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom, $crstype,$pathitem,$supplementalflag,$container,$filtersref,$currgroups, - $ltitoolsref,$canedit,$isencrypted,$ishidden,$navmapref,$hostname)=@_; - my ($foldertitle,$renametitle,$oldtitle,$encodedtitle); + $canedit,$isencrypted,$navmapref,$hostname)=@_; + my ($foldertitle,$renametitle,$oldtitle); if (&is_supplemental_title($title)) { ($title,$foldertitle,$renametitle) = &Apache::loncommon::parse_supplemental_title($title); - $encodedtitle=$title; } else { $title=&HTML::Entities::encode($title,'"<>&\''); - $encodedtitle=$title; $renametitle=$title; $foldertitle=$title; } @@ -4406,7 +3787,6 @@ END 'rn' => 'Rename', 'cp' => 'Copy', 'ex' => 'External Resource', - 'et' => 'External Tool', 'ed' => 'Edit', 'pr' => 'Preview', 'sv' => 'Save', @@ -4426,7 +3806,6 @@ END |/aboutme$ |/navmaps$ |/bulletinboard$ - |/ext\.tool$ |\.html$)}x) || $isexternal) { $skip_confirm = 1; @@ -4536,7 +3915,6 @@ END my $ispage; my $containerarg; my $folderurl; - my $plainurl; if ($uploaded) { if (($extension eq 'sequence') || ($extension eq 'page')) { $url=~/\Q$coursenum\E\/([\/\w]+)\.\Q$extension\E$/; @@ -4555,7 +3933,7 @@ END $url='/adm/supplemental?'; } } else { - $plainurl = $url; + &Apache::lonnet::allowuploaded('/adm/coursedoc',$url); } } @@ -4594,8 +3972,6 @@ END if (($ENV{'SERVER_PORT'} == 443) && ($exturl !~ /^https:/)) { $nomodal = 1; } - } elsif ($url=~m{^/adm/$coursedom/$coursenum/\d+/ext\.tool$}) { - $url='/adm/wrapper'.$url; } elsif ($url eq "/public/$coursedom/$coursenum/syllabus") { if (($ENV{'SERVER_PORT'} == 443) && ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) { @@ -4605,10 +3981,30 @@ END $nomodal = 1; } } - my $checkencrypt; - if (!$env{'request.role.adv'}) { + if (&Apache::lonnet::symbverify($symb,$url)) { + $shownsymb = $symb; + if ($isexternal) { + $url =~ s/\#[^#]+$//; + if ($container eq 'page') { + $url = &Apache::lonnet::clutter($url); + } + } + unless ($env{'request.role.adv'}) { + if ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) { + $url = ''; + } + if (&Apache::lonnet::EXT('resource.0.hiddenresource',$symb) =~ /^yes$/i) { + $url = ''; + $hiddenres = 1; + } + } + if ($url ne '') { + $url.=(($url=~/\?/)?'&':'?').'symb='.&escape($shownsymb); + } + } elsif (!$env{'request.role.adv'}) { + my $checkencrypt; if (((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i) || - ($isencrypted) || (&Apache::lonnet::EXT('resource.0.encrypturl',$symb) =~ /^yes$/i)) { + $isencrypted || (&Apache::lonnet::EXT('resource.0.encrypturl',$symb) =~ /^yes$/i)) { $checkencrypt = 1; } elsif (ref($navmapref)) { unless (ref($$navmapref)) { @@ -4620,40 +4016,22 @@ END } } } - } - if ($checkencrypt) { - my $currenc = $env{'request.enc'}; - $env{'request.enc'} = 1; - $shownsymb = &Apache::lonenc::encrypted($symb); - my $shownurl = &Apache::lonenc::encrypted($url); - if (&Apache::lonnet::symbverify($symb,$url)) { - $url = $shownurl; - } else { - $url = ''; - } - $env{'request.enc'} = $currenc; - } elsif (&Apache::lonnet::symbverify($symb,$url)) { - $shownsymb = $symb; - if ($isexternal) { - $url =~ s/\#[^#]+$//; - if ($container eq 'page') { - $url = &Apache::lonnet::clutter($url); + if ($checkencrypt) { + $shownsymb = &Apache::lonenc::encrypted($symb); + my $shownurl = &Apache::lonenc::encrypted($url); + if (&Apache::lonnet::symbverify($shownsymb,$shownurl)) { + $url = $shownurl.(($shownurl=~/\?/)?'&':'?').'symb='.&escape($shownsymb); + if ($env{'request.enc'} ne '') { + delete($env{'request.enc'}); + } + } else { + $url=''; } + } else { + $url=''; } } else { - $url = ''; - } - unless ($env{'request.role.adv'}) { - if ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) { - $url = ''; - } - if (&Apache::lonnet::EXT('resource.0.hiddenresource',$symb) =~ /^yes$/i) { - $url = ''; - $hiddenres = 1; - } - } - if (($url ne '') && ($shownsymb ne '')) { - $url .= (($url=~/\?/)?'&':'?').'symb='.&escape($shownsymb); + $url=''; } } } elsif ($supplementalflag) { @@ -4682,22 +4060,6 @@ END } $nomodal = 1; } - } elsif (($uploaded) && ($url ne '/adm/supplemental?') && ($url ne '/adm/coursedocs?')) { - my $embstyle=&Apache::loncommon::fileembstyle($extension); - unless ($embstyle eq 'ssi') { - if (($embstyle eq 'img') - || ($embstyle eq 'emb') - || ($embstyle eq 'wrp')) { - $url='/adm/wrapper'.$url; - } elsif ($url !~ /\.(sequence|page)$/) { - $url='/adm/coursedocs/showdoc'.$url; - } - } - } - unless ($allowed && $env{'request.role.adv'}) { - if ($ishidden || (&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) { - $hiddenres = 1; - } } } my ($rand_pick_text,$rand_order_text,$hiddenfolder); @@ -4709,9 +4071,6 @@ END if (!$allowed && $supplementalflag) { $folderpath.=$containerarg.'&'.$foldername; $url.='folderpath='.&escape($folderpath); - if ($ishidden || (&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) { - $hiddenfolder = 1; - } } else { my $rpicknum = (&LONCAPA::map::getparameter($orderidx, 'parameter_randompick'))[0]; @@ -4788,18 +4147,13 @@ $form_common."\n". ''. $form_end; } - } elsif ($supplementalflag) { - my $isexttool; - if ($url=~m{^/adm/$coursedom/$coursenum/\d+/ext\.tool$}) { - $url='/adm/wrapper'.$url; - $isexttool = 1; - } + } elsif ($supplementalflag && !$allowed) { $url .= ($url =~ /\?/) ? '&':'?'; $url .= 'folderpath='.&HTML::Entities::encode($esc_path,'<>&"'); if ($title) { - $url .= '&title='.$encodedtitle; + $url .= '&title='.&HTML::Entities::encode($renametitle,'<>&"'); } - if ((($isexternal) || ($isexttool)) && $orderidx) { + if ($isexternal && $orderidx) { $url .= '&idx='.$orderidx; } if ($anchor ne '') { @@ -4813,13 +4167,7 @@ $form_end; if ($isexternal) { ($editlink,$extresform) = &Apache::lonextresedit::extedit_form(0,$residx,$orig_url,$title,$pathitem, - undef,undef,undef,undef,undef,undef, - undef,$disabled); - } elsif ($orig_url =~ m{^/adm/$coursedom/$coursenum/\d+/ext\.tool$}) { - ($editlink,$extresform) = - &Apache::lonextresedit::extedit_form(0,$residx,$orig_url,$title,$pathitem, - undef,undef,undef,'tool',$coursedom, - $coursenum,$ltitoolsref,$disabled); + undef,undef,undef,$disabled); } elsif (!$isfolder && !$ispage) { my ($cfile,$home,$switchserver,$forceedit,$forceview) = &Apache::lonnet::can_edit_resource($fileloc,$coursenum,$coursedom,$orig_url); @@ -4852,18 +4200,9 @@ $form_end; $reinit = &mt('(re-initialize course to access)'); } $line.=''.$editlink.$renamelink; - my ($link,$nolink); + my $link; if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { - if ($allowed && !$env{'request.role.adv'} && !$isfolder && !$ispage) { - if ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) { - $nolink = 1; - } - } - if ($nolink) { - $line .= ''; - } else { - $line.=''; - } + $line.=''; } elsif ($url) { if ($anchor ne '') { if ($supplementalflag) { @@ -4872,28 +4211,14 @@ $form_end; $anchor = '#'.&HTML::Entities::encode($anchor,'"<>&'); } } - if (($nomodal) && ($hostname ne '')) { + + if ((!$supplementalflag) && ($nomodal) && ($hostname ne '')) { $link = 'http://'.$hostname.$url; } else { $link = $url; } - my $inhibitmenu; - if ((($supplementalflag) && ($allowed) && ($url =~ m{^/adm/wrapper/})) || - (($allowed) && (($url =~ m{^/adm/(viewclasslist|$match_domain/$match_username/aboutme)(\?|$)}) || - ($url =~ m{^/public/$match_domain/$match_courseid/syllabus(\?|$)})))) { - $inhibitmenu = 'only_body=1'; - } else { - $inhibitmenu = 'inhibitmenu=yes'; - } - $link = &js_escape($link.(($url=~/\?/)?'&':'?').$inhibitmenu.$anchor); - if ($allowed && !$env{'request.role.adv'} && !$isfolder && !$ispage && !$uploaded) { - if ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) { - $nolink = 1; - } - } - if ($nolink) { - $line.=''; - } elsif ($nomodal) { + $link = &js_escape($link.(($url=~/\?/)?'&':'?').'inhibitmenu=yes'.$anchor); + if ($nomodal) { $line.=''. ''; } else { @@ -4905,26 +4230,9 @@ $form_end; } $line.=' | '; if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { - if ($nolink) { - $line.=$title; - } else { - $line.=''.$title.''; - } - if (!$allowed && $supplementalflag && $canedit && $isfolder) { - my $editicon = &Apache::loncommon::lonhttpdurl('/res/adm/pages').'/editmap.png'; - my $editurl = $url; - $editurl =~ s{^\Q/adm/supplemental?\E}{/adm/coursedocs?command=direct&forcesupplement=1&}; - $line .= ' '.''. - ''. - ''; - } - if ((($hiddenfolder) || ($hiddenres)) && (!$allowed) && ($supplementalflag)) { - $line.= ' ('.&mt('hidden').') '; - } + $line.=''.$title.''; } elsif ($url) { - if ($nolink) { - $line.=$title; - } elsif ($nomodal) { + if ($nomodal) { $line.=''. $title.''; } else { @@ -4938,42 +4246,32 @@ $form_end; $line.="$extresform | "; $rand_pick_text = ' ' if ($rand_pick_text eq ''); $rand_order_text = ' ' if ($rand_order_text eq ''); - if ($uploaded && $url && !$isfolder && !$ispage) { - if (($plainurl ne '') && ($env{'request.role.adv'} || $allowed || !$hiddenres)) { - &Apache::lonnet::allowuploaded('/adm/coursedoc',$plainurl); + if (($allowed) && ($folder!~/^supplemental/)) { + my %lt=&Apache::lonlocal::texthash( + 'hd' => 'Hidden', + 'ec' => 'URL hidden'); + my ($enctext,$hidtext); + if ((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i) { + $enctext = ' checked="checked"'; + if (($ishash) && (ref($filtersref->{'encrypturl'}) eq 'ARRAY')) { + push(@{$filtersref->{'encrypturl'}},$orderidx); + } } - } - if ($allowed) { - my %lt=&Apache::lonlocal::texthash( - 'hd' => 'Hidden', - 'ec' => 'URL hidden'); - my ($enctext,$hidtext,$formhidden,$formurlhidden); if ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) { $hidtext = ' checked="checked"'; if (($ishash) && (ref($filtersref->{'hiddenresource'}) eq 'ARRAY')) { push(@{$filtersref->{'hiddenresource'}},$orderidx); } } - $formhidden = 'edit_hiddenresource_'.$orderidx; - $line.=(<