--- loncom/xml/lonxml.pm 2009/10/04 03:42:42 1.484.4.3
+++ loncom/xml/lonxml.pm 2008/10/24 18:23:22 1.487
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.484.4.3 2009/10/04 03:42:42 raeburn Exp $
+# $Id: lonxml.pm,v 1.487 2008/10/24 18:23:22 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -505,11 +505,13 @@ sub inner_xmlparse {
if (!$Apache::lonxml::usestyle) {
$extras=$Apache::lonxml::style_values;
}
- if ( $#$parstack > -1 ) {
- $result=&Apache::run::evaluate($result,$safeeval,$extras.$$parstack[-1]);
- } else {
- $result= &Apache::run::evaluate($result,$safeeval,$extras);
- }
+ if ($token->[1] ne 'translated') {
+ if ( $#$parstack > -1 ) {
+ $result=&Apache::run::evaluate($result,$safeeval,$extras.$$parstack[-1]);
+ } else {
+ $result= &Apache::run::evaluate($result,$safeeval,$extras);
+ }
+ }
}
$Apache::lonxml::post_evaluate=1;
@@ -658,7 +660,6 @@ sub setup_globals {
$Apache::lonxml::request=$request;
$errorcount=0;
$warningcount=0;
- $Apache::lonxml::internal_error=0;
$Apache::lonxml::default_homework_loaded=0;
$Apache::lonxml::usestyle=1;
&init_counter();
@@ -1587,12 +1588,9 @@ FULLPAGE
my $spelllink .=&Apache::lonhtmlcommon::spelllink('xmledit','filecont');
my $textarea_events = &Apache::edit::element_change_detection();
my $form_events = &Apache::edit::form_change_detection();
- my $htmlerror;
- if ($filetype eq 'html') {
- $htmlerror=&verify_html($filecontents);
- if ($htmlerror) {
- $htmlerror=''.$htmlerror.'';
- }
+ my $htmlerror=&verify_html($filecontents);
+ if ($htmlerror) {
+ $htmlerror=''.$htmlerror.'';
}
my $editfooter=(<set_last_modified(&Apache::lonnet::metadata($request->uri,
'lastrevisiondate'));
}
- # Embedded Flash movies (e.g., 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;
@@ -1847,8 +1830,6 @@ sub error {
$errorcount++;
- $Apache::lonxml::internal_error=1;
-
if (defined($Apache::inputtags::part)) {
if ( @Apache::inputtags::response ) {
push(@errors,
@@ -2158,7 +2139,109 @@ sub get_tag {
return $insertlist{"$tagnum.tag"};
}
+############################################################
+# PDF-FORM-METHODS
+
+=pod
+
+=item &print_pdf_radiobutton(fieldname, value, text)
+
+Returns a latexline to generate a PDF-Form-Radiobutton with Text.
+
+$fieldname: PDF internalname of the radiobutton
+$value: Value of radiobutton (read when dumping the PDF data)
+$text: Text on the rightside of the 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;
+}
+
+
+=pod
+
+=item &print_pdf_start_combobox(fieldname)
+
+Starts a latexline to generate a PDF-Form-Combobox with text.
+
+$fieldname: PDF internal name of the Combobox
+
+=cut
+sub print_pdf_start_combobox {
+ my $result;
+ my ($fieldName) = @_;
+ $result .= '\begin{tabularx}{\textwidth}{p{2.5cm}X}'."\n";
+ $result .= '\comboBox[]{'.$fieldName.'}{2.3cm}{14bp}{'; #
+
+ return $result;
+}
+
+
+=pod
+
+=item &print_pdf_add_combobox_option(options)
+
+Generates a latexline to add Options to a PDF-Form-ComboBox.
+
+$option: PDF internal name of the Combobox-Option
+
+=cut
+sub print_pdf_add_combobox_option {
+
+ my $result;
+ my ($option) = @_;
+
+ $result .= '('.$option.')';
+
+ return $result;
+}
+
+
+=pod
+
+=item &print_pdf_end_combobox(text) {
+
+Returns latexcode to end a PDF-Form-Combobox with text.
+
+=cut
+sub print_pdf_end_combobox {
+ my $result;
+ my ($text) = @_;
+
+ $result .= '}&'.$text."\\\\\n";
+ $result .= '\end{tabularx}' . "\n";
+ $result .= '\hspace{2mm}' . "\n";
+ return $result;
+}
+
+
+=pod
+
+=item &print_pdf_hiddenField(fieldname, user, domain)
+
+Returns a latexline to generate a PDF-Form-hiddenField with userdata.
+
+$fieldname label for hiddentextfield
+$user: name of user
+$domain: domain of user
+
+=cut
+sub print_pdf_hiddenfield {
+ my $result;
+ my ($fieldname, $user, $domain) = @_;
+
+ $result .= '\textField [\F{\FHidden}\F{-\FPrint}\V{'.$domain.'&'.$user.'}]{'.$fieldname.'}{0in}{0in}'."\n";
+
+ return $result;
+}
+
1;
__END__
-