$titledisplay
@@ -1732,12 +1726,25 @@ sub handler {
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.
@@ -1772,7 +1779,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
@@ -1796,21 +1803,31 @@ 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'}) {
+ if (&verify_html(''.$result.'')) {
+ $errorcount++;
+ }
+ $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 = '
'.
@@ -1823,7 +1840,7 @@ ENDNOTFOUND
$brcrum = [{'href' => &Apache::loncommon::authorspace(),
'text' => 'Construction Space'},
{'href' => '',
- 'text' => 'Editor'}];
+ 'text' => $breadcrumbtext}];
} else {
$brcrum = ''; # FIXME: Where are we?
}
@@ -1863,7 +1880,7 @@ ENDNOTFOUND
'href' => &Apache::loncommon::authorspace(),
'text' => 'Construction Space'},
{'href' => '',
- 'text' => 'HTML Editor'}];
+ 'text' => $breadcrumbtext}];
$header = &Apache::loncommon::head_subbox(
&Apache::loncommon::CSTR_pageheader());
}
@@ -1884,7 +1901,7 @@ ENDNOTFOUND
}
}
if ($filetype eq 'html') { &writeallows($request->uri); }
-
+
&Apache::lonxml::add_messages(\$result);
$request->print($result);
@@ -2253,24 +2270,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.'}';
}