--- loncom/xml/lonxml.pm 2011/12/09 21:21:43 1.527 +++ loncom/xml/lonxml.pm 2012/04/11 15:58:07 1.529 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.527 2011/12/09 21:21:43 www Exp $ +# $Id: lonxml.pm,v 1.529 2012/04/11 15:58:07 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -113,6 +113,7 @@ use Apache::lonr(); use Apache::lonlocal; use Apache::lonhtmlcommon(); use Apache::functionplotresponse(); +use Apache::lonnavmaps(); #==================================== Main subroutine: xmlparse @@ -210,8 +211,12 @@ sub xmlend { my $discussion; &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['LONCAPA_INTERNAL_no_discussion']); - if (! exists($env{'form.LONCAPA_INTERNAL_no_discussion'}) || - $env{'form.LONCAPA_INTERNAL_no_discussion'} ne 'true') { + if ( + ( (!exists($env{'form.LONCAPA_INTERNAL_no_discussion'})) + || ($env{'form.LONCAPA_INTERNAL_no_discussion'} ne 'true') + ) + && ($env{'form.inhibitmenu'} ne 'yes') + ) { $discussion=&Apache::lonfeedback::list_discussion($mode,$status); } if ($target eq 'tex') { @@ -1785,7 +1790,22 @@ ENDNOTFOUND if ($env{'form.editmode'} && (!($env{'form.viewmode'})) && (!($env{'form.discardview'}))) { my $displayfile=$request->uri; - $displayfile=~s/^\/[^\/]*//; + if ($displayfile =~ m{^/uploaded/}) { + if ($env{'request.course.id'}) { + my $symb = &Apache::lonnet::symbread(); + my ($map,$id,$res)=&Apache::lonnet::decode_symb($symb); + my $navmap=Apache::lonnavmaps::navmap->new; + if (ref($navmap)) { + my $res = $navmap->getBySymb($symb); + my @pathitems = + &Apache::loncommon::get_folder_hierarchy($navmap,$map,1); + push(@pathitems,$res->compTitle()); + $displayfile = join(' » ',@pathitems); + } + } + } else { + $displayfile=~s/^\/[^\/]*//; + } my ($edit_info, $add_to_onload, $add_to_onresize)= &inserteditinfo($filecontents,$filetype,$displayfile);