--- loncom/publisher/lonpubdir.pm 2012/04/24 10:29:53 1.142 +++ loncom/publisher/lonpubdir.pm 2012/04/27 16:13:47 1.143 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Construction Space Directory Lister # -# $Id: lonpubdir.pm,v 1.142 2012/04/24 10:29:53 bisitz Exp $ +# $Id: lonpubdir.pm,v 1.143 2012/04/27 16:13:47 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -458,11 +458,12 @@ sub putdirectory { my $disfilename = $dirname; # Don't display directory itself, and there is no way up from root directory unless ((($dirname eq '..') && ($reqfile=~/^\/[^\/]+\/[^\/]+$/)) || ($dirname eq '.')) { - my $kaputt=0; + my $kaputt=0; if (ref($bombs) eq 'HASH') { - foreach my $key (keys(%{$bombs})) { - if ($key =~ m{^\Q$targetdir/$disfilename\E/}) { $kaputt=1; last; } - } + foreach my $key (keys(%{$bombs})) { + my $currentdir = &Apache::lonnet::declutter("$targetdir/$disfilename"); + if (($key) =~ m{^\Q$currentdir\E/}) { $kaputt=1; last; } + } } # # Get the metadata from that directory's default.meta to display titles @@ -522,7 +523,7 @@ sub putresource { my $pubstatus = 'unpublished'; my $status=&mt('Unpublished'); my $css_class='LC_browser_file'; - my $title=' '; + my $title=''; my $publish_button=&mt('Publish'); my $cstr_dir = $r->dir_config('lonDocRoot').'/priv'.$thisdisfn; my $linkfilename=&HTML::Entities::encode('/priv'.$thisdisfn.'/'.$filename,'<>&"'); @@ -590,10 +591,6 @@ sub putresource { &mt('Diffs'),600,500); } } - - $title.="\n".'
'. - ($$bombs{$targetdir.'/'.$filename}?''.&mt('bomb').'':&mt('Edit Metadata')).''; - if (!$meta_same) { $title = &mt('Metadata Modified').'
'.$title. '
'. @@ -608,10 +605,15 @@ sub putresource { $status.="\n".'
'. &Apache::loncommon::modal_link( '/adm/retrieve?filename='.$linkfilename.'&inhibitmenu=yes&add_modal=yes',&mt('Retrieve'),600,500); - } else { - # Allow editing metadata of unpublished resources - $title .= ''.&mt('Edit Metadata').''; } + # Allow editing metadata of published and unpublished resources + $title .= "\n".'
' if ($title); + $title .= ''. + ($$bombs{&Apache::lonnet::declutter($targetdir.'/'.$filename)}? + ''.&mt('bomb').'': + &mt('Edit Metadata')). + ''; + my $editlink=''; my $editlink2=''; if ($filename=~/\.(xml|html|htm|xhtml|xhtm|sty)$/) {