+
@@ -1747,6 +1774,7 @@ sub handler {
}
}
}
+ my $inhibit_menu;
my %mystyle;
my $result = '';
my $filecontents=&Apache::lonnet::getfile($file);
@@ -1804,8 +1832,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') {
@@ -1822,8 +1857,17 @@ ENDNOTFOUND
}
my $brcrum;
if ($env{'request.state'} eq 'construct') {
- $brcrum = [{'href' => &Apache::loncommon::authorspace($request->uri),
- 'text' => 'Authoring Space'},
+ my $text = 'Authoring Space';
+ my $href = &Apache::loncommon::authorspace($request->uri);
+ if ($env{'request.course.id'}) {
+ my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ if ($href eq "/priv/$cdom/$cnum/") {
+ $text = 'Course Authoring Space';
+ }
+ }
+ $brcrum = [{'href' => $href,
+ 'text' => $text,},
{'href' => '',
'text' => $breadcrumbtext}];
} else {
@@ -1843,7 +1887,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);
@@ -1884,9 +1928,18 @@ ENDNOTFOUND
'onload' => $add_to_onload, });
my $header;
if ($env{'request.state'} eq 'construct') {
+ my $text = 'Authoring Space';
+ my $href = &Apache::loncommon::authorspace($request->uri);
+ if ($env{'request.course.id'}) {
+ my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ if ($href eq "/priv/$cdom/$cnum/") {
+ $text = 'Course Authoring Space';
+ }
+ }
$options{'bread_crumbs'} = [{
- 'href' => &Apache::loncommon::authorspace($request->uri),
- 'text' => 'Authoring Space'},
+ 'href' => $href,
+ 'text' => $text},
{'href' => '',
'text' => $breadcrumbtext}];
$header = &Apache::loncommon::head_subbox(
@@ -2042,7 +2095,7 @@ sub error {
my $declutter=&Apache::lonnet::declutter($env{'request.filename'});
my $baseurl = &Apache::lonnet::clutter($declutter);
my @userlist;
- foreach (keys %users) {
+ foreach (keys(%users)) {
my ($user,$domain) = split(/:/, $_);
push(@userlist,"$user:$domain");
my $key=$declutter.'_'.$user.'_'.$domain;
@@ -2242,7 +2295,7 @@ sub register_insert {
sub dump_insertlist {
my ($ext) = @_;
- open(XML,">/tmp/insertlist.xml.$ext");
+ open(XML,">","/tmp/insertlist.xml.$ext");
print XML ("
");
my $i=0;