--- loncom/xml/lonxml.pm 2014/06/21 23:39:27 1.531.2.16 +++ loncom/xml/lonxml.pm 2014/07/27 20:26:12 1.531.2.17 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.531.2.16 2014/06/21 23:39:27 raeburn Exp $ +# $Id: lonxml.pm,v 1.531.2.17 2014/07/27 20:26:12 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1845,6 +1845,7 @@ sub handler { } } } + my $inhibit_menu; my %mystyle; my $result = ''; my $filecontents=&Apache::lonnet::getfile($file); @@ -1902,8 +1903,15 @@ ENDNOTFOUND &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['rawmode']); if ($env{'form.rawmode'}) { $result = $filecontents; } + if (($env{'request.state'} eq 'construct') && + (($filetype eq 'css') || ($filetype eq 'js')) && ($ENV{'HTTP_REFERER'})) { + if ($ENV{'HTTP_REFERER'} =~ m{^https?\://[^\/]+/priv/$LONCAPA::match_domain/$LONCAPA::match_username/[^\?]+\.(x?html?|swf)(|\?)[^\?]*$}) { + $inhibit_menu = 1; + } + } if (($filetype ne 'html') && - (!$env{'form.return_only_error_and_warning_counts'})) { + (!$env{'form.return_only_error_and_warning_counts'}) && + (!$inhibit_menu)) { my $nochgview = 1; my $controls = ''; if ($env{'request.state'} eq 'construct') { @@ -1941,7 +1949,7 @@ ENDNOTFOUND # # Edit action? Insert editing commands # - unless ($env{'request.state'} eq 'published') { + unless (($env{'request.state'} eq 'published') || ($inhibit_menu)) { if ($env{'form.editmode'} && (!($env{'form.viewmode'})) && (!($env{'form.discardview'}))) { my ($displayfile,$url,$symb,$itemtitle,$action);