[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /xml lonxml.pm
raeburn
raeburn at source.lon-capa.org
Sun Jul 27 16:26:12 EDT 2014
raeburn Sun Jul 27 20:26:12 2014 EDT
Modified files: (Branch: version_2_11_X)
/loncom/xml lonxml.pm
Log:
- For 2.11
- Backport 1.549.
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.531.2.16 loncom/xml/lonxml.pm:1.531.2.17
--- loncom/xml/lonxml.pm:1.531.2.16 Sat Jun 21 23:39:27 2014
+++ loncom/xml/lonxml.pm Sun Jul 27 20:26:12 2014
@@ -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 @@
}
}
}
+ my $inhibit_menu;
my %mystyle;
my $result = '';
my $filecontents=&Apache::lonnet::getfile($file);
@@ -1902,8 +1903,15 @@
&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 @@
#
# 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);
More information about the LON-CAPA-cvs
mailing list