$titledisplay
@@ -1704,18 +1719,46 @@ sub handler {
$request->set_last_modified(&Apache::lonnet::metadata($request->uri,
'lastrevisiondate'));
}
+ # Embedded Flash movies from Camtasia served from https will not display in IE
+ # if XML config file has expired from cache.
+ if ($ENV{'SERVER_PORT'} == 443) {
+ if ($request->uri =~ /\.xml$/) {
+ my ($httpbrowser,$clientbrowser) =
+ &Apache::loncommon::decode_user_agent($request);
+ if ($clientbrowser =~ /^explorer$/i) {
+ delete $request->headers_out->{'Cache-control'};
+ delete $request->headers_out->{'Pragma'};
+ my $expiration = time + 60;
+ my $date=strftime("%a, %d %b %Y %H:%M:%S GMT",gmtime($expiration));
+ $request->headers_out->set("Expires" => $date);
+ }
+ }
+ }
$request->send_http_header;
return OK if $request->header_only;
my $file=&Apache::lonnet::filelocation("",$request->uri);
- my $filetype;
- if ($file =~ /\.(sty|css|js|txt)$/) {
+ my ($filetype,$breadcrumbtext);
+ if ($file =~ /\.(sty|css|js|txt|tex)$/) {
$filetype=$1;
} else {
$filetype='html';
}
+ if ($filetype eq 'sty') {
+ $breadcrumbtext = 'Style File Editor';
+ } elsif ($filetype eq 'js') {
+ $breadcrumbtext = 'Javascript Editor';
+ } elsif ($filetype eq 'css') {
+ $breadcrumbtext = 'CSS Editor';
+ } elsif ($filetype eq 'txt') {
+ $breadcrumbtext = 'Text Editor';
+ } elsif ($filetype eq 'tex') {
+ $breadcrumbtext = 'TeX Editor';
+ } else {
+ $breadcrumbtext = 'HTML Editor';
+ }
#
# Edit action? Save file.
@@ -1750,7 +1793,7 @@ ENDNOTFOUND
$filecontents=&createnewsty();
} elsif ($filetype eq 'js') {
$filecontents=&createnewjs();
- } elsif (($filetype ne 'css') && ($filetype ne 'txt')) {
+ } elsif ($filetype ne 'css' && $filetype ne 'txt' && $filetype ne 'tex') {
$filecontents=&createnewhtml();
}
$env{'form.editmode'}='Edit'; #force edit mode
@@ -1774,21 +1817,28 @@ ENDNOTFOUND
# up if it did
&Apache::structuretags::reset_problem_globals();
&Apache::lonhomework::finished_parsing();
+ } elsif ($filetype eq 'tex') {
+ $result = &Apache::lontexconvert::converted(\$filecontents,
+ $env{'form.texengine'});
+ if ($env{'form.return_only_error_and_warning_counts'}) {
+ $result = "$errorcount:$warningcount";
+ }
} else {
$result = $filecontents;
}
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['rawmode']);
if ($env{'form.rawmode'}) { $result = $filecontents; }
- if ($filetype ne 'html') {
- my $nochgview = 1;
+ if (($filetype ne 'html') &&
+ (!$env{'form.return_only_error_and_warning_counts'})) {
+ my $nochgview = 1;
my $controls = '';
if ($env{'request.state'} eq 'construct') {
$controls = &Apache::loncommon::head_subbox(
&Apache::loncommon::CSTR_pageheader()
.&Apache::londefdef::edit_controls($nochgview));
}
- if ($filetype ne 'sty') {
+ if ($filetype ne 'sty' && $filetype ne 'tex') {
$result =~ s/</g;
$result =~ s/>/>/g;
$result = '
'.
@@ -1801,7 +1851,7 @@ ENDNOTFOUND
$brcrum = [{'href' => &Apache::loncommon::authorspace(),
'text' => 'Construction Space'},
{'href' => '',
- 'text' => 'Editor'}];
+ 'text' => $breadcrumbtext}];
} else {
$brcrum = ''; # FIXME: Where are we?
}
@@ -1835,13 +1885,16 @@ ENDNOTFOUND
('add_entries' =>
{'onresize' => $add_to_onresize,
'onload' => $add_to_onload, });
-
- $options{'bread_crumbs'} = [{
- 'href' => &Apache::loncommon::authorspace(),
- 'text' => 'Construction Space'},
- {'href' => '',
- 'text' => 'HTML Editor'}];
-
+ my $header;
+ if ($env{'request.state'} eq 'construct') {
+ $options{'bread_crumbs'} = [{
+ 'href' => &Apache::loncommon::authorspace(),
+ 'text' => 'Construction Space'},
+ {'href' => '',
+ 'text' => $breadcrumbtext}];
+ $header = &Apache::loncommon::head_subbox(
+ &Apache::loncommon::CSTR_pageheader());
+ }
if ($env{'environment.remote'} ne 'off') {
$options{'bgcolor'} = '#FFFFFF';
$options{'only_body'} = 1;
@@ -1852,15 +1905,14 @@ ENDNOTFOUND
my $start_page = &Apache::loncommon::start_page(undef,$js,
\%options);
$result = $start_page
- .&Apache::loncommon::head_subbox(
- &Apache::loncommon::CSTR_pageheader())
+ .$header
.&Apache::lonxml::message_location()
.$edit_info
.&Apache::loncommon::end_page();
}
}
if ($filetype eq 'html') { &writeallows($request->uri); }
-
+
&Apache::lonxml::add_messages(\$result);
$request->print($result);
@@ -2093,11 +2145,13 @@ sub register_insert_xml {
while (my $token = $parser->get_token()) {
if ($token->[0] eq 'S') {
my $key;
- if ($token->[1] eq 'tag') {
+ if ($token->[1] eq 'tag') {
$tag = $token->[2]{'name'};
- $insertlist{"$tagnum.tag"} = $tag;
- $insertlist{"$tag.num"} = $tagnum;
- push(@alltags,$tag);
+ if (defined($tag)) {
+ $insertlist{$tagnum.'.tag'} = $tag;
+ $insertlist{$tag.'.num'} = $tagnum;
+ push(@alltags,$tag);
+ }
} elsif ($in_help && $token->[1] eq 'file') {
$key = $tag.'.helpfile';
} elsif ($in_help && $token->[1] eq 'description') {
@@ -2129,12 +2183,12 @@ sub register_insert_xml {
# parse the allows and ignore tags set to no
foreach my $tag (@alltags) {
- next if (!exists($insertlist{"$tag.allow"}));
- my $allow = $insertlist{"$tag.allow"};
+ next if (!exists($insertlist{$tag.'.allow'}));
+ my $allow = $insertlist{$tag.'.allow'};
foreach my $element (split(',',$allow)) {
$element =~ s/(^\s*|\s*$ )//gx;
- if (!exists($insertlist{"$element.show"})
- || $insertlist{"$element.show"} ne 'no') {
+ if (!exists($insertlist{$element.'.show'})
+ || $insertlist{$element.'.show'} ne 'no') {
push(@{ $insertlist{$tag.'.which'} },$element);
}
}
@@ -2229,24 +2283,20 @@ sub get_tag {
=pod
-=item &print_pdf_radiobutton(fieldname, value, text)
+=item &print_pdf_radiobutton(fieldname, value)
-Returns a latexline to generate a PDF-Form-Radiobutton with Text.
+Returns a latexline to generate a PDF-Form-Radiobutton.
+Note: Radiobuttons with equal names are automaticly grouped
+ in a selection-group.
-$fieldname: PDF internalname of the radiobutton
-$value: Value of radiobutton (read when dumping the PDF data)
-$text: Text on the rightside of the radiobutton
+$fieldname: PDF internalname of the radiobutton(group)
+$value: Value of radiobutton
=cut
sub print_pdf_radiobutton {
- my $result = '';
- my ($fieldName, $value, $text) = @_;
- $result .= '\begin{tabularx}{\textwidth}{p{0cm}X}'."\n";
- $result .= '\radioButton[\symbolchoice{circle}]{'.
- $fieldName.'}{10bp}{10bp}{'.$value.'}&'.$text."\n";
- $result .= '\end{tabularx}' . "\n";
- $result .= '\hspace{2mm}' . "\n";
- return $result;
+ my ($fieldname, $value) = @_;
+ return '\radioButton[\symbolchoice{circle}]{'
+ .$fieldname.'}{10bp}{10bp}{'.$value.'}';
}